pub struct AuthContext { /* private fields */ }Expand description
Who is asking, and what they hold.
Built once per request at the transport boundary from whatever the peer proved, and then read — never mutated — by the visibility predicate.
Implementations§
Source§impl AuthContext
impl AuthContext
Sourcepub fn anonymous() -> Self
pub fn anonymous() -> Self
An unauthenticated principal holding nothing.
Distinct from AuthContext::new with a name and no scopes in exactly
one way, and it is worth being explicit about the difference: an
anonymous caller is a peer that has not presented credentials, while a
named principal holding nothing is a peer that presented credentials
which granted nothing. Both see the same primitives. The name differs so
a trace can say which happened.
Sourcepub fn new(principal: impl Into<Arc<str>>, scopes: ScopeSet) -> Self
pub fn new(principal: impl Into<Arc<str>>, scopes: ScopeSet) -> Self
A named principal holding scopes.
Sourcepub fn unrestricted(principal: impl Into<Arc<str>>) -> Self
pub fn unrestricted(principal: impl Into<Arc<str>>) -> Self
A principal holding every scope. For a server with no authorization of its own, which is the common case before T16.
Trait Implementations§
Source§impl Clone for AuthContext
impl Clone for AuthContext
Source§impl Debug for AuthContext
impl Debug for AuthContext
Source§impl Default for AuthContext
impl Default for AuthContext
impl Eq for AuthContext
Source§impl PartialEq for AuthContext
impl PartialEq for AuthContext
impl StructuralPartialEq 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