-
Notifications
You must be signed in to change notification settings - Fork 7
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
implement iam-runtime GetAccessToken #39
Conversation
44ec769
to
3c057e2
Compare
3c057e2
to
6684a7d
Compare
2c38384
to
f681ba6
Compare
37b4cd3
to
db28be4
Compare
db28be4
to
85889cf
Compare
1f18247
to
73ce84e
Compare
This implements the GetAccessToken method which returns an access token upon request. Returned tokens can be configured to be from a file or client credentials. Additionally the sourced token can be exchanged for another token. This is particularly useful within a kubernetes cluster. You can exchange the service account token for one from another issuer. Signed-off-by: Mike Mason <[email protected]>
73ce84e
to
c5ef94c
Compare
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.
Looks good! Some thoughts.
oauth2.SetAuthURLParam("grant_type", s.cfg.GrantType), | ||
oauth2.SetAuthURLParam("subject_token", s.upstreamToken.AccessToken), | ||
oauth2.SetAuthURLParam("subject_token_type", s.cfg.TokenType), |
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.
Usually I like to make OAuth parameters constants elsewhere, though in this case since we're not reusing them anywhere this might be fine.
Co-authored-by: John Schaeffer <[email protected]> Signed-off-by: Mike Mason <[email protected]>
Co-authored-by: John Schaeffer <[email protected]> Signed-off-by: Mike Mason <[email protected]>
Signed-off-by: Mike Mason <[email protected]>
Signed-off-by: Mike Mason <[email protected]>
Signed-off-by: Mike Mason <[email protected]>
f769099
to
593cd3a
Compare
This implements the GetAccessToken method which returns an access token upon request.
Returned tokens can be configured to be from a file or client credentials.
Additionally the sourced token can be exchanged for another token.
This is particularly useful within a kubernetes cluster.
You can exchange the service account token for one from another issuer.