Skip to content

protocol

Structs

Enums

  • AuthorizationScope - Whether an authorization may issue a renewable credential.
  • NativeTokenError - A native login failure that never includes code, verifier, state, or token.

firma_login::protocol::AuthenticatedConnection

Section titled “firma_login::protocol::AuthenticatedConnection”

Struct

Result of the first authenticated Workspace request.

Fields:

  • workspace_id: firma_identifiers::WorkspaceId - Workspace the access token is bound to.
  • membership_id: firma_identifiers::MembershipId - Membership the access token is bound to.

Methods:

  • fn access_token(self: &Self) -> &SecretString - The access token, still wrapped so Debug stays redacted.
  • fn into_refresh_token(self: Self) -> Option<SecretString> - Moves the renewable credential out after identity proof succeeds.

firma_login::protocol::AuthorizationRequest

Section titled “firma_login::protocol::AuthorizationRequest”

Struct

An authorization URL coupled to the only listener that can complete it.

Methods:

  • fn with_scope(origin: &ControlPlaneOrigin, pending: PendingAuthorizationAttempt, scope: AuthorizationScope) -> Self - Compose an authorization request with the selected scope.
  • fn as_url(self: &Self) -> &Url - URL to give to the browser. It contains state and must not enter logs.
  • fn receive(self: Self, timeout: CallbackWaitTimeout) -> Result<AuthorizedTokenExchange, LoopbackCallbackError> - Receive the browser callback and keep its original redirect URI paired
  • fn redirect_uri(self: &Self) -> &Url - Exact redirect URI retained for the token exchange.

Enum

Whether an authorization may issue a renewable credential.

Variants:

  • AccessOnly - Request only the short-lived access credential.
  • OfflineAccess - Request an offline_access refresh credential.

Traits: Eq, Copy

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Default
    • fn default() -> Self
  • PartialEq
    • fn eq(self: &Self, other: &Self) -> bool
  • Clone
    • fn clone(self: &Self) -> Self

firma_login::protocol::AuthorizedTokenExchange

Section titled “firma_login::protocol::AuthorizedTokenExchange”

Struct

A callback result that cannot lose its original redirect URI.

Struct

The result of one token exchange. The access token is never formatted or serialized.

Fields:

  • workspace_id: firma_identifiers::WorkspaceId - Workspace the approval selected.
  • membership_id: firma_identifiers::MembershipId - Membership the approval selected.

Struct

A bounded, redirect rejecting token transport for one PKCE exchange.

Methods:

  • fn new(origin: &ControlPlaneOrigin) -> Result<Self, NativeTokenError> - Construct the transport from the validated Control Plane origin.
  • fn exchange(self: &Self, exchange: AuthorizedTokenExchange) -> Result<NativeAccessGrant, NativeTokenError> - Exchange one completed callback, without retrying an uncertain request.
  • fn revoke(self: &Self, token: &SecretString) -> Result<(), NativeTokenError> - Revokes one renewable family. Unknown and already-revoked tokens are
  • fn prove(self: &Self, grant: NativeAccessGrant) -> Result<AuthenticatedConnection, NativeTokenError> - Make the first protected Workspace request and check it reports the

Enum

A native login failure that never includes code, verifier, state, or token.

Variants:

  • InvalidCode - The manually entered code is not canonical.
  • Entropy(crate::EntropyError) - Secure operating-system randomness was unavailable.
  • FailureAndRevocationUnconfirmed{ failure: Box<Self>, revocation: Box<Self> } - An issued renewable credential could not be verified or accepted, and
  • Transport(reqwest::Error) - The HTTP transport failed.
  • Refused(crate::LoginRefusal) - The Control Plane refused the login with an RFC 6749 error code.
  • Rejected(reqwest::StatusCode) - Authority rejected a native login request.
  • InvalidResponse - Authority returned an unexpected or oversized success document.

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: crate::EntropyError) -> Self
  • Error
    • fn source(self: &Self) -> ::core::option::Option<&dyn ::thiserror::__private21::Error>

firma_login::protocol::TerminalAuthorizationRequest

Section titled “firma_login::protocol::TerminalAuthorizationRequest”

Struct

One terminal-code attempt using the original PKCE verifier without a listener.

Methods:

  • fn with_scope(origin: &ControlPlaneOrigin, attempt: AuthorizationAttempt, scope: AuthorizationScope) -> Self - Compose the terminal request with the selected scope.
  • fn as_url(self: &Self) -> &Url - Browser URL containing the per-attempt state.
  • fn complete(self: Self, code: &str) -> Result<AuthorizedTokenExchange, NativeTokenError> - Pair a canonical one-time code with this attempt’s original verifier.