API Reference Charon v3.1.1

modules

Modules

Authentication & sessions for API's.

Config struct.

Tokens to be communicated to the client.

Plugs to create, update/refresh and delete sessions. When creating or updating a session, new tokens are created as well.

Error raised when token transport method "bearer" is requested by a browser client.

Error raised when a new/updated session could not be stored.

Error raised on an optimistic locking error when updating an existing session.

The persistent session store. See Charon.SessionStore.Behaviour for callbacks. All functions delegate to the configured session store module.

Behaviour definition of a persistent session store. Clients should not use the implementation directly, but should use Charon.SessionStore.

A dummy session store that can be used if fully stateless tokens are desired.

An in-memory persistent session store, implements behaviour Charon.SessionStore. In addition to the required callbacks, this store also provides get_all/3 and delete_all/3 (for a user) functions.

A persistent session store based on Redis, which implements behaviour Charon.SessionStore. In addition to the required callbacks, this store also provides get_all/3 and delete_all/3 (for a user) functions.

Utility functions for writing tests.

Entrypoint for Charon.TokenFactory.Behaviour implementation. All functions delegate to the configured module.

Behaviour for token-signing modules.

JWT's with either symmetric (HMAC) or asymmetric (EDDSA) signatures. The default, simplest and most performant option is symmetric signatures (MAC), with the key derived from the Charon base secret.

The plugs in this module (and its submodules) can be used to verify tokens. The token's presence, signature, expiration and any claims can be checked. Additionally, the token's session can be loaded and, in case of a refresh token, it can be verified that it matches the session.

After verifying everything you would want to verify about a token, assign the following to the conn

Utility functions, mainly getters and setters for module internals.

Derive a key from a base secret using PBKDF2.