Add exec-based credential support for OCI registry authentication - #1864
Open
dennismdejong wants to merge 1 commit into
Open
Add exec-based credential support for OCI registry authentication#1864dennismdejong wants to merge 1 commit into
dennismdejong wants to merge 1 commit into
Conversation
Adds a password_exec block to the registry configuration that allows obtaining OCI registry credentials by executing an external command. This enables OIDC/OAuth2 token-based authentication for private registries (e.g., az acr login, kubelogin). The exec block supports: - command: the executable to run - args: list of arguments - env: additional environment variables The output is parsed for common token field names (accessToken, token, access_token) or nested status.token, with raw stdout as fallback. Fixes hashicorp#1699
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
Adds a
password_execblock to theregistryconfiguration that allows obtaining OCI registry credentials by executing an external command. This enables OIDC/OAuth2 token-based authentication for private registries without requiring long-lived credentials.Background
Users authenticating to OCI registries (e.g., ACR, ECR, GCR) with OIDC/OAuth2 tokens currently have no way to use short-lived credentials with the Helm provider. This adds exec-based credential support similar to what already exists for Kubernetes authentication.
Configuration
Implementation
password_execnested attribute to the registry schema withcommand,args, andenvfieldsexecuteRegistryExecfunction that runs the command and parses the outputaccessToken,token,access_token,status.token) with raw stdout fallbackpasswordfield is now Optional instead of Required; eitherpasswordorpassword_execmust be setFixes #1699