HummingbirdAuth
import HummingbirdAuth
Module information
- Declarations
- 85
- Symbols
- 105
import HummingbirdAuth
protocol AuthRequestContext<Identity> : RequestContext
Protocol that all request contexts should conform to if they want to support authentication middleware
protocol AuthenticatorMiddleware : RouterMiddleware where Self.Context : AuthRequestContext
Protocol for a middleware that checks if a request is authenticated.
protocol SessionRequestContext<Session> : RequestContext
Protocol for RequestContext that stores session data
protocol UserSessionRepository<Identifier, User> : Sendable
Repository of users identified by a session object
struct BasicAuthRequestContext<Identity> where Identity : Sendable
Implementation of a basic request context that supports authenticators
struct BasicAuthentication
Basic authentication information extracted from request header “Authorization”
struct BasicSessionRequestContext<Session, Identity> where Session : Decodable, Session : Encodable, Session : Sendable, Identity : Sendable
Implementation of a basic request context that supports session storage and authenticators
struct BearerAuthentication
Bearer authentication information extracted from request header “Authorization”
struct ClosureAuthenticator<Context> where Context : AuthRequestContext
Authenticator that uses a closure to return authentication state
struct IsAuthenticatedMiddleware<Context> where Context : AuthRequestContext
Middleware returning 401 for unauthenticated requests
struct SessionAuthenticator<Context, Repository> where Context : AuthRequestContext, Context : SessionRequestContext, Repository : UserSessionRepository, Context.Identity == Repository.User, Context.Session == Repository.Identifier
Session authenticator
struct SessionContext<Session> where Session : Decodable, Session : Encodable, Session : Sendable
Session context
struct SessionCookieParameters
Session cookie parameters
@dynamicMemberLookup struct SessionData<Session> where Session : Decodable, Session : Encodable, Session : Sendable
Session data
struct SessionMiddleware<Context> where Context : SessionRequestContext
Middleware that extracts session data for a request and stores it in the context
struct SessionStorage<SessionType> where SessionType : Decodable, SessionType : Encodable
Stores session data
struct UserRepositoryContext
Context object supplied when requesting user
struct UserSessionClosureRepository<Identifier, User> where Identifier : Decodable, Identifier : Encodable, User : Sendable
Implementation of UserRepository that uses a closure
typealias SessionUserRepository = UserSessionRepository
import CBcrypt
import HummingbirdAuthTesting
import HummingbirdBasicAuth
import HummingbirdBcrypt
import HummingbirdOTP