Expand description
Authentication, authorization, CSRF, and password hashing.
Structs§
- Access
Decision Manager - Collects voters and applies an affirmative strategy (any grant wins; any deny without grant fails).
- Argon2id
Password Hasher - Argon2id hasher using the crate defaults (PHC string output).
- Async
Session Token Middleware - Async variant of
SessionTokenMiddleware. - Authorization
Request - Authorization redirect URL plus CSRF
stateand PKCEcode_verifier. - Csrf
Token - Issued CSRF token: intention id + opaque value for the form field.
- Firewall
Middleware - Firewall that reads a header, runs an
Authenticator, and stores the token on the request. - Hmac
Csrf Token Manager - HMAC-SHA256 CSRF manager. Secret must be app-owned and stable across requests.
- InMemory
User - Simple in-memory user for apps and tests.
- Ldap
Authenticator - Firewall
Authenticatorthat expectsusername:passwordin the credentials string. - Ldap
Bind Config - Connection / DN templates for an LDAP bind authenticator.
- Ldap
Identity - Identity returned after a successful directory bind.
- Mock
Ldap Binder - Fixed-response binder for tests.
- Mock
Token Exchanger - Fixed-response exchanger for tests.
- OAuth
Client Config - OAuth 2.0 / OIDC client (relying party) settings.
- OAuth
Token Response - Parsed token-endpoint JSON body.
- Role
Voter - Grants when the token is authenticated and holds
role. - Session
Token Middleware - Sync middleware: restore session identity onto
_security_tokenwhen absent. - Username
Password Token - Username/password-style token (also used for bearer/API key strings).
Enums§
- Security
Error - AuthN/Z and CSRF failure.
- Vote
- Affirmative / deny / abstain vote.
Constants§
- CSRF_
FIELD_ NAME - Default HTML form field name for the CSRF token (Symfony
_token). - LDAP_
USERNAME_ PLACEHOLDER - Placeholder token replaced by
LdapBindConfig::user_dn. - SECURITY_
SESSION_ KEY - Session attribute key for the serialized security identity.
- TOKEN_
ATTRIBUTE - Request attribute key where the firewall stores the security token.
Traits§
- Authenticator
- Turns request credentials into a
UsernamePasswordToken. - Csrf
Token Manager - Issues and validates CSRF tokens.
- Ldap
Binder - Sync LDAP bind. Apps implement this with their LDAP client.
- Password
Hasher - Hashes and verifies password strings.
- Token
Exchanger - Sync token exchange. Apps implement this with their HTTP stack.
- Token
Interface - Security token carrying credentials and optional user.
- User
Interface - Authenticated (or anonymous) principal.
- Voter
- Decides access for a token against a subject.
Functions§
- authenticate_
ldap_ password - Binds then maps to a
UsernamePasswordToken. - build_
authorization_ request - Builds an authorization request with a fresh random
stateand PKCE verifier. - build_
authorization_ request_ with - Builds an authorization request with caller-supplied
stateand PKCE verifier. - decode_
jwt_ payload_ json - Decodes the JWT payload segment without verifying the signature.
- login
- Stores an authenticated token in
session(user id + roles only; no credentials). - logout
- Removes the security identity from
session. - parse_
token_ response - Parses a token-endpoint JSON response body.
- request_
token - Returns the firewall token from request attributes when present.
- split_
user_ password - Splits
username:password(first colon). Password may contain colons. - subject_
from_ id_ token - Reads the OIDC
subclaim from an unverified ID token payload. - token_
exchange_ form application/x-www-form-urlencodedbody for the authorization-code token exchange.- token_
from_ ldap_ identity - Builds an authenticated security token from a successful LDAP identity.
- token_
from_ oidc_ subject - Builds an authenticated security token from an
IdPsubject and roles. - token_
from_ session - Restores a token from
sessionwhen a valid identity is stored.
Type Aliases§
- Subject
- Subject of an access check (attribute string in v0).