pub struct BearerIdentity {
pub caller_id: String,
pub granted_capabilities: Vec<String>,
pub secrets: Option<Arc<SecretBundle>>,
pub expires_at: Option<SystemTime>,
pub cache_until: Option<SystemTime>,
}Expand description
Outcome of a successful bearer resolution. Returned by
TokenBroker::resolve_bearer; the HTTP listener consumes this to
build a CallContext per request (SP-streamable-http §4.3).
Fields are public so brokers in any crate can use struct-literal construction. New fields, if added, will be a minor-version bump.
Fields§
§caller_id: StringStable caller identifier. Same shape as the
CallContext::caller_id populated from SP-12 Hello.client_id,
so RBAC checks downstream of the listener treat HTTP callers
uniformly with UDS callers.
granted_capabilities: Vec<String>Capabilities this bearer’s caller is granted. The HTTP listener
intersects these with the server’s granted_capabilities
allow-list before each tools/call
(SP-streamable-http §4.3, SP-12 Hello semantics specialised
per-request rather than per-connection).
secrets: Option<Arc<SecretBundle>>Optional secret bundle, same role as the phase-1
TokenBroker::resolve return. Brokers MAY supply both
secrets and the bearer identity in one resolve_bearer call
when the bearer carries enough info to pre-stage secrets;
otherwise leave None and let the listener call resolve
separately. Celia leaves this None because the DEK lives in
KeyCache only (patent §13.1) and is never relayed.
expires_at: Option<SystemTime>Absolute time at which this bearer ceases to be valid. None
means “no advertised expiry” (Celia process-lifetime semantics
— pairing codes live until the user revokes them in the wizard
or the host process restarts). SSE listeners use this to
schedule re-validation cadence per SP-token-broker-phase2 §4.7.
cache_until: Option<SystemTime>Hint to the broker’s own cache layer: do not return this
BearerIdentity from cache after this time without
revalidating. None lets the broker choose freely.
Trait Implementations§
Source§impl Clone for BearerIdentity
impl Clone for BearerIdentity
Source§fn clone(&self) -> BearerIdentity
fn clone(&self) -> BearerIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more