fix: accept Opaque secrets for mTLS auth#276
Open
ConnorGraham wants to merge 2 commits intotemporalio:mainfrom
Open
fix: accept Opaque secrets for mTLS auth#276ConnorGraham wants to merge 2 commits intotemporalio:mainfrom
ConnorGraham wants to merge 2 commits intotemporalio:mainfrom
Conversation
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.
What was changed
Relax the secret type check in
ParseClientSecretto accept bothkubernetes.io/tlsandOpaquesecret types forAuthModeTLS. Update theMutualTLSSecretReffield comment in the CRD types to reflect the expanded accepted types.Why?
Previously, the controller enforced
type: kubernetes.io/tlsfor mTLS secrets. This blocked organizations that store TLS credentials inOpaquesecrets — a common pattern when bundlingtls.crt,tls.key, andca.crtinto a single secret (e.g. multi-file cert-manager outputs, or any tooling that produces a keypair alongside a custom CA).The
kubernetes.io/tlssecret type natively supports only two keys (tls.crtandtls.key), so teams needing to include a CA cert alongside the keypair must useOpaque. The downstream handlerfetchClientUsingMTLSSecretalready accesses secret data by key name and works correctly with either type — only the type guard was blocking it.Checklist
Closes [Bug] ParseClientSecret rejects Opaque secrets for AuthModeTLS #275
How was this tested:
Unit test
TestParseClientSecret_OpaqueSecretType(renamed fromTestParseClientSecret_WrongSecretType) now asserts that anOpaquesecret containingtls.crtandtls.keyis accepted and produces a validClientAuthwithAuthModeTLS. All 316 existing tests continue to pass.MutualTLSSecretReffield comment inapi/v1alpha1/temporalconnection_types.goupdated to document both accepted secret types.