docs(auth): document JWT-trust mode and complete validation gate - #6755
Open
jonpspri wants to merge 3 commits into
Open
docs(auth): document JWT-trust mode and complete validation gate#6755jonpspri wants to merge 3 commits into
jonpspri wants to merge 3 commits into
Conversation
jonpspri
added this pull request to stack #6729
September 10, 2026 05:20
jonpspri
marked this pull request as ready for review
September 10, 2026 05:20
jonpspri
requested review from
Lang-Akshay,
brian-hussey,
crivetimihai,
ja8zyjits and
msureshkumar88
as code owners
September 10, 2026 05:20
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 10, 2026 06:23
c4f9b93 to
1166227
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 10, 2026 07:53
1166227 to
1e1f3da
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
2 times, most recently
from
September 10, 2026 14:20
2902cc6 to
1994d61
Compare
jonpspri
removed this pull request from stack #6729
September 12, 2026 08:50
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 12, 2026 09:07
1994d61 to
b043411
Compare
jonpspri
added this pull request to stack #6798
September 12, 2026 09:08
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
2 times, most recently
from
September 12, 2026 09:48
2c48c8d to
fdbe15b
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 12, 2026 09:52
fdbe15b to
d67460b
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 12, 2026 16:45
d67460b to
47f4e58
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 12, 2026 17:20
47f4e58 to
682ed8d
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 12, 2026 17:35
682ed8d to
b431804
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
2 times, most recently
from
September 12, 2026 18:09
a941d7d to
bb99e68
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
2 times, most recently
from
September 12, 2026 18:52
688a427 to
42cb1df
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
2 times, most recently
from
September 12, 2026 20:00
67cc058 to
6b61a6b
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 12, 2026 20:26
6b61a6b to
e7716d2
Compare
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 12, 2026 20:49
e7716d2 to
5438258
Compare
Extra scope beyond the docs sweep: - Error-path wiring for the B.2 matrix disabled rows that B.3/B.12 did not cover: password login/register/reset (401), SSO browser login (401, at the browser callback; the cited service function stays live for the default-funnel provisioning path), session-token refresh (401), user management in the admin UI and admin API (403), invitations and team membership writes for trust-only principals (403 via the new LocalUserRecordRequiredError). tests/unit/mcpgateway/ test_trust_mode_disabled_surfaces.py covers every disabled matrix row and asserts status plus message. - Test-isolation fixes exposed by the two-mode gate: a conftest autouse fixture clears the correlation-id contextvar per test (a sync test leaked it into the worker root context and broke an A.9 audit lookup), a conftest autouse fixture pins jwt_trust_mode=db per test so the suite is hermetic when JWT_TRUST_MODE=jwt-trust is exported, test_jwt_trust_config test_defaults now removes the ambient JWT_TRUST_MODE it claimed to isolate, and the auth_cache key doctest asserts the mode segment against settings instead of a hard-coded db. - Pylint false-positive fix (pre-existing, gate-blocking): inline not-callable disables on the two SQLAlchemy func.now() server defaults in the external_group_mappings model. - .secrets.baseline regenerated by make detect-secrets-scan (line drift from the doc edits). Signed-off-by: Jonathan Springer <jps@s390x.com>
jonpspri
force-pushed
the
docs/5906-trust-mode-docs-gate
branch
from
September 12, 2026 21:11
5438258 to
9a8e1c9
Compare
…ontracts - auth-token-dispatch.md: document the get_current_user() ingress dispatch (external-issuer bearers -> JWKS verifier in trust mode; definitive trust-root failure -> 401 fail-closed; non-trust-root -> internal funnel) and pin the 200/401/403/404 result semantics with the live e2e matrix and the re-pinned barrier test - configuration.md: compose wiring (commented default-off flags), JWT_CLAIM_TEAMS groups-claim collision guard, full provider-setup pointer incl. TESTS_DNS_PASSTHROUGH_HOSTS for the Entra E2E suite - multitenancy.md: dual-write (FK-safe) writer + dual-key reader contract; scope-exact cf_role resolution - rbac.md: strict admin-claim parsing in trust mode - oauth-design.md: ingress dispatch note in the JWT trust mode section Signed-off-by: Jonathan Springer <jps@s390x.com>
- trusted_claims.py: drop the Role import left unused after role resolution moved to services/role_resolution.py - role_resolution.py: mark cf_team_id with the repo-standard pylint unused-argument disable; it is a documented interface parameter (scope context), not dead code - test_email_users_user_id_migration.py: re-pin DOWN_REVISION to 5e211ec89cad, the parent bf2998718ea1 has had since the multi-head fix; the migration file was correct, the structural test pin was stale Signed-off-by: Jonathan Springer <jps@s390x.com>
Collaborator
Author
|
Requirement note (remediation) — docs and gates Five doc pages now state the post-fix contracts: ingress dispatch, the 401/403/200/404 result table, dual-write writers, strict admin typing, and Compose wiring. The six validation gates ran green on this PR: lint and docstring coverage 100%, full suite 23,561 passed, diff coverage 97%, live protocol and RBAC suites, and the secrets scan. The trust-mode live pass ran 7 of 7. |
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.
Completes Epic 2 (#5885): executable tests for every disabled-with-clear-error row of the feature-mode matrix, the trust-mode documentation sweep, and the validation gate in both modes.
Matrix coverage: 20 tests in
tests/unit/mcpgateway/test_trust_mode_disabled_surfaces.pyassert BOTH the status code and the exact message for all seven disabled rows (TDD: 17 red first). Only the token-catalog row had landed with #5904; this PR wires the rest, all gated onjwt_trust_mode="jwt-trust"(no default-mode change): password login/register/reset (401), SSO browser login (401), session refresh (401), user management (403, API and admin HTML), invitations and team membership writes (403 viaLocalUserRecordRequiredError).Docs:
configuration.md(posture change, disabled surfaces,POST /admin/tokens/trustmint endpoint),rbac.md(trust-mode section),multitenancy.md(cross-tenant group mapping),oauth-design.md(dispatch rule, revocation guarantee, overage policy),AGENTS.md(+4 Security Invariants: dispatch rule; mandatory configured revocation claim, no sid-keyed revocation; admin-claim posture, missing -> non-admin; is_active loss handled at the IdP or blocklist — plus thenormalize_token_teamspointer fixed toauth_context.py)..env.exampleverified complete, zero additions.Gate (both modes green,
JWT_TRUST_MODE=dband=jwt-trust):make ruff interrogate pylint— clean; interrogate 100%; pylint 10.00/10make test— 23401 passed, 879 skipped, 2 xfailed (each mode)make coverage diff-cover— exit 0, fail-under=90 met (717 changed lines)make detect-secrets-scan— exit 0NOT-RUN-HERE (no live stack in this worktree; evidence captured, runs after merge in the maintainer environment): the docker prod stack bring-up (
testing-uprequires.envsecrets) andmake test-mcp-protocol-e2e test-mcp-rbac(all 40 self-skip: gateway not reachable).make test-protocol-compliancedoes not exist; dropped from the gate per plan.Risk to existing users: none — every new guard is trust-mode-gated; default mode verified green in the full suite. Also includes
docs/plans/security-refactor-jwt-userid-stack-report.md: the dated 25-PR stack report (PR, issue, description per row). Also includes : the dated 25-PR stack report (PR, issue, description per row).Stack: B.14 of epic #5885 (base: #6753). Final PR of the 24-PR stack.
Closes #5906