Repository navigation
fix(server): preserve introspection subjects without username claims - #134
Open
cariandrum22 wants to merge 5 commits into
Open
cariandrum22 wants to merge 5 commits into
cariandrum22 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently updates both introspection paths with comprehensive coverage and aligned documentation.
Review effort: Balanced
Findings: None
What changed in this PR
Updates introspection responses to preserve token subjects in sub while omitting unsupported username claims.
Changes:
- Removes
usernamefrom active HTTP and signed introspection responses. - Migrates the public local helper from
usernametosub. - Adds subject-preservation tests and compliance documentation.
| File | Description |
|---|---|
spec/compliance-matrix.yaml |
Records subject-claim behavior and evidence. |
docs/operations/oauth-conformance.md |
Documents semantics and compatibility impact. |
crates/server/src/web/token_lifecycle/tests/subject.rs |
Tests exact subject preservation. |
crates/server/src/web/token_lifecycle/tests/schema.rs |
Verifies username omission. |
crates/server/src/web/token_lifecycle/tests.rs |
Registers the subject tests. |
crates/server/src/web/token_lifecycle/introspection.rs |
Removes the HTTP username claim. |
crates/server/src/web/token_client_credentials/tests/signed_introspection.rs |
Covers machine subjects and signed responses. |
crates/server/src/authcode/token/validator.rs |
Returns sub from local introspection. |
crates/server/src/authcode/token/tests/local_introspection.rs |
Tests local helper subject behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cariandrum22
force-pushed
the
fix/signed-introspection-recipient
branch
from
October 28, 2026 10:24
d81a935 to
d3004d9
Compare
cariandrum22
force-pushed
the
fix/signed-introspection-recipient
branch
from
October 28, 2026 10:46
d3004d9 to
529350b
Compare
cariandrum22
changed the base branch from
fix/signed-introspection-recipient
to
main
October 28, 2026 10:49
cariandrum22
force-pushed
the
fix/introspection-subject-claims
branch
from
October 28, 2026 10:49
1d1dadc to
dd28778
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.
Summary
Preserve the stored token subject as
suband omitusernamefrom active JSON and signed introspection responses. RFC 7662 section 2.2 gives these optional fields distinct meanings; a stored subject does not establish a human-readable username source. Client-credentials tokens retain their machine subject, and inactive responses remain false-only.The public
TokenValidator::introspect_tokenhelper now returnssubin place of its formerusernamefield. The implementation preserves exact opaque, readable and Unicode subject bytes without normalization, inference, user lookup or additional disclosure permission.Validation
The consolidated source passes all 504 standard container tests: 137 Redis, 257 PostgreSQL, one dynamic-registration and 109 combined-service tests. Each expected test executes once, including the new subject regression in the combined PostgreSQL/Redis lane. Its name follows the established
shared_redisconvention. All owned test containers were removed.All 55 selected recipient, introspection and stored-JWT tests pass on the same source. Routed controls cover JSON and independently verified signed responses, issued client-credentials machine subjects, exact Unicode/opaque subjects, denied owners and unknown/revoked/expired records. Local-helper tests verify the
subtransition and continued client-credentials refusal. The inherited #129 parser-policy guard and #133 recipient-test formatting corrections are included.Both Clippy packages, formatting, changed-file hooks, strict proof references and runtime drift pass. Commands include
nix build .#database-tests .#lint-supplemental-clippy .#lint-server-clippy-inventory-dev, the source-bound executable withsigned_recipient,introspectionandstored_jwtfilters, andscripts/tests/run_server_container_integration.sh all. Fresh public-head CI and Copilot review are required after consolidation.Upgrade and scope
Depends on #133. This branch adds one signed subject-claim commit above the consolidated predecessor. Local-helper consumers reading subjects from
usernamemust migrate tosub; HTTP responses already exposesub. No migration or token rewrite is required. The helper remains a local stored-status API without online requester authorization and still refuses client-credentials records.Aegaeon omits
usernamebecause it has no dedicated username source. Broader JSON entitlement, authentication interpretation, privacy/scope and response protection remain separate obligations. Finite tests do not establish a complete feature/issuance matrix, deployment behavior or formal/product assurance.