| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
OryKratos.API
Contents
Description
Client and Server
Synopsis
- data Config = Config {}
- data OryKratosBackend m = OryKratosBackend {
- createIdentity :: CreateIdentity -> m Identity
- createRecoveryLink :: CreateRecoveryLink -> m RecoveryLink
- deleteIdentity :: Text -> m NoContent
- getIdentity :: Text -> m Identity
- getSchema :: Text -> m Value
- getSelfServiceError :: Maybe Text -> m SelfServiceErrorContainer
- getSelfServiceLoginFlow :: Maybe Text -> m LoginFlow
- getSelfServiceRecoveryFlow :: Maybe Text -> m RecoveryFlow
- getSelfServiceRegistrationFlow :: Maybe Text -> m RegistrationFlow
- getSelfServiceSettingsFlow :: Maybe Text -> Maybe Text -> m SettingsFlow
- getSelfServiceVerificationFlow :: Maybe Text -> m VerificationFlow
- listIdentities :: Maybe Integer -> Maybe Integer -> m [Identity]
- prometheus :: m NoContent
- updateIdentity :: Text -> UpdateIdentity -> m Identity
- isInstanceAlive :: m HealthStatus
- isInstanceReady :: m HealthStatus
- initializeSelfServiceBrowserLogoutFlow :: m NoContent
- initializeSelfServiceLoginForBrowsers :: Maybe Bool -> m NoContent
- initializeSelfServiceLoginForNativeApps :: Maybe Bool -> m LoginFlow
- initializeSelfServiceRecoveryForBrowsers :: m NoContent
- initializeSelfServiceRecoveryForNativeApps :: m RecoveryFlow
- initializeSelfServiceRegistrationForBrowsers :: m NoContent
- initializeSelfServiceRegistrationForNativeApps :: m RegistrationFlow
- initializeSelfServiceSettingsForBrowsers :: m NoContent
- initializeSelfServiceSettingsForNativeApps :: Maybe Text -> m SettingsFlow
- initializeSelfServiceVerificationForBrowsers :: m NoContent
- initializeSelfServiceVerificationForNativeApps :: m VerificationFlow
- revokeSession :: RevokeSession -> m NoContent
- submitSelfServiceLoginFlow :: Maybe Text -> Value -> m LoginViaApiResponse
- submitSelfServiceRecoveryFlow :: Maybe Text -> Value -> m NoContent
- submitSelfServiceRecoveryFlowWithLinkMethod :: Maybe Text -> Maybe Text -> SubmitSelfServiceRecoveryFlowWithLinkMethod -> m NoContent
- submitSelfServiceRegistrationFlow :: Maybe Text -> Value -> m RegistrationViaApiResponse
- submitSelfServiceSettingsFlow :: Maybe Text -> Value -> Maybe Text -> m SettingsViaApiResponse
- submitSelfServiceVerificationFlow :: Maybe Text -> Value -> m NoContent
- toSession :: Maybe Text -> m Session
- getVersion :: m Version
- createOryKratosClient :: OryKratosBackend OryKratosClient
- runOryKratosServer :: (MonadIO m, MonadThrow m) => Config -> OryKratosBackend (ExceptT ServerError IO) -> m ()
- runOryKratosMiddlewareServer :: (MonadIO m, MonadThrow m) => Config -> Middleware -> OryKratosBackend (ExceptT ServerError IO) -> m ()
- runOryKratosClient :: Config -> OryKratosClient a -> ExceptT ClientError IO a
- runOryKratosClientWithManager :: Manager -> Config -> OryKratosClient a -> ExceptT ClientError IO a
- callOryKratos :: (MonadIO m, MonadThrow m) => ClientEnv -> OryKratosClient a -> m a
- data OryKratosClient a
- newtype OryKratosClientError = OryKratosClientError ClientError
- type OryKratosAPI = ("identities" :> (ReqBody '[JSON] CreateIdentity :> Verb 'POST 200 '[JSON] Identity)) :<|> (("recovery" :> ("link" :> (ReqBody '[JSON] CreateRecoveryLink :> Verb 'POST 200 '[JSON] RecoveryLink))) :<|> (("identities" :> (Capture "id" Text :> Verb 'DELETE 200 '[JSON] NoContent)) :<|> (("identities" :> (Capture "id" Text :> Verb 'GET 200 '[JSON] Identity)) :<|> (("identities" :> (QueryParam "per_page" Integer :> (QueryParam "page" Integer :> Verb 'GET 200 '[JSON] [Identity]))) :<|> (("metrics" :> ("prometheus" :> Verb 'GET 200 '[JSON] NoContent)) :<|> (("identities" :> (Capture "id" Text :> (ReqBody '[JSON] UpdateIdentity :> Verb 'PUT 200 '[JSON] Identity))) :<|> (("health" :> ("alive" :> Verb 'GET 200 '[JSON] HealthStatus)) :<|> (("health" :> ("ready" :> Verb 'GET 200 '[JSON] HealthStatus)) :<|> (("schemas" :> (Capture "id" Text :> Verb 'GET 200 '[JSON] Value)) :<|> (("self-service" :> ("errors" :> (QueryParam "error" Text :> Verb 'GET 200 '[JSON] SelfServiceErrorContainer))) :<|> (("self-service" :> ("login" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] LoginFlow)))) :<|> (("self-service" :> ("recovery" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] RecoveryFlow)))) :<|> (("self-service" :> ("registration" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] RegistrationFlow)))) :<|> (("self-service" :> ("settings" :> ("flows" :> (QueryParam "id" Text :> (Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] SettingsFlow))))) :<|> (("self-service" :> ("verification" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] VerificationFlow)))) :<|> (("self-service" :> ("browser" :> ("flows" :> ("logout" :> Verb 'GET 200 '[JSON] NoContent)))) :<|> (("self-service" :> ("login" :> ("browser" :> (QueryParam "refresh" Bool :> Verb 'GET 200 '[JSON] NoContent)))) :<|> (("self-service" :> ("login" :> ("api" :> (QueryParam "refresh" Bool :> Verb 'GET 200 '[JSON] LoginFlow)))) :<|> (("self-service" :> ("recovery" :> ("browser" :> Verb 'GET 200 '[JSON] NoContent))) :<|> (("self-service" :> ("recovery" :> ("api" :> Verb 'GET 200 '[JSON] RecoveryFlow))) :<|> (("self-service" :> ("registration" :> ("browser" :> Verb 'GET 200 '[JSON] NoContent))) :<|> (("self-service" :> ("registration" :> ("api" :> Verb 'GET 200 '[JSON] RegistrationFlow))) :<|> (("self-service" :> ("settings" :> ("browser" :> Verb 'GET 200 '[JSON] NoContent))) :<|> (("self-service" :> ("settings" :> ("api" :> (Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] SettingsFlow)))) :<|> (("self-service" :> ("verification" :> ("browser" :> Verb 'GET 200 '[JSON] NoContent))) :<|> (("self-service" :> ("verification" :> ("api" :> Verb 'GET 200 '[JSON] VerificationFlow))) :<|> (("sessions" :> (ReqBody '[JSON] RevokeSession :> Verb 'DELETE 200 '[JSON] NoContent)) :<|> (("self-service" :> ("login" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] LoginViaApiResponse)))) :<|> (("self-service" :> ("recovery" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] NoContent)))) :<|> (("self-service" :> ("recovery" :> ("methods" :> ("link" :> (QueryParam "token" Text :> (QueryParam "flow" Text :> (ReqBody '[JSON] SubmitSelfServiceRecoveryFlowWithLinkMethod :> Verb 'POST 200 '[JSON] NoContent))))))) :<|> (("self-service" :> ("registration" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] RegistrationViaApiResponse)))) :<|> (("self-service" :> ("settings" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> (Header "X-Session-Token" Text :> Verb 'POST 200 '[JSON] SettingsViaApiResponse))))) :<|> (("self-service" :> ("verification" :> ("methods" :> ("link" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] NoContent)))))) :<|> (("sessions" :> ("whoami" :> (Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] Session))) :<|> (("version" :> Verb 'GET 200 '[JSON] Version) :<|> Raw)))))))))))))))))))))))))))))))))))
Documentation
Server or client configuration, specifying the host and port to query or serve on.
Constructors
| Config | |
Fields
| |
data OryKratosBackend m Source #
Configuration, specifying the full url of the service.
Backend for OryKratos.
The backend can be used both for the client and the server. The client generated from the OryKratos OpenAPI spec
is a backend that executes actions by sending HTTP requests (see createOryKratosClient). Alternatively, provided
a backend, the API can be served using runOryKratosMiddlewareServer.
Constructors
| OryKratosBackend | |
Fields
| |
runOryKratosServer :: (MonadIO m, MonadThrow m) => Config -> OryKratosBackend (ExceptT ServerError IO) -> m () Source #
Run the OryKratos server at the provided host and port.
runOryKratosMiddlewareServer :: (MonadIO m, MonadThrow m) => Config -> Middleware -> OryKratosBackend (ExceptT ServerError IO) -> m () Source #
Run the OryKratos server at the provided host and port.
runOryKratosClient :: Config -> OryKratosClient a -> ExceptT ClientError IO a Source #
Run requests in the OryKratosClient monad.
runOryKratosClientWithManager :: Manager -> Config -> OryKratosClient a -> ExceptT ClientError IO a Source #
Run requests in the OryKratosClient monad using a custom manager.
callOryKratos :: (MonadIO m, MonadThrow m) => ClientEnv -> OryKratosClient a -> m a Source #
Like runClient, but returns the response or throws
a OryKratosClientError
data OryKratosClient a Source #
Instances
| Monad OryKratosClient Source # | |
Defined in OryKratos.API Methods (>>=) :: OryKratosClient a -> (a -> OryKratosClient b) -> OryKratosClient b # (>>) :: OryKratosClient a -> OryKratosClient b -> OryKratosClient b # return :: a -> OryKratosClient a # | |
| Functor OryKratosClient Source # | |
Defined in OryKratos.API Methods fmap :: (a -> b) -> OryKratosClient a -> OryKratosClient b # (<$) :: a -> OryKratosClient b -> OryKratosClient a # | |
| Applicative OryKratosClient Source # | |
Defined in OryKratos.API Methods pure :: a -> OryKratosClient a # (<*>) :: OryKratosClient (a -> b) -> OryKratosClient a -> OryKratosClient b # liftA2 :: (a -> b -> c) -> OryKratosClient a -> OryKratosClient b -> OryKratosClient c # (*>) :: OryKratosClient a -> OryKratosClient b -> OryKratosClient b # (<*) :: OryKratosClient a -> OryKratosClient b -> OryKratosClient a # | |
| MonadIO OryKratosClient Source # | |
Defined in OryKratos.API Methods liftIO :: IO a -> OryKratosClient a # | |
newtype OryKratosClientError Source #
Custom exception type for our errors.
Constructors
| OryKratosClientError ClientError |
Instances
| Show OryKratosClientError Source # | |
Defined in OryKratos.API Methods showsPrec :: Int -> OryKratosClientError -> ShowS # show :: OryKratosClientError -> String # showList :: [OryKratosClientError] -> ShowS # | |
| Exception OryKratosClientError Source # | |
Defined in OryKratos.API Methods toException :: OryKratosClientError -> SomeException # fromException :: SomeException -> Maybe OryKratosClientError # | |
Servant
type OryKratosAPI = ("identities" :> (ReqBody '[JSON] CreateIdentity :> Verb 'POST 200 '[JSON] Identity)) :<|> (("recovery" :> ("link" :> (ReqBody '[JSON] CreateRecoveryLink :> Verb 'POST 200 '[JSON] RecoveryLink))) :<|> (("identities" :> (Capture "id" Text :> Verb 'DELETE 200 '[JSON] NoContent)) :<|> (("identities" :> (Capture "id" Text :> Verb 'GET 200 '[JSON] Identity)) :<|> (("identities" :> (QueryParam "per_page" Integer :> (QueryParam "page" Integer :> Verb 'GET 200 '[JSON] [Identity]))) :<|> (("metrics" :> ("prometheus" :> Verb 'GET 200 '[JSON] NoContent)) :<|> (("identities" :> (Capture "id" Text :> (ReqBody '[JSON] UpdateIdentity :> Verb 'PUT 200 '[JSON] Identity))) :<|> (("health" :> ("alive" :> Verb 'GET 200 '[JSON] HealthStatus)) :<|> (("health" :> ("ready" :> Verb 'GET 200 '[JSON] HealthStatus)) :<|> (("schemas" :> (Capture "id" Text :> Verb 'GET 200 '[JSON] Value)) :<|> (("self-service" :> ("errors" :> (QueryParam "error" Text :> Verb 'GET 200 '[JSON] SelfServiceErrorContainer))) :<|> (("self-service" :> ("login" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] LoginFlow)))) :<|> (("self-service" :> ("recovery" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] RecoveryFlow)))) :<|> (("self-service" :> ("registration" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] RegistrationFlow)))) :<|> (("self-service" :> ("settings" :> ("flows" :> (QueryParam "id" Text :> (Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] SettingsFlow))))) :<|> (("self-service" :> ("verification" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] VerificationFlow)))) :<|> (("self-service" :> ("browser" :> ("flows" :> ("logout" :> Verb 'GET 200 '[JSON] NoContent)))) :<|> (("self-service" :> ("login" :> ("browser" :> (QueryParam "refresh" Bool :> Verb 'GET 200 '[JSON] NoContent)))) :<|> (("self-service" :> ("login" :> ("api" :> (QueryParam "refresh" Bool :> Verb 'GET 200 '[JSON] LoginFlow)))) :<|> (("self-service" :> ("recovery" :> ("browser" :> Verb 'GET 200 '[JSON] NoContent))) :<|> (("self-service" :> ("recovery" :> ("api" :> Verb 'GET 200 '[JSON] RecoveryFlow))) :<|> (("self-service" :> ("registration" :> ("browser" :> Verb 'GET 200 '[JSON] NoContent))) :<|> (("self-service" :> ("registration" :> ("api" :> Verb 'GET 200 '[JSON] RegistrationFlow))) :<|> (("self-service" :> ("settings" :> ("browser" :> Verb 'GET 200 '[JSON] NoContent))) :<|> (("self-service" :> ("settings" :> ("api" :> (Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] SettingsFlow)))) :<|> (("self-service" :> ("verification" :> ("browser" :> Verb 'GET 200 '[JSON] NoContent))) :<|> (("self-service" :> ("verification" :> ("api" :> Verb 'GET 200 '[JSON] VerificationFlow))) :<|> (("sessions" :> (ReqBody '[JSON] RevokeSession :> Verb 'DELETE 200 '[JSON] NoContent)) :<|> (("self-service" :> ("login" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] LoginViaApiResponse)))) :<|> (("self-service" :> ("recovery" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] NoContent)))) :<|> (("self-service" :> ("recovery" :> ("methods" :> ("link" :> (QueryParam "token" Text :> (QueryParam "flow" Text :> (ReqBody '[JSON] SubmitSelfServiceRecoveryFlowWithLinkMethod :> Verb 'POST 200 '[JSON] NoContent))))))) :<|> (("self-service" :> ("registration" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] RegistrationViaApiResponse)))) :<|> (("self-service" :> ("settings" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> (Header "X-Session-Token" Text :> Verb 'POST 200 '[JSON] SettingsViaApiResponse))))) :<|> (("self-service" :> ("verification" :> ("methods" :> ("link" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] NoContent)))))) :<|> (("sessions" :> ("whoami" :> (Header "X-Session-Token" Text :> Verb 'GET 200 '[JSON] Session))) :<|> (("version" :> Verb 'GET 200 '[JSON] Version) :<|> Raw))))))))))))))))))))))))))))))))))) Source #
Servant type-level API, generated from the OpenAPI spec for OryKratos.