Add environment variable support for OIDC client secret #2325
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.
Summary
Add support for loading OIDC client secret from
TOOLHIVE_OIDC_CLIENT_SECRETenvironment variable in the token validator. This is preparatory work for Kubernetes-native secret injection via SecretKeyRef.Changes
osimport topkg/auth/token.goNewTokenValidator()TOOLHIVE_OIDC_CLIENT_SECRETwhenconfig.ClientSecretis emptyBehavior
Backward Compatible:
config.ClientSecretas beforeconfig.ClientSecretis set → uses that value (no change)config.ClientSecretis empty AND env var is set → uses env var valueUse Case:
This enables Kubernetes operators to inject OIDC client secrets via environment variables sourced from Kubernetes Secrets, without embedding secrets in ConfigMaps or YAML manifests.
Testing
Follow-up Work
This is Part 1 of 2 for implementing #2321:
Part 2 will add:
ClientSecretReffield toInlineOIDCConfigCRDRelated
Related to #2321
🤖 Generated with Claude Code