Module: AtprotoAuth::State
- Defined in:
- lib/atproto_auth/state.rb,
lib/atproto_auth/state/session.rb,
lib/atproto_auth/state/token_set.rb,
lib/atproto_auth/state/session_manager.rb
Overview
Manages OAuth state for AT Protocol authorization flows. This module provides thread-safe storage and management of authorization session data, including tokens, PKCE values, and identity information.
The module consists of three main components:
-
TokenSet - Represents OAuth tokens (access and refresh) with their metadata, including expiration times, scope, and the authenticated user’s DID.
-
Session - Tracks the complete state of an authorization flow, including:
-
PKCE verifier/challenge pairs
-
State tokens for request verification
-
Authorization server information
-
Current tokens and user identity (DID)
-
-
SessionManager - Provides thread-safe storage and retrieval of active sessions, with support for lookup by session ID or state token.
All classes in this module are thread-safe and can be used in concurrent environments. The module handles secure generation and validation of state tokens, and ensures consistency of session data through synchronized access.
Defined Under Namespace
Classes: Session, SessionError, SessionManager, TokenSet