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

Consolidate STS code #37021

Closed
howardjohn opened this issue Jan 26, 2022 · 2 comments
Closed

Consolidate STS code #37021

howardjohn opened this issue Jan 26, 2022 · 2 comments
Labels
area/security lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while

Comments

@howardjohn
Copy link
Member

Currently we have 2-3 partially overlapping STS usages in Istio. Would be good to consolidate these. Below captures my notes quickly running through these:

caclient/credentials:
calls TokenExchange (CA)
inline code for TokenManager.GenerateToken

TokenManager - STS -> response. GenerateToken
Can also get "metadata"
1 impl: stsservice/tokenmanager

tokenmanager.Plugin -> STS -> response. TokenManager just delegates to this
1 impl: google/tokenexchangeplugin
has a cache for access token (also for federated token, but its never actually used)
constructFederatedTokenRequest - token -> federated accesstoken (http req w/ retry)
access token - federated access token -> access token for gcp-sa-meshdataplane.iam.gserviceaccount.com:generateAccessToken
finally convets to StsResponseParameters format

TokenExchanger: token -> token
1 impl: providers/google/stsclient
create raw map (instead of StsRequestParameters)
http request to sts.googleapis.com/v1/token with retry
response into federatedTokenResponse
return AccessToken

Users:

  • XDS: TokenManager.GenerateToken then unmarshal StsResponseParameters to get .AccessToken
  • CA: TokenExchanger.ExchangeToken, returns access token directly
  • STS server: gets sts req over http, calls tokenManager.GenerateToken. Responses with json directly
    So it seems the CA is a subset of XDS/STS Server
@istio-policy-bot istio-policy-bot added the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Apr 27, 2022
@howardjohn
Copy link
Member Author

howardjohn commented Apr 27, 2022 via email

@istio-policy-bot istio-policy-bot removed the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Apr 27, 2022
@istio-policy-bot istio-policy-bot added the lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while label Jul 27, 2022
@istio-policy-bot
Copy link

🚧 This issue or pull request has been closed due to not having had activity from an Istio team member since 2022-04-27. If you feel this issue or pull request deserves attention, please reopen the issue. Please see this wiki page for more information. Thank you for your contributions.

Created by the issue and PR lifecycle manager.

@istio-policy-bot istio-policy-bot added the lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. label Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security lifecycle/automatically-closed Indicates a PR or issue that has been closed automatically. lifecycle/stale Indicates a PR or issue hasn't been manipulated by an Istio team member for a while
Projects
None yet
Development

No branches or pull requests

2 participants