happstack-authenticate-2.4.0: Happstack Authentication Library

Safe HaskellNone
LanguageHaskell98

Happstack.Authenticate.Core

Synopsis

Documentation

data AuthenticateConfig Source #

Various configuration options that apply to all authentication methods

Constructors

AuthenticateConfig 

Fields

Instances
Generic AuthenticateConfig Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep AuthenticateConfig :: Type -> Type Source #

type Rep AuthenticateConfig Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep AuthenticateConfig = D1 (MetaData "AuthenticateConfig" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" False) (C1 (MetaCons "AuthenticateConfig" PrefixI True) ((S1 (MetaSel (Just "_isAuthAdmin") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (UserId -> IO Bool)) :*: (S1 (MetaSel (Just "_usernameAcceptable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Username -> Maybe CoreError)) :*: S1 (MetaSel (Just "_requireEmail") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))) :*: (S1 (MetaSel (Just "_systemFromAddress") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe SimpleAddress)) :*: (S1 (MetaSel (Just "_systemReplyToAddress") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe SimpleAddress)) :*: S1 (MetaSel (Just "_systemSendmailPath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe FilePath))))))

newtype UserId #

Constructors

UserId 

Fields

Instances
Enum UserId 
Instance details

Defined in Data.UserId

Eq UserId 
Instance details

Defined in Data.UserId

Data UserId 
Instance details

Defined in Data.UserId

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UserId -> c UserId Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UserId Source #

toConstr :: UserId -> Constr Source #

dataTypeOf :: UserId -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UserId) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UserId) Source #

gmapT :: (forall b. Data b => b -> b) -> UserId -> UserId Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UserId -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UserId -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UserId -> m UserId Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UserId -> m UserId Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UserId -> m UserId Source #

Ord UserId 
Instance details

Defined in Data.UserId

Read UserId 
Instance details

Defined in Data.UserId

Show UserId 
Instance details

Defined in Data.UserId

Generic UserId 
Instance details

Defined in Data.UserId

Associated Types

type Rep UserId :: Type -> Type Source #

ToJSON UserId 
Instance details

Defined in Data.UserId

FromJSON UserId 
Instance details

Defined in Data.UserId

SafeCopy UserId 
Instance details

Defined in Data.UserId

PathInfo UserId 
Instance details

Defined in Data.UserId

Methods

toPathSegments :: UserId -> [Text]

fromPathSegments :: URLParser UserId

Serialize UserId 
Instance details

Defined in Data.UserId

Methods

put :: Putter UserId

get :: Get UserId

Indexable UserIxs User Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep UserId 
Instance details

Defined in Data.UserId

type Rep UserId = D1 (MetaData "UserId" "Data.UserId" "userid-0.1.3.3-DFcc7aQw8YGcjTySp1ikU" True) (C1 (MetaCons "UserId" PrefixI True) (S1 (MetaSel (Just "_unUserId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Integer)))

unUserId :: Functor f => (Integer -> f Integer) -> UserId -> f UserId #

rUserId :: Boomerang e tok (Integer :- r) (UserId :- r) #

jsonOptions :: Options Source #

when creating JSON field names, drop the first character. Since we are using lens, the leading character should always be _.

toJSONResponse :: (RenderMessage HappstackAuthenticateI18N e, ToJSON a) => Either e a -> Response Source #

convert a value to a JSON encoded Response

toJSONSuccess :: ToJSON a => a -> Response Source #

convert a value to a JSON encoded Response

toJSONError :: forall e. RenderMessage HappstackAuthenticateI18N e => e -> Response Source #

convert an error to a JSON encoded Response

FIXME: I18N

newtype Username Source #

an arbitrary, but unique string that the user uses to identify themselves

Constructors

Username 

Fields

Instances
Eq Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

Data Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Username -> c Username Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Username Source #

toConstr :: Username -> Constr Source #

dataTypeOf :: Username -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Username) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Username) Source #

gmapT :: (forall b. Data b => b -> b) -> Username -> Username Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Username -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Username -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Username -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Username -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Username -> m Username Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Username -> m Username Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Username -> m Username Source #

Ord Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep Username :: Type -> Type Source #

ToJSON Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

FromJSON Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

SafeCopy Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

PathInfo Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

Indexable UserIxs User Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep Username Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep Username = D1 (MetaData "Username" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" True) (C1 (MetaCons "Username" PrefixI True) (S1 (MetaSel (Just "_unUsername") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

rUsername :: forall tok e r. Boomerang e tok ((:-) Text r) ((:-) Username r) Source #

usernamePolicy :: Username -> Maybe CoreError Source #

a very basic policy for userAcceptable

Enforces:

Username can not be empty

newtype Email Source #

an Email address. No validation in performed.

Constructors

Email 

Fields

Instances
Eq Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

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

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

Data Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Email -> c Email Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Email Source #

toConstr :: Email -> Constr Source #

dataTypeOf :: Email -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Email) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Email) Source #

gmapT :: (forall b. Data b => b -> b) -> Email -> Email Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Email -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Email -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Email -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Email -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Email -> m Email Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Email -> m Email Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Email -> m Email Source #

Ord Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep Email :: Type -> Type Source #

Methods

from :: Email -> Rep Email x Source #

to :: Rep Email x -> Email Source #

ToJSON Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

FromJSON Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

SafeCopy Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

PathInfo Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

toPathSegments :: Email -> [Text]

fromPathSegments :: URLParser Email

Indexable UserIxs User Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep Email Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep Email = D1 (MetaData "Email" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" True) (C1 (MetaCons "Email" PrefixI True) (S1 (MetaSel (Just "_unEmail") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

data User Source #

A unique User

Constructors

User 
Instances
Eq User Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

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

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

Data User Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> User -> c User Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c User Source #

toConstr :: User -> Constr Source #

dataTypeOf :: User -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c User) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c User) Source #

gmapT :: (forall b. Data b => b -> b) -> User -> User Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> User -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> User -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> User -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> User -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> User -> m User Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> User -> m User Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> User -> m User Source #

Ord User Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read User Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show User Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic User Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep User :: Type -> Type Source #

Methods

from :: User -> Rep User x Source #

to :: Rep User x -> User Source #

ToJSON User Source # 
Instance details

Defined in Happstack.Authenticate.Core

FromJSON User Source # 
Instance details

Defined in Happstack.Authenticate.Core

SafeCopy User Source # 
Instance details

Defined in Happstack.Authenticate.Core

Indexable UserIxs User Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep User Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep User = D1 (MetaData "User" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" False) (C1 (MetaCons "User" PrefixI True) (S1 (MetaSel (Just "_userId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserId) :*: (S1 (MetaSel (Just "_username") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Username) :*: S1 (MetaSel (Just "_email") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Email)))))

newtype SharedSecret Source #

The shared secret is used to encrypt a users data on a per-user basis. We can invalidate a JWT value by changing the shared secret.

Constructors

SharedSecret 
Instances
Eq SharedSecret Source # 
Instance details

Defined in Happstack.Authenticate.Core

Data SharedSecret Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SharedSecret -> c SharedSecret Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SharedSecret Source #

toConstr :: SharedSecret -> Constr Source #

dataTypeOf :: SharedSecret -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SharedSecret) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SharedSecret) Source #

gmapT :: (forall b. Data b => b -> b) -> SharedSecret -> SharedSecret Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SharedSecret -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SharedSecret -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SharedSecret -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SharedSecret -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SharedSecret -> m SharedSecret Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedSecret -> m SharedSecret Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedSecret -> m SharedSecret Source #

Ord SharedSecret Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read SharedSecret Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show SharedSecret Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic SharedSecret Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep SharedSecret :: Type -> Type Source #

SafeCopy SharedSecret Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep SharedSecret Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep SharedSecret = D1 (MetaData "SharedSecret" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" True) (C1 (MetaCons "SharedSecret" PrefixI True) (S1 (MetaSel (Just "_unSharedSecret") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

data SimpleAddress Source #

Constructors

SimpleAddress 
Instances
Eq SimpleAddress Source # 
Instance details

Defined in Happstack.Authenticate.Core

Data SimpleAddress Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SimpleAddress -> c SimpleAddress Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SimpleAddress Source #

toConstr :: SimpleAddress -> Constr Source #

dataTypeOf :: SimpleAddress -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SimpleAddress) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SimpleAddress) Source #

gmapT :: (forall b. Data b => b -> b) -> SimpleAddress -> SimpleAddress Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SimpleAddress -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SimpleAddress -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SimpleAddress -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SimpleAddress -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SimpleAddress -> m SimpleAddress Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SimpleAddress -> m SimpleAddress Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SimpleAddress -> m SimpleAddress Source #

Ord SimpleAddress Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read SimpleAddress Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show SimpleAddress Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic SimpleAddress Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep SimpleAddress :: Type -> Type Source #

SafeCopy SimpleAddress Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep SimpleAddress Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep SimpleAddress = D1 (MetaData "SimpleAddress" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" False) (C1 (MetaCons "SimpleAddress" PrefixI True) (S1 (MetaSel (Just "_saName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_saEmail") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Email)))

genSharedSecret :: MonadIO m => m SharedSecret Source #

Generate a Salt from 128 bits of data from /dev/urandom, with the system RNG as a fallback. This is the function used to generate salts by makePassword.

type SharedSecrets = Map UserId SharedSecret Source #

A map which stores the SharedSecret for each UserId

data CoreError Source #

the CoreError type is used to represent errors in a language agnostic manner. The errors are translated into human readable form via the I18N translations.

Instances
Eq CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

Data CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CoreError -> c CoreError Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CoreError Source #

toConstr :: CoreError -> Constr Source #

dataTypeOf :: CoreError -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CoreError) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CoreError) Source #

gmapT :: (forall b. Data b => b -> b) -> CoreError -> CoreError Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoreError -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoreError -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CoreError -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CoreError -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoreError -> m CoreError Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoreError -> m CoreError Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoreError -> m CoreError Source #

Ord CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep CoreError :: Type -> Type Source #

ToJSON CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

FromJSON CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

SafeCopy CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

ToJExpr CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

toJExpr :: CoreError -> JExpr

toJExprFromList :: [CoreError] -> JExpr

RenderMessage HappstackAuthenticateI18N CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep CoreError Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep CoreError = D1 (MetaData "CoreError" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" False) (((C1 (MetaCons "HandlerNotFound" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "URLDecodeFailed" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "UsernameAlreadyExists" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "AuthorizationRequired" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Forbidden" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "JSONDecodeFailed" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "InvalidUserId" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "UsernameNotAcceptable" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "InvalidEmail" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "TextError" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))))))

data NewAccountMode Source #

This value is used to configure the type of new user registrations permitted for this system.

Constructors

OpenRegistration

new users can create their own accounts

ModeratedRegistration

new users can apply to create their own accounts, but a moderator must approve them before they are active

ClosedRegistration

only the admin can create a new account

Instances
Eq NewAccountMode Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show NewAccountMode Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic NewAccountMode Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep NewAccountMode :: Type -> Type Source #

SafeCopy NewAccountMode Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep NewAccountMode Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep NewAccountMode = D1 (MetaData "NewAccountMode" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" False) (C1 (MetaCons "OpenRegistration" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "ModeratedRegistration" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ClosedRegistration" PrefixI False) (U1 :: Type -> Type)))

data AuthenticateState Source #

this acid-state value contains the state common to all authentication methods

Instances
Eq AuthenticateState Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show AuthenticateState Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic AuthenticateState Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep AuthenticateState :: Type -> Type Source #

SafeCopy AuthenticateState Source # 
Instance details

Defined in Happstack.Authenticate.Core

IsAcidic AuthenticateState Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

acidEvents :: [Event AuthenticateState]

type Rep AuthenticateState Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep AuthenticateState = D1 (MetaData "AuthenticateState" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" False) (C1 (MetaCons "AuthenticateState" PrefixI True) ((S1 (MetaSel (Just "_sharedSecrets") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SharedSecrets) :*: S1 (MetaSel (Just "_users") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IxUser)) :*: (S1 (MetaSel (Just "_nextUserId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UserId) :*: (S1 (MetaSel (Just "_defaultSessionTimeout") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "_newAccountMode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NewAccountMode)))))

newtype CreateUser Source #

Constructors

CreateUser User 
Instances
SafeCopy CreateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

UpdateEvent CreateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

Method CreateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type MethodResult CreateUser :: Type

type MethodState CreateUser :: Type

Methods

methodTag :: CreateUser -> Tag

type MethodResult CreateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

type MethodResult CreateUser = Either CoreError User
type MethodState CreateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

type MethodState CreateUser = AuthenticateState

newtype UpdateUser Source #

Constructors

UpdateUser User 
Instances
SafeCopy UpdateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

UpdateEvent UpdateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

Method UpdateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type MethodResult UpdateUser :: Type

type MethodState UpdateUser :: Type

Methods

methodTag :: UpdateUser -> Tag

type MethodResult UpdateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

type MethodResult UpdateUser = ()
type MethodState UpdateUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

type MethodState UpdateUser = AuthenticateState

newtype DeleteUser Source #

Constructors

DeleteUser UserId 
Instances
SafeCopy DeleteUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

UpdateEvent DeleteUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

Method DeleteUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type MethodResult DeleteUser :: Type

type MethodState DeleteUser :: Type

Methods

methodTag :: DeleteUser -> Tag

type MethodResult DeleteUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

type MethodResult DeleteUser = ()
type MethodState DeleteUser Source # 
Instance details

Defined in Happstack.Authenticate.Core

type MethodState DeleteUser = AuthenticateState

getOrGenSharedSecret :: MonadIO m => AcidState AuthenticateState -> UserId -> m SharedSecret Source #

get the SharedSecret for UserId. Generate one if they don't have one yet.

data Token Source #

The Token type represents the encrypted data used to identify a user.

Constructors

Token 
Instances
Eq Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

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

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

Data Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Token -> c Token Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Token Source #

toConstr :: Token -> Constr Source #

dataTypeOf :: Token -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Token) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Token) Source #

gmapT :: (forall b. Data b => b -> b) -> Token -> Token Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Token -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Token -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Token -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Token -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Token -> m Token Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Token -> m Token Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Token -> m Token Source #

Ord Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep Token :: Type -> Type Source #

Methods

from :: Token -> Rep Token x Source #

to :: Rep Token x -> Token Source #

ToJSON Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

FromJSON Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep Token Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep Token = D1 (MetaData "Token" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" False) (C1 (MetaCons "Token" PrefixI True) (S1 (MetaSel (Just "_tokenUser") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 User) :*: S1 (MetaSel (Just "_tokenIsAuthAdmin") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))

type TokenText = Text Source #

TokenText is the encrypted form of the Token which is passed between the server and the client.

issueToken Source #

Arguments

:: MonadIO m 
=> AcidState AuthenticateState 
-> AuthenticateConfig 
-> User

the user

-> m TokenText 

create a Token for User

The isAuthAdmin paramater is a function which will be called to determine if UserId is a user who should be given Administrator privileges. This includes the ability to things such as set the OpenId realm, change the registeration mode, etc.

decodeAndVerifyToken :: MonadIO m => AcidState AuthenticateState -> UTCTime -> TokenText -> m (Maybe (Token, JWT VerifiedJWT)) Source #

decode and verify the TokenText. If successful, return the Token otherwise Nothing.

authCookieName :: String Source #

name of the Cookie used to hold the TokenText

addTokenCookie :: Happstack m => AcidState AuthenticateState -> AuthenticateConfig -> User -> m TokenText Source #

create a Token for User and add a Cookie to the Response

see also: issueToken

getTokenCookie :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT)) Source #

get, decode, and verify the Token from the Cookie.

getTokenHeader :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT)) Source #

get, decode, and verify the Token from the Authorization HTTP header

getToken :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT)) Source #

get, decode, and verify the Token looking first in the Authorization header and then in Cookie.

see also: getTokenHeader, getTokenCookie

getUserId :: Happstack m => AcidState AuthenticateState -> m (Maybe UserId) Source #

get the UserId

calls getToken but returns only the UserId

newtype AuthenticationMethod Source #

AuthenticationMethod is used by the routing system to select which authentication backend should handle this request.

Instances
Eq AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

Data AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AuthenticationMethod -> c AuthenticationMethod Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AuthenticationMethod Source #

toConstr :: AuthenticationMethod -> Constr Source #

dataTypeOf :: AuthenticationMethod -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AuthenticationMethod) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AuthenticationMethod) Source #

gmapT :: (forall b. Data b => b -> b) -> AuthenticationMethod -> AuthenticationMethod Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AuthenticationMethod -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AuthenticationMethod -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> AuthenticationMethod -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> AuthenticationMethod -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> AuthenticationMethod -> m AuthenticationMethod Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AuthenticationMethod -> m AuthenticationMethod Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AuthenticationMethod -> m AuthenticationMethod Source #

Ord AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep AuthenticationMethod :: Type -> Type Source #

ToJSON AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

FromJSON AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

SafeCopy AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

PathInfo AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep AuthenticationMethod Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep AuthenticationMethod = D1 (MetaData "AuthenticationMethod" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" True) (C1 (MetaCons "AuthenticationMethod" PrefixI True) (S1 (MetaSel (Just "_unAuthenticationMethod") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

data AuthenticateURL Source #

Instances
Eq AuthenticateURL Source # 
Instance details

Defined in Happstack.Authenticate.Core

Data AuthenticateURL Source # 
Instance details

Defined in Happstack.Authenticate.Core

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AuthenticateURL -> c AuthenticateURL Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AuthenticateURL Source #

toConstr :: AuthenticateURL -> Constr Source #

dataTypeOf :: AuthenticateURL -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AuthenticateURL) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AuthenticateURL) Source #

gmapT :: (forall b. Data b => b -> b) -> AuthenticateURL -> AuthenticateURL Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AuthenticateURL -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AuthenticateURL -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> AuthenticateURL -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> AuthenticateURL -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> AuthenticateURL -> m AuthenticateURL Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AuthenticateURL -> m AuthenticateURL Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AuthenticateURL -> m AuthenticateURL Source #

Ord AuthenticateURL Source # 
Instance details

Defined in Happstack.Authenticate.Core

Read AuthenticateURL Source # 
Instance details

Defined in Happstack.Authenticate.Core

Show AuthenticateURL Source # 
Instance details

Defined in Happstack.Authenticate.Core

Generic AuthenticateURL Source # 
Instance details

Defined in Happstack.Authenticate.Core

Associated Types

type Rep AuthenticateURL :: Type -> Type Source #

PathInfo AuthenticateURL Source # 
Instance details

Defined in Happstack.Authenticate.Core

(Functor m, Monad m) => EmbedAsChild (Partial' m) PartialMsgs 
Instance details

Defined in Happstack.Authenticate.OpenId.Partials

Methods

asChild :: PartialMsgs -> GenChildList (Partial' m)

(Functor m, Monad m) => EmbedAsChild (Partial' m) PartialMsgs 
Instance details

Defined in Happstack.Authenticate.Password.Partials

Methods

asChild :: PartialMsgs -> GenChildList (Partial' m)

(Functor m, Monad m) => EmbedAsAttr (Partial' m) (Attr Text PartialMsgs) 
Instance details

Defined in Happstack.Authenticate.OpenId.Partials

Methods

asAttr :: Attr Text PartialMsgs -> GenAttributeList (Partial' m)

(Functor m, Monad m) => EmbedAsAttr (Partial' m) (Attr Text PartialMsgs) 
Instance details

Defined in Happstack.Authenticate.Password.Partials

Methods

asAttr :: Attr Text PartialMsgs -> GenAttributeList (Partial' m)

(Functor m, MonadIO m) => IntegerSupply (RouteT AuthenticateURL m) 
Instance details

Defined in Happstack.Authenticate.Route

type Rep AuthenticateURL Source # 
Instance details

Defined in Happstack.Authenticate.Core

type Rep AuthenticateURL = D1 (MetaData "AuthenticateURL" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0-6wnCD6Xg0Yq5QbkMD1BNVr" False) (C1 (MetaCons "AuthenticationMethods" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (AuthenticationMethod, [Text])))) :+: C1 (MetaCons "Controllers" PrefixI False) (U1 :: Type -> Type))

rControllers :: forall tok e r. Boomerang e tok r ((:-) AuthenticateURL r) Source #

authenticateURL :: Router () (AuthenticateURL :- ()) Source #

a Router for AuthenicateURL

nestAuthenticationMethod :: PathInfo methodURL => AuthenticationMethod -> RouteT methodURL m a -> RouteT AuthenticateURL m a Source #

helper function which converts a URL for an authentication backend into an AuthenticateURL.