Safe Haskell | None |
---|---|
Language | Haskell98 |
Happstack.Authenticate.Core
Synopsis
- data AuthenticateConfig = AuthenticateConfig {
- _isAuthAdmin :: UserId -> IO Bool
- _usernameAcceptable :: Username -> Maybe CoreError
- _requireEmail :: Bool
- _systemFromAddress :: Maybe SimpleAddress
- _systemReplyToAddress :: Maybe SimpleAddress
- _systemSendmailPath :: Maybe FilePath
- isAuthAdmin :: Lens' AuthenticateConfig (UserId -> IO Bool)
- usernameAcceptable :: Lens' AuthenticateConfig (Username -> Maybe CoreError)
- requireEmail :: Lens' AuthenticateConfig Bool
- data HappstackAuthenticateI18N = HappstackAuthenticateI18N
- newtype UserId = UserId {
- _unUserId :: Integer
- unUserId :: Functor f => (Integer -> f Integer) -> UserId -> f UserId
- rUserId :: forall tok e r. Boomerang e tok (Integer :- r) (UserId :- r)
- succUserId :: UserId -> UserId
- jsonOptions :: Options
- toJSONResponse :: (RenderMessage HappstackAuthenticateI18N e, ToJSON a) => Either e a -> Response
- toJSONSuccess :: ToJSON a => a -> Response
- toJSONError :: forall e. RenderMessage HappstackAuthenticateI18N e => e -> Response
- newtype Username = Username {
- _unUsername :: Text
- unUsername :: Iso' Username Text
- rUsername :: forall tok e r. Boomerang e tok ((:-) Text r) ((:-) Username r)
- usernamePolicy :: Username -> Maybe CoreError
- newtype Email = Email {
- _unEmail :: Text
- unEmail :: Iso' Email Text
- data User = User {}
- userId :: Lens' User UserId
- username :: Lens' User Username
- email :: Lens' User (Maybe Email)
- type UserIxs = '[UserId, Username, Email]
- type IxUser = IxSet UserIxs User
- newtype SharedSecret = SharedSecret {
- _unSharedSecret :: Text
- unSharedSecret :: Iso' SharedSecret Text
- data SimpleAddress = SimpleAddress {}
- genSharedSecret :: MonadIO m => m SharedSecret
- genSharedSecretDevURandom :: IO SharedSecret
- genSharedSecretSysRandom :: IO SharedSecret
- type SharedSecrets = Map UserId SharedSecret
- initialSharedSecrets :: SharedSecrets
- data CoreError
- data NewAccountMode
- data AuthenticateState = AuthenticateState {}
- sharedSecrets :: Lens' AuthenticateState SharedSecrets
- users :: Lens' AuthenticateState IxUser
- nextUserId :: Lens' AuthenticateState UserId
- defaultSessionTimeout :: Lens' AuthenticateState Int
- newAccountMode :: Lens' AuthenticateState NewAccountMode
- initialAuthenticateState :: AuthenticateState
- data SetSharedSecret = SetSharedSecret UserId SharedSecret
- newtype GetSharedSecret = GetSharedSecret UserId
- newtype SetDefaultSessionTimeout = SetDefaultSessionTimeout Int
- data GetDefaultSessionTimeout = GetDefaultSessionTimeout
- newtype SetNewAccountMode = SetNewAccountMode NewAccountMode
- data GetNewAccountMode = GetNewAccountMode
- newtype CreateUser = CreateUser User
- data CreateAnonymousUser = CreateAnonymousUser
- newtype UpdateUser = UpdateUser User
- newtype DeleteUser = DeleteUser UserId
- newtype GetUserByUsername = GetUserByUsername Username
- newtype GetUserByUserId = GetUserByUserId UserId
- newtype GetUserByEmail = GetUserByEmail Email
- data GetAuthenticateState = GetAuthenticateState
- getOrGenSharedSecret :: MonadIO m => AcidState AuthenticateState -> UserId -> m SharedSecret
- data Token = Token {
- _tokenUser :: User
- _tokenIsAuthAdmin :: Bool
- tokenUser :: Lens' Token User
- tokenIsAuthAdmin :: Lens' Token Bool
- type TokenText = Text
- issueToken :: MonadIO m => AcidState AuthenticateState -> AuthenticateConfig -> User -> m TokenText
- decodeAndVerifyToken :: MonadIO m => AcidState AuthenticateState -> UTCTime -> TokenText -> m (Maybe (Token, JWT VerifiedJWT))
- authCookieName :: String
- addTokenCookie :: Happstack m => AcidState AuthenticateState -> AuthenticateConfig -> User -> m TokenText
- deleteTokenCookie :: Happstack m => m ()
- getTokenCookie :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT))
- getTokenHeader :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT))
- getToken :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT))
- getUserId :: Happstack m => AcidState AuthenticateState -> m (Maybe UserId)
- newtype AuthenticationMethod = AuthenticationMethod {
- _unAuthenticationMethod :: Text
- unAuthenticationMethod :: Iso' AuthenticationMethod Text
- rAuthenticationMethod :: forall tok e r. Boomerang e tok ((:-) Text r) ((:-) AuthenticationMethod r)
- type AuthenticationHandler = [Text] -> RouteT AuthenticateURL (ServerPartT IO) Response
- type AuthenticationHandlers = Map AuthenticationMethod AuthenticationHandler
- data AuthenticateURL
- = AuthenticationMethods (Maybe (AuthenticationMethod, [Text]))
- | Controllers
- rAuthenticationMethods :: forall tok e r. Boomerang e tok ((:-) (Maybe (AuthenticationMethod, [Text])) r) ((:-) AuthenticateURL r)
- rControllers :: forall tok e r. Boomerang e tok r ((:-) AuthenticateURL r)
- systemFromAddress :: Lens' AuthenticateConfig (Maybe SimpleAddress)
- systemReplyToAddress :: Lens' AuthenticateConfig (Maybe SimpleAddress)
- systemSendmailPath :: Lens' AuthenticateConfig (Maybe FilePath)
- authenticateURL :: Router () (AuthenticateURL :- ())
- nestAuthenticationMethod :: PathInfo methodURL => AuthenticationMethod -> RouteT methodURL m a -> RouteT AuthenticateURL m a
Documentation
data AuthenticateConfig Source #
Various configuration options that apply to all authentication methods
Constructors
AuthenticateConfig | |
Fields
|
Instances
Generic AuthenticateConfig Source # | |
Defined in Happstack.Authenticate.Core Associated Types type Rep AuthenticateConfig :: Type -> Type Methods from :: AuthenticateConfig -> Rep AuthenticateConfig x to :: Rep AuthenticateConfig x -> AuthenticateConfig | |
type Rep AuthenticateConfig Source # | |
Defined in Happstack.Authenticate.Core type Rep AuthenticateConfig = D1 ('MetaData "AuthenticateConfig" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" '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)))))) |
isAuthAdmin :: Lens' AuthenticateConfig (UserId -> IO Bool) Source #
usernameAcceptable :: Lens' AuthenticateConfig (Username -> Maybe CoreError) Source #
requireEmail :: Lens' AuthenticateConfig Bool Source #
data HappstackAuthenticateI18N Source #
Constructors
HappstackAuthenticateI18N |
Instances
RenderMessage HappstackAuthenticateI18N CoreError Source # | |
Defined in Happstack.Authenticate.Core Methods renderMessage :: HappstackAuthenticateI18N -> [Lang] -> CoreError -> Text Source # | |
RenderMessage HappstackAuthenticateI18N OpenIdError Source # | |
Defined in Happstack.Authenticate.OpenId.Core Methods renderMessage :: HappstackAuthenticateI18N -> [Lang] -> OpenIdError -> Text Source # | |
RenderMessage HappstackAuthenticateI18N PartialMsgs Source # | |
Defined in Happstack.Authenticate.OpenId.Partials Methods renderMessage :: HappstackAuthenticateI18N -> [Lang] -> PartialMsgs -> Text Source # | |
RenderMessage HappstackAuthenticateI18N PasswordError Source # | |
Defined in Happstack.Authenticate.Password.Core Methods renderMessage :: HappstackAuthenticateI18N -> [Lang] -> PasswordError -> Text Source # | |
RenderMessage HappstackAuthenticateI18N PartialMsgs Source # | |
Defined in Happstack.Authenticate.Password.Partials Methods renderMessage :: HappstackAuthenticateI18N -> [Lang] -> PartialMsgs -> Text Source # |
a UserId
uniquely identifies a user.
Instances
Enum UserId | |
Eq UserId | |
Data UserId | |
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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UserId dataTypeOf :: UserId -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UserId) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UserId) gmapT :: (forall b. Data b => b -> b) -> UserId -> UserId gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r gmapQ :: (forall d. Data d => d -> u) -> UserId -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> UserId -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> UserId -> m UserId gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UserId -> m UserId gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UserId -> m UserId | |
Ord UserId | |
Read UserId | |
Defined in Data.UserId | |
Show UserId | |
Generic UserId | |
SafeCopy UserId | |
Defined in Data.UserId | |
ToJSON UserId | |
FromJSON UserId | |
PathInfo UserId | |
Defined in Data.UserId | |
Serialize UserId | |
Defined in Data.UserId | |
Indexable UserIxs User Source # | |
type Rep UserId | |
Defined in Data.UserId type Rep UserId = D1 ('MetaData "UserId" "Data.UserId" "userid-0.1.3.5-28P2oI55MpI3Jkza4jjkHA" 'True) (C1 ('MetaCons "UserId" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unUserId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer))) |
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
toJSONError :: forall e. RenderMessage HappstackAuthenticateI18N e => e -> Response Source #
convert an error to a JSON encoded Response
FIXME: I18N
an arbitrary, but unique string that the user uses to identify themselves
Constructors
Username | |
Fields
|
Instances
Eq Username Source # | |
Data Username Source # | |
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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Username toConstr :: Username -> Constr dataTypeOf :: Username -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Username) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Username) gmapT :: (forall b. Data b => b -> b) -> Username -> Username gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Username -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Username -> r gmapQ :: (forall d. Data d => d -> u) -> Username -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Username -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Username -> m Username gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Username -> m Username gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Username -> m Username | |
Ord Username Source # | |
Defined in Happstack.Authenticate.Core | |
Read Username Source # | |
Defined in Happstack.Authenticate.Core | |
Show Username Source # | |
Generic Username Source # | |
SafeCopy Username Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version Username Source # kind :: Kind Username Source # getCopy :: Contained (Get Username) Source # putCopy :: Username -> Contained Put Source # internalConsistency :: Consistency Username Source # objectProfile :: Profile Username Source # errorTypeName :: Proxy Username -> String Source # | |
ToJSON Username Source # | |
FromJSON Username Source # | |
PathInfo Username Source # | |
Defined in Happstack.Authenticate.Core | |
Indexable UserIxs User Source # | |
type Rep Username Source # | |
Defined in Happstack.Authenticate.Core type Rep Username = D1 ('MetaData "Username" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" 'True) (C1 ('MetaCons "Username" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unUsername") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
unUsername :: Iso' Username Text Source #
usernamePolicy :: Username -> Maybe CoreError Source #
an Email
address. No validation in performed.
Instances
Eq Email Source # | |
Data Email Source # | |
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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Email dataTypeOf :: Email -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Email) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Email) gmapT :: (forall b. Data b => b -> b) -> Email -> Email gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Email -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Email -> r gmapQ :: (forall d. Data d => d -> u) -> Email -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Email -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Email -> m Email gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Email -> m Email gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Email -> m Email | |
Ord Email Source # | |
Read Email Source # | |
Defined in Happstack.Authenticate.Core | |
Show Email Source # | |
Generic Email Source # | |
SafeCopy Email Source # | |
Defined in Happstack.Authenticate.Core | |
ToJSON Email Source # | |
FromJSON Email Source # | |
PathInfo Email Source # | |
Defined in Happstack.Authenticate.Core | |
Indexable UserIxs User Source # | |
type Rep Email Source # | |
Defined in Happstack.Authenticate.Core type Rep Email = D1 ('MetaData "Email" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" 'True) (C1 ('MetaCons "Email" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unEmail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
A unique User
Instances
Eq User Source # | |
Data User Source # | |
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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c User dataTypeOf :: User -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c User) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c User) gmapT :: (forall b. Data b => b -> b) -> User -> User gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> User -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> User -> r gmapQ :: (forall d. Data d => d -> u) -> User -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> User -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> User -> m User gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> User -> m User gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> User -> m User | |
Ord User Source # | |
Read User Source # | |
Defined in Happstack.Authenticate.Core | |
Show User Source # | |
Generic User Source # | |
SafeCopy User Source # | |
Defined in Happstack.Authenticate.Core | |
ToJSON User Source # | |
FromJSON User Source # | |
Indexable UserIxs User Source # | |
type Rep User Source # | |
Defined in Happstack.Authenticate.Core type Rep User = D1 ('MetaData "User" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" '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 | |
Fields
|
Instances
unSharedSecret :: Iso' SharedSecret Text Source #
data SimpleAddress Source #
Constructors
SimpleAddress | |
Instances
Eq SimpleAddress Source # | |
Defined in Happstack.Authenticate.Core | |
Data SimpleAddress Source # | |
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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SimpleAddress toConstr :: SimpleAddress -> Constr dataTypeOf :: SimpleAddress -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SimpleAddress) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SimpleAddress) gmapT :: (forall b. Data b => b -> b) -> SimpleAddress -> SimpleAddress gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SimpleAddress -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SimpleAddress -> r gmapQ :: (forall d. Data d => d -> u) -> SimpleAddress -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> SimpleAddress -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> SimpleAddress -> m SimpleAddress gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SimpleAddress -> m SimpleAddress gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SimpleAddress -> m SimpleAddress | |
Ord SimpleAddress Source # | |
Defined in Happstack.Authenticate.Core Methods compare :: SimpleAddress -> SimpleAddress -> Ordering (<) :: SimpleAddress -> SimpleAddress -> Bool (<=) :: SimpleAddress -> SimpleAddress -> Bool (>) :: SimpleAddress -> SimpleAddress -> Bool (>=) :: SimpleAddress -> SimpleAddress -> Bool max :: SimpleAddress -> SimpleAddress -> SimpleAddress min :: SimpleAddress -> SimpleAddress -> SimpleAddress | |
Read SimpleAddress Source # | |
Defined in Happstack.Authenticate.Core Methods readsPrec :: Int -> ReadS SimpleAddress readList :: ReadS [SimpleAddress] readPrec :: ReadPrec SimpleAddress readListPrec :: ReadPrec [SimpleAddress] | |
Show SimpleAddress Source # | |
Defined in Happstack.Authenticate.Core Methods showsPrec :: Int -> SimpleAddress -> ShowS show :: SimpleAddress -> String showList :: [SimpleAddress] -> ShowS | |
Generic SimpleAddress Source # | |
Defined in Happstack.Authenticate.Core Associated Types type Rep SimpleAddress :: Type -> Type | |
SafeCopy SimpleAddress Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version SimpleAddress Source # kind :: Kind SimpleAddress Source # getCopy :: Contained (Get SimpleAddress) Source # putCopy :: SimpleAddress -> Contained Put Source # internalConsistency :: Consistency SimpleAddress Source # objectProfile :: Profile SimpleAddress Source # errorTypeName :: Proxy SimpleAddress -> String Source # | |
type Rep SimpleAddress Source # | |
Defined in Happstack.Authenticate.Core type Rep SimpleAddress = D1 ('MetaData "SimpleAddress" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" '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
.
genSharedSecretDevURandom :: IO SharedSecret Source #
Generate a SharedSecret
from /dev/urandom
.
see: genSharedSecret
genSharedSecretSysRandom :: IO SharedSecret Source #
Generate a SharedSecret
from Random
.
see: genSharedSecret
type SharedSecrets = Map UserId SharedSecret Source #
A map which stores the SharedSecret
for each UserId
initialSharedSecrets :: SharedSecrets Source #
An empty SharedSecrets
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.
Constructors
HandlerNotFound | |
URLDecodeFailed | |
UsernameAlreadyExists | |
AuthorizationRequired | |
Forbidden | |
JSONDecodeFailed | |
InvalidUserId | |
UsernameNotAcceptable | |
InvalidEmail | |
TextError Text |
Instances
Eq CoreError Source # | |
Data CoreError Source # | |
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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CoreError toConstr :: CoreError -> Constr dataTypeOf :: CoreError -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CoreError) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CoreError) gmapT :: (forall b. Data b => b -> b) -> CoreError -> CoreError gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoreError -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoreError -> r gmapQ :: (forall d. Data d => d -> u) -> CoreError -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> CoreError -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoreError -> m CoreError gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoreError -> m CoreError gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoreError -> m CoreError | |
Ord CoreError Source # | |
Defined in Happstack.Authenticate.Core | |
Read CoreError Source # | |
Defined in Happstack.Authenticate.Core | |
Show CoreError Source # | |
Generic CoreError Source # | |
SafeCopy CoreError Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version CoreError Source # kind :: Kind CoreError Source # getCopy :: Contained (Get CoreError) Source # putCopy :: CoreError -> Contained Put Source # internalConsistency :: Consistency CoreError Source # objectProfile :: Profile CoreError Source # errorTypeName :: Proxy CoreError -> String Source # | |
ToJSON CoreError Source # | |
FromJSON CoreError Source # | |
ToJExpr CoreError Source # | |
RenderMessage HappstackAuthenticateI18N CoreError Source # | |
Defined in Happstack.Authenticate.Core Methods renderMessage :: HappstackAuthenticateI18N -> [Lang] -> CoreError -> Text Source # | |
type Rep CoreError Source # | |
Defined in Happstack.Authenticate.Core type Rep CoreError = D1 ('MetaData "CoreError" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" '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 # | |
Defined in Happstack.Authenticate.Core Methods (==) :: NewAccountMode -> NewAccountMode -> Bool (/=) :: NewAccountMode -> NewAccountMode -> Bool | |
Show NewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Methods showsPrec :: Int -> NewAccountMode -> ShowS show :: NewAccountMode -> String showList :: [NewAccountMode] -> ShowS | |
Generic NewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Associated Types type Rep NewAccountMode :: Type -> Type | |
SafeCopy NewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version NewAccountMode Source # kind :: Kind NewAccountMode Source # getCopy :: Contained (Get NewAccountMode) Source # putCopy :: NewAccountMode -> Contained Put Source # internalConsistency :: Consistency NewAccountMode Source # objectProfile :: Profile NewAccountMode Source # errorTypeName :: Proxy NewAccountMode -> String Source # | |
type Rep NewAccountMode Source # | |
Defined in Happstack.Authenticate.Core type Rep NewAccountMode = D1 ('MetaData "NewAccountMode" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" '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
Constructors
AuthenticateState | |
Fields
|
Instances
Eq AuthenticateState Source # | |
Defined in Happstack.Authenticate.Core Methods (==) :: AuthenticateState -> AuthenticateState -> Bool (/=) :: AuthenticateState -> AuthenticateState -> Bool | |
Show AuthenticateState Source # | |
Defined in Happstack.Authenticate.Core Methods showsPrec :: Int -> AuthenticateState -> ShowS show :: AuthenticateState -> String showList :: [AuthenticateState] -> ShowS | |
Generic AuthenticateState Source # | |
Defined in Happstack.Authenticate.Core Associated Types type Rep AuthenticateState :: Type -> Type Methods from :: AuthenticateState -> Rep AuthenticateState x to :: Rep AuthenticateState x -> AuthenticateState | |
SafeCopy AuthenticateState Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version AuthenticateState Source # kind :: Kind AuthenticateState Source # getCopy :: Contained (Get AuthenticateState) Source # putCopy :: AuthenticateState -> Contained Put Source # internalConsistency :: Consistency AuthenticateState Source # objectProfile :: Profile AuthenticateState Source # errorTypeName :: Proxy AuthenticateState -> String Source # | |
IsAcidic AuthenticateState Source # | |
Defined in Happstack.Authenticate.Core Methods | |
type Rep AuthenticateState Source # | |
Defined in Happstack.Authenticate.Core type Rep AuthenticateState = D1 ('MetaData "AuthenticateState" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" '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))))) |
initialAuthenticateState :: AuthenticateState Source #
a reasonable initial AuthenticateState
newtype SetDefaultSessionTimeout Source #
Constructors
SetDefaultSessionTimeout Int |
Instances
SafeCopy SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version SetDefaultSessionTimeout Source # kind :: Kind SetDefaultSessionTimeout Source # getCopy :: Contained (Get SetDefaultSessionTimeout) Source # putCopy :: SetDefaultSessionTimeout -> Contained Put Source # internalConsistency :: Consistency SetDefaultSessionTimeout Source # objectProfile :: Profile SetDefaultSessionTimeout Source # errorTypeName :: Proxy SetDefaultSessionTimeout -> String Source # | |
UpdateEvent SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core | |
Method SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: SetDefaultSessionTimeout -> Tag Source # | |
type MethodState SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core |
data GetDefaultSessionTimeout Source #
Constructors
GetDefaultSessionTimeout |
Instances
SafeCopy GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version GetDefaultSessionTimeout Source # kind :: Kind GetDefaultSessionTimeout Source # getCopy :: Contained (Get GetDefaultSessionTimeout) Source # putCopy :: GetDefaultSessionTimeout -> Contained Put Source # internalConsistency :: Consistency GetDefaultSessionTimeout Source # objectProfile :: Profile GetDefaultSessionTimeout Source # errorTypeName :: Proxy GetDefaultSessionTimeout -> String Source # | |
QueryEvent GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: GetDefaultSessionTimeout -> Tag Source # | |
type MethodState GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core |
newtype SetNewAccountMode Source #
Constructors
SetNewAccountMode NewAccountMode |
Instances
SafeCopy SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version SetNewAccountMode Source # kind :: Kind SetNewAccountMode Source # getCopy :: Contained (Get SetNewAccountMode) Source # putCopy :: SetNewAccountMode -> Contained Put Source # internalConsistency :: Consistency SetNewAccountMode Source # objectProfile :: Profile SetNewAccountMode Source # errorTypeName :: Proxy SetNewAccountMode -> String Source # | |
UpdateEvent SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core | |
Method SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: SetNewAccountMode -> Tag Source # | |
type MethodState SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core |
data GetNewAccountMode Source #
Constructors
GetNewAccountMode |
Instances
SafeCopy GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version GetNewAccountMode Source # kind :: Kind GetNewAccountMode Source # getCopy :: Contained (Get GetNewAccountMode) Source # putCopy :: GetNewAccountMode -> Contained Put Source # internalConsistency :: Consistency GetNewAccountMode Source # objectProfile :: Profile GetNewAccountMode Source # errorTypeName :: Proxy GetNewAccountMode -> String Source # | |
QueryEvent GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: GetNewAccountMode -> Tag Source # | |
type MethodState GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core |
newtype CreateUser Source #
Constructors
CreateUser User |
Instances
SafeCopy CreateUser Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version CreateUser Source # kind :: Kind CreateUser Source # getCopy :: Contained (Get CreateUser) Source # putCopy :: CreateUser -> Contained Put Source # internalConsistency :: Consistency CreateUser Source # objectProfile :: Profile CreateUser Source # errorTypeName :: Proxy CreateUser -> String Source # | |
UpdateEvent CreateUser Source # | |
Defined in Happstack.Authenticate.Core | |
Method CreateUser Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: CreateUser -> Tag Source # | |
type MethodState CreateUser Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult CreateUser Source # | |
Defined in Happstack.Authenticate.Core |
data CreateAnonymousUser Source #
Constructors
CreateAnonymousUser |
Instances
SafeCopy CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version CreateAnonymousUser Source # kind :: Kind CreateAnonymousUser Source # getCopy :: Contained (Get CreateAnonymousUser) Source # putCopy :: CreateAnonymousUser -> Contained Put Source # internalConsistency :: Consistency CreateAnonymousUser Source # objectProfile :: Profile CreateAnonymousUser Source # errorTypeName :: Proxy CreateAnonymousUser -> String Source # | |
UpdateEvent CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core | |
Method CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: CreateAnonymousUser -> Tag Source # | |
type MethodState CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core |
newtype UpdateUser Source #
Constructors
UpdateUser User |
Instances
SafeCopy UpdateUser Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version UpdateUser Source # kind :: Kind UpdateUser Source # getCopy :: Contained (Get UpdateUser) Source # putCopy :: UpdateUser -> Contained Put Source # internalConsistency :: Consistency UpdateUser Source # objectProfile :: Profile UpdateUser Source # errorTypeName :: Proxy UpdateUser -> String Source # | |
UpdateEvent UpdateUser Source # | |
Defined in Happstack.Authenticate.Core | |
Method UpdateUser Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: UpdateUser -> Tag Source # | |
type MethodState UpdateUser Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult UpdateUser Source # | |
Defined in Happstack.Authenticate.Core |
newtype DeleteUser Source #
Constructors
DeleteUser UserId |
Instances
SafeCopy DeleteUser Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version DeleteUser Source # kind :: Kind DeleteUser Source # getCopy :: Contained (Get DeleteUser) Source # putCopy :: DeleteUser -> Contained Put Source # internalConsistency :: Consistency DeleteUser Source # objectProfile :: Profile DeleteUser Source # errorTypeName :: Proxy DeleteUser -> String Source # | |
UpdateEvent DeleteUser Source # | |
Defined in Happstack.Authenticate.Core | |
Method DeleteUser Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: DeleteUser -> Tag Source # | |
type MethodState DeleteUser Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult DeleteUser Source # | |
Defined in Happstack.Authenticate.Core |
newtype GetUserByUsername Source #
Constructors
GetUserByUsername Username |
Instances
SafeCopy GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version GetUserByUsername Source # kind :: Kind GetUserByUsername Source # getCopy :: Contained (Get GetUserByUsername) Source # putCopy :: GetUserByUsername -> Contained Put Source # internalConsistency :: Consistency GetUserByUsername Source # objectProfile :: Profile GetUserByUsername Source # errorTypeName :: Proxy GetUserByUsername -> String Source # | |
QueryEvent GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: GetUserByUsername -> Tag Source # | |
type MethodState GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core |
newtype GetUserByUserId Source #
Constructors
GetUserByUserId UserId |
Instances
SafeCopy GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version GetUserByUserId Source # kind :: Kind GetUserByUserId Source # getCopy :: Contained (Get GetUserByUserId) Source # putCopy :: GetUserByUserId -> Contained Put Source # internalConsistency :: Consistency GetUserByUserId Source # objectProfile :: Profile GetUserByUserId Source # errorTypeName :: Proxy GetUserByUserId -> String Source # | |
QueryEvent GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: GetUserByUserId -> Tag Source # | |
type MethodState GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core |
newtype GetUserByEmail Source #
Constructors
GetUserByEmail Email |
Instances
SafeCopy GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version GetUserByEmail Source # kind :: Kind GetUserByEmail Source # getCopy :: Contained (Get GetUserByEmail) Source # putCopy :: GetUserByEmail -> Contained Put Source # internalConsistency :: Consistency GetUserByEmail Source # objectProfile :: Profile GetUserByEmail Source # errorTypeName :: Proxy GetUserByEmail -> String Source # | |
QueryEvent GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: GetUserByEmail -> Tag Source # | |
type MethodState GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core |
data GetAuthenticateState Source #
Constructors
GetAuthenticateState |
Instances
SafeCopy GetAuthenticateState Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version GetAuthenticateState Source # kind :: Kind GetAuthenticateState Source # getCopy :: Contained (Get GetAuthenticateState) Source # putCopy :: GetAuthenticateState -> Contained Put Source # internalConsistency :: Consistency GetAuthenticateState Source # objectProfile :: Profile GetAuthenticateState Source # errorTypeName :: Proxy GetAuthenticateState -> String Source # | |
QueryEvent GetAuthenticateState Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetAuthenticateState Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: GetAuthenticateState -> Tag Source # | |
type MethodState GetAuthenticateState Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodResult GetAuthenticateState Source # | |
Defined in Happstack.Authenticate.Core |
getOrGenSharedSecret :: MonadIO m => AcidState AuthenticateState -> UserId -> m SharedSecret Source #
get the SharedSecret
for UserId
. Generate one if they don't have one yet.
The Token
type represents the encrypted data used to identify a
user.
Constructors
Token | |
Fields
|
Instances
Eq Token Source # | |
Data Token Source # | |
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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Token dataTypeOf :: Token -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Token) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Token) gmapT :: (forall b. Data b => b -> b) -> Token -> Token gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Token -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Token -> r gmapQ :: (forall d. Data d => d -> u) -> Token -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Token -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Token -> m Token gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Token -> m Token gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Token -> m Token | |
Ord Token Source # | |
Read Token Source # | |
Defined in Happstack.Authenticate.Core | |
Show Token Source # | |
Generic Token Source # | |
ToJSON Token Source # | |
FromJSON Token Source # | |
type Rep Token Source # | |
Defined in Happstack.Authenticate.Core type Rep Token = D1 ('MetaData "Token" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" 'False) (C1 ('MetaCons "Token" 'PrefixI 'True) (S1 ('MetaSel ('Just "_tokenUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 User) :*: S1 ('MetaSel ('Just "_tokenIsAuthAdmin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) |
tokenIsAuthAdmin :: Lens' Token Bool Source #
Arguments
:: MonadIO m | |
=> AcidState AuthenticateState | |
-> AuthenticateConfig | |
-> User | the user |
-> m TokenText |
decodeAndVerifyToken :: MonadIO m => AcidState AuthenticateState -> UTCTime -> TokenText -> m (Maybe (Token, JWT VerifiedJWT)) Source #
authCookieName :: String Source #
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 #
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
newtype AuthenticationMethod Source #
AuthenticationMethod
is used by the routing system to select which
authentication backend should handle this request.
Constructors
AuthenticationMethod | |
Fields
|
Instances
rAuthenticationMethod :: forall tok e r. Boomerang e tok ((:-) Text r) ((:-) AuthenticationMethod r) Source #
type AuthenticationHandler = [Text] -> RouteT AuthenticateURL (ServerPartT IO) Response Source #
data AuthenticateURL Source #
Constructors
AuthenticationMethods (Maybe (AuthenticationMethod, [Text])) | |
Controllers |
Instances
Eq AuthenticateURL Source # | |
Defined in Happstack.Authenticate.Core Methods (==) :: AuthenticateURL -> AuthenticateURL -> Bool (/=) :: AuthenticateURL -> AuthenticateURL -> Bool | |
Data AuthenticateURL Source # | |
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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AuthenticateURL toConstr :: AuthenticateURL -> Constr dataTypeOf :: AuthenticateURL -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AuthenticateURL) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AuthenticateURL) gmapT :: (forall b. Data b => b -> b) -> AuthenticateURL -> AuthenticateURL gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AuthenticateURL -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AuthenticateURL -> r gmapQ :: (forall d. Data d => d -> u) -> AuthenticateURL -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> AuthenticateURL -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> AuthenticateURL -> m AuthenticateURL gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AuthenticateURL -> m AuthenticateURL gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AuthenticateURL -> m AuthenticateURL | |
Ord AuthenticateURL Source # | |
Defined in Happstack.Authenticate.Core Methods compare :: AuthenticateURL -> AuthenticateURL -> Ordering (<) :: AuthenticateURL -> AuthenticateURL -> Bool (<=) :: AuthenticateURL -> AuthenticateURL -> Bool (>) :: AuthenticateURL -> AuthenticateURL -> Bool (>=) :: AuthenticateURL -> AuthenticateURL -> Bool max :: AuthenticateURL -> AuthenticateURL -> AuthenticateURL min :: AuthenticateURL -> AuthenticateURL -> AuthenticateURL | |
Read AuthenticateURL Source # | |
Defined in Happstack.Authenticate.Core Methods readsPrec :: Int -> ReadS AuthenticateURL readList :: ReadS [AuthenticateURL] readPrec :: ReadPrec AuthenticateURL readListPrec :: ReadPrec [AuthenticateURL] | |
Show AuthenticateURL Source # | |
Defined in Happstack.Authenticate.Core Methods showsPrec :: Int -> AuthenticateURL -> ShowS show :: AuthenticateURL -> String showList :: [AuthenticateURL] -> ShowS | |
Generic AuthenticateURL Source # | |
Defined in Happstack.Authenticate.Core Associated Types type Rep AuthenticateURL :: Type -> Type Methods from :: AuthenticateURL -> Rep AuthenticateURL x to :: Rep AuthenticateURL x -> AuthenticateURL | |
PathInfo AuthenticateURL Source # | |
Defined in Happstack.Authenticate.Core Methods toPathSegments :: AuthenticateURL -> [Text] Source # | |
(Functor m, Monad m) => EmbedAsChild (Partial' m) PartialMsgs Source # | |
Defined in Happstack.Authenticate.OpenId.Partials Methods asChild :: PartialMsgs -> GenChildList (Partial' m) Source # | |
(Functor m, Monad m) => EmbedAsChild (Partial' m) PartialMsgs Source # | |
Defined in Happstack.Authenticate.Password.Partials Methods asChild :: PartialMsgs -> GenChildList (Partial' m) Source # | |
(Functor m, Monad m) => EmbedAsAttr (Partial' m) (Attr Text PartialMsgs) Source # | |
Defined in Happstack.Authenticate.OpenId.Partials Methods asAttr :: Attr Text PartialMsgs -> GenAttributeList (Partial' m) Source # | |
(Functor m, Monad m) => EmbedAsAttr (Partial' m) (Attr Text PartialMsgs) Source # | |
Defined in Happstack.Authenticate.Password.Partials Methods asAttr :: Attr Text PartialMsgs -> GenAttributeList (Partial' m) Source # | |
(Functor m, MonadIO m) => IntegerSupply (RouteT AuthenticateURL m) Source # | |
Defined in Happstack.Authenticate.Route Methods nextInteger :: RouteT AuthenticateURL m Integer Source # | |
type Rep AuthenticateURL Source # | |
Defined in Happstack.Authenticate.Core type Rep AuthenticateURL = D1 ('MetaData "AuthenticateURL" "Happstack.Authenticate.Core" "happstack-authenticate-2.4.0.3-DpQayMu4giD19Dqr0gjvw2" '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)) |
rAuthenticationMethods :: forall tok e r. Boomerang e tok ((:-) (Maybe (AuthenticationMethod, [Text])) r) ((:-) AuthenticateURL r) Source #
rControllers :: forall tok e r. Boomerang e tok r ((:-) AuthenticateURL r) Source #
systemFromAddress :: Lens' AuthenticateConfig (Maybe SimpleAddress) Source #
systemReplyToAddress :: Lens' AuthenticateConfig (Maybe SimpleAddress) Source #
systemSendmailPath :: Lens' AuthenticateConfig (Maybe FilePath) 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
.