pub struct OidcFederationStrategyBuilder<P, S = NoStore> { /* private fields */ }Expand description
Builder for OidcFederationStrategy.
Created via OidcFederationStrategy::builder.
Implementations§
Source§impl<P, S> OidcFederationStrategyBuilder<P, S>
impl<P, S> OidcFederationStrategyBuilder<P, S>
Sourcepub fn base_url(self, url: Url) -> Self
pub fn base_url(self, url: Url) -> Self
Override the base URL resolved by service discovery.
Takes precedence over both the CS_CTS_HOST environment variable and
region-derived service discovery. Use this to point a single strategy
instance at a specific CTS host — e.g. a self-hosted CTS, or a local
mock auth server in development — without relying on the process-wide
CS_CTS_HOST, which would also redirect any other CTS client (e.g. the
protect-ffi encryption client) sharing the same process.
Sourcepub fn maybe_base_url(self, base_url: Option<String>) -> Result<Self, AuthError>
pub fn maybe_base_url(self, base_url: Option<String>) -> Result<Self, AuthError>
Apply an optional base-URL override supplied as a raw string.
The string-typed convenience the language bindings (napi, wasm) call,
so the “empty means absent, otherwise parse-or-reject” semantics live in
one place rather than being re-derived per binding. An absent or empty
string is a no-op — base-URL resolution falls back to CS_CTS_HOST /
region service discovery (see build); a non-empty but
malformed string is rejected as AuthError::InvalidUrl. For an
already-parsed URL, use base_url.
Sourcepub fn with_token_store<T: TokenStore>(
self,
store: T,
) -> OidcFederationStrategyBuilder<P, T>
pub fn with_token_store<T: TokenStore>( self, store: T, ) -> OidcFederationStrategyBuilder<P, T>
Wire an external TokenStore into the strategy.
On every call to get_token, if no token is
cached in memory, the store is consulted before falling back to
re-federating. After every successful federation the new token is
written back to the store. Use this from short-lived strategy instances
(Edge Functions, Workers) to share a service-token cache across
processes — e.g. an HTTP-only cookie.
Returns a new builder with the store type erased into the chain — see
InMemoryTokenStore and
TokenStoreFn for ready-made implementations.
Source§impl<P: OidcProvider, S: TokenStore> OidcFederationStrategyBuilder<P, S>
impl<P: OidcProvider, S: TokenStore> OidcFederationStrategyBuilder<P, S>
Sourcepub fn build(self) -> Result<OidcFederationStrategy<P, S>, AuthError>
pub fn build(self) -> Result<OidcFederationStrategy<P, S>, AuthError>
Build the OidcFederationStrategy.
Resolves the base URL in priority order: an explicit base_url
override, then the CS_CTS_HOST environment variable, then service
discovery using the CRN’s region.
Auto Trait Implementations§
impl<P, S> Freeze for OidcFederationStrategyBuilder<P, S>
impl<P, S> RefUnwindSafe for OidcFederationStrategyBuilder<P, S>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for OidcFederationStrategyBuilder<P, S>
impl<P, S> Sync for OidcFederationStrategyBuilder<P, S>
impl<P, S> Unpin for OidcFederationStrategyBuilder<P, S>
impl<P, S> UnsafeUnpin for OidcFederationStrategyBuilder<P, S>where
P: UnsafeUnpin,
S: UnsafeUnpin,
impl<P, S> UnwindSafe for OidcFederationStrategyBuilder<P, S>where
P: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
impl<T> AuthStrategyBounds for T
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> 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