chore(injector): remove unused JWTAudience field#373
Merged
huang195 merged 1 commit intoMay 23, 2026
Conversation
cfg.JWTAudience was parsed from authbridge-config ConfigMap's JWT_AUDIENCE key but never read by anything else in the operator. Pure dead code traced via grep — only writes (namespace_config.go, resolved_config.go), zero reads. The chart will stop emitting JWT_AUDIENCE in a companion PR; the JWT-SVID assertion audience used by authbridge's token-exchange plugin is now sourced per-tokenexchange-instance from the in-process SPIFFE provider config, not a cluster-wide env var. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
pdettori
approved these changes
May 23, 2026
pdettori
left a comment
Member
There was a problem hiding this comment.
Clean dead-code removal — verified via GitHub code search that JWTAudience has zero readers in the codebase (only the 4 lines being deleted). Companion PR sequencing is well-documented and orthogonal.
Areas reviewed: Go structs, config reading logic
CI: All 16 checks passing (E2E, unit, integration, lint, security)
Commit: Signed-off, good message explaining the rationale
This was referenced May 23, 2026
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.
Companion to kagenti-extensions#432 and kagenti#1653.
What
Remove the
JWTAudiencefield from the webhook injector'sNamespaceConfigandResolvedConfigstructs, and the line that readJWT_AUDIENCEfrom theauthbridge-configConfigMap. Pure dead-code removal:cfg.JWTAudience = cm.Data["JWT_AUDIENCE"]was the only writer\.JWTAudiencereturns zero readers — the value was parsed and never usedWhy
The
JWT_AUDIENCEenv var was a vestige from when the legacy in-podclient-registrationsidecar may have consumed it; that sidecar has long since been replaced by the operator'sClientRegistrationReconciler(which doesn't read it). The companion kagenti PR drops the env var from the chart'sauthbridge-configConfigMap. After both PRs land, the env var is gone end-to-end.The JWT-SVID client-assertion audience used by authbridge's
tokenexchangeplugin is now sourced per-tokenexchange-instance from the in-process SPIFFE provider config (kagenti-extensions#432's redesign), not via a cluster-wide env var.Sequencing
This PR is fully orthogonal to the other two. It can land in any order:
JWT_AUDIENCE): operator stops reading a key that's still set. Harmless — empty struct field, nothing reads it.cfg.JWTAudiencebecomes empty string regardless. Same outcome.volume_builder.go:38at/spiffe-workload-api/spire-agent.sock) — no operator change needed for that.What this PR does NOT touch (intentional)
spiffe-helper-configConfigMap volume mount remains. Old authbridge images still consume it (helper.conf). New images ignore it. Cleanup eligible after all old-image deployments are gone.SpiffeHelperConfigMapNameconstant +SpiffeHelperConffield remain — same backward-compat reason.jwt_audience="kagenti"inside helper.conf TOML strings) remain.Test plan
go build ./...clean (verified)go test ./...— all 12 unit-test packages pass (E2E fails environmentally, looking for a Kind cluster namedkind; same onmain)JWTAudiencereferences in the codebase post-mergeAssisted-By: Claude Code