Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- _postLoginRedirect :: Maybe Text
- _createUserCallback :: Maybe (User -> IO ())
- isAuthAdmin :: Lens' AuthenticateConfig (UserId -> IO Bool)
- usernameAcceptable :: Lens' AuthenticateConfig (Username -> Maybe CoreError)
- requireEmail :: Lens' AuthenticateConfig Bool
- systemFromAddress :: Lens' AuthenticateConfig (Maybe SimpleAddress)
- systemReplyToAddress :: Lens' AuthenticateConfig (Maybe SimpleAddress)
- systemSendmailPath :: Lens' AuthenticateConfig (Maybe FilePath)
- postLoginRedirect :: Lens' AuthenticateConfig (Maybe Text)
- createUserCallback :: Lens' AuthenticateConfig (Maybe (User -> IO ()))
- data HappstackAuthenticateI18N = HappstackAuthenticateI18N
- newtype UserId = UserId {}
- 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 :: 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 :: 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 GetUsers = GetUsers
- newtype GetUsersByEmail = GetUsersByEmail Email
- data GetAuthenticateState = GetAuthenticateState
- getOrGenSharedSecret :: MonadIO m => AcidState AuthenticateState -> UserId -> m SharedSecret
- data Token = Token {}
- 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 :: 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
- 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
isAuthAdmin :: Lens' AuthenticateConfig (UserId -> IO Bool) Source #
createUserCallback :: Lens' AuthenticateConfig (Maybe (User -> IO ())) 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
FromJSON UserId | |
ToJSON 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 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 :: forall r r'. (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 # | |
Enum UserId | |
Defined in Data.UserId Methods succ :: UserId -> UserId Source # pred :: UserId -> UserId Source # toEnum :: Int -> UserId Source # fromEnum :: UserId -> Int Source # enumFrom :: UserId -> [UserId] Source # enumFromThen :: UserId -> UserId -> [UserId] Source # enumFromTo :: UserId -> UserId -> [UserId] Source # enumFromThenTo :: UserId -> UserId -> UserId -> [UserId] Source # | |
Generic UserId | |
Read UserId | |
Show UserId | |
Serialize UserId | |
Defined in Data.UserId | |
Eq UserId | |
Ord UserId | |
SafeCopy UserId | |
Defined in Data.UserId | |
PathInfo UserId | |
Defined in Data.UserId | |
Indexable UserIxs User Source # | |
type Rep UserId | |
Defined in Data.UserId |
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
an Email
address. No validation in performed.
Instances
FromJSON Email Source # | |
ToJSON 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 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 :: forall r r'. (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 # | |
Generic Email Source # | |
Read Email Source # | |
Show Email Source # | |
Eq Email Source # | |
Ord Email Source # | |
Defined in Happstack.Authenticate.Core | |
SafeCopy Email Source # | |
Defined in Happstack.Authenticate.Core | |
PathInfo Email Source # | |
Defined in Happstack.Authenticate.Core | |
Indexable UserIxs User Source # | |
type Rep Email Source # | |
Defined in Happstack.Authenticate.Core |
A unique User
Instances
FromJSON User Source # | |
ToJSON 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 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 :: forall r r'. (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 # | |
Generic User Source # | |
Read User Source # | |
Show User Source # | |
Eq User Source # | |
Ord User Source # | |
Defined in Happstack.Authenticate.Core | |
SafeCopy User Source # | |
Defined in Happstack.Authenticate.Core | |
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.6.1-KUA8vY6cK2N5JF9yBv4iZe" '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
data SimpleAddress Source #
Instances
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
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
data AuthenticateState Source #
this acid-state value contains the state common to all authentication methods
Constructors
AuthenticateState | |
Fields
|
Instances
initialAuthenticateState :: AuthenticateState Source #
a reasonable initial AuthenticateState
newtype SetDefaultSessionTimeout Source #
Constructors
SetDefaultSessionTimeout Int |
Instances
UpdateEvent SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core | |
Method SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: SetDefaultSessionTimeout -> Tag Source # | |
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 # | |
type MethodResult SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState SetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core |
data GetDefaultSessionTimeout Source #
Constructors
GetDefaultSessionTimeout |
Instances
QueryEvent GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: GetDefaultSessionTimeout -> Tag Source # | |
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 # | |
type MethodResult GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState GetDefaultSessionTimeout Source # | |
Defined in Happstack.Authenticate.Core |
newtype SetNewAccountMode Source #
Constructors
SetNewAccountMode NewAccountMode |
Instances
UpdateEvent SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core | |
Method SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: SetNewAccountMode -> Tag Source # | |
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 # | |
type MethodResult SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState SetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core |
data GetNewAccountMode Source #
Constructors
GetNewAccountMode |
Instances
QueryEvent GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: GetNewAccountMode -> Tag Source # | |
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 # | |
type MethodResult GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState GetNewAccountMode Source # | |
Defined in Happstack.Authenticate.Core |
newtype CreateUser Source #
Constructors
CreateUser User |
Instances
UpdateEvent CreateUser Source # | |
Defined in Happstack.Authenticate.Core | |
Method CreateUser Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: CreateUser -> Tag Source # | |
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 # | |
type MethodResult CreateUser Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState CreateUser Source # | |
Defined in Happstack.Authenticate.Core |
data CreateAnonymousUser Source #
Constructors
CreateAnonymousUser |
Instances
UpdateEvent CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core | |
Method CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: CreateAnonymousUser -> Tag Source # | |
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 # | |
type MethodResult CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState CreateAnonymousUser Source # | |
Defined in Happstack.Authenticate.Core |
newtype UpdateUser Source #
Constructors
UpdateUser User |
Instances
UpdateEvent UpdateUser Source # | |
Defined in Happstack.Authenticate.Core | |
Method UpdateUser Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: UpdateUser -> Tag Source # | |
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 # | |
type MethodResult UpdateUser Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState UpdateUser Source # | |
Defined in Happstack.Authenticate.Core |
newtype DeleteUser Source #
Constructors
DeleteUser UserId |
Instances
UpdateEvent DeleteUser Source # | |
Defined in Happstack.Authenticate.Core | |
Method DeleteUser Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: DeleteUser -> Tag Source # | |
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 # | |
type MethodResult DeleteUser Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState DeleteUser Source # | |
Defined in Happstack.Authenticate.Core |
newtype GetUserByUsername Source #
Constructors
GetUserByUsername Username |
Instances
QueryEvent GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: GetUserByUsername -> Tag Source # | |
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 # | |
type MethodResult GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState GetUserByUsername Source # | |
Defined in Happstack.Authenticate.Core |
newtype GetUserByUserId Source #
Constructors
GetUserByUserId UserId |
Instances
QueryEvent GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: GetUserByUserId -> Tag Source # | |
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 # | |
type MethodResult GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState GetUserByUserId Source # | |
Defined in Happstack.Authenticate.Core |
newtype GetUserByEmail Source #
Constructors
GetUserByEmail Email |
Instances
QueryEvent GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: GetUserByEmail -> Tag Source # | |
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 # | |
type MethodResult GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState GetUserByEmail Source # | |
Defined in Happstack.Authenticate.Core |
Constructors
GetUsers |
Instances
QueryEvent GetUsers Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetUsers Source # | |
Defined in Happstack.Authenticate.Core | |
SafeCopy GetUsers Source # | |
type MethodResult GetUsers Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState GetUsers Source # | |
Defined in Happstack.Authenticate.Core |
newtype GetUsersByEmail Source #
Constructors
GetUsersByEmail Email |
Instances
QueryEvent GetUsersByEmail Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetUsersByEmail Source # | |
Defined in Happstack.Authenticate.Core Methods methodTag :: GetUsersByEmail -> Tag Source # | |
SafeCopy GetUsersByEmail Source # | |
Defined in Happstack.Authenticate.Core Methods version :: Version GetUsersByEmail Source # kind :: Kind GetUsersByEmail Source # getCopy :: Contained (Get GetUsersByEmail) Source # putCopy :: GetUsersByEmail -> Contained Put Source # internalConsistency :: Consistency GetUsersByEmail Source # | |
type MethodResult GetUsersByEmail Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState GetUsersByEmail Source # | |
Defined in Happstack.Authenticate.Core |
data GetAuthenticateState Source #
Constructors
GetAuthenticateState |
Instances
QueryEvent GetAuthenticateState Source # | |
Defined in Happstack.Authenticate.Core | |
Method GetAuthenticateState Source # | |
Defined in Happstack.Authenticate.Core Associated Types Methods methodTag :: GetAuthenticateState -> Tag Source # | |
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 # | |
type MethodResult GetAuthenticateState Source # | |
Defined in Happstack.Authenticate.Core | |
type MethodState 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
FromJSON Token Source # | |
ToJSON 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 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 :: forall r r'. (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 # | |
Generic Token Source # | |
Read Token Source # | |
Show Token Source # | |
Eq Token Source # | |
Ord Token Source # | |
Defined in Happstack.Authenticate.Core | |
type Rep Token Source # | |
Defined in Happstack.Authenticate.Core type Rep Token = D1 ('MetaData "Token" "Happstack.Authenticate.Core" "happstack-authenticate-2.6.1-KUA8vY6cK2N5JF9yBv4iZe" 'False) (C1 ('MetaCons "Token" 'PrefixI 'True) (S1 ('MetaSel ('Just "_tokenUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 User) :*: S1 ('MetaSel ('Just "_tokenIsAuthAdmin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) |
Arguments
:: MonadIO m | |
=> AcidState AuthenticateState | |
-> AuthenticateConfig | |
-> User | the user |
-> m TokenText |
decodeAndVerifyToken :: MonadIO m => AcidState AuthenticateState -> UTCTime -> TokenText -> m (Maybe (Token, JWT VerifiedJWT)) 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
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 #
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
.