servant-routes-0.1.0.0: Generate route descriptions from Servant APIs
Copyright(c) Frederick Pringle 2025
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Servant.API.Routes.Auth

Description

Here we define a very very basic type to represent authentication schemes.

Synopsis

Documentation

data Auth Source #

There are 2 variants:

Instances

Instances details
ToJSON Auth Source # 
Instance details

Defined in Servant.API.Routes.Internal.Auth

Show Auth Source # 
Instance details

Defined in Servant.API.Routes.Internal.Auth

Eq Auth Source # 
Instance details

Defined in Servant.API.Routes.Internal.Auth

Methods

(==) :: Auth -> Auth -> Bool Source #

(/=) :: Auth -> Auth -> Bool Source #

Ord Auth Source # 
Instance details

Defined in Servant.API.Routes.Internal.Auth

basicAuth :: forall realm. KnownSymbol realm => Auth Source #

Create a term-level representation of a "Basic" authentication scheme.

For example:

ghci> toJSON $ basicAuth @"user"
String "Basic user"

customAuth :: forall tag. KnownSymbol tag => Auth Source #

Create a term-level representation of a "Custom" authentication scheme, i.e. one that corresponds to Servant's AuthProtect combinator.

For example:

ghci> toJSON $ customAuth @"OnlyAdminUsers"
String "OnlyAdminUsers"