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§
- Account
Context - Server-derived product, tenant, and entitlement information.
- Activation
Preparation - Authorization
- Everything Snaplink reports about the current bearer.
- Entitlement
- A server-derived commercial entitlement snapshot.
- Entitlement
File - A verified commercial entitlement read from a local file.
- License
Trust - A set of public keys an entitlement file may be signed by.
- Limit
Grant - A soft threshold and a hard safety limit, mirroring
commerce.LimitGrant. - Login
Options - Public-client login configuration. There is deliberately no client secret.
- Login
Setup Options - Inline setup configuration for LoginOptions; base URL and client id are inherited from the surrounding login options.
- Memory
State Store - In-process state storage for development and single-process examples.
- Menu
Button - A per-node action the subject may take.
- Menu
Node - One node of the navigation tree the subject may see.
- PlanRef
- A plan identifier and version, mirroring
commerce.PlanRef. - Presentation
Preferences - Application-facing presentation preferences.
- Presentation
Preferences Patch - A partial update. An empty value removes the corresponding preference.
- Reqwest
Transport - Default backend:
reqwest’s async client over rustls. - Setup
Options - Direct setup configuration. The license or invitation value is sent only in the HTTPS request body and is never kept in login state.
- Snaplink
Client - Public-client hosted-login session.
- Token
Response - Successful OAuth/OIDC token response.
- Transport
Error - Transport failure. Kept distinct from
crate::SnaplinkErrorso a backend can be swapped without the error taxonomy changing underneath callers. - Transport
Request - A fully-formed request. Built by the SDK, executed by a
Transport. - Transport
Response - 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. - Inactive
Reason - Why an entitlement is present but not usable.
- License
Error - Failures specific to entitlement-file verification.
- License
State - The three states a product licence can be in.
- Limit
- Stable quota dimensions, mirroring
commerce.LimitKey. - Login
Result - 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.
- Preference
Error - Why a preference value was rejected.
- Snaplink
Error - Errors returned by the hosted-login SDK.
- Theme
Mode - 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§
- State
Store - Atomic short-lived transaction storage.
- Transport
- The injectable network seam.
sendis 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
permissionsholdsrequired, 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.