Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type HTM = PrettyHTML
- renderHTM :: Html -> LBS
- data PrettyHTML
- data TextCss
- type FAction = Action FActionError FrontendSessionData
- data FActionError
- data FrontendSessionData = FrontendSessionData {
- _fsdLogin :: Maybe FrontendSessionLoginData
- _fsdServiceLoginState :: Maybe ServiceLoginState
- _fsdMessages :: [FrontendMsg]
- emptyFrontendSessionData :: FrontendSessionData
- data FrontendSessionLoginData = FrontendSessionLoginData {
- _fslToken :: ThentosSessionToken
- _fslUserId :: UserId
- _fslDashboardTab :: Maybe DashboardTab
- data DashboardTab
- data ServiceLoginState = ServiceLoginState {
- _fslServiceId :: ServiceId
- _fslRR :: RelativeRef
- data FrontendMsg
- = FrontendMsgError ST
- | FrontendMsgSuccess ST
- fsdServiceLoginState :: Lens' FrontendSessionData (Maybe ServiceLoginState)
- fsdMessages :: Lens' FrontendSessionData [FrontendMsg]
- fsdLogin :: Lens' FrontendSessionData (Maybe FrontendSessionLoginData)
- fslUserId :: Lens' FrontendSessionLoginData UserId
- fslToken :: Lens' FrontendSessionLoginData ThentosSessionToken
- fslDashboardTab :: Lens' FrontendSessionLoginData (Maybe DashboardTab)
- fslServiceId :: Lens' ServiceLoginState ServiceId
- fslRR :: Lens' ServiceLoginState RelativeRef
content types
type HTM = PrettyHTML
Html content type with pretty printing. (See also: package servant-blaze.)
renderHTM :: Html -> LBS
data PrettyHTML
Accept * PrettyHTML | |
ToMarkup a => MimeRender * PrettyHTML a | |
MimeRender * PrettyHTML Html |
data TextCss
Accept * TextCss | |
MimeRender * TextCss String | |
MimeRender * TextCss ST | |
MimeRender * TextCss SBS | |
MimeRender * TextCss LT | |
MimeRender * TextCss LBS |
frontend actions
data FActionError
FActionError303 SBS | |
FActionError404 | |
FActionErrorNoToken | |
FActionErrorCreateService | |
FActionErrorServiceLoginNoCbUrl | |
FActionError500 String |
Eq FActionError | |
Show FActionError |
session state
data FrontendSessionData
FrontendSessionData | |
|
Eq FrontendSessionData | |
Show FrontendSessionData | |
Generic FrontendSessionData | |
ToJSON FrontendSessionData | |
FromJSON FrontendSessionData | |
type Rep FrontendSessionData |
FrontendSessionLoginData | |
|
Eq FrontendSessionLoginData | |
Show FrontendSessionLoginData | |
Generic FrontendSessionLoginData | |
ToJSON FrontendSessionLoginData | |
FromJSON FrontendSessionLoginData | |
type Rep FrontendSessionLoginData |
data DashboardTab
DashboardTabDetails | |
DashboardTabServices | |
DashboardTabOwnServices | |
DashboardTabUsers | |
DashboardTabLogout |
Bounded DashboardTab | |
Enum DashboardTab | |
Eq DashboardTab | |
Ord DashboardTab | |
Read DashboardTab | |
Show DashboardTab | |
Generic DashboardTab | |
ToJSON DashboardTab | |
FromJSON DashboardTab | |
type Rep DashboardTab |
data ServiceLoginState
If a user comes from a service login and is sent to the "register
with a new service" page because no valid ServiceAccount
exists
in thentos, an extra round of indirection is required (the user is
confronted with the service details and must say "yes, i want to
register", "share this-and-that data", etc.). There may be further
extra rounds for logging in to thentos or registering with thentos.
This type is used to store the information from the service login
request in FrontendSessionData
until all these steps have been
taken.
ServiceLoginState | |
|
Eq ServiceLoginState | |
Show ServiceLoginState | |
Generic ServiceLoginState | |
ToJSON ServiceLoginState | |
FromJSON ServiceLoginState | |
type Rep ServiceLoginState |
data FrontendMsg
If we want to communicate information from the last request to the user in the next one, we need to stash it in the state. This is the type for that.
Eq FrontendMsg | |
Show FrontendMsg | |
Generic FrontendMsg | |
ToJSON FrontendMsg | |
FromJSON FrontendMsg | |
type Rep FrontendMsg |
fsdServiceLoginState :: Lens' FrontendSessionData (Maybe ServiceLoginState)
fsdMessages :: Lens' FrontendSessionData [FrontendMsg]
fsdLogin :: Lens' FrontendSessionData (Maybe FrontendSessionLoginData)
fslUserId :: Lens' FrontendSessionLoginData UserId
fslDashboardTab :: Lens' FrontendSessionLoginData (Maybe DashboardTab)
fslServiceId :: Lens' ServiceLoginState ServiceId
fslRR :: Lens' ServiceLoginState RelativeRef