-
Notifications
You must be signed in to change notification settings - Fork 227
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: adds JwtCredentials with custom claims #290
Conversation
Codecov Report
@@ Coverage Diff @@
## master #290 +/- ##
=========================================
Coverage ? 79.07%
Complexity ? 357
=========================================
Files ? 24
Lines ? 1606
Branches ? 168
=========================================
Hits ? 1270
Misses ? 251
Partials ? 85
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't you push the cache down as well?
The cache in When you request a |
The cache has a secondary benefit of async refresh as well |
Actually nevermind, I never added that part. Sorry for the noise |
oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This justifies a minor version bump to 0.17
oauth2_http/javatests/com/google/auth/oauth2/JwtCredentialsTest.java
Outdated
Show resolved
Hide resolved
oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java
Show resolved
Hide resolved
@kolea2, @igorbernstein2, @elharo any other concerns here? |
Adds the ability to create custom JWT Credentials (
JwtCredentials
) with custom claims from aServiceAccountJwtAccessCredentials
instance.ServiceAccountJwtAccessCredentials
will continue to provide on-demand credentials where the audience is based on the requested URIJwtCredentials
class which can be directly built with aPrivateKey
, privateKeyId string, and customJwtCredentials.Claims
. You can also build newJwtCredentials
viaJwtCredentials#jwtWithClaims(JwtCredentials.Claims)
which only overrides the new specified claims fields.ServiceAccountJwtAccessCredentials#jwtWithClaims(JwtCredentials.Claims)
which will provide aJwtCredentials
instance with custom claimsFixes: #30