feat(sensitive): bind opaque handle use to audience - #55
Draft
seonghobae wants to merge 8 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
added a commit
that referenced
this pull request
Aug 10, 2026
This was referenced Aug 10, 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.
Partial implementation of #10.
Buyer/security gap
Issue #10 requires an opaque sensitive-value handle to be usable only by the intended authenticated workload/service audience. The stacked #53 state already binds tenant/task/field/purpose/destination/classification, expiry, authoritative use count, and revocation; this PR adds an explicit non-transferable audience dimension to the in-process policy primitive.
Current exact implementation
This Draft remains stacked on exact #53 base
86ce4bc1c11c270dc532593d673c42bd6f623d74. Current exact head is8d3ccf0a3b99fd9789210dd9798b422431fab7d8.The active implementation now requires:
SensitiveValueHandleScopeto carry an explicit bounded ASCII audience identifier;HandleUseRequestand authoritativereserve_usecall to present that audience again;AudienceMismatchwithout consuming a use;Authorizedand oneUseLimitReached, while a wrong-audience contender remainsAudienceMismatchand cannot consume the use.TDD / RCA evidence
Audience binding initially moved the revocation check after general request evaluation. A revoked handle with a different scope could therefore return
ScopeMismatchrather than the authoritativeRevokedresult, regressing #53 lifecycle semantics and exposing later policy-state information.Test-only head
95f0f1e418024f5dbe7aa613e5fd1e9d88a9417aaddedrevocation_precedes_request_mismatch_without_leaking_later_policy_state. CI run31419991170established the intended RED: formatting and workspace check passed, while the regression failed with actualScopeMismatchversus requiredRevoked.The narrow production repair moved the revocation check back ahead of request evaluation while retaining audience binding. A subsequent concurrency regression exercises three synchronized contenders through
Arc<Mutex<SensitiveHandleUseState>>without adding a false cross-process transaction claim.Exact-head evidence
Exact head
8d3ccf0a3b99fd9789210dd9798b422431fab7d8passes CI run31421061134:cargo fmt --all --check: success;No predecessor-head result is transferred to this exact head.
Scope boundary
This is still only an in-process authority/audience primitive. External synchronization in the concurrency test proves the state composes safely with one-process exclusive mutation; it is not a durable or distributed transaction guarantee. This PR does not claim authenticated workload identity, token-audience verification, durable handle storage, protected-value resolution, KMS, mTLS identity, database persistence, cross-process transactions, model disclosure, browser fill, or release readiness. A later trusted broker/service-identity boundary must derive the audience from authenticated caller identity rather than user-controlled input.
Keep Draft while #53/#46 remain active. Canonical whole-product documentation remains owned by PR #44, and this active branch must not be described as protected-main shipped truth.