feat(core): propagate technical caller bearer token - #12
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe core crate adds ChangesTechnical caller token propagation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Permission providers now receive the request-scoped technical caller bearer token unchanged while it remains separate from user identity and target-adapter inputs. The updated contract and propagation coverage indicate no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Code Review ✅ ApprovedIntroduces OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Important Your trial ends in 6 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified.
Pull request overview
Adds a transport-neutral, request-scoped technical-caller bearer token to the Core Permission Provider boundary.
Changes:
- Introduces an opaque raw-token type.
- Makes the token mandatory in
PermissionProviderRequest. - Adds propagation, preservation, and
Send + Synccoverage.
File summaries
| File | Summary |
|---|---|
crates/permissionsync-core/src/technical_caller.rs |
Defines the opaque bearer-token type and preservation test. |
crates/permissionsync-core/src/ports.rs |
Adds mandatory token propagation and request tests. |
crates/permissionsync-core/src/lib.rs |
Registers and re-exports the new type. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Goal
Make the technical-caller bearer token a mandatory, request-scoped input at the Core Permission Provider boundary.
Related ADRs
ADR 0001, ADR 0002, ADR 0004, ADR 0006, ADR 0007, ADR 0008.
Scope
TechnicalCallerBearerTokenas the Core representation of the raw technical-caller bearer token.PermissionProviderRequest.Send + Synccompatibility.Out of scope
JWT authentication and validation, inbound HTTP, Generic REST Provider implementation, HTTP transport, Provider configuration, orchestration, routing changes, Target Adapter changes, observability implementation, and runtime/OCI work.
Implementation
Introduce the opaque Core type:
with the deliberately minimal API:
TechnicalCallerBearerToken::newpreserves the supplied value unchanged. Core does not authenticate, parse, validate, normalize, or otherwise interpret the token.PermissionProviderRequestnow requires:IdentityContext;LogicalTarget;TechnicalCallerBearerToken;SynchronizationContext.The bearer token is borrowed by the Provider request and remains separate from synchronized-user identity, routing state, desired state, synchronization context, and Target Adapter inputs.
Dependencies
None.
Review guide
Focus on:
TechnicalCallerBearerToken;LogicalTargetsemantics.Architecture invariants
The technical caller and synchronized end user remain distinct concepts.
PermissionSync retains
LogicalTargetfor selected-target routing and orchestration.The technical-caller bearer token is available to the Permission Provider but is not part of
IdentityContext,SynchronizationContext, desired state, orTargetAdapterRequest.Core remains transport-neutral and does not perform JWT or HTTP processing.
Tests
TechnicalCallerBearerTokenpreserves the supplied value exactly.PermissionProviderreceives identity, logical target, bearer token, deadline, and cancellation context.TechnicalCallerBearerTokensatisfies the existingSend + Syncboundary requirements.Security considerations
TechnicalCallerBearerTokenintentionally provides no ordinary formatting, cloning, serialization, dereferencing, or generic string-conversion API.The raw bearer value is exposed deliberately through
as_str()for Permission Provider use and must be treated as sensitive.The type does not claim authenticated provenance: the future inbound authentication boundary remains responsible for constructing it from a successfully authenticated caller credential.
No bearer token is propagated to Target Adapters through the Core API.
Follow-ups
Implement the Generic REST Permission Provider against ADR 0008 using the bearer token exposed by
PermissionProviderRequest.