{- ORY Hydra Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here. OpenAPI Version: 3.0.1 ORY Hydra API version: latest Generated by OpenAPI Generator (https://openapi-generator.tech) -} {-| Module : ORYHydra.API.Admin -} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MonoLocalBinds #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} module ORYHydra.API.Admin where import ORYHydra.Core import ORYHydra.MimeTypes import ORYHydra.Model as M import qualified Data.Aeson as A import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) import qualified Data.Foldable as P import qualified Data.Map as Map import qualified Data.Maybe as P import qualified Data.Proxy as P (Proxy(..)) import qualified Data.Set as Set import qualified Data.String as P import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Encoding as TL import qualified Data.Time as TI import qualified Network.HTTP.Client.MultipartFormData as NH import qualified Network.HTTP.Media as ME import qualified Network.HTTP.Types as NH import qualified Web.FormUrlEncoded as WH import qualified Web.HttpApiData as WH import Data.Text (Text) import GHC.Base ((<|>)) import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) import qualified Prelude as P -- * Operations -- ** Admin -- *** acceptConsentRequest0 -- | @PUT \/oauth2\/auth\/requests\/consent\/accept@ -- -- Accept a Consent Request -- -- When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access resources on his/her behalf. The consent provider includes additional information, such as session data for access and ID tokens, and if the consent request should be used as basis for future requests. The response contains a redirect URL which the consent provider should redirect the user-agent to. -- acceptConsentRequest0 :: (Consumes AcceptConsentRequest0 MimeJSON) => ConsentChallenge -- ^ "consentChallenge" -> ORYHydraRequest AcceptConsentRequest0 MimeJSON CompletedRequest MimeJSON acceptConsentRequest0 (ConsentChallenge consentChallenge) = _mkRequest "PUT" ["/oauth2/auth/requests/consent/accept"] `addQuery` toQuery ("consent_challenge", Just consentChallenge) data AcceptConsentRequest0 instance HasBodyParam AcceptConsentRequest0 AcceptConsentRequest -- | @application/json@ instance Consumes AcceptConsentRequest0 MimeJSON -- | @application/json@ instance Produces AcceptConsentRequest0 MimeJSON -- *** acceptLoginRequest0 -- | @PUT \/oauth2\/auth\/requests\/login\/accept@ -- -- Accept a Login Request -- -- When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. This endpoint tells ORY Hydra that the subject has successfully authenticated and includes additional information such as the subject's ID and if ORY Hydra should remember the subject's subject agent for future authentication attempts by setting a cookie. The response contains a redirect URL which the login provider should redirect the user-agent to. -- acceptLoginRequest0 :: (Consumes AcceptLoginRequest0 MimeJSON) => LoginChallenge -- ^ "loginChallenge" -> ORYHydraRequest AcceptLoginRequest0 MimeJSON CompletedRequest MimeJSON acceptLoginRequest0 (LoginChallenge loginChallenge) = _mkRequest "PUT" ["/oauth2/auth/requests/login/accept"] `addQuery` toQuery ("login_challenge", Just loginChallenge) data AcceptLoginRequest0 instance HasBodyParam AcceptLoginRequest0 AcceptLoginRequest -- | @application/json@ instance Consumes AcceptLoginRequest0 MimeJSON -- | @application/json@ instance Produces AcceptLoginRequest0 MimeJSON -- *** acceptLogoutRequest -- | @PUT \/oauth2\/auth\/requests\/logout\/accept@ -- -- Accept a Logout Request -- -- When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm that logout request. No body is required. The response contains a redirect URL which the consent provider should redirect the user-agent to. -- acceptLogoutRequest :: LogoutChallenge -- ^ "logoutChallenge" -> ORYHydraRequest AcceptLogoutRequest MimeNoContent CompletedRequest MimeJSON acceptLogoutRequest (LogoutChallenge logoutChallenge) = _mkRequest "PUT" ["/oauth2/auth/requests/logout/accept"] `addQuery` toQuery ("logout_challenge", Just logoutChallenge) data AcceptLogoutRequest -- | @application/json@ instance Produces AcceptLogoutRequest MimeJSON -- *** createJsonWebKeySet -- | @POST \/keys\/{set}@ -- -- Generate a New JSON Web Key -- -- This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys (RS256, ECDSA). If the specified JSON Web Key Set does not exist, it will be created. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. -- createJsonWebKeySet :: (Consumes CreateJsonWebKeySet MimeJSON) => Set -- ^ "set" - The set -> ORYHydraRequest CreateJsonWebKeySet MimeJSON JSONWebKeySet MimeJSON createJsonWebKeySet (Set set) = _mkRequest "POST" ["/keys/",toPath set] data CreateJsonWebKeySet instance HasBodyParam CreateJsonWebKeySet JsonWebKeySetGeneratorRequest -- | @application/json@ instance Consumes CreateJsonWebKeySet MimeJSON -- | @application/json@ instance Produces CreateJsonWebKeySet MimeJSON -- *** createOAuth2Client -- | @POST \/clients@ -- -- Create an OAuth 2.0 Client -- -- Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -- createOAuth2Client :: (Consumes CreateOAuth2Client MimeJSON, MimeRender MimeJSON OAuth2Client) => OAuth2Client -- ^ "body" -> ORYHydraRequest CreateOAuth2Client MimeJSON OAuth2Client MimeJSON createOAuth2Client body = _mkRequest "POST" ["/clients"] `setBodyParam` body data CreateOAuth2Client instance HasBodyParam CreateOAuth2Client OAuth2Client -- | @application/json@ instance Consumes CreateOAuth2Client MimeJSON -- | @application/json@ instance Produces CreateOAuth2Client MimeJSON -- *** deleteJsonWebKey -- | @DELETE \/keys\/{set}\/{kid}@ -- -- Delete a JSON Web Key -- -- Use this endpoint to delete a single JSON Web Key. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. -- deleteJsonWebKey :: Kid -- ^ "kid" - The kid of the desired key -> Set -- ^ "set" - The set -> ORYHydraRequest DeleteJsonWebKey MimeNoContent NoContent MimeNoContent deleteJsonWebKey (Kid kid) (Set set) = _mkRequest "DELETE" ["/keys/",toPath set,"/",toPath kid] data DeleteJsonWebKey instance Produces DeleteJsonWebKey MimeNoContent -- *** deleteJsonWebKeySet -- | @DELETE \/keys\/{set}@ -- -- Delete a JSON Web Key Set -- -- Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. -- deleteJsonWebKeySet :: Set -- ^ "set" - The set -> ORYHydraRequest DeleteJsonWebKeySet MimeNoContent NoContent MimeNoContent deleteJsonWebKeySet (Set set) = _mkRequest "DELETE" ["/keys/",toPath set] data DeleteJsonWebKeySet instance Produces DeleteJsonWebKeySet MimeNoContent -- *** deleteOAuth2Client -- | @DELETE \/clients\/{id}@ -- -- Deletes an OAuth 2.0 Client -- -- Delete an existing OAuth 2.0 Client by its ID. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -- deleteOAuth2Client :: Id -- ^ "id" - The id of the OAuth 2.0 Client. -> ORYHydraRequest DeleteOAuth2Client MimeNoContent NoContent MimeNoContent deleteOAuth2Client (Id id) = _mkRequest "DELETE" ["/clients/",toPath id] data DeleteOAuth2Client instance Produces DeleteOAuth2Client MimeNoContent -- *** deleteOAuth2Token -- | @DELETE \/oauth2\/tokens@ -- -- Delete OAuth2 Access Tokens from a Client -- -- This endpoint deletes OAuth2 access tokens issued for a client from the database -- deleteOAuth2Token :: ClientId -- ^ "clientId" -> ORYHydraRequest DeleteOAuth2Token MimeNoContent NoContent MimeNoContent deleteOAuth2Token (ClientId clientId) = _mkRequest "DELETE" ["/oauth2/tokens"] `addQuery` toQuery ("client_id", Just clientId) data DeleteOAuth2Token instance Produces DeleteOAuth2Token MimeNoContent -- *** flushInactiveOAuth2Tokens -- | @POST \/oauth2\/flush@ -- -- Flush Expired OAuth2 Access Tokens -- -- This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which no tokens will be not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be flushed as they are deleted automatically when performing the refresh flow. -- flushInactiveOAuth2Tokens :: (Consumes FlushInactiveOAuth2Tokens MimeJSON) => ORYHydraRequest FlushInactiveOAuth2Tokens MimeJSON NoContent MimeNoContent flushInactiveOAuth2Tokens = _mkRequest "POST" ["/oauth2/flush"] data FlushInactiveOAuth2Tokens instance HasBodyParam FlushInactiveOAuth2Tokens FlushInactiveOAuth2TokensRequest -- | @application/json@ instance Consumes FlushInactiveOAuth2Tokens MimeJSON instance Produces FlushInactiveOAuth2Tokens MimeNoContent -- *** getConsentRequest -- | @GET \/oauth2\/auth\/requests\/consent@ -- -- Get Consent Request Information -- -- When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. -- getConsentRequest :: ConsentChallenge -- ^ "consentChallenge" -> ORYHydraRequest GetConsentRequest MimeNoContent ConsentRequest MimeJSON getConsentRequest (ConsentChallenge consentChallenge) = _mkRequest "GET" ["/oauth2/auth/requests/consent"] `addQuery` toQuery ("consent_challenge", Just consentChallenge) data GetConsentRequest -- | @application/json@ instance Produces GetConsentRequest MimeJSON -- *** getJsonWebKey -- | @GET \/keys\/{set}\/{kid}@ -- -- Fetch a JSON Web Key -- -- This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid). -- getJsonWebKey :: Kid -- ^ "kid" - The kid of the desired key -> Set -- ^ "set" - The set -> ORYHydraRequest GetJsonWebKey MimeNoContent JSONWebKeySet MimeJSON getJsonWebKey (Kid kid) (Set set) = _mkRequest "GET" ["/keys/",toPath set,"/",toPath kid] data GetJsonWebKey -- | @application/json@ instance Produces GetJsonWebKey MimeJSON -- *** getJsonWebKeySet -- | @GET \/keys\/{set}@ -- -- Retrieve a JSON Web Key Set -- -- This endpoint can be used to retrieve JWK Sets stored in ORY Hydra. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. -- getJsonWebKeySet :: Set -- ^ "set" - The set -> ORYHydraRequest GetJsonWebKeySet MimeNoContent JSONWebKeySet MimeJSON getJsonWebKeySet (Set set) = _mkRequest "GET" ["/keys/",toPath set] data GetJsonWebKeySet -- | @application/json@ instance Produces GetJsonWebKeySet MimeJSON -- *** getLoginRequest -- | @GET \/oauth2\/auth\/requests\/login@ -- -- Get a Login Request -- -- When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. -- getLoginRequest :: LoginChallenge -- ^ "loginChallenge" -> ORYHydraRequest GetLoginRequest MimeNoContent LoginRequest MimeJSON getLoginRequest (LoginChallenge loginChallenge) = _mkRequest "GET" ["/oauth2/auth/requests/login"] `addQuery` toQuery ("login_challenge", Just loginChallenge) data GetLoginRequest -- | @application/json@ instance Produces GetLoginRequest MimeJSON -- *** getLogoutRequest -- | @GET \/oauth2\/auth\/requests\/logout@ -- -- Get a Logout Request -- -- Use this endpoint to fetch a logout request. -- getLogoutRequest :: LogoutChallenge -- ^ "logoutChallenge" -> ORYHydraRequest GetLogoutRequest MimeNoContent LogoutRequest MimeJSON getLogoutRequest (LogoutChallenge logoutChallenge) = _mkRequest "GET" ["/oauth2/auth/requests/logout"] `addQuery` toQuery ("logout_challenge", Just logoutChallenge) data GetLogoutRequest -- | @application/json@ instance Produces GetLogoutRequest MimeJSON -- *** getOAuth2Client -- | @GET \/clients\/{id}@ -- -- Get an OAuth 2.0 Client. -- -- Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -- getOAuth2Client :: Id -- ^ "id" - The id of the OAuth 2.0 Client. -> ORYHydraRequest GetOAuth2Client MimeNoContent OAuth2Client MimeJSON getOAuth2Client (Id id) = _mkRequest "GET" ["/clients/",toPath id] data GetOAuth2Client -- | @application/json@ instance Produces GetOAuth2Client MimeJSON -- *** getVersion -- | @GET \/version@ -- -- Get Service Version -- -- This endpoint returns the service version typically notated using semantic versioning. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. -- getVersion :: ORYHydraRequest GetVersion MimeNoContent Version MimeJSON getVersion = _mkRequest "GET" ["/version"] data GetVersion -- | @application/json@ instance Produces GetVersion MimeJSON -- *** introspectOAuth2Token -- | @POST \/oauth2\/introspect@ -- -- Introspect OAuth2 Tokens -- -- The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. You can set additional data for a token by setting `accessTokenExtra` during the consent flow. For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-endpoint/). -- introspectOAuth2Token :: (Consumes IntrospectOAuth2Token MimeFormUrlEncoded) => Token -- ^ "token" - The string value of the token. For access tokens, this is the \\\"access_token\\\" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the \\\"refresh_token\\\" value returned. -> ORYHydraRequest IntrospectOAuth2Token MimeFormUrlEncoded OAuth2TokenIntrospection MimeJSON introspectOAuth2Token (Token token) = _mkRequest "POST" ["/oauth2/introspect"] `addForm` toForm ("token", token) data IntrospectOAuth2Token -- | /Optional Param/ "scope" - An optional, space separated list of required scopes. If the access token was not granted one of the scopes, the result of active will be false. instance HasOptionalParam IntrospectOAuth2Token Scope where applyOptionalParam req (Scope xs) = req `addForm` toForm ("scope", xs) -- | @application/x-www-form-urlencoded@ instance Consumes IntrospectOAuth2Token MimeFormUrlEncoded -- | @application/json@ instance Produces IntrospectOAuth2Token MimeJSON -- *** isInstanceAlive -- | @GET \/health\/alive@ -- -- Check Alive Status -- -- This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance. -- isInstanceAlive :: ORYHydraRequest IsInstanceAlive MimeNoContent HealthStatus MimeJSON isInstanceAlive = _mkRequest "GET" ["/health/alive"] data IsInstanceAlive -- | @application/json@ instance Produces IsInstanceAlive MimeJSON -- *** listOAuth2Clients -- | @GET \/clients@ -- -- List OAuth 2.0 Clients -- -- This endpoint lists all clients in the database, and never returns client secrets. As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. The \"Link\" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. -- listOAuth2Clients :: ORYHydraRequest ListOAuth2Clients MimeNoContent [OAuth2Client] MimeJSON listOAuth2Clients = _mkRequest "GET" ["/clients"] data ListOAuth2Clients -- | /Optional Param/ "limit" - The maximum amount of clients to returned, upper bound is 500 clients. instance HasOptionalParam ListOAuth2Clients Limit where applyOptionalParam req (Limit xs) = req `addQuery` toQuery ("limit", Just xs) -- | /Optional Param/ "offset" - The offset from where to start looking. instance HasOptionalParam ListOAuth2Clients Offset where applyOptionalParam req (Offset xs) = req `addQuery` toQuery ("offset", Just xs) -- | /Optional Param/ "client_name" - The name of the clients to filter by. instance HasOptionalParam ListOAuth2Clients ClientName where applyOptionalParam req (ClientName xs) = req `addQuery` toQuery ("client_name", Just xs) -- | /Optional Param/ "owner" - The owner of the clients to filter by. instance HasOptionalParam ListOAuth2Clients Owner where applyOptionalParam req (Owner xs) = req `addQuery` toQuery ("owner", Just xs) -- | @application/json@ instance Produces ListOAuth2Clients MimeJSON -- *** listSubjectConsentSessions -- | @GET \/oauth2\/auth\/sessions\/consent@ -- -- Lists All Consent Sessions of a Subject -- -- This endpoint lists all subject's granted consent sessions, including client and granted scope. If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an empty JSON array with status code 200 OK. The \"Link\" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. -- listSubjectConsentSessions :: Subject -- ^ "subject" -> ORYHydraRequest ListSubjectConsentSessions MimeNoContent [PreviousConsentSession] MimeJSON listSubjectConsentSessions (Subject subject) = _mkRequest "GET" ["/oauth2/auth/sessions/consent"] `addQuery` toQuery ("subject", Just subject) data ListSubjectConsentSessions -- | @application/json@ instance Produces ListSubjectConsentSessions MimeJSON -- *** patchOAuth2Client -- | @PATCH \/clients\/{id}@ -- -- Patch an OAuth 2.0 Client -- -- Patch an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -- patchOAuth2Client :: (Consumes PatchOAuth2Client MimeJSON, MimeRender MimeJSON Body) => Body -- ^ "body" -> Id -- ^ "id" -> ORYHydraRequest PatchOAuth2Client MimeJSON OAuth2Client MimeJSON patchOAuth2Client body (Id id) = _mkRequest "PATCH" ["/clients/",toPath id] `setBodyParam` body data PatchOAuth2Client instance HasBodyParam PatchOAuth2Client Body -- | @application/json@ instance Consumes PatchOAuth2Client MimeJSON -- | @application/json@ instance Produces PatchOAuth2Client MimeJSON -- *** rejectConsentRequest -- | @PUT \/oauth2\/auth\/requests\/consent\/reject@ -- -- Reject a Consent Request -- -- When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access resources on his/her behalf. The consent provider must include a reason why the consent was not granted. The response contains a redirect URL which the consent provider should redirect the user-agent to. -- rejectConsentRequest :: (Consumes RejectConsentRequest MimeJSON) => ConsentChallenge -- ^ "consentChallenge" -> ORYHydraRequest RejectConsentRequest MimeJSON CompletedRequest MimeJSON rejectConsentRequest (ConsentChallenge consentChallenge) = _mkRequest "PUT" ["/oauth2/auth/requests/consent/reject"] `addQuery` toQuery ("consent_challenge", Just consentChallenge) data RejectConsentRequest instance HasBodyParam RejectConsentRequest RejectRequest -- | @application/json@ instance Consumes RejectConsentRequest MimeJSON -- | @application/json@ instance Produces RejectConsentRequest MimeJSON -- *** rejectLoginRequest -- | @PUT \/oauth2\/auth\/requests\/login\/reject@ -- -- Reject a Login Request -- -- When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the authentication was be denied. The response contains a redirect URL which the login provider should redirect the user-agent to. -- rejectLoginRequest :: (Consumes RejectLoginRequest MimeJSON) => LoginChallenge -- ^ "loginChallenge" -> ORYHydraRequest RejectLoginRequest MimeJSON CompletedRequest MimeJSON rejectLoginRequest (LoginChallenge loginChallenge) = _mkRequest "PUT" ["/oauth2/auth/requests/login/reject"] `addQuery` toQuery ("login_challenge", Just loginChallenge) data RejectLoginRequest instance HasBodyParam RejectLoginRequest RejectRequest -- | @application/json@ instance Consumes RejectLoginRequest MimeJSON -- | @application/json@ instance Produces RejectLoginRequest MimeJSON -- *** rejectLogoutRequest -- | @PUT \/oauth2\/auth\/requests\/logout\/reject@ -- -- Reject a Logout Request -- -- When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny that logout request. No body is required. The response is empty as the logout provider has to chose what action to perform next. -- rejectLogoutRequest :: (Consumes RejectLogoutRequest contentType) => ContentType contentType -- ^ request content-type ('MimeType') -> LogoutChallenge -- ^ "logoutChallenge" -> ORYHydraRequest RejectLogoutRequest contentType NoContent MimeNoContent rejectLogoutRequest _ (LogoutChallenge logoutChallenge) = _mkRequest "PUT" ["/oauth2/auth/requests/logout/reject"] `addQuery` toQuery ("logout_challenge", Just logoutChallenge) data RejectLogoutRequest instance HasBodyParam RejectLogoutRequest RejectRequest -- | @application/json@ instance Consumes RejectLogoutRequest MimeJSON -- | @application/x-www-form-urlencoded@ instance Consumes RejectLogoutRequest MimeFormUrlEncoded instance Produces RejectLogoutRequest MimeNoContent -- *** revokeAuthenticationSession -- | @DELETE \/oauth2\/auth\/sessions\/login@ -- -- Invalidates All Login Sessions of a Certain User Invalidates a Subject's Authentication Session -- -- This endpoint invalidates a subject's authentication session. After revoking the authentication session, the subject has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work with OpenID Connect Front- or Back-channel logout. -- revokeAuthenticationSession :: Subject -- ^ "subject" -> ORYHydraRequest RevokeAuthenticationSession MimeNoContent NoContent MimeNoContent revokeAuthenticationSession (Subject subject) = _mkRequest "DELETE" ["/oauth2/auth/sessions/login"] `addQuery` toQuery ("subject", Just subject) data RevokeAuthenticationSession instance Produces RevokeAuthenticationSession MimeNoContent -- *** revokeConsentSessions -- | @DELETE \/oauth2\/auth\/sessions\/consent@ -- -- Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client -- -- This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and invalidates all associated OAuth 2.0 Access Tokens. -- revokeConsentSessions :: Subject -- ^ "subject" - The subject (Subject) who's consent sessions should be deleted. -> ORYHydraRequest RevokeConsentSessions MimeNoContent NoContent MimeNoContent revokeConsentSessions (Subject subject) = _mkRequest "DELETE" ["/oauth2/auth/sessions/consent"] `addQuery` toQuery ("subject", Just subject) data RevokeConsentSessions -- | /Optional Param/ "client" - If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID instance HasOptionalParam RevokeConsentSessions Client where applyOptionalParam req (Client xs) = req `addQuery` toQuery ("client", Just xs) -- | /Optional Param/ "all" - If set to `?all=true`, deletes all consent sessions by the Subject that have been granted. instance HasOptionalParam RevokeConsentSessions All where applyOptionalParam req (All xs) = req `addQuery` toQuery ("all", Just xs) instance Produces RevokeConsentSessions MimeNoContent -- *** updateJsonWebKey -- | @PUT \/keys\/{set}\/{kid}@ -- -- Update a JSON Web Key -- -- Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. -- updateJsonWebKey :: (Consumes UpdateJsonWebKey MimeJSON) => Kid -- ^ "kid" - The kid of the desired key -> Set -- ^ "set" - The set -> ORYHydraRequest UpdateJsonWebKey MimeJSON JSONWebKey MimeJSON updateJsonWebKey (Kid kid) (Set set) = _mkRequest "PUT" ["/keys/",toPath set,"/",toPath kid] data UpdateJsonWebKey instance HasBodyParam UpdateJsonWebKey JSONWebKey -- | @application/json@ instance Consumes UpdateJsonWebKey MimeJSON -- | @application/json@ instance Produces UpdateJsonWebKey MimeJSON -- *** updateJsonWebKeySet -- | @PUT \/keys\/{set}@ -- -- Update a JSON Web Key Set -- -- Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. -- updateJsonWebKeySet :: (Consumes UpdateJsonWebKeySet MimeJSON) => Set -- ^ "set" - The set -> ORYHydraRequest UpdateJsonWebKeySet MimeJSON JSONWebKeySet MimeJSON updateJsonWebKeySet (Set set) = _mkRequest "PUT" ["/keys/",toPath set] data UpdateJsonWebKeySet instance HasBodyParam UpdateJsonWebKeySet JSONWebKeySet -- | @application/json@ instance Consumes UpdateJsonWebKeySet MimeJSON -- | @application/json@ instance Produces UpdateJsonWebKeySet MimeJSON -- *** updateOAuth2Client -- | @PUT \/clients\/{id}@ -- -- Update an OAuth 2.0 Client -- -- Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -- updateOAuth2Client :: (Consumes UpdateOAuth2Client MimeJSON, MimeRender MimeJSON OAuth2Client) => OAuth2Client -- ^ "body" -> Id -- ^ "id" -> ORYHydraRequest UpdateOAuth2Client MimeJSON OAuth2Client MimeJSON updateOAuth2Client body (Id id) = _mkRequest "PUT" ["/clients/",toPath id] `setBodyParam` body data UpdateOAuth2Client instance HasBodyParam UpdateOAuth2Client OAuth2Client -- | @application/json@ instance Consumes UpdateOAuth2Client MimeJSON -- | @application/json@ instance Produces UpdateOAuth2Client MimeJSON