pub struct Auth { /* private fields */ }Expand description
Compiled auth configuration: the verifier, the claims to forward, and the route policies.
Implementations§
Source§impl Auth
impl Auth
Sourcepub fn build(
config: &AuthConfig,
verifier: Option<Arc<dyn TokenVerifier>>,
) -> Result<Option<Arc<Self>>, String>
pub fn build( config: &AuthConfig, verifier: Option<Arc<dyn TokenVerifier>>, ) -> Result<Option<Arc<Self>>, String>
Build auth from config, or None when auth.mode is not "jwt".
verifier is the embedder-supplied token verifier, if any. With None
the built-in one is built from auth.jwt, which then must name a key
source. With Some, the key source in config is unused (the verifier
owns its own keys) and auth.jwt may be omitted entirely; the rest of
the block (claims_headers, roles_claim) still applies.
§Errors
Returns an error string when the built-in verifier is required but this build has no crypto backend, when its key source is missing or unusable, or when a policy glob fails to compile.
Auto Trait Implementations§
impl !RefUnwindSafe for Auth
impl !UnwindSafe for Auth
impl Freeze for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnsafeUnpin for Auth
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request