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 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>
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