-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Happstack Authentication Library
--
@package happstack-authenticate
@version 2.1.4
module Happstack.Authenticate.OpenId.PartialsURL
data PartialURL
UsingGoogle :: PartialURL
UsingYahoo :: PartialURL
RealmForm :: PartialURL
rRealmForm :: Boomerang e tok r ((:-) PartialURL r)
rUsingYahoo :: Boomerang e tok r ((:-) PartialURL r)
rUsingGoogle :: Boomerang e tok r ((:-) PartialURL r)
partialURL :: Router () (PartialURL :- ())
instance PathInfo PartialURL
instance Typeable PartialURL
instance Eq PartialURL
instance Ord PartialURL
instance Data PartialURL
instance Generic PartialURL
instance Read PartialURL
instance Show PartialURL
instance Datatype D1PartialURL
instance Constructor C1_0PartialURL
instance Constructor C1_1PartialURL
instance Constructor C1_2PartialURL
module Happstack.Authenticate.Password.PartialsURL
data PartialURL
LoginInline :: PartialURL
Logout :: PartialURL
SignupPassword :: PartialURL
ChangePassword :: PartialURL
RequestResetPasswordForm :: PartialURL
ResetPasswordForm :: PartialURL
rResetPasswordForm :: Boomerang e tok r ((:-) PartialURL r)
rRequestResetPasswordForm :: Boomerang e tok r ((:-) PartialURL r)
rChangePassword :: Boomerang e tok r ((:-) PartialURL r)
rSignupPassword :: Boomerang e tok r ((:-) PartialURL r)
rLogout :: Boomerang e tok r ((:-) PartialURL r)
rLoginInline :: Boomerang e tok r ((:-) PartialURL r)
partialURL :: Router () (PartialURL :- ())
instance PathInfo PartialURL
instance Typeable PartialURL
instance Eq PartialURL
instance Ord PartialURL
instance Data PartialURL
instance Generic PartialURL
instance Datatype D1PartialURL
instance Constructor C1_0PartialURL
instance Constructor C1_1PartialURL
instance Constructor C1_2PartialURL
instance Constructor C1_3PartialURL
instance Constructor C1_4PartialURL
instance Constructor C1_5PartialURL
module Happstack.Authenticate.Core
data HappstackAuthenticateI18N
HappstackAuthenticateI18N :: HappstackAuthenticateI18N
-- | when creating JSON field names, drop the first character. Since we are
-- using lens, the leading character should always be _.
jsonOptions :: Options
-- | convert a value to a JSON encoded Response
toJSONResponse :: (RenderMessage HappstackAuthenticateI18N e, ToJSON a) => Either e a -> Response
-- | convert a value to a JSON encoded Response
toJSONSuccess :: ToJSON a => a -> Response
-- | convert an error to a JSON encoded Response
toJSONError :: RenderMessage HappstackAuthenticateI18N e => e -> Response
-- | a UserId uniquely identifies a user.
newtype UserId
UserId :: Integer -> UserId
_unUserId :: UserId -> Integer
unUserId :: Iso' UserId Integer
rUserId :: Boomerang e tok ((:-) Integer r) ((:-) UserId r)
-- | get the next UserId
succUserId :: UserId -> UserId
-- | an arbitrary, but unique string that the user uses to identify
-- themselves
newtype Username
Username :: Text -> Username
_unUsername :: Username -> Text
unUsername :: Iso' Username Text
rUsername :: Boomerang e tok ((:-) Text r) ((:-) Username r)
-- | an Email address. No validation in performed.
newtype Email
Email :: Text -> Email
_unEmail :: Email -> Text
unEmail :: Iso' Email Text
-- | A unique User
data User
User :: UserId -> Username -> Maybe Email -> User
_userId :: User -> UserId
_username :: User -> Username
_email :: User -> Maybe Email
username :: Lens' User Username
userId :: Lens' User UserId
email :: Lens' User (Maybe Email)
type UserIxs = '[UserId, Username, Email]
type IxUser = IxSet UserIxs User
-- | 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.
newtype SharedSecret
SharedSecret :: Text -> SharedSecret
_unSharedSecret :: SharedSecret -> Text
unSharedSecret :: Iso' SharedSecret Text
-- | 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.
genSharedSecret :: MonadIO m => m SharedSecret
-- | Generate a SharedSecret from /dev/urandom.
--
-- see: genSharedSecret
genSharedSecretDevURandom :: IO SharedSecret
-- | Generate a SharedSecret from Random.
--
-- see: genSharedSecret
genSharedSecretSysRandom :: IO SharedSecret
-- | A map which stores the SharedSecret for each UserId
type SharedSecrets = Map UserId SharedSecret
-- | An empty SharedSecrets
initialSharedSecrets :: 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.
data CoreError
HandlerNotFound :: CoreError
URLDecodeFailed :: CoreError
UsernameAlreadyExists :: CoreError
AuthorizationRequired :: CoreError
Forbidden :: CoreError
JSONDecodeFailed :: CoreError
InvalidUserId :: CoreError
-- | This value is used to configure the type of new user registrations
-- permitted for this system.
data NewAccountMode
-- | new users can create their own accounts
OpenRegistration :: NewAccountMode
-- | new users can apply to create their own accounts, but a moderator must
-- approve them before they are active
ModeratedRegistration :: NewAccountMode
-- | only the admin can create a new account
ClosedRegistration :: NewAccountMode
-- | this acid-state value contains the state common to all authentication
-- methods
data AuthenticateState
AuthenticateState :: SharedSecrets -> IxUser -> UserId -> Int -> NewAccountMode -> AuthenticateState
_sharedSecrets :: AuthenticateState -> SharedSecrets
_users :: AuthenticateState -> IxUser
_nextUserId :: AuthenticateState -> UserId
-- | default session time out in seconds
_defaultSessionTimeout :: AuthenticateState -> Int
_newAccountMode :: AuthenticateState -> NewAccountMode
users :: Lens' AuthenticateState IxUser
sharedSecrets :: Lens' AuthenticateState SharedSecrets
nextUserId :: Lens' AuthenticateState UserId
newAccountMode :: Lens' AuthenticateState NewAccountMode
defaultSessionTimeout :: Lens' AuthenticateState Int
-- | a reasonable initial AuthenticateState
initialAuthenticateState :: AuthenticateState
-- | set the SharedSecret for UserId overwritten any previous
-- secret.
setSharedSecret :: UserId -> SharedSecret -> Update AuthenticateState ()
-- | get the SharedSecret for UserId
getSharedSecret :: UserId -> Query AuthenticateState (Maybe SharedSecret)
-- | set the default inactivity timeout for new sessions
setDefaultSessionTimeout :: Int -> Update AuthenticateState ()
-- | set the default inactivity timeout for new sessions
getDefaultSessionTimeout :: Query AuthenticateState Int
-- | set the NewAccountMode
setNewAccountMode :: NewAccountMode -> Update AuthenticateState ()
-- | get the NewAccountMode
getNewAccountMode :: Query AuthenticateState NewAccountMode
-- | Create a new User. This will allocate a new UserId. The
-- returned User value will have the updated UserId.
createUser :: User -> Update AuthenticateState (Either CoreError User)
-- | Create a new User. This will allocate a new UserId. The
-- returned User value will have the updated UserId.
createAnonymousUser :: Update AuthenticateState User
-- | Update an existing User. Must already have a valid
-- UserId.
updateUser :: User -> Update AuthenticateState ()
-- | Delete User with the specified UserId
deleteUser :: UserId -> Update AuthenticateState ()
-- | look up a User by their Username
getUserByUsername :: Username -> Query AuthenticateState (Maybe User)
-- | look up a User by their UserId
getUserByUserId :: UserId -> Query AuthenticateState (Maybe User)
-- | look up a User by their Email
getUserByEmail :: Email -> Query AuthenticateState (Maybe User)
-- | get the entire AuthenticateState value
getAuthenticateState :: Query AuthenticateState AuthenticateState
newtype SetDefaultSessionTimeout
SetDefaultSessionTimeout :: Int -> SetDefaultSessionTimeout
data GetDefaultSessionTimeout
GetDefaultSessionTimeout :: GetDefaultSessionTimeout
data SetSharedSecret
SetSharedSecret :: UserId -> SharedSecret -> SetSharedSecret
newtype GetSharedSecret
GetSharedSecret :: UserId -> GetSharedSecret
newtype SetNewAccountMode
SetNewAccountMode :: NewAccountMode -> SetNewAccountMode
data GetNewAccountMode
GetNewAccountMode :: GetNewAccountMode
newtype CreateUser
CreateUser :: User -> CreateUser
data CreateAnonymousUser
CreateAnonymousUser :: CreateAnonymousUser
newtype UpdateUser
UpdateUser :: User -> UpdateUser
newtype DeleteUser
DeleteUser :: UserId -> DeleteUser
newtype GetUserByUsername
GetUserByUsername :: Username -> GetUserByUsername
newtype GetUserByUserId
GetUserByUserId :: UserId -> GetUserByUserId
newtype GetUserByEmail
GetUserByEmail :: Email -> GetUserByEmail
data GetAuthenticateState
GetAuthenticateState :: GetAuthenticateState
-- | get the SharedSecret for UserId. Generate one if they
-- don't have one yet.
getOrGenSharedSecret :: MonadIO m => AcidState AuthenticateState -> UserId -> m (SharedSecret)
-- | The Token type represents the encrypted data used to identify a
-- user.
data Token
Token :: User -> Bool -> Token
_tokenUser :: Token -> User
_tokenIsAuthAdmin :: Token -> Bool
tokenUser :: Lens' Token User
tokenIsAuthAdmin :: Lens' Token Bool
-- | TokenText is the encrypted form of the Token which is
-- passed between the server and the client.
type TokenText = Text
-- | 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.
issueToken :: MonadIO m => AcidState AuthenticateState -> (UserId -> IO Bool) -> User -> m TokenText
-- | decode and verify the TokenText. If successful, return the
-- Token otherwise Nothing.
decodeAndVerifyToken :: MonadIO m => AcidState AuthenticateState -> TokenText -> m (Maybe (Token, JWT VerifiedJWT))
-- | name of the Cookie used to hold the TokenText
authCookieName :: String
-- | create a Token for User and add a Cookie to the
-- Response
--
-- see also: issueToken
addTokenCookie :: Happstack m => AcidState AuthenticateState -> (UserId -> IO Bool) -> User -> m TokenText
-- | delete the Token Cookie
deleteTokenCookie :: Happstack m => m ()
-- | get, decode, and verify the Token from the Cookie.
getTokenCookie :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT))
-- | get, decode, and verify the Token from the
-- Authorization HTTP header
getTokenHeader :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT))
-- | get, decode, and verify the Token looking first in the
-- Authorization header and then in Cookie.
--
-- see also: getTokenHeader, getTokenCookie
getToken :: Happstack m => AcidState AuthenticateState -> m (Maybe (Token, JWT VerifiedJWT))
-- | get the UserId
--
-- calls getToken but returns only the UserId
getUserId :: Happstack m => AcidState AuthenticateState -> m (Maybe UserId)
-- | AuthenticationMethod is used by the routing system to select
-- which authentication backend should handle this request.
newtype AuthenticationMethod
AuthenticationMethod :: Text -> AuthenticationMethod
_unAuthenticationMethod :: AuthenticationMethod -> Text
unAuthenticationMethod :: Iso' AuthenticationMethod Text
rAuthenticationMethod :: 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])) -> AuthenticateURL
Controllers :: AuthenticateURL
rControllers :: Boomerang e tok r ((:-) AuthenticateURL r)
rAuthenticationMethods :: Boomerang e tok ((:-) (Maybe (AuthenticationMethod, [Text])) r) ((:-) AuthenticateURL r)
-- | a Router for AuthenicateURL
authenticateURL :: Router () (AuthenticateURL :- ())
-- | helper function which converts a URL for an authentication backend
-- into an AuthenticateURL.
nestAuthenticationMethod :: PathInfo methodURL => AuthenticationMethod -> RouteT methodURL m a -> RouteT AuthenticateURL m a
instance PathInfo AuthenticateURL
instance Typeable AuthenticateURL
instance Eq AuthenticateURL
instance Ord AuthenticateURL
instance Read AuthenticateURL
instance Show AuthenticateURL
instance Data AuthenticateURL
instance Generic AuthenticateURL
instance Datatype D1AuthenticateURL
instance Constructor C1_0AuthenticateURL
instance Constructor C1_1AuthenticateURL
instance FromJSON AuthenticationMethod
instance ToJSON AuthenticationMethod
instance SafeCopy AuthenticationMethod
instance PathInfo AuthenticationMethod
instance Typeable AuthenticationMethod
instance Eq AuthenticationMethod
instance Ord AuthenticationMethod
instance Read AuthenticationMethod
instance Show AuthenticationMethod
instance Data AuthenticationMethod
instance Generic AuthenticationMethod
instance Datatype D1AuthenticationMethod
instance Constructor C1_0AuthenticationMethod
instance Selector S1_0_0AuthenticationMethod
instance FromJSON Token
instance ToJSON Token
instance Typeable SetDefaultSessionTimeout
instance Typeable GetDefaultSessionTimeout
instance Typeable SetSharedSecret
instance Typeable GetSharedSecret
instance Typeable SetNewAccountMode
instance Typeable GetNewAccountMode
instance Typeable CreateUser
instance Typeable CreateAnonymousUser
instance Typeable UpdateUser
instance Typeable DeleteUser
instance Typeable GetUserByUsername
instance Typeable GetUserByUserId
instance Typeable GetUserByEmail
instance Typeable GetAuthenticateState
instance Typeable Token
instance Eq Token
instance Ord Token
instance Read Token
instance Show Token
instance Data Token
instance Generic Token
instance Datatype D1Token
instance Constructor C1_0Token
instance Selector S1_0_0Token
instance Selector S1_0_1Token
instance QueryEvent GetAuthenticateState
instance Method GetAuthenticateState
instance SafeCopy GetAuthenticateState
instance QueryEvent GetUserByEmail
instance Method GetUserByEmail
instance SafeCopy GetUserByEmail
instance QueryEvent GetUserByUserId
instance Method GetUserByUserId
instance SafeCopy GetUserByUserId
instance QueryEvent GetUserByUsername
instance Method GetUserByUsername
instance SafeCopy GetUserByUsername
instance UpdateEvent DeleteUser
instance Method DeleteUser
instance SafeCopy DeleteUser
instance UpdateEvent UpdateUser
instance Method UpdateUser
instance SafeCopy UpdateUser
instance UpdateEvent CreateAnonymousUser
instance Method CreateAnonymousUser
instance SafeCopy CreateAnonymousUser
instance UpdateEvent CreateUser
instance Method CreateUser
instance SafeCopy CreateUser
instance QueryEvent GetNewAccountMode
instance Method GetNewAccountMode
instance SafeCopy GetNewAccountMode
instance UpdateEvent SetNewAccountMode
instance Method SetNewAccountMode
instance SafeCopy SetNewAccountMode
instance QueryEvent GetSharedSecret
instance Method GetSharedSecret
instance SafeCopy GetSharedSecret
instance UpdateEvent SetSharedSecret
instance Method SetSharedSecret
instance SafeCopy SetSharedSecret
instance QueryEvent GetDefaultSessionTimeout
instance Method GetDefaultSessionTimeout
instance SafeCopy GetDefaultSessionTimeout
instance UpdateEvent SetDefaultSessionTimeout
instance Method SetDefaultSessionTimeout
instance SafeCopy SetDefaultSessionTimeout
instance IsAcidic AuthenticateState
instance SafeCopy AuthenticateState
instance Typeable AuthenticateState
instance Eq AuthenticateState
instance Show AuthenticateState
instance Generic AuthenticateState
instance Datatype D1AuthenticateState
instance Constructor C1_0AuthenticateState
instance Selector S1_0_0AuthenticateState
instance Selector S1_0_1AuthenticateState
instance Selector S1_0_2AuthenticateState
instance Selector S1_0_3AuthenticateState
instance Selector S1_0_4AuthenticateState
instance SafeCopy NewAccountMode
instance Typeable NewAccountMode
instance Eq NewAccountMode
instance Show NewAccountMode
instance Generic NewAccountMode
instance Datatype D1NewAccountMode
instance Constructor C1_0NewAccountMode
instance Constructor C1_1NewAccountMode
instance Constructor C1_2NewAccountMode
instance RenderMessage HappstackAuthenticateI18N CoreError
instance SafeCopy CoreError
instance Typeable CoreError
instance Eq CoreError
instance Ord CoreError
instance Read CoreError
instance Show CoreError
instance Data CoreError
instance Generic CoreError
instance Datatype D1CoreError
instance Constructor C1_0CoreError
instance Constructor C1_1CoreError
instance Constructor C1_2CoreError
instance Constructor C1_3CoreError
instance Constructor C1_4CoreError
instance Constructor C1_5CoreError
instance Constructor C1_6CoreError
instance ToJExpr CoreError
instance FromJSON CoreError
instance ToJSON CoreError
instance SafeCopy SharedSecret
instance Typeable SharedSecret
instance Eq SharedSecret
instance Ord SharedSecret
instance Read SharedSecret
instance Show SharedSecret
instance Data SharedSecret
instance Generic SharedSecret
instance Datatype D1SharedSecret
instance Constructor C1_0SharedSecret
instance Selector S1_0_0SharedSecret
instance Indexable UserIxs User
instance FromJSON User
instance ToJSON User
instance SafeCopy User
instance Typeable User
instance Eq User
instance Ord User
instance Read User
instance Show User
instance Data User
instance Generic User
instance Datatype D1User
instance Constructor C1_0User
instance Selector S1_0_0User
instance Selector S1_0_1User
instance Selector S1_0_2User
instance PathInfo Email
instance FromJSON Email
instance ToJSON Email
instance SafeCopy Email
instance Typeable Email
instance Eq Email
instance Ord Email
instance Read Email
instance Show Email
instance Data Email
instance Generic Email
instance Datatype D1Email
instance Constructor C1_0Email
instance Selector S1_0_0Email
instance PathInfo Username
instance FromJSON Username
instance ToJSON Username
instance SafeCopy Username
instance Typeable Username
instance Eq Username
instance Ord Username
instance Read Username
instance Show Username
instance Data Username
instance Generic Username
instance Datatype D1Username
instance Constructor C1_0Username
instance Selector S1_0_0Username
instance PathInfo UserId
instance FromJSON UserId
instance ToJSON UserId
instance SafeCopy UserId
instance Typeable UserId
instance Eq UserId
instance Ord UserId
instance Enum UserId
instance Read UserId
instance Show UserId
instance Data UserId
instance Generic UserId
instance Datatype D1UserId
instance Constructor C1_0UserId
instance Selector S1_0_0UserId
module Happstack.Authenticate.Controller
authenticateCtrl :: Monad m => RouteT AuthenticateURL m JStat
authenticateCtrlJs :: (AuthenticateURL -> [(Text, Maybe Text)] -> Text) -> JStat
module Happstack.Authenticate.Route
route :: [RouteT AuthenticateURL (ServerPartT IO) JStat] -> AuthenticationHandlers -> AuthenticateURL -> RouteT AuthenticateURL (ServerPartT IO) Response
initAuthentication :: Maybe FilePath -> (UserId -> IO Bool) -> [FilePath -> AcidState AuthenticateState -> (UserId -> IO Bool) -> IO (Bool -> IO (), (AuthenticationMethod, AuthenticationHandler), RouteT AuthenticateURL (ServerPartT IO) JStat)] -> IO (IO (), AuthenticateURL -> RouteT AuthenticateURL (ServerPartT IO) Response, AcidState AuthenticateState)
instance (Functor m, MonadIO m) => IntegerSupply (RouteT AuthenticateURL m)
module Happstack.Authenticate.Password.URL
passwordAuthenticationMethod :: AuthenticationMethod
data AccountURL
Password :: AccountURL
rPassword :: Boomerang e tok r ((:-) AccountURL r)
accountURL :: Router () (AccountURL :- ())
data PasswordURL
Token :: PasswordURL
Account :: (Maybe (UserId, AccountURL)) -> PasswordURL
Partial :: PartialURL -> PasswordURL
PasswordRequestReset :: PasswordURL
PasswordReset :: PasswordURL
UsernamePasswordCtrl :: PasswordURL
rUsernamePasswordCtrl :: Boomerang e tok r ((:-) PasswordURL r)
rPasswordReset :: Boomerang e tok r ((:-) PasswordURL r)
rPasswordRequestReset :: Boomerang e tok r ((:-) PasswordURL r)
rPartial :: Boomerang e tok ((:-) PartialURL r) ((:-) PasswordURL r)
rAccount :: Boomerang e tok ((:-) (Maybe (UserId, AccountURL)) r) ((:-) PasswordURL r)
rToken :: Boomerang e tok r ((:-) PasswordURL r)
passwordURL :: Router () (PasswordURL :- ())
nestPasswordURL :: RouteT PasswordURL m a -> RouteT AuthenticateURL m a
instance PathInfo PasswordURL
instance Typeable PasswordURL
instance Eq PasswordURL
instance Ord PasswordURL
instance Data PasswordURL
instance Generic PasswordURL
instance Datatype D1PasswordURL
instance Constructor C1_0PasswordURL
instance Constructor C1_1PasswordURL
instance Constructor C1_2PasswordURL
instance Constructor C1_3PasswordURL
instance Constructor C1_4PasswordURL
instance Constructor C1_5PasswordURL
instance PathInfo AccountURL
instance Typeable AccountURL
instance Eq AccountURL
instance Ord AccountURL
instance Read AccountURL
instance Show AccountURL
instance Data AccountURL
instance Generic AccountURL
instance Datatype D1AccountURL
instance Constructor C1_0AccountURL
module Happstack.Authenticate.Password.Controllers
usernamePasswordCtrl :: Monad m => RouteT AuthenticateURL m JStat
usernamePasswordCtrlJs :: (PasswordURL -> [(Text, Maybe Text)] -> Text) -> JStat
module Happstack.Authenticate.Password.Core
data PasswordError
NotAuthenticated :: PasswordError
NotAuthorized :: PasswordError
InvalidUsername :: PasswordError
InvalidPassword :: PasswordError
InvalidUsernamePassword :: PasswordError
NoEmailAddress :: PasswordError
MissingResetToken :: PasswordError
InvalidResetToken :: PasswordError
PasswordMismatch :: PasswordError
CoreError :: CoreError -> PasswordError
passwordErrorMessageE :: PasswordError -> CoreError
newtype HashedPass
HashedPass :: ByteString -> HashedPass
_unHashedPass :: HashedPass -> ByteString
unHashedPass :: Iso' HashedPass ByteString
-- | hash a password string
mkHashedPass :: (Functor m, MonadIO m) => Text -> m HashedPass
-- | verify a password
verifyHashedPass :: Text -> HashedPass -> Bool
data PasswordState
PasswordState :: Map UserId HashedPass -> PasswordState
_passwords :: PasswordState -> Map UserId HashedPass
passwords :: Iso' PasswordState (Map UserId HashedPass)
initialPasswordState :: PasswordState
-- | set the password for UserId
setPassword :: UserId -> HashedPass -> Update PasswordState ()
-- | delete the password for UserId
deletePassword :: UserId -> Update PasswordState ()
-- | verify that the supplied password matches the stored hashed password
-- for UserId
verifyPasswordForUserId :: UserId -> Text -> Query PasswordState Bool
data SetPassword
SetPassword :: UserId -> HashedPass -> SetPassword
newtype DeletePassword
DeletePassword :: UserId -> DeletePassword
data VerifyPasswordForUserId
VerifyPasswordForUserId :: UserId -> Text -> VerifyPasswordForUserId
-- | verify that the supplied username/password is valid
verifyPassword :: MonadIO m => AcidState AuthenticateState -> AcidState PasswordState -> Username -> Text -> m Bool
data UserPass
UserPass :: Username -> Text -> UserPass
_user :: UserPass -> Username
_password :: UserPass -> Text
user :: Lens' UserPass Username
password :: Lens' UserPass Text
token :: Happstack m => AcidState AuthenticateState -> (UserId -> IO Bool) -> AcidState PasswordState -> m Response
-- | JSON record for new account data
data NewAccountData
NewAccountData :: User -> Text -> Text -> NewAccountData
_naUser :: NewAccountData -> User
_naPassword :: NewAccountData -> Text
_naPasswordConfirm :: NewAccountData -> Text
naUser :: Lens' NewAccountData User
naPasswordConfirm :: Lens' NewAccountData Text
naPassword :: Lens' NewAccountData Text
-- | JSON record for change password data
data ChangePasswordData
ChangePasswordData :: Text -> Text -> Text -> ChangePasswordData
_cpOldPassword :: ChangePasswordData -> Text
_cpNewPassword :: ChangePasswordData -> Text
_cpNewPasswordConfirm :: ChangePasswordData -> Text
cpOldPassword :: Lens' ChangePasswordData Text
cpNewPasswordConfirm :: Lens' ChangePasswordData Text
cpNewPassword :: Lens' ChangePasswordData Text
-- | account handler
account :: Happstack m => AcidState AuthenticateState -> AcidState PasswordState -> Maybe (UserId, AccountURL) -> m (Either PasswordError UserId)
-- | JSON record for new account data
data RequestResetPasswordData
RequestResetPasswordData :: Username -> RequestResetPasswordData
_rrpUsername :: RequestResetPasswordData -> Username
rrpUsername :: Iso' RequestResetPasswordData Username
-- | request reset password
passwordRequestReset :: Happstack m => Text -> Text -> AcidState AuthenticateState -> AcidState PasswordState -> m (Either PasswordError Text)
-- | issueResetToken
issueResetToken :: MonadIO m => AcidState AuthenticateState -> User -> m (Either PasswordError JSON)
sendResetEmail :: MonadIO m => Email -> Email -> Text -> m ()
-- | JSON record for new account data
data ResetPasswordData
ResetPasswordData :: Text -> Text -> Text -> ResetPasswordData
_rpPassword :: ResetPasswordData -> Text
_rpPasswordConfirm :: ResetPasswordData -> Text
_rpResetToken :: ResetPasswordData -> Text
rpResetToken :: Lens' ResetPasswordData Text
rpPasswordConfirm :: Lens' ResetPasswordData Text
rpPassword :: Lens' ResetPasswordData Text
passwordReset :: Happstack m => AcidState AuthenticateState -> AcidState PasswordState -> m (Either PasswordError ())
decodeAndVerifyResetToken :: MonadIO m => AcidState AuthenticateState -> Text -> m (Maybe (User, JWT VerifiedJWT))
instance FromJSON ResetPasswordData
instance ToJSON ResetPasswordData
instance Typeable ResetPasswordData
instance Eq ResetPasswordData
instance Ord ResetPasswordData
instance Read ResetPasswordData
instance Show ResetPasswordData
instance Data ResetPasswordData
instance Generic ResetPasswordData
instance Datatype D1ResetPasswordData
instance Constructor C1_0ResetPasswordData
instance Selector S1_0_0ResetPasswordData
instance Selector S1_0_1ResetPasswordData
instance Selector S1_0_2ResetPasswordData
instance FromJSON RequestResetPasswordData
instance ToJSON RequestResetPasswordData
instance Typeable RequestResetPasswordData
instance Eq RequestResetPasswordData
instance Ord RequestResetPasswordData
instance Read RequestResetPasswordData
instance Show RequestResetPasswordData
instance Data RequestResetPasswordData
instance Generic RequestResetPasswordData
instance Datatype D1RequestResetPasswordData
instance Constructor C1_0RequestResetPasswordData
instance Selector S1_0_0RequestResetPasswordData
instance FromJSON ChangePasswordData
instance ToJSON ChangePasswordData
instance Typeable ChangePasswordData
instance Eq ChangePasswordData
instance Ord ChangePasswordData
instance Read ChangePasswordData
instance Show ChangePasswordData
instance Data ChangePasswordData
instance Generic ChangePasswordData
instance Datatype D1ChangePasswordData
instance Constructor C1_0ChangePasswordData
instance Selector S1_0_0ChangePasswordData
instance Selector S1_0_1ChangePasswordData
instance Selector S1_0_2ChangePasswordData
instance FromJSON NewAccountData
instance ToJSON NewAccountData
instance Typeable NewAccountData
instance Eq NewAccountData
instance Ord NewAccountData
instance Read NewAccountData
instance Show NewAccountData
instance Data NewAccountData
instance Generic NewAccountData
instance Datatype D1NewAccountData
instance Constructor C1_0NewAccountData
instance Selector S1_0_0NewAccountData
instance Selector S1_0_1NewAccountData
instance Selector S1_0_2NewAccountData
instance ToJExpr UserPass
instance FromJSON UserPass
instance ToJSON UserPass
instance Typeable SetPassword
instance Typeable DeletePassword
instance Typeable VerifyPasswordForUserId
instance Typeable UserPass
instance Eq UserPass
instance Ord UserPass
instance Read UserPass
instance Show UserPass
instance Data UserPass
instance Generic UserPass
instance Datatype D1UserPass
instance Constructor C1_0UserPass
instance Selector S1_0_0UserPass
instance Selector S1_0_1UserPass
instance QueryEvent VerifyPasswordForUserId
instance Method VerifyPasswordForUserId
instance SafeCopy VerifyPasswordForUserId
instance UpdateEvent DeletePassword
instance Method DeletePassword
instance SafeCopy DeletePassword
instance UpdateEvent SetPassword
instance Method SetPassword
instance SafeCopy SetPassword
instance IsAcidic PasswordState
instance SafeCopy PasswordState
instance Typeable PasswordState
instance Eq PasswordState
instance Ord PasswordState
instance Read PasswordState
instance Show PasswordState
instance Data PasswordState
instance Generic PasswordState
instance Datatype D1PasswordState
instance Constructor C1_0PasswordState
instance Selector S1_0_0PasswordState
instance SafeCopy HashedPass
instance Typeable HashedPass
instance Eq HashedPass
instance Ord HashedPass
instance Read HashedPass
instance Show HashedPass
instance Data HashedPass
instance Generic HashedPass
instance Datatype D1HashedPass
instance Constructor C1_0HashedPass
instance Selector S1_0_0HashedPass
instance RenderMessage HappstackAuthenticateI18N PasswordError
instance Typeable PasswordError
instance Eq PasswordError
instance Ord PasswordError
instance Read PasswordError
instance Show PasswordError
instance Data PasswordError
instance Generic PasswordError
instance Datatype D1PasswordError
instance Constructor C1_0PasswordError
instance Constructor C1_1PasswordError
instance Constructor C1_2PasswordError
instance Constructor C1_3PasswordError
instance Constructor C1_4PasswordError
instance Constructor C1_5PasswordError
instance Constructor C1_6PasswordError
instance Constructor C1_7PasswordError
instance Constructor C1_8PasswordError
instance Constructor C1_9PasswordError
instance Selector S1_9_0PasswordError
instance ToJExpr PasswordError
instance FromJSON PasswordError
instance ToJSON PasswordError
module Happstack.Authenticate.Password.Forms
usernamePasswordForm :: (Functor m, Monad m) => XMLGenT (RouteT AuthenticateURL m) XML
module Happstack.Authenticate.Password.Partials
type Partial' m = RouteT AuthenticateURL (ReaderT [Lang] m)
type Partial m = XMLGenT (RouteT AuthenticateURL (ReaderT [Lang] m))
data PartialMsgs
UsernameMsg :: PartialMsgs
EmailMsg :: PartialMsgs
PasswordMsg :: PartialMsgs
PasswordConfirmationMsg :: PartialMsgs
SignUpMsg :: PartialMsgs
SignInMsg :: PartialMsgs
LogoutMsg :: PartialMsgs
OldPasswordMsg :: PartialMsgs
NewPasswordMsg :: PartialMsgs
NewPasswordConfirmationMsg :: PartialMsgs
ChangePasswordMsg :: PartialMsgs
RequestPasswordResetMsg :: PartialMsgs
routePartial :: (Functor m, Monad m, Happstack m) => AcidState AuthenticateState -> PartialURL -> Partial m XML
signupPasswordForm :: (Functor m, Monad m) => Partial m XML
usernamePasswordForm :: (Functor m, Monad m) => Partial m XML
logoutForm :: (Functor m, MonadIO m) => Partial m XML
changePasswordForm :: (Functor m, MonadIO m) => UserId -> Partial m XML
requestResetPasswordForm :: (Functor m, MonadIO m) => Partial m XML
resetPasswordForm :: (Functor m, MonadIO m) => Partial m XML
instance (Functor m, Monad m) => EmbedAsAttr (Partial' m) (Attr Text PartialMsgs)
instance (Functor m, Monad m) => EmbedAsChild (Partial' m) PartialMsgs
instance RenderMessage HappstackAuthenticateI18N PartialMsgs
module Happstack.Authenticate.Password.Route
routePassword :: Happstack m => Text -> Text -> AcidState AuthenticateState -> (UserId -> IO Bool) -> AcidState PasswordState -> [Text] -> RouteT AuthenticateURL (ReaderT [Lang] m) Response
initPassword :: Text -> Text -> FilePath -> AcidState AuthenticateState -> (UserId -> IO Bool) -> IO (Bool -> IO (), (AuthenticationMethod, AuthenticationHandler), RouteT AuthenticateURL (ServerPartT IO) JStat)
module Happstack.Authenticate.OpenId.URL
openIdAuthenticationMethod :: AuthenticationMethod
data OpenIdURL
Partial :: PartialURL -> OpenIdURL
BeginDance :: Text -> OpenIdURL
ReturnTo :: OpenIdURL
Realm :: OpenIdURL
rRealm :: Boomerang e tok r ((:-) OpenIdURL r)
rReturnTo :: Boomerang e tok r ((:-) OpenIdURL r)
rBeginDance :: Boomerang e tok ((:-) Text r) ((:-) OpenIdURL r)
rPartial :: Boomerang e tok ((:-) PartialURL r) ((:-) OpenIdURL r)
openIdURL :: Router () (OpenIdURL :- ())
nestOpenIdURL :: RouteT OpenIdURL m a -> RouteT AuthenticateURL m a
instance PathInfo OpenIdURL
instance Typeable OpenIdURL
instance Eq OpenIdURL
instance Ord OpenIdURL
instance Data OpenIdURL
instance Generic OpenIdURL
instance Read OpenIdURL
instance Show OpenIdURL
instance Datatype D1OpenIdURL
instance Constructor C1_0OpenIdURL
instance Constructor C1_1OpenIdURL
instance Constructor C1_2OpenIdURL
instance Constructor C1_3OpenIdURL
module Happstack.Authenticate.OpenId.Core
data OpenIdError
UnknownIdentifier :: OpenIdError
CoreError :: CoreError -> OpenIdError
openIdErrorMessageE :: OpenIdError -> CoreError
data OpenIdState_1
OpenIdState_1 :: Map Identifier UserId -> OpenIdState_1
_identifiers_1 :: OpenIdState_1 -> Map Identifier UserId
identifiers_1 :: Iso' OpenIdState_1 (Map Identifier UserId)
data OpenIdState
OpenIdState :: Map Identifier UserId -> Maybe Text -> OpenIdState
_identifiers :: OpenIdState -> Map Identifier UserId
_openIdRealm :: OpenIdState -> Maybe Text
openIdRealm :: Lens' OpenIdState (Maybe Text)
identifiers :: Lens' OpenIdState (Map Identifier UserId)
initialOpenIdState :: OpenIdState
identifierToUserId :: Identifier -> Query OpenIdState (Maybe UserId)
associateIdentifierWithUserId :: Identifier -> UserId -> Update OpenIdState ()
-- | Get the OpenId realm to use for authentication
getOpenIdRealm :: Query OpenIdState (Maybe Text)
-- | set the realm used for OpenId Authentication
--
-- IMPORTANT: Changing this value after users have registered is likely
-- to invalidate existing OpenId tokens resulting in users no longer
-- being able to access their old accounts.
setOpenIdRealm :: Maybe Text -> Update OpenIdState ()
newtype IdentifierToUserId
IdentifierToUserId :: Identifier -> IdentifierToUserId
data AssociateIdentifierWithUserId
AssociateIdentifierWithUserId :: Identifier -> UserId -> AssociateIdentifierWithUserId
data GetOpenIdRealm
GetOpenIdRealm :: GetOpenIdRealm
newtype SetOpenIdRealm
SetOpenIdRealm :: Maybe Text -> SetOpenIdRealm
data SetRealmData
SetRealmData :: Maybe Text -> SetRealmData
_srOpenIdRealm :: SetRealmData -> Maybe Text
srOpenIdRealm :: Iso' SetRealmData (Maybe Text)
realm :: Happstack m => AcidState AuthenticateState -> AcidState OpenIdState -> m Response
getIdentifier :: Happstack m => m Identifier
token :: (Alternative m, Happstack m) => AcidState AuthenticateState -> (UserId -> IO Bool) -> AcidState OpenIdState -> m Response
instance FromJSON SetRealmData
instance ToJSON SetRealmData
instance Typeable IdentifierToUserId
instance Typeable AssociateIdentifierWithUserId
instance Typeable GetOpenIdRealm
instance Typeable SetOpenIdRealm
instance Typeable SetRealmData
instance Eq SetRealmData
instance Ord SetRealmData
instance Read SetRealmData
instance Show SetRealmData
instance Data SetRealmData
instance Generic SetRealmData
instance Datatype D1SetRealmData
instance Constructor C1_0SetRealmData
instance Selector S1_0_0SetRealmData
instance UpdateEvent SetOpenIdRealm
instance Method SetOpenIdRealm
instance SafeCopy SetOpenIdRealm
instance QueryEvent GetOpenIdRealm
instance Method GetOpenIdRealm
instance SafeCopy GetOpenIdRealm
instance UpdateEvent AssociateIdentifierWithUserId
instance Method AssociateIdentifierWithUserId
instance SafeCopy AssociateIdentifierWithUserId
instance QueryEvent IdentifierToUserId
instance Method IdentifierToUserId
instance SafeCopy IdentifierToUserId
instance IsAcidic OpenIdState
instance Migrate OpenIdState
instance SafeCopy OpenIdState
instance Typeable OpenIdState
instance Eq OpenIdState
instance Ord OpenIdState
instance Read OpenIdState
instance Show OpenIdState
instance Data OpenIdState
instance Generic OpenIdState
instance Datatype D1OpenIdState
instance Constructor C1_0OpenIdState
instance Selector S1_0_0OpenIdState
instance Selector S1_0_1OpenIdState
instance SafeCopy OpenIdState_1
instance Typeable OpenIdState_1
instance Eq OpenIdState_1
instance Ord OpenIdState_1
instance Read OpenIdState_1
instance Show OpenIdState_1
instance Data OpenIdState_1
instance Generic OpenIdState_1
instance Datatype D1OpenIdState_1
instance Constructor C1_0OpenIdState_1
instance Selector S1_0_0OpenIdState_1
instance RenderMessage HappstackAuthenticateI18N OpenIdError
instance Typeable OpenIdError
instance Eq OpenIdError
instance Ord OpenIdError
instance Read OpenIdError
instance Show OpenIdError
instance Data OpenIdError
instance Generic OpenIdError
instance Datatype D1OpenIdError
instance Constructor C1_0OpenIdError
instance Constructor C1_1OpenIdError
instance Selector S1_1_0OpenIdError
instance ToJExpr OpenIdError
instance FromJSON OpenIdError
instance ToJSON OpenIdError
instance SafeCopy Identifier
module Happstack.Authenticate.OpenId.Controllers
openIdCtrl :: Happstack m => AcidState AuthenticateState -> AcidState OpenIdState -> RouteT AuthenticateURL m JStat
openIdCtrlJs :: Maybe Text -> (OpenIdURL -> [(Text, Maybe Text)] -> Text) -> JStat
module Happstack.Authenticate.OpenId.Partials
type Partial' m = RouteT AuthenticateURL (ReaderT [Lang] m)
type Partial m = XMLGenT (RouteT AuthenticateURL (ReaderT [Lang] m))
data PartialMsgs
UsingGoogleMsg :: PartialMsgs
UsingYahooMsg :: PartialMsgs
SetRealmMsg :: PartialMsgs
OpenIdRealmMsg :: PartialMsgs
routePartial :: (Functor m, Monad m, Happstack m) => AcidState AuthenticateState -> AcidState OpenIdState -> PartialURL -> Partial m XML
usingGoogle :: (Functor m, Monad m) => Partial m XML
usingYahoo :: (Functor m, Monad m) => Partial m XML
realmForm :: (Functor m, MonadIO m) => AcidState OpenIdState -> Partial m XML
instance (Functor m, Monad m) => EmbedAsAttr (Partial' m) (Attr Text PartialMsgs)
instance (Functor m, Monad m) => EmbedAsChild (Partial' m) PartialMsgs
instance RenderMessage HappstackAuthenticateI18N PartialMsgs
module Happstack.Authenticate.OpenId.Route
routeOpenId :: Happstack m => AcidState AuthenticateState -> (UserId -> IO Bool) -> AcidState OpenIdState -> [Text] -> RouteT AuthenticateURL (ReaderT [Lang] m) Response
initOpenId :: FilePath -> AcidState AuthenticateState -> (UserId -> IO Bool) -> IO (Bool -> IO (), (AuthenticationMethod, AuthenticationHandler), RouteT AuthenticateURL (ServerPartT IO) JStat)