Skip to content

feat: add api key credential as client library authorization type#1483

Merged
ldetmer merged 16 commits intomainfrom
api-keys
Sep 20, 2024
Merged

feat: add api key credential as client library authorization type#1483
ldetmer merged 16 commits intomainfrom
api-keys

Conversation

@ldetmer
Copy link
Copy Markdown
Contributor

@ldetmer ldetmer commented Aug 28, 2024

Add new ApiKeyCredentials that will pass the appropriate api-key header for authorizing api requests from client libraries

Note: ApiKeyCredentials extends from the base Credential class as Api Keys are not considered oauth2 credentials since there is no access token which is required by GoogleCredentials/OAuth2Credentials. This also follows definition of oauth2 credentials as specified by Google Identity Protocols that require an access token when using Oauth 2.0 to access google APIs.

@conventional-commit-lint-gcf
Copy link
Copy Markdown

conventional-commit-lint-gcf Bot commented Aug 28, 2024

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Sep 16, 2024
@ldetmer ldetmer changed the title [POC] add api key credential feat: add api key credential as authorization type Sep 16, 2024
@ldetmer ldetmer marked this pull request as ready for review September 16, 2024 20:38
@ldetmer ldetmer requested review from a team, blakeli0, lqiu96 and zhumin8 September 16, 2024 20:38
@ldetmer ldetmer changed the title feat: add api key credential as authorization type feat: add api key credential as client library authorization type Sep 16, 2024
Comment thread credentials/java/com/google/auth/ApiKeyCredentials.java Outdated
Comment thread credentials/java/com/google/auth/ApiKeyCredentials.java
@lqiu96
Copy link
Copy Markdown
Member

lqiu96 commented Sep 17, 2024

I think the changes LGTM. I'll need to double check the authenticationType being "" and the refresh() behavior.

@ldetmer
Copy link
Copy Markdown
Contributor Author

ldetmer commented Sep 17, 2024

I think the changes LGTM. I'll need to double check the authenticationType being "" and the refresh() behavior.

FYI, Blake and I discussed refresh with Carl and he agreed no op was correct.

Comment thread credentials/java/com/google/auth/ApiKeyCredentials.java Outdated
Comment thread credentials/pom.xml Outdated
@lqiu96
Copy link
Copy Markdown
Member

lqiu96 commented Sep 17, 2024

I think the changes LGTM. I'll need to double check the authenticationType being "" and the refresh() behavior.

FYI, Blake and I discussed refresh with Carl and he agreed no op was correct.

Yep. I think it makes sense just wanted to confirm the behavior and I think it works as intended. I'll ask about the authenticationType with the Auth Team and once I get their input on this, I think we should be good to go.

Comment thread credentials/java/com/google/auth/ApiKeyCredentials.java
Comment thread credentials/java/com/google/auth/ApiKeyCredentials.java Outdated
Comment thread credentials/java/com/google/auth/ApiKeyCredentials.java
Comment thread credentials/javatests/com/google/auth/ApiKeyCredentialsTest.java Outdated
Comment thread credentials/javatests/com/google/auth/ApiKeyCredentialsTest.java Outdated
Comment thread credentials/java/com/google/auth/ApiKeyCredentials.java
@burkedavison
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

@lqiu96 lqiu96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@zhumin8 for approval as well

@sonarqubecloud
Copy link
Copy Markdown

@ldetmer ldetmer merged commit 6401e51 into main Sep 20, 2024
@ldetmer ldetmer deleted the api-keys branch September 20, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants