pub struct BrokerClient { /* private fields */ }Expand description
HTTP client for a credential broker. Presents the machine’s own bearer token (NOT the provider credential) and receives a short-lived access token.
Implementations§
Source§impl BrokerClient
impl BrokerClient
pub fn new( endpoint: impl Into<String>, machine_token: impl Into<String>, ) -> Self
Sourcepub fn with_client(
endpoint: impl Into<String>,
machine_token: impl Into<String>,
http: Client,
) -> Self
pub fn with_client( endpoint: impl Into<String>, machine_token: impl Into<String>, http: Client, ) -> Self
Like new but reuses an existing reqwest::Client (shared connection
pool) instead of building a fresh one per call. (#158 A5)
Sourcepub fn with_machine_token(
endpoint: impl Into<String>,
machine_token: MachineToken,
http: Client,
) -> Self
pub fn with_machine_token( endpoint: impl Into<String>, machine_token: MachineToken, http: Client, ) -> Self
Share an existing (reloadable) machine token, e.g. the
super::RemoteBroker’s, so a reload after a 401 reaches both.
Sourcepub fn from_source(source: &CredentialSource) -> Option<Self>
pub fn from_source(source: &CredentialSource) -> Option<Self>
Build from a CredentialSource. None for Local.
Trait Implementations§
Source§impl TokenFetcher for BrokerClient
impl TokenFetcher for BrokerClient
async fn fetch_token(&self, provider: &str) -> Result<BrokerToken, String>
Source§async fn fetch_credential(
&self,
cred: &CredentialRef,
) -> Result<BrokerToken, TokenFetchError>
async fn fetch_credential( &self, cred: &CredentialRef, ) -> Result<BrokerToken, TokenFetchError>
Account-addressed fetch. Default: the default slot goes through
fetch_token; a named slot is unsupported (never
silently served from the default slot).Auto Trait Implementations§
impl !RefUnwindSafe for BrokerClient
impl !UnwindSafe for BrokerClient
impl Freeze for BrokerClient
impl Send for BrokerClient
impl Sync for BrokerClient
impl Unpin for BrokerClient
impl UnsafeUnpin for BrokerClient
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
Mutably borrows from an owned value. Read more