Repository navigation
feat(authn): validate OIDC callers with bounded JWKS staleness (#449) - #458
Merged
Merged
Conversation
jhrozek
force-pushed
the
spike/authn-wiring
branch
2 times, most recently
from
August 12, 2026 14:50
3f099b2 to
15cc736
Compare
JAORMX
approved these changes
Aug 12, 2026
Co-Authored-By: mecatl <[email protected]>
Co-Authored-By: mecatl <[email protected]>
Co-Authored-By: mecatl <[email protected]>
Co-Authored-By: mecatl <[email protected]>
Co-Authored-By: mecatl <[email protected]>
Resolves the ship-blockers and hardening gaps from the post-merge review of spike/authn-wiring: - Reject --auth-token + --oidc-issuer together at startup instead of letting every request 401 (ValidateOIDCAuthToken). - Preserve the originating caller's principal for the detached user-model review Stop hook (context.WithoutCancel instead of context.Background). - Add a peer-keyed rejected-bearer rate limiter so invalid-token traffic can no longer bypass metering ahead of full JWT validation; context cancellation/deadlines pass through with native gRPC/HTTP statuses instead of consuming that budget. - Reject duplicate gRPC authorization metadata instead of silently taking the first value. - Register the startup model-catalog refresh as a syscaller root (RootModelCatalogRefresh). - Pin that origin_session_id can never arrive over the wire. - Clone the owner on the MetaLister listing path so a caller can't mutate the store's shared Principal through a listed row. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ing docs user-docs/ and docs/usage/mecated.md are operator-facing; naming the delegated OIDC/JWT validator's module path and pinned version there creates a doc/impl divergence liability with no reader benefit (the ADRs and PRODUCTION-READINESS.md are the right place for that detail). Describe the validator by behavior instead. Also fixes a broken anchor in docs/tui.md — it pointed at a heading that was never added to mecak8s.md; the caller-identity content actually lives under mecated.md's Security & transport section. Regenerated llms.txt (task docs:llms) to match. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: mecatl <[email protected]>
Co-Authored-By: mecatl <[email protected]>
…ine/session Reusable, stdlib-only projection from an already-verified claim set to a session.Principal, so any engine consumer that verifies its own bearer tokens can derive attribution without reinventing the grant-type heuristic. GrantTypeFromClaims moves verbatim from internal/adapter/server/grant_type.go (deleted in the next commit). Public API addition to engine/ (ADR 0037 process): engine/api/session.txt regenerated, engine/CHANGELOG.md classified Added (minor). See ADR 0103. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Package internal/cliconfig/authnvalidator.go's toolhive-core/authn wrapper as github.com/stacklok/mecatl/authn/oidc, its own Go module (own go.mod, requires engine + toolhive-core), mirroring the provider/* pattern (ADR 0093): a real dependency useful to some consumers, kept out of engine's closure. internal/cliconfig becomes mecated/mecak8s's thin composition layer over it, unchanged in behavior — same error-sentinel mapping, same Close() lifecycle. internal/adapter/server/grant_type.go is deleted (moved to engine/session in the prior commit). Wires the new module into go.work, CI (build/test/lint/vet/govulncheck), dependabot, and the Taskfile lint/test/tidy/coverage tasks. See ADR 0103. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The standalone GOWORK=off gate (test:authn-standalone) resolves authn/oidc against the tagged engine release, not the local go.work replace, so PrincipalFromClaims/GrantTypeFromClaims (this PR) need engine/v0.10.0 cut and the requirement bumped to compile. Mirrors the precedent in ea11126 for provider/anthropic. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
jhrozek
force-pushed
the
spike/authn-wiring
branch
from
August 12, 2026 15:17
15cc736 to
a1a5c23
Compare
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.
Closes #449.
Summary
Wires real OIDC caller-token validation at the gRPC and HTTP server boundaries, with a bounded JWKS staleness policy rather than indefinitely trusting a warm signing-key cache.
mecatedandmecak8s;Unavailable, separately from rejected credentials;Manual verification
On a fresh kind cluster with Dex:
mecatui, and received a MockLLM reply;MECATL_AUTH_TOKENis an intentional CLI fallback;env -u MECATL_AUTH_TOKEN; the first unauthenticated prompt was rejected before a model response;Verification
git diff --checktask generatewas attempted after the user-doc change, but cannot fetch privategithub.com/stacklok/[email protected]in this environment. Its partially generatedllms.txtwas restored; CI should regenerate and validate the docs.Relation to PR #430
PR #430 is the earlier Track-A attribution implementation for #367. Its own review notes correctly state that production OIDC validation was not yet wired. This PR is the follow-up implementation for #449 and deliberately does not claim to close #367.