pub struct AuthContext { /* private fields */ }Expand description
Immutable identity used to obtain a service token. Formatting is redacted.
Implementations§
Source§impl AuthContext
impl AuthContext
Sourcepub fn new(
issuer: Endpoint,
client_id: impl Into<String>,
credential_generation: u64,
tsg_id: impl Into<String>,
) -> Result<Self>
pub fn new( issuer: Endpoint, client_id: impl Into<String>, credential_generation: u64, tsg_id: impl Into<String>, ) -> Result<Self>
Default scope is exactly tsg_id:<tenant>. Each provider isolates its cache.
Sourcepub fn with_scopes(self, scopes: Vec<String>) -> Result<Self>
pub fn with_scopes(self, scopes: Vec<String>) -> Result<Self>
Supply explicit scopes including this identity’s tenant scope. Conflicting tenant scopes and duplicate scopes are rejected.
Sourcepub fn with_audience(self, audience: impl Into<String>) -> Result<Self>
pub fn with_audience(self, audience: impl Into<String>) -> Result<Self>
Optional service audience, sent as an encoded form field.
pub fn issuer(&self) -> &Endpoint
pub fn client_id(&self) -> &str
pub fn credential_generation(&self) -> u64
pub fn tsg_id(&self) -> &str
pub fn scopes(&self) -> &[String]
pub fn audience(&self) -> Option<&str>
Trait Implementations§
Source§impl Clone for AuthContext
impl Clone for AuthContext
Auto Trait Implementations§
impl Freeze for AuthContext
impl RefUnwindSafe for AuthContext
impl Send for AuthContext
impl Sync for AuthContext
impl Unpin for AuthContext
impl UnsafeUnpin for AuthContext
impl UnwindSafe for AuthContext
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