Expand description
Shared helpers for plugin implementations.
Extracted to avoid duplicating common patterns across plugins (DRY).
Structs§
- Issued
Session - Result of issuing a real session for a user.
Enums§
- Session
Issue Error - Session issuance failures that callers may need to surface differently from a generic auth error (for example OAuth callback redirects).
Functions§
- admin_
banned_ user_ message - Resolve the configured message shown when a banned user attempts to create a session.
- admin_
plugin_ enabled - Whether the admin plugin is active for this auth instance.
- apply_
default_ role - Apply the configured default admin role to a new user when the caller didn’t set an explicit role.
- delete_
session_ cookie_ headers - TS-style cookie clearing used by
deleteSessionCookie. - expires_
in_ to_ at - Convert an
expiresInvalue (seconds from now) into an RFC 3339expires_attimestamp string. - get_
cookie - Parse a cookie value from the request’s
Cookieheader. - get_
credential_ account - Fetch the user’s credential account, if present.
- get_
credential_ password_ hash - Resolve the user’s stored password hash from the credential account.
- get_
owned_ api_ key - Fetch an API key by ID and verify that it belongs to the given user.
- issue_
user_ session - Issue a session for the given user, applying admin-plugin ban semantics when the admin plugin is enabled.
- user_
has_ password - Whether the user currently has a password set.