snaplet-persistent-0.7.1: persistent snaplet for the Snap Framework
Safe HaskellNone
LanguageHaskell2010

Snap.Snaplet.Auth.Backends.Persistent

Synopsis

Documentation

initPersistAuthManager :: SnapletLens b SessionManager -> ConnectionPool -> SnapletInit b (AuthManager b) Source #

Initializer that gets AuthSettings from a config file.

initPersistAuthManager' :: AuthSettings -> SnapletLens b SessionManager -> ConnectionPool -> SnapletInit b (AuthManager b) Source #

Initializer that lets you specify AuthSettings.

authEntityDefs :: [UnboundEntityDef] Source #

The list of entity definitions this snaplet exposes. You need them so that you can append to your application's list of entity definitions and perform the migration in one block.

See how this example combined an app's own entity definitions and the auth snaplet's in one migration block:

share [mkMigrate "migrateAll"] $
   authEntityDefs ++
   $(persistFileWith lowerCaseSettings "schema.txt")

Persistent Auth Data Types

Persistent creates its own data types mirroring the database schema, so we have to export this extra layer of types and conversion to AuthUser.

data SnapAuthUser Source #

Instances

Instances details
PersistFieldSql SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

(TypeError (NoUniqueKeysError SnapAuthUser) :: Constraint) => OnlyOneUniqueKey SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

(TypeError (MultipleUniqueKeysError SnapAuthUser) :: Constraint) => AtLeastOneUniqueKey SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

PersistEntity SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SafeToInsert SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

PersistField SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

ToBackendKey SqlBackend SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "createdAt" SnapAuthUser UTCTime Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "email" SnapAuthUser Text Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "failedLoginCount" SnapAuthUser Int Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "login" SnapAuthUser Text Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "loginCount" SnapAuthUser Int Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "meta" SnapAuthUser String Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "password" SnapAuthUser Text Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "roles" SnapAuthUser String Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "updatedAt" SnapAuthUser UTCTime Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "activatedAt" SnapAuthUser (Maybe UTCTime) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "currentIp" SnapAuthUser (Maybe Text) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "currentLoginAt" SnapAuthUser (Maybe UTCTime) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "id" SnapAuthUser (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "lastIp" SnapAuthUser (Maybe Text) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "lastLoginAt" SnapAuthUser (Maybe UTCTime) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "lockedOutUntil" SnapAuthUser (Maybe UTCTime) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "rememberToken" SnapAuthUser (Maybe Text) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "resetRequestedAt" SnapAuthUser (Maybe UTCTime) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "resetToken" SnapAuthUser (Maybe Text) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

SymbolToField "suspendedAt" SnapAuthUser (Maybe UTCTime) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

Eq (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

Ord (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

Read (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

Show (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

ToJSON (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

FromJSON (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

ToHttpApiData (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

FromHttpApiData (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

PathPiece (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

PersistFieldSql (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

PersistField (Key SnapAuthUser) Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

data Unique SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

data EntityField SnapAuthUser typ Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

newtype Key SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

type PersistEntityBackend SnapAuthUser Source # 
Instance details

Defined in Snap.Snaplet.Auth.Backends.Persistent.Types

db2au :: Entity SnapAuthUser -> AuthUser Source #

Function to convert a SnapAuthUser entity into the auth snaplet's AuthUser.

dbUserSplices :: Monad n => Splices (RuntimeSplice n (Entity SnapAuthUser) -> Splice n) Source #

Splices for SnapAuthUser that are equivalent to the ones for AuthUser.

userDBKey :: AuthUser -> Maybe SnapAuthUserId Source #

Get the db key from an AuthUser