fix(workload-identity): allow-list issuer enums, label SPIFFE preview - #777
Open
lakhansamani wants to merge 1 commit into
Open
fix(workload-identity): allow-list issuer enums, label SPIFFE preview#777lakhansamani wants to merge 1 commit into
lakhansamani wants to merge 1 commit into
Conversation
key_source_type and issuer_type were checked for non-emptiness only, so
any string was stored verbatim. The value that mattered was
"spiffe_bundle_endpoint": a declared constant with no implementation —
fetchJWKSBytes has no case for it and returns "unsupported
key_source_type" — so an operator got a 200 and a row that looked
configured, and learned it was dead only when the first workload tried to
authenticate. A plain typo failed identically, at the same unhelpful
moment.
The dashboard offered spiffe_bundle_endpoint in its dropdown, so this
would otherwise have left the UI presenting an option guaranteed to
error. Removed there too — the two lists are now the same list.
Existing rows are unaffected: validation is write-time only,
UpdateTrustedIssuerRequest cannot set either field, and the read path is
unchanged. A row already holding spiffe_bundle_endpoint was already
broken and stays exactly as broken.
Also:
- README labels SPIFFE JWT-SVID preview, which grant_types.go has said
since it landed ("Ship as experimental only") and nothing user-facing
repeated. The README already uses that convention for the Vue and
Svelte SDKs.
- AuthMethodX509MTLS removed: nothing read it, AddTrustedIssuer hardcoded
jwt_assertion, and no request field could set it — unreachable in every
direction. Reintroduce with the implementation, not ahead of it.
- AddTrustedIssuer now writes constants.AuthMethodJWTAssertion instead of
a bare "jwt_assertion" literal, which is what made that constant look
unused in the first place.
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.
Follow-up to the review that produced #774–#776, from the question "is SPIFFE
shipped as preview?".
It says preview in exactly one place — a Go comment
internal/constants/grant_types.go:31reads "PREVIEW: the underlying draftexpired 2026-01-02 and is not WG-adopted. This URN is not IANA-registered and may
change. Ship as experimental only."
Nothing user-facing repeated that. README listed SPIFFE JWT-SVID with a ✅
alongside GA features — while already using a "beta" caveat for the Vue and
Svelte SDKs, so the convention existed and simply wasn't applied. Now labelled.
The part that was more than a docs gap
key_source_typeandissuer_typewere validated for non-emptiness only.spiffe_bundle_endpointis a declared constant with no implementation —fetchJWKSByteshas no case for it and falls through tounsupported key_source_type— so an operator could create a trusted issuer, get a 200 and arow that looked configured, and find out it was dead only when the first workload
tried to authenticate. A typo (
static_jwks_urls) failed the same way at thesame unhelpful moment.
Both fields are now allow-listed,
spiffe_bundle_endpointrefused by namewith "not implemented yet" rather than a generic invalid — those call for
different actions.
Nothing breaks
spiffe_bundle_endpointin its dropdown(
UpdateTrustedIssuerModal.tsx:23-25). Left alone, this PR would have made theUI present an option guaranteed to error. Removed there too; the two lists are
now the same list.
UpdateTrustedIssuerRequestcannot set either field, and the read path isuntouched. A row already holding
spiffe_bundle_endpointwas already brokenand stays exactly as broken — no upgrade cliff.
oidc_discovery,static_jwks_url,kubernetes_sa) is allow-listed, and the existing gRPC/GraphQL trusted-issuertests pass unchanged.
Dead code removed
AuthMethodX509MTLS("x509_mtls", Phase 6): nothing read it,AddTrustedIssuerhardcoded
jwt_assertion, and no request field could set it — unreachable inevery direction. Removed rather than left as a claim the code does not honour.
AddTrustedIssuernow usesconstants.AuthMethodJWTAssertioninstead of a bareliteral, which is what made that constant look unused too.
KeySourceSPIFFEBundleEndpointis deliberately kept — the new validatorrejects it by name, so the constant now has a job.
Verification
Both allow-list tests confirmed failing with the validator reverted.
Separately — a bigger finding, not fixed here
While checking this wouldn't break Kubernetes deployments I found that
in-cluster TokenReview cannot work at all, and the code says so at
client_assertion.go:492:SafeHTTPClientrefuses private IPs, sohttps://kubernetes.default.svcis unreachable — whileperformTokenReviewreads Authorizer's in-cluster SA token (
/var/run/secrets/...) to authenticateto it. The two assumptions contradict, and README lists Kubernetes TokenReview
as shipped with no caveat. Writing that up separately with a kind-based test.