Skip to content

fix: accept Opaque secrets for mTLS auth#276

Open
ConnorGraham wants to merge 2 commits intotemporalio:mainfrom
ConnorGraham:fix/opaque-tls-secret
Open

fix: accept Opaque secrets for mTLS auth#276
ConnorGraham wants to merge 2 commits intotemporalio:mainfrom
ConnorGraham:fix/opaque-tls-secret

Conversation

@ConnorGraham
Copy link
Copy Markdown

What was changed

Relax the secret type check in ParseClientSecret to accept both kubernetes.io/tls and Opaque secret types for AuthModeTLS. Update the MutualTLSSecretRef field comment in the CRD types to reflect the expanded accepted types.

Why?

Previously, the controller enforced type: kubernetes.io/tls for mTLS secrets. This blocked organizations that store TLS credentials in Opaque secrets — a common pattern when bundling tls.crt, tls.key, and ca.crt into a single secret (e.g. multi-file cert-manager outputs, or any tooling that produces a keypair alongside a custom CA).

The kubernetes.io/tls secret type natively supports only two keys (tls.crt and tls.key), so teams needing to include a CA cert alongside the keypair must use Opaque. The downstream handler fetchClientUsingMTLSSecret already accesses secret data by key name and works correctly with either type — only the type guard was blocking it.

Checklist

  1. Closes [Bug] ParseClientSecret rejects Opaque secrets for AuthModeTLS #275

  2. How was this tested:

Unit test TestParseClientSecret_OpaqueSecretType (renamed from TestParseClientSecret_WrongSecretType) now asserts that an Opaque secret containing tls.crt and tls.key is accepted and produces a valid ClientAuth with AuthModeTLS. All 316 existing tests continue to pass.

  1. Any docs updates needed?

MutualTLSSecretRef field comment in api/v1alpha1/temporalconnection_types.go updated to document both accepted secret types.

@ConnorGraham ConnorGraham requested review from a team and jlegrone as code owners April 14, 2026 19:01
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 14, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ParseClientSecret rejects Opaque secrets for AuthModeTLS

2 participants