pub struct AccessTokenSubstrateRuntime { /* private fields */ }Expand description
Unified runtime for the access-token substrate layer.
Owns the token propagator (which may be absent when propagation is
disabled). The resource-server verifier lives alongside in
ServerState so it can be accessed
independently, mirroring the pattern used by oidc_client.
Implementations§
Source§impl AccessTokenSubstrateRuntime
impl AccessTokenSubstrateRuntime
Sourcepub async fn from_resolved_config(
config: &ResolvedAccessTokenSubstrateConfig,
) -> Result<(Self, Option<Arc<OAuthResourceServerVerifier>>), AccessTokenSubstrateRuntimeError>
pub async fn from_resolved_config( config: &ResolvedAccessTokenSubstrateConfig, ) -> Result<(Self, Option<Arc<OAuthResourceServerVerifier>>), AccessTokenSubstrateRuntimeError>
Recommended entry point. Build the substrate runtime from a
[ResolvedAccessTokenSubstrateConfig], returning the runtime together
with an optional resource-server verifier.
The verifier is returned separately so that the caller can store it
independently (e.g. as oauth_resource_server_verifier on
ServerState), mirroring the pattern used by oidc_client.
ResolvedAccessTokenSubstrateConfig
──▸ from_resolved_config()
──▸ (AccessTokenSubstrateRuntime, Option<Arc<OAuthResourceServerVerifier>>)Sourcepub fn new(
token_propagation: &TokenPropagation,
) -> Result<Self, AccessTokenSubstrateRuntimeError>
pub fn new( token_propagation: &TokenPropagation, ) -> Result<Self, AccessTokenSubstrateRuntimeError>
Build from a TokenPropagation axis.
Lower-level constructor — prefer
from_resolved_config when you have a
[ResolvedAccessTokenSubstrateConfig].
Sourcepub fn token_propagator(&self) -> Option<&Arc<TokenPropagator>>
pub fn token_propagator(&self) -> Option<&Arc<TokenPropagator>>
Access the token propagator, if enabled.
Sourcepub fn propagation_enabled(&self) -> bool
pub fn propagation_enabled(&self) -> bool
Whether propagation is enabled (propagator is present).
Sourcepub fn build_forwarder<C>(
&self,
config: &C,
) -> Option<Result<C::Forwarder, C::Error>>where
C: PropagationForwarderConfigSource,
pub fn build_forwarder<C>(
&self,
config: &C,
) -> Option<Result<C::Forwarder, C::Error>>where
C: PropagationForwarderConfigSource,
Build a forwarder from this runtime and a forwarder config source.
Returns None if propagation is disabled (no propagator available).
Returns Some(Err(...)) if the forwarder config is present but
construction fails.
Trait Implementations§
Source§impl Clone for AccessTokenSubstrateRuntime
impl Clone for AccessTokenSubstrateRuntime
Source§fn clone(&self) -> AccessTokenSubstrateRuntime
fn clone(&self) -> AccessTokenSubstrateRuntime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AccessTokenSubstrateRuntime
impl RefUnwindSafe for AccessTokenSubstrateRuntime
impl Send for AccessTokenSubstrateRuntime
impl Sync for AccessTokenSubstrateRuntime
impl Unpin for AccessTokenSubstrateRuntime
impl UnsafeUnpin for AccessTokenSubstrateRuntime
impl UnwindSafe for AccessTokenSubstrateRuntime
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more