| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Auth
Synopsis
- type API = FrontendAPI :<|> CallbackAPI
- type FrontendAPI = ("oauth" :> ((BrowserHeader "Cookie" Text :> ("status" :> Get '[JSON] AuthStatus)) :<|> ("github" :> GetRedirect (Headers '[Header "Location" Text])))) :<|> (BrowserHeader "Cookie" Text :> ("gists" :> GistAPI))
- server :: (MonadNow m, MonadWeb m, MonadLogger m, MonadError ServerError m, MonadIO m, MonadReader Env m) => ServerT API m
- data AuthStatus
- data AuthRole
- data Config = Config {}
- configJWTSignature :: Lens' Config EncodeSigner
- configFrontendUrl :: Lens' Config Text
- configGithubCbPath :: Lens' Config Text
- configGithubClientId :: Lens' Config OAuthClientId
- configGithubClientSecret :: Lens' Config OAuthClientSecret
- data GithubEndpoints
- mkGithubEndpoints :: IO GithubEndpoints
- githubEndpointsAuthLocation :: Lens' GithubEndpoints Request
- githubEndpointsAccessTokenLocation :: Lens' GithubEndpoints Request
- githubEndpointsApiBaseUrl :: Lens' GithubEndpoints BaseUrl
- githubEndpointsCallbackUri :: Lens' GithubEndpoints Text
Documentation
type API = FrontendAPI :<|> CallbackAPI Source #
We split out the API here because we don't want the Github Callback to be exported for the frontend to call directly.
type FrontendAPI = ("oauth" :> ((BrowserHeader "Cookie" Text :> ("status" :> Get '[JSON] AuthStatus)) :<|> ("github" :> GetRedirect (Headers '[Header "Location" Text])))) :<|> (BrowserHeader "Cookie" Text :> ("gists" :> GistAPI)) Source #
server :: (MonadNow m, MonadWeb m, MonadLogger m, MonadError ServerError m, MonadIO m, MonadReader Env m) => ServerT API m Source #
data AuthStatus Source #
Instances
| Eq AuthStatus Source # | |
Defined in Auth Methods (==) :: AuthStatus -> AuthStatus -> Bool Source # (/=) :: AuthStatus -> AuthStatus -> Bool Source # | |
| Show AuthStatus Source # | |
| Generic AuthStatus Source # | |
Defined in Auth | |
| ToJSON AuthStatus Source # | |
Defined in Auth Methods toJSON :: AuthStatus -> Value Source # toEncoding :: AuthStatus -> Encoding Source # toJSONList :: [AuthStatus] -> Value Source # toEncodingList :: [AuthStatus] -> Encoding Source # | |
| FromJSON AuthStatus Source # | |
Defined in Auth Methods parseJSON :: Value -> Parser AuthStatus Source # parseJSONList :: Value -> Parser [AuthStatus] Source # | |
| type Rep AuthStatus Source # | |
Defined in Auth type Rep AuthStatus = D1 ('MetaData "AuthStatus" "Auth" "playground-common-1.1.0.0-BGIv25EIALK13vHpc6sZbN" 'True) (C1 ('MetaCons "AuthStatus" 'PrefixI 'True) (S1 ('MetaSel ('Just "_authStatusAuthRole") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AuthRole))) | |
Config supplied at runtime.
Constructors
| Config | |
data GithubEndpoints Source #
mkGithubEndpoints :: IO GithubEndpoints Source #
Config determined by Github.