Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add api key support #826

Merged
merged 3 commits into from
Jan 19, 2022
Merged

feat: add api key support #826

merged 3 commits into from
Jan 19, 2022

Conversation

arithmetic1728
Copy link
Contributor

@arithmetic1728 arithmetic1728 commented Aug 5, 2021

This PR adds API key support. Internal doc: go/gapic-api-key-support

(1) created a new credential class for API key. The credential adds API key to x-goog-api-key header.

(2) The new ADC logic is:

  • if both GOOGLE_API_KEY and GOOGLE_APPLICATION_CREDENTIALS are set, raise an exception
  • if GOOGLE_API_KEY is set then return an API key credential; otherwise use the existing ADC flow

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 5, 2021
@arithmetic1728 arithmetic1728 marked this pull request as ready for review August 6, 2021 01:19
@arithmetic1728 arithmetic1728 requested review from silvolu and a team as code owners August 6, 2021 01:19
@arithmetic1728 arithmetic1728 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 6, 2021
@arithmetic1728 arithmetic1728 force-pushed the apikeyheader branch 2 times, most recently from 9ea731c to 1eabe0a Compare September 8, 2021 00:11
@arithmetic1728 arithmetic1728 removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 19, 2022
google/auth/_default.py Outdated Show resolved Hide resolved
@arithmetic1728 arithmetic1728 merged commit 3b15092 into main Jan 19, 2022
@arithmetic1728 arithmetic1728 deleted the apikeyheader branch January 19, 2022 22:55
gcf-merge-on-green bot pushed a commit that referenced this pull request Jan 20, 2022
🤖 I have created a release *beep* *boop*
---


## [2.4.0](v2.3.3...v2.4.0) (2022-01-20)


### Features

* add 'py.typed' declaration ([#919](#919)) ([c993504](c993504))
* add api key support ([#826](#826)) ([3b15092](3b15092))


### Bug Fixes

* **deps:** allow cachetools 5.0 for python 3.7+ ([#937](#937)) ([1eae37d](1eae37d))
* fix the message format for metadata server exception ([#916](#916)) ([e756f08](e756f08))


### Documentation

* fix intersphinx link for 'requests-oauthlib' ([#921](#921)) ([967be4f](967be4f))
* note ValueError in `verify_oauth2_token` ([#928](#928)) ([82bc5f0](82bc5f0))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
arithmetic1728 added a commit that referenced this pull request Jan 28, 2022
arithmetic1728 added a commit that referenced this pull request Jan 31, 2022
This reverts commit 3b15092.

Co-authored-by: Anthonios Partheniou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants