Skip to main content

Crate snaplink_sso

Crate snaplink_sso 

Source
Expand description

Framework-neutral Snaplink hosted login for public OAuth clients.

The first login call returns the existing Console /login/ URL. The callback call validates state and issuer, then exchanges the authorization code with S256 PKCE. A web framework only needs to issue the redirect and pass the callback URL back to this client; no BFF is required.

Structs§

AccountContext
Server-derived product, tenant, and entitlement information.
ActivationPreparation
Authorization
Everything Snaplink reports about the current bearer.
Entitlement
A server-derived commercial entitlement snapshot.
EntitlementFile
A verified commercial entitlement read from a local file.
LicenseTrust
A set of public keys an entitlement file may be signed by.
LimitGrant
A soft threshold and a hard safety limit, mirroring commerce.LimitGrant.
LoginOptions
Public-client login configuration. There is deliberately no client secret.
LoginSetupOptions
Inline setup configuration for LoginOptions; base URL and client id are inherited from the surrounding login options.
MemoryStateStore
In-process state storage for development and single-process examples.
MenuButton
A per-node action the subject may take.
MenuNode
One node of the navigation tree the subject may see.
PlanRef
A plan identifier and version, mirroring commerce.PlanRef.
PresentationPreferences
Application-facing presentation preferences.
PresentationPreferencesPatch
A partial update. An empty value removes the corresponding preference.
ReqwestTransport
Default backend: reqwest’s async client over rustls.
SetupOptions
Direct setup configuration. The license or invitation value is sent only in the HTTPS request body and is never kept in login state.
SnaplinkClient
Public-client hosted-login session.
TokenResponse
Successful OAuth/OIDC token response.
TransportError
Transport failure. Kept distinct from crate::SnaplinkError so a backend can be swapped without the error taxonomy changing underneath callers.
TransportRequest
A fully-formed request. Built by the SDK, executed by a Transport.
TransportResponse
A backend-agnostic response. Only the status and body are surfaced: the SDK never needs redirects, cookies, or streaming.

Enums§

Feature
Stable product capability identifiers, mirroring commerce.FeatureKey.
InactiveReason
Why an entitlement is present but not usable.
LicenseError
Failures specific to entitlement-file verification.
LicenseState
The three states a product licence can be in.
Limit
Stable quota dimensions, mirroring commerce.LimitKey.
LoginResult
Result of starting or completing hosted login.
Method
HTTP verbs the SDK issues. Deliberately minimal — a hosted-login client never needs anything beyond GET and POST, and a closed enum keeps every backend implementation honest.
PreferenceError
Why a preference value was rejected.
SnaplinkError
Errors returned by the hosted-login SDK.
ThemeMode
Presentation theme values shared by Snaplink-hosted applications.

Constants§

UNCLASSIFIED_ERROR
SDK-originated code for a failure response that carried no usable error code.

Traits§

StateStore
Atomic short-lived transaction storage.
Transport
The injectable network seam. send is the whole contract, which is what makes the shape portable across the five SDKs.

Functions§

build_login_preference_handoff
Build the hosted-login handoff: only explicitly changed, non-empty values.
error_from_response
Classify a failure response the way this crate’s own transport does.
from_stored_preferences
Map a stored preference response to application fields.
holds
Whether permissions holds required, following the server’s rule.
to_update_request
Map a patch to the update request body.
unix_now
Current time in Unix seconds, the clock the state helpers expect.