redirect
Module: redirect
Section titled “Module: redirect”Contents
Section titled “Contents”Structs
AuthorizationCode- An opaque authorization code accepted by the bound callback listener.CallbackLanding- The Control Plane pages the browser lands on once the callback isCallbackWaitTimeout- A non-zero deadline for completing the loopback callback.CompletedAuthorizationAttempt- The validated callback result coupled to its matching PKCE verifier.LoopbackRedirectUri- The exact loopback callback URI for a bound native-login listener.PendingAuthorizationAttempt- An authorization attempt with its callback listener bound.
Enums
CallbackTimeoutError- Failure to construct a callback timeout.LoopbackCallbackError- Failure while receiving a callback.LoopbackCallbackListenerError- Failure to bind or represent a callback listener.
Constants
LANDING_PATH- Path of the Control Plane page the browser lands on after the callback.
firma_login::redirect::AuthorizationCode
Section titled “firma_login::redirect::AuthorizationCode”Struct
An opaque authorization code accepted by the bound callback listener.
Tuple Struct: ()
Methods:
fn as_secret(self: &Self) -> &SecretString- Return the authorization code for the token-exchange boundary.
firma_login::redirect::CallbackLanding
Section titled “firma_login::redirect::CallbackLanding”Struct
The Control Plane pages the browser lands on once the callback is answered: one for a granted login, one for a refused one.
Both pages are on the validated Control Plane origin, so the listener can never redirect the browser anywhere else. The pages are cosmetic: they are reachable by anyone and prove nothing about the login.
Methods:
fn on(origin: &ControlPlaneOrigin) -> Self- The outcome pages under [LANDING_PATH] onorigin.
Trait Implementations:
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- Clone
fn clone(self: &Self) -> Self
firma_login::redirect::CallbackTimeoutError
Section titled “firma_login::redirect::CallbackTimeoutError”Enum
Failure to construct a callback timeout.
Variants:
Zero- Callback timeouts cannot be zero.
Traits: Eq, Error
Trait Implementations:
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- Display
fn fmt(self: &Self, __formatter: & mut ::core::fmt::Formatter) -> ::core::fmt::Result
- PartialEq
fn eq(self: &Self, other: &Self) -> bool
firma_login::redirect::CallbackWaitTimeout
Section titled “firma_login::redirect::CallbackWaitTimeout”Struct
A non-zero deadline for completing the loopback callback.
Tuple Struct: ()
Traits: Copy, Eq
Trait Implementations:
- PartialEq
fn eq(self: &Self, other: &Self) -> bool
- Clone
fn clone(self: &Self) -> Self
- TryFrom
fn try_from(value: Duration) -> Result<Self, <Self as >::Error>
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
firma_login::redirect::CompletedAuthorizationAttempt
Section titled “firma_login::redirect::CompletedAuthorizationAttempt”Struct
The validated callback result coupled to its matching PKCE verifier.
Methods:
fn authorization_code(self: &Self) -> &AuthorizationCode- Return the opaque authorization code.fn pkce_verifier(self: &Self) -> &PkceVerifier- Return the PKCE verifier that generated the accepted challenge.
firma_login::redirect::LANDING_PATH
Section titled “firma_login::redirect::LANDING_PATH”Constant: &str
Path of the Control Plane page the browser lands on after the callback.
The Control Plane renders it, so its copy can change without a CLI release. It must serve this path before a CLI that redirects there ships.
firma_login::redirect::LoopbackCallbackError
Section titled “firma_login::redirect::LoopbackCallbackError”Enum
Failure while receiving a callback.
Variants:
AuthorizationRejected(crate::LoginRefusal)- The authorization server declined the authorization request.CallbackFailed(anyhow::Error)- The callback could not be accepted or validated.
Trait Implementations:
- Display
fn fmt(self: &Self, __formatter: & mut ::core::fmt::Formatter) -> ::core::fmt::Result
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- From
fn from(source: anyhow::Error) -> Self
- Error
fn source(self: &Self) -> ::core::option::Option<&dyn ::thiserror::__private21::Error>
firma_login::redirect::LoopbackCallbackListenerError
Section titled “firma_login::redirect::LoopbackCallbackListenerError”Enum
Failure to bind or represent a callback listener.
Variants:
Bind(std::io::Error)- The operating system could not bind the required loopback listener.LocalAddress(std::io::Error)- The bound listener’s local address could not be read.RedirectUri(url::ParseError)- The fixed loopback callback URI is invalid for the URL library.
Trait Implementations:
- Error
fn source(self: &Self) -> ::core::option::Option<&dyn ::thiserror::__private21::Error>
- Display
fn fmt(self: &Self, __formatter: & mut ::core::fmt::Formatter) -> ::core::fmt::Result
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
firma_login::redirect::LoopbackRedirectUri
Section titled “firma_login::redirect::LoopbackRedirectUri”Struct
The exact loopback callback URI for a bound native-login listener.
Methods:
fn as_url(self: &Self) -> &Url- Return the validated callback URI.
Traits: Eq
Trait Implementations:
- PartialEq
fn eq(self: &Self, other: &Self) -> bool
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
firma_login::redirect::PendingAuthorizationAttempt
Section titled “firma_login::redirect::PendingAuthorizationAttempt”Struct
An authorization attempt with its callback listener bound.
Methods:
fn redirect_uri(self: &Self) -> &LoopbackRedirectUri- Return the callback URI to place in the authorization request.fn state_parameter(self: &Self) -> &str- Return the state parameter to place in the authorization request.fn pkce_challenge(self: &Self) -> &PkceChallenge- Return the S256 challenge to place in the authorization request.fn receive(self: Self, timeout: CallbackWaitTimeout, landing: CallbackLanding) -> Result<CompletedAuthorizationAttempt, LoopbackCallbackError>- Receive the first valid callback before the overall deadline, then