API Reference Charon v2.1.2-beta

modules

Modules

Authentication & sessions for API's.

Config struct. Keys & defaults

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.

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

Behaviour definition of a persistent session store. The implementation is expected to handle cleanup of expired entries.

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

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, 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.