Preserve registry identity tokens for OCI chart pulls#334
Closed
mateipinzaru-parloa wants to merge 4 commits into
Closed
Preserve registry identity tokens for OCI chart pulls#334mateipinzaru-parloa wants to merge 4 commits into
mateipinzaru-parloa wants to merge 4 commits into
Conversation
16cebd2 to
f22da52
Compare
Signed-off-by: Matei Pinzaru <201221140+mateipinzaru-parloa@users.noreply.github.com>
f22da52 to
dd78ac1
Compare
Signed-off-by: Matei Pinzaru <201221140+mateipinzaru-parloa@users.noreply.github.com>
470e0c7 to
81c8279
Compare
Signed-off-by: Matei Pinzaru <201221140+mateipinzaru-parloa@users.noreply.github.com>
73c8fe2 to
bbb6b46
Compare
Signed-off-by: Matei Pinzaru <201221140+mateipinzaru-parloa@users.noreply.github.com>
Author
|
Github automation unintentionally closed the PR, reopened it now 🙈. Please let me know if I'm missing anything to get this reviewed and merged. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
Fixes #335
This change preserves Docker credential-helper identity tokens returned by the default keychain and uses them for OCI chart pulls.
go-containerregistrymaps Docker helper responses with username<token>toauthn.AuthConfig.IdentityToken. Before this change,provider-helmcopied onlyUsernameandPasswordintoRepoCreds, dropping identity-token credentials such as ACR refresh tokens returned bydocker-credential-acr-env. Private OCI chart pulls that relied on provider runtime identity could therefore fall back to anonymous/no usable credentials and fail with401 unauthorized.The implementation:
authConfig.IdentityTokenwhen resolving credentials from the default keychain.RepoCredswithIdentityTokenand uses ORASauth.Credential.RefreshTokenfor OCI identity-token pulls.plainHTTPandinsecureSkipTLSVerifybehavior for the identity-token path.provider-helmalready reuses Helm action clients across reconciles. This PR does not change that ownership model; it resets pull-scoped fields and restores the default registry client so identity-token auth state does not leak into later pulls or install/upgrade actions.I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Unit coverage includes keychain identity-token mapping, identity-token precedence, pull-state reset, registry-client reset, malformed OCI host handling, direct HTTP chart URL reset behavior, TLS transport wiring, and a fake OCI bearer challenge that asserts ORAS exchanges the identity token as
grant_type=refresh_token.Latest local validation passed:
Runtime validation passed against a private ACR OCI Helm chart:
Releasefor a private OCI chart withchart.pullSecretRefomitted.ReleasereachedSynced=True,Ready=True, and Helm statedeployed.401 unauthorizedbefore the provider service account was allowed to federate into the runtime identity.