Skip to main content

BearerIdentity

Struct BearerIdentity 

Source
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: String

Stable 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

Source§

fn clone(&self) -> BearerIdentity

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BearerIdentity

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V