module

Patty::Auth

Constants

ENROLLMENT_MAX_AGE = 10.minutes
FORM_CSRF_COOKIE = "patty_form_csrf"
MFA_CHALLENGE_COOKIE = "patty_mfa_challenge"
MFA_CHALLENGE_MAX_AGE = 5.minutes
MFA_CHALLENGE_MAX_TRIES = 5
PASSWORD_ALGORITHM = "bcrypt-sha256"
RECOVERY_CODE_COUNT = 10
SESSION_COOKIE = "patty_session"
SESSION_IDLE_TIMEOUT = 2.hours
SESSION_MAX_AGE = 7.days
VERSION = 2

Class methods

begin_enrollment(session : Session, now : Time = Time.utc) : Enrollment
Source
confirm_enrollment(env : HTTP::Server::Context, session : Session, code : String, secure : Bool = Security::RequestSecurity.https?(env), now : Time = Time.utc) : Session | Nil
Source
create_mfa_challenge(env : HTTP::Server::Context, ip : String, secure : Bool = Security::RequestSecurity.https?(env), now : Time = Time.utc)
Source
create_session(env : HTTP::Server::Context, secure : Bool = Security::RequestSecurity.https?(env), now : Time = Time.utc) : Session
Source
destroy_session(env : HTTP::Server::Context)
Source
disable_mfa!(env : HTTP::Server::Context, secure : Bool = Security::RequestSecurity.https?(env), now : Time = Time.utc) : Session | Nil
Source
enrollment_for(session : Session, now : Time = Time.utc) : Enrollment | Nil
Source
issue_form_token(env : HTTP::Server::Context, secure : Bool = Security::RequestSecurity.https?(env)) : String
Source
login_limiter
Source
mfa_enabled?
Source
password_algorithm
Source
password_set?
Source
pending_mfa_challenge?(env : HTTP::Server::Context, ip : String, now : Time = Time.utc) : Bool
Source
recovery_codes_remaining
Source
regenerate_recovery_codes!(env : HTTP::Server::Context, secure : Bool = Security::RequestSecurity.https?(env), now : Time = Time.utc) : Session | Nil
Source
reset_mfa!
Source
reset_password!
Source
reset_runtime!
Source
revoke_sessions!
Source
secret_store_status
Source
session_for(env : HTTP::Server::Context, now : Time = Time.utc) : Session | Nil
Source
set_password(password : String)
Source
valid_form_token?(env : HTTP::Server::Context, submitted : String | Nil) : Bool
Source
verify_mfa_challenge(env : HTTP::Server::Context, ip : String, code : String, now : Time = Time.utc) : Bool
Source
verify_password(password : String) : Bool
Source
verify_second_factor(code : String, now : Time = Time.utc) : Bool
Source

Nested types