Skip to main content

Module identity

Module identity 

Source
Expand description

Who sends a request and how they logged in.

Every endpoint names the login methods it accepts with its extractor: TokenUser for a cargo token (or basic auth), SessionUser for the session cookie of the web UI, AnyUser for either, and AdminUser for an admin session. Wrapped in an Option, the login is optional.

Structs§

AdminUser
An admin logged in with a session cookie.
AnyUser
A user logged in with a cargo token or a session cookie. Optional, every failed login is anonymous.
Identity
A logged in user.
SessionUser
A user logged in with a session cookie. Optional, a request without a session cookie is anonymous, while an invalid session is rejected.
TokenUser
A user logged in with a cargo token. Optional, a request without an Authorization header is anonymous, while an invalid token is rejected.

Enums§

Accepts
The login methods an endpoint accepts.
Source
How a user logged in.