Module

Yoga.HTTP.API.Route.Auth

Package
purescript-yoga-http-api
Repository
rowtype-yoga/purescript-yoga-http-api

#BearerToken Source

newtype BearerToken

Bearer token newtype that validates the "Bearer " prefix

Example: parseHeader "Bearer abc123" :: Either String BearerToken = Right (BearerToken "abc123") parseHeader "abc123" :: Either String BearerToken = Left "missing 'Bearer ' prefix"

Constructors

Instances

#BasicAuth Source

newtype BasicAuth

Basic authentication header value (Base64-encoded credentials)

Example: parseHeader "Basic dXNlcjpwYXNz" :: Either String BasicAuth = Right (BasicAuth "dXNlcjpwYXNz")

The raw Base64-encoded credentials are preserved for server-side verification

Constructors

Instances

#ApiKeyHeader Source

newtype ApiKeyHeader

API Key passed in a custom header

Example: parseHeader "abc123" :: Either String ApiKeyHeader = Right (ApiKeyHeader "abc123")

Constructors

Instances

#ApiKeyCookie Source

newtype ApiKeyCookie

API Key passed in a cookie (for authentication purposes) This is a marker type that indicates the cookie should be treated as an authentication mechanism in OpenAPI (securitySchemes) rather than a regular cookie parameter.

Example: Request { cookies :: { sessionId :: ApiKeyCookie } }

Constructors

Instances

#DigestAuth Source

newtype DigestAuth

Digest authentication header value

Example: parseHeader "Digest username="user", realm="api", ..." :: Either String DigestAuth = Right (DigestAuth "Digest username="user", realm="api", ...")

Constructors

Instances