Skip to main content

Crate apiplant_auth

Crate apiplant_auth 

Source
Expand description

§apiplant-auth

Authentication primitives, independent of HTTP so they can be unit-tested in isolation:

  • Authenticator — password hashing (argon2), JWT session tokens, and API-key generation/hashing.
  • Principal — the resolved caller identity, including the organisations they belong to and their role within each (roles are per-organisation).

Authorization itself (mapping a resource’s Access policy plus org context to a decision) lives in the server, where the active organisation and resource schema are known.

Structs§

Authenticator
Issues and verifies credentials for one running server.
OrgMembership
A user’s membership in one organisation, and the roles they hold there.
Principal
The authenticated caller behind a request.

Enums§

Error
Auth errors.

Constants§

ADMIN_ROLE
The role that satisfies every other.