pub struct CredentialHost { /* private fields */ }Implementations§
Source§impl CredentialHost
impl CredentialHost
pub fn new(store: Arc<dyn CredentialStore>, component: String) -> Self
Sourcepub fn with_refresher(self, refresher: Arc<dyn CredentialRefresher>) -> Self
pub fn with_refresher(self, refresher: Arc<dyn CredentialRefresher>) -> Self
Give this host a way to renew credentials. Without one, a near-expiry credential is served as it is: the alternative — refusing it — would break every component whose upstream issues short-lived tokens, and the host has nothing better to offer.
Sourcepub fn component(&self) -> &str
pub fn component(&self) -> &str
The component reference this host serves — resolve::profile_key of
the reference the operator wrote, not the literal spelling. It is the
profile namespace — the boundary the whole design rests on (design
§2.1) — and it is what a consent prompt must name (design §5.5).
pub fn note_session_opened(&self, id: &str)
pub fn note_session_closed(&self, id: &str)
Sourcepub fn get_secret(&self, session: &str, key: &str) -> Result<Secret, HostError>
pub fn get_secret(&self, session: &str, key: &str) -> Result<Secret, HostError>
A hit returns the projection only. The host-only compartment — refresh tokens, issuer binding — never crosses the boundary (design D4).
The caller must have resolved the act:credentials capability decision
before getting here: a denial must not depend on whether the key
exists, or denied becomes a probing channel (design §3.4).
Sourcepub async fn refresh_if_due(&self, key: &str, now: u64)
pub async fn refresh_if_due(&self, key: &str, now: u64)
Renew any field of this credential that is too close to expiry, before it is served.
Silent by design (design §5.4): the component asked for a credential and gets one that works. It never sees a refresh token and never re-opens a session because one expired.
Failure is not fatal. A renewal that cannot happen — no refresher, no issuer recorded, the server refusing — leaves the stored value alone and lets it be served. It may still work: the skew is a margin, not an expiry, and a token inside it is usually still valid. Refusing here would turn a renewal problem into a failed tool call for a credential that was very likely fine, and the component’s own upstream is the thing that actually knows. The attempt is logged; the reason never reaches the guest.
Sourcepub fn list_secrets(
&self,
session: Option<&str>,
) -> Result<Vec<SecretInfo>, HostError>
pub fn list_secrets( &self, session: Option<&str>, ) -> Result<Vec<SecretInfo>, HostError>
Metadata only — no value can reach this path, because SecretInfo has
no field that could hold one. Deliberately unaudited (design §9): a
listing hands over nothing, and recording it would bury the issue
records that matter.
Auto Trait Implementations§
impl !Freeze for CredentialHost
impl !RefUnwindSafe for CredentialHost
impl !UnwindSafe for CredentialHost
impl Send for CredentialHost
impl Sync for CredentialHost
impl Unpin for CredentialHost
impl UnsafeUnpin for CredentialHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more