Safe Haskell | None |
---|---|
Language | Haskell2010 |
Client and Server
Synopsis
- data Config = Config {}
- data OryKratosBackend m = OryKratosBackend {
- createIdentity :: CreateIdentity -> m Identity
- createRecoveryLink :: CreateRecoveryLink -> m RecoveryLink
- deleteIdentity :: Text -> m ()
- getIdentity :: Text -> m Identity
- getSchema :: Text -> m Value
- getSelfServiceError :: Maybe Text -> m ErrorContainer
- getSelfServiceLoginFlow :: Maybe Text -> m LoginFlow
- getSelfServiceRecoveryFlow :: Maybe Text -> m RecoveryFlow
- getSelfServiceRegistrationFlow :: Maybe Text -> m RegistrationFlow
- getSelfServiceSettingsFlow :: Maybe Text -> m SettingsFlow
- getSelfServiceVerificationFlow :: Maybe Text -> m VerificationFlow
- listIdentities :: Maybe Integer -> Maybe Integer -> m [Identity]
- prometheus :: m ()
- updateIdentity :: Text -> UpdateIdentity -> m Identity
- isInstanceAlive :: m HealthStatus
- isInstanceReady :: m HealthStatus
- completeSelfServiceBrowserSettingsOIDCSettingsFlow :: m ()
- completeSelfServiceLoginFlowWithPasswordMethod :: Maybe Text -> CompleteSelfServiceLoginFlowWithPasswordMethod -> m LoginViaApiResponse
- completeSelfServiceRecoveryFlowWithLinkMethod :: Maybe Text -> Maybe Text -> CompleteSelfServiceRecoveryFlowWithLinkMethod -> m ()
- completeSelfServiceRegistrationFlowWithPasswordMethod :: Maybe Text -> Value -> m RegistrationViaApiResponse
- completeSelfServiceSettingsFlowWithPasswordMethod :: Maybe Text -> CompleteSelfServiceSettingsFlowWithPasswordMethod -> m SettingsViaApiResponse
- completeSelfServiceSettingsFlowWithProfileMethod :: Maybe Text -> Value -> m SettingsFlow
- completeSelfServiceVerificationFlowWithLinkMethod :: Maybe Text -> Maybe Text -> CompleteSelfServiceVerificationFlowWithLinkMethod -> m ()
- initializeSelfServiceBrowserLogoutFlow :: m ()
- initializeSelfServiceLoginViaAPIFlow :: Maybe Bool -> m LoginFlow
- initializeSelfServiceLoginViaBrowserFlow :: m ()
- initializeSelfServiceRecoveryViaAPIFlow :: m RecoveryFlow
- initializeSelfServiceRecoveryViaBrowserFlow :: m ()
- initializeSelfServiceRegistrationViaAPIFlow :: m RegistrationFlow
- initializeSelfServiceRegistrationViaBrowserFlow :: m ()
- initializeSelfServiceSettingsViaAPIFlow :: m SettingsFlow
- initializeSelfServiceSettingsViaBrowserFlow :: m ()
- initializeSelfServiceVerificationViaAPIFlow :: m VerificationFlow
- initializeSelfServiceVerificationViaBrowserFlow :: m ()
- revokeSession :: RevokeSession -> m ()
- whoami :: Maybe Text -> 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] ())) :<|> (("identities" :> (Capture "id" Text :> Verb 'GET 200 '[JSON] Identity)) :<|> (("schemas" :> (Capture "id" Text :> Verb 'GET 200 '[JSON] Value)) :<|> (("self-service" :> ("errors" :> (QueryParam "error" Text :> Verb 'GET 200 '[JSON] ErrorContainer))) :<|> (("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 :> Verb 'GET 200 '[JSON] SettingsFlow)))) :<|> (("self-service" :> ("verification" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] VerificationFlow)))) :<|> (("identities" :> (QueryParam "per_page" Integer :> (QueryParam "page" Integer :> Verb 'GET 200 '[JSON] [Identity]))) :<|> (("metrics" :> ("prometheus" :> Verb 'GET 200 '[JSON] ())) :<|> (("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)) :<|> (("self-service" :> ("browser" :> ("flows" :> ("registration" :> ("strategies" :> ("oidc" :> ("settings" :> ("connections" :> Verb 'POST 200 '[JSON] ())))))))) :<|> (("self-service" :> ("login" :> ("methods" :> ("password" :> (QueryParam "flow" Text :> (ReqBody '[JSON] CompleteSelfServiceLoginFlowWithPasswordMethod :> Verb 'POST 200 '[JSON] LoginViaApiResponse)))))) :<|> (("self-service" :> ("recovery" :> ("methods" :> ("link" :> (QueryParam "token" Text :> (QueryParam "flow" Text :> (ReqBody '[JSON] CompleteSelfServiceRecoveryFlowWithLinkMethod :> Verb 'POST 200 '[JSON] ()))))))) :<|> (("self-service" :> ("registration" :> ("methods" :> ("password" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] RegistrationViaApiResponse)))))) :<|> (("self-service" :> ("settings" :> ("methods" :> ("password" :> (QueryParam "flow" Text :> (ReqBody '[JSON] CompleteSelfServiceSettingsFlowWithPasswordMethod :> Verb 'POST 200 '[JSON] SettingsViaApiResponse)))))) :<|> (("self-service" :> ("settings" :> ("methods" :> ("profile" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] SettingsFlow)))))) :<|> (("self-service" :> ("verification" :> ("methods" :> ("link" :> (QueryParam "token" Text :> (QueryParam "flow" Text :> (ReqBody '[JSON] CompleteSelfServiceVerificationFlowWithLinkMethod :> Verb 'POST 200 '[JSON] ()))))))) :<|> (("self-service" :> ("browser" :> ("flows" :> ("logout" :> Verb 'GET 200 '[JSON] ())))) :<|> (("self-service" :> ("login" :> ("api" :> (QueryParam "refresh" Bool :> Verb 'GET 200 '[JSON] LoginFlow)))) :<|> (("self-service" :> ("login" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("self-service" :> ("recovery" :> ("api" :> Verb 'GET 200 '[JSON] RecoveryFlow))) :<|> (("self-service" :> ("recovery" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("self-service" :> ("registration" :> ("api" :> Verb 'GET 200 '[JSON] RegistrationFlow))) :<|> (("self-service" :> ("registration" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("self-service" :> ("settings" :> ("api" :> Verb 'GET 200 '[JSON] SettingsFlow))) :<|> (("self-service" :> ("settings" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("self-service" :> ("verification" :> ("api" :> Verb 'GET 200 '[JSON] VerificationFlow))) :<|> (("self-service" :> ("verification" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("sessions" :> (ReqBody '[JSON] RevokeSession :> Verb 'DELETE 200 '[JSON] ())) :<|> (("sessions" :> ("whoami" :> (QueryParam "Authorization" Text :> (Header "Cookie" 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.
Config | |
|
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
.
OryKratosBackend | |
|
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 (>>=) :: OryKratosClient a -> (a -> OryKratosClient b) -> OryKratosClient b # (>>) :: OryKratosClient a -> OryKratosClient b -> OryKratosClient b # return :: a -> OryKratosClient a # | |
Functor OryKratosClient Source # | |
Defined in OryKratos.API fmap :: (a -> b) -> OryKratosClient a -> OryKratosClient b # (<$) :: a -> OryKratosClient b -> OryKratosClient a # | |
Applicative OryKratosClient Source # | |
Defined in OryKratos.API 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 liftIO :: IO a -> OryKratosClient a # |
newtype OryKratosClientError Source #
Custom exception type for our errors.
Instances
Show OryKratosClientError Source # | |
Defined in OryKratos.API showsPrec :: Int -> OryKratosClientError -> ShowS # show :: OryKratosClientError -> String # showList :: [OryKratosClientError] -> ShowS # | |
Exception OryKratosClientError Source # | |
Defined in OryKratos.API |
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] ())) :<|> (("identities" :> (Capture "id" Text :> Verb 'GET 200 '[JSON] Identity)) :<|> (("schemas" :> (Capture "id" Text :> Verb 'GET 200 '[JSON] Value)) :<|> (("self-service" :> ("errors" :> (QueryParam "error" Text :> Verb 'GET 200 '[JSON] ErrorContainer))) :<|> (("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 :> Verb 'GET 200 '[JSON] SettingsFlow)))) :<|> (("self-service" :> ("verification" :> ("flows" :> (QueryParam "id" Text :> Verb 'GET 200 '[JSON] VerificationFlow)))) :<|> (("identities" :> (QueryParam "per_page" Integer :> (QueryParam "page" Integer :> Verb 'GET 200 '[JSON] [Identity]))) :<|> (("metrics" :> ("prometheus" :> Verb 'GET 200 '[JSON] ())) :<|> (("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)) :<|> (("self-service" :> ("browser" :> ("flows" :> ("registration" :> ("strategies" :> ("oidc" :> ("settings" :> ("connections" :> Verb 'POST 200 '[JSON] ())))))))) :<|> (("self-service" :> ("login" :> ("methods" :> ("password" :> (QueryParam "flow" Text :> (ReqBody '[JSON] CompleteSelfServiceLoginFlowWithPasswordMethod :> Verb 'POST 200 '[JSON] LoginViaApiResponse)))))) :<|> (("self-service" :> ("recovery" :> ("methods" :> ("link" :> (QueryParam "token" Text :> (QueryParam "flow" Text :> (ReqBody '[JSON] CompleteSelfServiceRecoveryFlowWithLinkMethod :> Verb 'POST 200 '[JSON] ()))))))) :<|> (("self-service" :> ("registration" :> ("methods" :> ("password" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] RegistrationViaApiResponse)))))) :<|> (("self-service" :> ("settings" :> ("methods" :> ("password" :> (QueryParam "flow" Text :> (ReqBody '[JSON] CompleteSelfServiceSettingsFlowWithPasswordMethod :> Verb 'POST 200 '[JSON] SettingsViaApiResponse)))))) :<|> (("self-service" :> ("settings" :> ("methods" :> ("profile" :> (QueryParam "flow" Text :> (ReqBody '[JSON] Value :> Verb 'POST 200 '[JSON] SettingsFlow)))))) :<|> (("self-service" :> ("verification" :> ("methods" :> ("link" :> (QueryParam "token" Text :> (QueryParam "flow" Text :> (ReqBody '[JSON] CompleteSelfServiceVerificationFlowWithLinkMethod :> Verb 'POST 200 '[JSON] ()))))))) :<|> (("self-service" :> ("browser" :> ("flows" :> ("logout" :> Verb 'GET 200 '[JSON] ())))) :<|> (("self-service" :> ("login" :> ("api" :> (QueryParam "refresh" Bool :> Verb 'GET 200 '[JSON] LoginFlow)))) :<|> (("self-service" :> ("login" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("self-service" :> ("recovery" :> ("api" :> Verb 'GET 200 '[JSON] RecoveryFlow))) :<|> (("self-service" :> ("recovery" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("self-service" :> ("registration" :> ("api" :> Verb 'GET 200 '[JSON] RegistrationFlow))) :<|> (("self-service" :> ("registration" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("self-service" :> ("settings" :> ("api" :> Verb 'GET 200 '[JSON] SettingsFlow))) :<|> (("self-service" :> ("settings" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("self-service" :> ("verification" :> ("api" :> Verb 'GET 200 '[JSON] VerificationFlow))) :<|> (("self-service" :> ("verification" :> ("browser" :> Verb 'GET 200 '[JSON] ()))) :<|> (("sessions" :> (ReqBody '[JSON] RevokeSession :> Verb 'DELETE 200 '[JSON] ())) :<|> (("sessions" :> ("whoami" :> (QueryParam "Authorization" Text :> (Header "Cookie" 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.