{- 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.Model -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} module ORYHydra.Model where import ORYHydra.Core import ORYHydra.MimeTypes import Data.Aeson ((.:),(.:!),(.:?),(.=)) import qualified Control.Arrow as P (left) import qualified Data.Aeson as A import qualified Data.ByteString as B import qualified Data.ByteString.Base64 as B64 import qualified Data.ByteString.Char8 as BC 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.HashMap.Lazy as HM import qualified Data.Map as Map import qualified Data.Maybe as P import qualified Data.Set as Set import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Time as TI import qualified Lens.Micro as L import qualified Web.FormUrlEncoded as WH import qualified Web.HttpApiData as WH import Control.Applicative ((<|>)) import Control.Applicative (Alternative) import Data.Function ((&)) import Data.Monoid ((<>)) import Data.Text (Text) import Prelude (($),(/=),(.),(<$>),(<*>),(>>=),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) import qualified Prelude as P -- * Parameter newtypes -- ** All newtype All = All { unAll :: Bool } deriving (P.Eq, P.Show) -- ** Client newtype Client = Client { unClient :: Text } deriving (P.Eq, P.Show) -- ** ClientId newtype ClientId = ClientId { unClientId :: Text } deriving (P.Eq, P.Show) -- ** Code newtype Code = Code { unCode :: Text } deriving (P.Eq, P.Show) -- ** ConsentChallenge newtype ConsentChallenge = ConsentChallenge { unConsentChallenge :: Text } deriving (P.Eq, P.Show) -- ** GrantType newtype GrantType = GrantType { unGrantType :: Text } deriving (P.Eq, P.Show) -- ** Id newtype Id = Id { unId :: Text } deriving (P.Eq, P.Show) -- ** Kid newtype Kid = Kid { unKid :: Text } deriving (P.Eq, P.Show) -- ** Limit newtype Limit = Limit { unLimit :: Integer } deriving (P.Eq, P.Show) -- ** LoginChallenge newtype LoginChallenge = LoginChallenge { unLoginChallenge :: Text } deriving (P.Eq, P.Show) -- ** LogoutChallenge newtype LogoutChallenge = LogoutChallenge { unLogoutChallenge :: Text } deriving (P.Eq, P.Show) -- ** Offset newtype Offset = Offset { unOffset :: Integer } deriving (P.Eq, P.Show) -- ** RedirectUri newtype RedirectUri = RedirectUri { unRedirectUri :: Text } deriving (P.Eq, P.Show) -- ** RefreshToken newtype RefreshToken = RefreshToken { unRefreshToken :: Text } deriving (P.Eq, P.Show) -- ** Scope newtype Scope = Scope { unScope :: Text } deriving (P.Eq, P.Show) -- ** Set newtype Set = Set { unSet :: Text } deriving (P.Eq, P.Show) -- ** Subject newtype Subject = Subject { unSubject :: Text } deriving (P.Eq, P.Show) -- ** Token newtype Token = Token { unToken :: Text } deriving (P.Eq, P.Show) -- * Models -- ** AcceptConsentRequest -- | AcceptConsentRequest -- The request payload used to accept a consent request. -- data AcceptConsentRequest = AcceptConsentRequest { acceptConsentRequestGrantAccessTokenAudience :: Maybe [Text] -- ^ "grant_access_token_audience" , acceptConsentRequestGrantScope :: Maybe [Text] -- ^ "grant_scope" , acceptConsentRequestHandledAt :: Maybe DateTime -- ^ "handled_at" , acceptConsentRequestRemember :: Maybe Bool -- ^ "remember" - Remember, if set to true, tells ORY Hydra to remember this consent authorization and reuse it if the same client asks the same user for the same, or a subset of, scope. , acceptConsentRequestRememberFor :: Maybe Integer -- ^ "remember_for" - RememberFor sets how long the consent authorization should be remembered for in seconds. If set to `0`, the authorization will be remembered indefinitely. , acceptConsentRequestSession :: Maybe ConsentRequestSession -- ^ "session" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON AcceptConsentRequest instance A.FromJSON AcceptConsentRequest where parseJSON = A.withObject "AcceptConsentRequest" $ \o -> AcceptConsentRequest <$> (o .:? "grant_access_token_audience") <*> (o .:? "grant_scope") <*> (o .:? "handled_at") <*> (o .:? "remember") <*> (o .:? "remember_for") <*> (o .:? "session") -- | ToJSON AcceptConsentRequest instance A.ToJSON AcceptConsentRequest where toJSON AcceptConsentRequest {..} = _omitNulls [ "grant_access_token_audience" .= acceptConsentRequestGrantAccessTokenAudience , "grant_scope" .= acceptConsentRequestGrantScope , "handled_at" .= acceptConsentRequestHandledAt , "remember" .= acceptConsentRequestRemember , "remember_for" .= acceptConsentRequestRememberFor , "session" .= acceptConsentRequestSession ] -- | Construct a value of type 'AcceptConsentRequest' (by applying it's required fields, if any) mkAcceptConsentRequest :: AcceptConsentRequest mkAcceptConsentRequest = AcceptConsentRequest { acceptConsentRequestGrantAccessTokenAudience = Nothing , acceptConsentRequestGrantScope = Nothing , acceptConsentRequestHandledAt = Nothing , acceptConsentRequestRemember = Nothing , acceptConsentRequestRememberFor = Nothing , acceptConsentRequestSession = Nothing } -- ** AcceptLoginRequest -- | AcceptLoginRequest -- HandledLoginRequest is the request payload used to accept a login request. -- data AcceptLoginRequest = AcceptLoginRequest { acceptLoginRequestAcr :: Maybe Text -- ^ "acr" - ACR sets the Authentication AuthorizationContext Class Reference value for this authentication session. You can use it to express that, for example, a user authenticated using two factor authentication. , acceptLoginRequestContext :: Maybe A.Value -- ^ "context" , acceptLoginRequestForceSubjectIdentifier :: Maybe Text -- ^ "force_subject_identifier" - ForceSubjectIdentifier forces the \"pairwise\" user ID of the end-user that authenticated. The \"pairwise\" user ID refers to the (Pairwise Identifier Algorithm)[http://openid.net/specs/openid-connect-core-1_0.html#PairwiseAlg] of the OpenID Connect specification. It allows you to set an obfuscated subject (\"user\") identifier that is unique to the client. Please note that this changes the user ID on endpoint /userinfo and sub claim of the ID Token. It does not change the sub claim in the OAuth 2.0 Introspection. Per default, ORY Hydra handles this value with its own algorithm. In case you want to set this yourself you can use this field. Please note that setting this field has no effect if `pairwise` is not configured in ORY Hydra or the OAuth 2.0 Client does not expect a pairwise identifier (set via `subject_type` key in the client's configuration). Please also be aware that ORY Hydra is unable to properly compute this value during authentication. This implies that you have to compute this value on every authentication process (probably depending on the client ID or some other unique value). If you fail to compute the proper value, then authentication processes which have id_token_hint set might fail. , acceptLoginRequestRemember :: Maybe Bool -- ^ "remember" - Remember, if set to true, tells ORY Hydra to remember this user by telling the user agent (browser) to store a cookie with authentication data. If the same user performs another OAuth 2.0 Authorization Request, he/she will not be asked to log in again. , acceptLoginRequestRememberFor :: Maybe Integer -- ^ "remember_for" - RememberFor sets how long the authentication should be remembered for in seconds. If set to `0`, the authorization will be remembered for the duration of the browser session (using a session cookie). , acceptLoginRequestSubject :: Text -- ^ /Required/ "subject" - Subject is the user ID of the end-user that authenticated. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON AcceptLoginRequest instance A.FromJSON AcceptLoginRequest where parseJSON = A.withObject "AcceptLoginRequest" $ \o -> AcceptLoginRequest <$> (o .:? "acr") <*> (o .:? "context") <*> (o .:? "force_subject_identifier") <*> (o .:? "remember") <*> (o .:? "remember_for") <*> (o .: "subject") -- | ToJSON AcceptLoginRequest instance A.ToJSON AcceptLoginRequest where toJSON AcceptLoginRequest {..} = _omitNulls [ "acr" .= acceptLoginRequestAcr , "context" .= acceptLoginRequestContext , "force_subject_identifier" .= acceptLoginRequestForceSubjectIdentifier , "remember" .= acceptLoginRequestRemember , "remember_for" .= acceptLoginRequestRememberFor , "subject" .= acceptLoginRequestSubject ] -- | Construct a value of type 'AcceptLoginRequest' (by applying it's required fields, if any) mkAcceptLoginRequest :: Text -- ^ 'acceptLoginRequestSubject': Subject is the user ID of the end-user that authenticated. -> AcceptLoginRequest mkAcceptLoginRequest acceptLoginRequestSubject = AcceptLoginRequest { acceptLoginRequestAcr = Nothing , acceptLoginRequestContext = Nothing , acceptLoginRequestForceSubjectIdentifier = Nothing , acceptLoginRequestRemember = Nothing , acceptLoginRequestRememberFor = Nothing , acceptLoginRequestSubject } -- ** CompletedRequest -- | CompletedRequest -- The response payload sent when accepting or rejecting a login or consent request. -- data CompletedRequest = CompletedRequest { completedRequestRedirectTo :: Text -- ^ /Required/ "redirect_to" - RedirectURL is the URL which you should redirect the user to once the authentication process is completed. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON CompletedRequest instance A.FromJSON CompletedRequest where parseJSON = A.withObject "CompletedRequest" $ \o -> CompletedRequest <$> (o .: "redirect_to") -- | ToJSON CompletedRequest instance A.ToJSON CompletedRequest where toJSON CompletedRequest {..} = _omitNulls [ "redirect_to" .= completedRequestRedirectTo ] -- | Construct a value of type 'CompletedRequest' (by applying it's required fields, if any) mkCompletedRequest :: Text -- ^ 'completedRequestRedirectTo': RedirectURL is the URL which you should redirect the user to once the authentication process is completed. -> CompletedRequest mkCompletedRequest completedRequestRedirectTo = CompletedRequest { completedRequestRedirectTo } -- ** ConsentRequest -- | ConsentRequest -- Contains information on an ongoing consent request. -- data ConsentRequest = ConsentRequest { consentRequestAcr :: Maybe Text -- ^ "acr" - ACR represents the Authentication AuthorizationContext Class Reference value for this authentication session. You can use it to express that, for example, a user authenticated using two factor authentication. , consentRequestChallenge :: Text -- ^ /Required/ "challenge" - ID is the identifier (\"authorization challenge\") of the consent authorization request. It is used to identify the session. , consentRequestClient :: Maybe OAuth2Client -- ^ "client" , consentRequestContext :: Maybe A.Value -- ^ "context" , consentRequestLoginChallenge :: Maybe Text -- ^ "login_challenge" - LoginChallenge is the login challenge this consent challenge belongs to. It can be used to associate a login and consent request in the login & consent app. , consentRequestLoginSessionId :: Maybe Text -- ^ "login_session_id" - LoginSessionID is the login session ID. If the user-agent reuses a login session (via cookie / remember flag) this ID will remain the same. If the user-agent did not have an existing authentication session (e.g. remember is false) this will be a new random value. This value is used as the \"sid\" parameter in the ID Token and in OIDC Front-/Back- channel logout. It's value can generally be used to associate consecutive login requests by a certain user. , consentRequestOidcContext :: Maybe OpenIDConnectContext -- ^ "oidc_context" , consentRequestRequestUrl :: Maybe Text -- ^ "request_url" - RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth 2.0 client. It is the URL which initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but might come in handy if you want to deal with additional request parameters. , consentRequestRequestedAccessTokenAudience :: Maybe [Text] -- ^ "requested_access_token_audience" , consentRequestRequestedScope :: Maybe [Text] -- ^ "requested_scope" , consentRequestSkip :: Maybe Bool -- ^ "skip" - Skip, if true, implies that the client has requested the same scopes from the same user previously. If true, you must not ask the user to grant the requested scopes. You must however either allow or deny the consent request using the usual API call. , consentRequestSubject :: Maybe Text -- ^ "subject" - Subject is the user ID of the end-user that authenticated. Now, that end user needs to grant or deny the scope requested by the OAuth 2.0 client. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ConsentRequest instance A.FromJSON ConsentRequest where parseJSON = A.withObject "ConsentRequest" $ \o -> ConsentRequest <$> (o .:? "acr") <*> (o .: "challenge") <*> (o .:? "client") <*> (o .:? "context") <*> (o .:? "login_challenge") <*> (o .:? "login_session_id") <*> (o .:? "oidc_context") <*> (o .:? "request_url") <*> (o .:? "requested_access_token_audience") <*> (o .:? "requested_scope") <*> (o .:? "skip") <*> (o .:? "subject") -- | ToJSON ConsentRequest instance A.ToJSON ConsentRequest where toJSON ConsentRequest {..} = _omitNulls [ "acr" .= consentRequestAcr , "challenge" .= consentRequestChallenge , "client" .= consentRequestClient , "context" .= consentRequestContext , "login_challenge" .= consentRequestLoginChallenge , "login_session_id" .= consentRequestLoginSessionId , "oidc_context" .= consentRequestOidcContext , "request_url" .= consentRequestRequestUrl , "requested_access_token_audience" .= consentRequestRequestedAccessTokenAudience , "requested_scope" .= consentRequestRequestedScope , "skip" .= consentRequestSkip , "subject" .= consentRequestSubject ] -- | Construct a value of type 'ConsentRequest' (by applying it's required fields, if any) mkConsentRequest :: Text -- ^ 'consentRequestChallenge': ID is the identifier (\"authorization challenge\") of the consent authorization request. It is used to identify the session. -> ConsentRequest mkConsentRequest consentRequestChallenge = ConsentRequest { consentRequestAcr = Nothing , consentRequestChallenge , consentRequestClient = Nothing , consentRequestContext = Nothing , consentRequestLoginChallenge = Nothing , consentRequestLoginSessionId = Nothing , consentRequestOidcContext = Nothing , consentRequestRequestUrl = Nothing , consentRequestRequestedAccessTokenAudience = Nothing , consentRequestRequestedScope = Nothing , consentRequestSkip = Nothing , consentRequestSubject = Nothing } -- ** ConsentRequestSession -- | ConsentRequestSession -- Used to pass session data to a consent request. -- data ConsentRequestSession = ConsentRequestSession { consentRequestSessionAccessToken :: Maybe A.Value -- ^ "access_token" - AccessToken sets session data for the access and refresh token, as well as any future tokens issued by the refresh grant. Keep in mind that this data will be available to anyone performing OAuth 2.0 Challenge Introspection. If only your services can perform OAuth 2.0 Challenge Introspection, this is usually fine. But if third parties can access that endpoint as well, sensitive data from the session might be exposed to them. Use with care! , consentRequestSessionIdToken :: Maybe A.Value -- ^ "id_token" - IDToken sets session data for the OpenID Connect ID token. Keep in mind that the session'id payloads are readable by anyone that has access to the ID Challenge. Use with care! } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ConsentRequestSession instance A.FromJSON ConsentRequestSession where parseJSON = A.withObject "ConsentRequestSession" $ \o -> ConsentRequestSession <$> (o .:? "access_token") <*> (o .:? "id_token") -- | ToJSON ConsentRequestSession instance A.ToJSON ConsentRequestSession where toJSON ConsentRequestSession {..} = _omitNulls [ "access_token" .= consentRequestSessionAccessToken , "id_token" .= consentRequestSessionIdToken ] -- | Construct a value of type 'ConsentRequestSession' (by applying it's required fields, if any) mkConsentRequestSession :: ConsentRequestSession mkConsentRequestSession = ConsentRequestSession { consentRequestSessionAccessToken = Nothing , consentRequestSessionIdToken = Nothing } -- ** ContainerWaitOKBodyError -- | ContainerWaitOKBodyError -- ContainerWaitOKBodyError container waiting error, if any data ContainerWaitOKBodyError = ContainerWaitOKBodyError { containerWaitOKBodyErrorMessage :: Maybe Text -- ^ "Message" - Details of an error } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ContainerWaitOKBodyError instance A.FromJSON ContainerWaitOKBodyError where parseJSON = A.withObject "ContainerWaitOKBodyError" $ \o -> ContainerWaitOKBodyError <$> (o .:? "Message") -- | ToJSON ContainerWaitOKBodyError instance A.ToJSON ContainerWaitOKBodyError where toJSON ContainerWaitOKBodyError {..} = _omitNulls [ "Message" .= containerWaitOKBodyErrorMessage ] -- | Construct a value of type 'ContainerWaitOKBodyError' (by applying it's required fields, if any) mkContainerWaitOKBodyError :: ContainerWaitOKBodyError mkContainerWaitOKBodyError = ContainerWaitOKBodyError { containerWaitOKBodyErrorMessage = Nothing } -- ** FlushInactiveOAuth2TokensRequest -- | FlushInactiveOAuth2TokensRequest data FlushInactiveOAuth2TokensRequest = FlushInactiveOAuth2TokensRequest { flushInactiveOAuth2TokensRequestNotAfter :: Maybe DateTime -- ^ "notAfter" - NotAfter sets after which point tokens should not be flushed. This is useful when you want to keep a history of recently issued tokens for auditing. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON FlushInactiveOAuth2TokensRequest instance A.FromJSON FlushInactiveOAuth2TokensRequest where parseJSON = A.withObject "FlushInactiveOAuth2TokensRequest" $ \o -> FlushInactiveOAuth2TokensRequest <$> (o .:? "notAfter") -- | ToJSON FlushInactiveOAuth2TokensRequest instance A.ToJSON FlushInactiveOAuth2TokensRequest where toJSON FlushInactiveOAuth2TokensRequest {..} = _omitNulls [ "notAfter" .= flushInactiveOAuth2TokensRequestNotAfter ] -- | Construct a value of type 'FlushInactiveOAuth2TokensRequest' (by applying it's required fields, if any) mkFlushInactiveOAuth2TokensRequest :: FlushInactiveOAuth2TokensRequest mkFlushInactiveOAuth2TokensRequest = FlushInactiveOAuth2TokensRequest { flushInactiveOAuth2TokensRequestNotAfter = Nothing } -- ** GenericError -- | GenericError -- Error response -- -- Error responses are sent when an error (e.g. unauthorized, bad request, ...) occurred. data GenericError = GenericError { genericErrorDebug :: Maybe Text -- ^ "debug" - Debug contains debug information. This is usually not available and has to be enabled. , genericErrorError :: Text -- ^ /Required/ "error" - Name is the error name. , genericErrorErrorDescription :: Maybe Text -- ^ "error_description" - Description contains further information on the nature of the error. , genericErrorStatusCode :: Maybe Integer -- ^ "status_code" - Code represents the error status code (404, 403, 401, ...). } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON GenericError instance A.FromJSON GenericError where parseJSON = A.withObject "GenericError" $ \o -> GenericError <$> (o .:? "debug") <*> (o .: "error") <*> (o .:? "error_description") <*> (o .:? "status_code") -- | ToJSON GenericError instance A.ToJSON GenericError where toJSON GenericError {..} = _omitNulls [ "debug" .= genericErrorDebug , "error" .= genericErrorError , "error_description" .= genericErrorErrorDescription , "status_code" .= genericErrorStatusCode ] -- | Construct a value of type 'GenericError' (by applying it's required fields, if any) mkGenericError :: Text -- ^ 'genericErrorError': Name is the error name. -> GenericError mkGenericError genericErrorError = GenericError { genericErrorDebug = Nothing , genericErrorError , genericErrorErrorDescription = Nothing , genericErrorStatusCode = Nothing } -- ** HealthNotReadyStatus -- | HealthNotReadyStatus data HealthNotReadyStatus = HealthNotReadyStatus { healthNotReadyStatusErrors :: Maybe (Map.Map String Text) -- ^ "errors" - Errors contains a list of errors that caused the not ready status. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON HealthNotReadyStatus instance A.FromJSON HealthNotReadyStatus where parseJSON = A.withObject "HealthNotReadyStatus" $ \o -> HealthNotReadyStatus <$> (o .:? "errors") -- | ToJSON HealthNotReadyStatus instance A.ToJSON HealthNotReadyStatus where toJSON HealthNotReadyStatus {..} = _omitNulls [ "errors" .= healthNotReadyStatusErrors ] -- | Construct a value of type 'HealthNotReadyStatus' (by applying it's required fields, if any) mkHealthNotReadyStatus :: HealthNotReadyStatus mkHealthNotReadyStatus = HealthNotReadyStatus { healthNotReadyStatusErrors = Nothing } -- ** HealthStatus -- | HealthStatus data HealthStatus = HealthStatus { healthStatusStatus :: Maybe Text -- ^ "status" - Status always contains \"ok\". } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON HealthStatus instance A.FromJSON HealthStatus where parseJSON = A.withObject "HealthStatus" $ \o -> HealthStatus <$> (o .:? "status") -- | ToJSON HealthStatus instance A.ToJSON HealthStatus where toJSON HealthStatus {..} = _omitNulls [ "status" .= healthStatusStatus ] -- | Construct a value of type 'HealthStatus' (by applying it's required fields, if any) mkHealthStatus :: HealthStatus mkHealthStatus = HealthStatus { healthStatusStatus = Nothing } -- ** JSONWebKey -- | JSONWebKey -- It is important that this model object is named JSONWebKey for \"swagger generate spec\" to generate only on definition of a JSONWebKey. data JSONWebKey = JSONWebKey { jSONWebKeyAlg :: Text -- ^ /Required/ "alg" - The \"alg\" (algorithm) parameter identifies the algorithm intended for use with the key. The values used should either be registered in the IANA \"JSON Web Signature and Encryption Algorithms\" registry established by [JWA] or be a value that contains a Collision- Resistant Name. , jSONWebKeyCrv :: Maybe Text -- ^ "crv" , jSONWebKeyD :: Maybe Text -- ^ "d" , jSONWebKeyDp :: Maybe Text -- ^ "dp" , jSONWebKeyDq :: Maybe Text -- ^ "dq" , jSONWebKeyE :: Maybe Text -- ^ "e" , jSONWebKeyK :: Maybe Text -- ^ "k" , jSONWebKeyKid :: Text -- ^ /Required/ "kid" - The \"kid\" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover. The structure of the \"kid\" value is unspecified. When \"kid\" values are used within a JWK Set, different keys within the JWK Set SHOULD use distinct \"kid\" values. (One example in which different keys might use the same \"kid\" value is if they have different \"kty\" (key type) values but are considered to be equivalent alternatives by the application using them.) The \"kid\" value is a case-sensitive string. , jSONWebKeyKty :: Text -- ^ /Required/ "kty" - The \"kty\" (key type) parameter identifies the cryptographic algorithm family used with the key, such as \"RSA\" or \"EC\". \"kty\" values should either be registered in the IANA \"JSON Web Key Types\" registry established by [JWA] or be a value that contains a Collision- Resistant Name. The \"kty\" value is a case-sensitive string. , jSONWebKeyN :: Maybe Text -- ^ "n" , jSONWebKeyP :: Maybe Text -- ^ "p" , jSONWebKeyQ :: Maybe Text -- ^ "q" , jSONWebKeyQi :: Maybe Text -- ^ "qi" , jSONWebKeyUse :: Text -- ^ /Required/ "use" - Use (\"public key use\") identifies the intended use of the public key. The \"use\" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Values are commonly \"sig\" (signature) or \"enc\" (encryption). , jSONWebKeyX :: Maybe Text -- ^ "x" , jSONWebKeyX5c :: Maybe [Text] -- ^ "x5c" - The \"x5c\" (X.509 certificate chain) parameter contains a chain of one or more PKIX certificates [RFC5280]. The certificate chain is represented as a JSON array of certificate value strings. Each string in the array is a base64-encoded (Section 4 of [RFC4648] -- not base64url-encoded) DER [ITU.X690.1994] PKIX certificate value. The PKIX certificate containing the key value MUST be the first certificate. , jSONWebKeyY :: Maybe Text -- ^ "y" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON JSONWebKey instance A.FromJSON JSONWebKey where parseJSON = A.withObject "JSONWebKey" $ \o -> JSONWebKey <$> (o .: "alg") <*> (o .:? "crv") <*> (o .:? "d") <*> (o .:? "dp") <*> (o .:? "dq") <*> (o .:? "e") <*> (o .:? "k") <*> (o .: "kid") <*> (o .: "kty") <*> (o .:? "n") <*> (o .:? "p") <*> (o .:? "q") <*> (o .:? "qi") <*> (o .: "use") <*> (o .:? "x") <*> (o .:? "x5c") <*> (o .:? "y") -- | ToJSON JSONWebKey instance A.ToJSON JSONWebKey where toJSON JSONWebKey {..} = _omitNulls [ "alg" .= jSONWebKeyAlg , "crv" .= jSONWebKeyCrv , "d" .= jSONWebKeyD , "dp" .= jSONWebKeyDp , "dq" .= jSONWebKeyDq , "e" .= jSONWebKeyE , "k" .= jSONWebKeyK , "kid" .= jSONWebKeyKid , "kty" .= jSONWebKeyKty , "n" .= jSONWebKeyN , "p" .= jSONWebKeyP , "q" .= jSONWebKeyQ , "qi" .= jSONWebKeyQi , "use" .= jSONWebKeyUse , "x" .= jSONWebKeyX , "x5c" .= jSONWebKeyX5c , "y" .= jSONWebKeyY ] -- | Construct a value of type 'JSONWebKey' (by applying it's required fields, if any) mkJSONWebKey :: Text -- ^ 'jSONWebKeyAlg': The \"alg\" (algorithm) parameter identifies the algorithm intended for use with the key. The values used should either be registered in the IANA \"JSON Web Signature and Encryption Algorithms\" registry established by [JWA] or be a value that contains a Collision- Resistant Name. -> Text -- ^ 'jSONWebKeyKid': The \"kid\" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover. The structure of the \"kid\" value is unspecified. When \"kid\" values are used within a JWK Set, different keys within the JWK Set SHOULD use distinct \"kid\" values. (One example in which different keys might use the same \"kid\" value is if they have different \"kty\" (key type) values but are considered to be equivalent alternatives by the application using them.) The \"kid\" value is a case-sensitive string. -> Text -- ^ 'jSONWebKeyKty': The \"kty\" (key type) parameter identifies the cryptographic algorithm family used with the key, such as \"RSA\" or \"EC\". \"kty\" values should either be registered in the IANA \"JSON Web Key Types\" registry established by [JWA] or be a value that contains a Collision- Resistant Name. The \"kty\" value is a case-sensitive string. -> Text -- ^ 'jSONWebKeyUse': Use (\"public key use\") identifies the intended use of the public key. The \"use\" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Values are commonly \"sig\" (signature) or \"enc\" (encryption). -> JSONWebKey mkJSONWebKey jSONWebKeyAlg jSONWebKeyKid jSONWebKeyKty jSONWebKeyUse = JSONWebKey { jSONWebKeyAlg , jSONWebKeyCrv = Nothing , jSONWebKeyD = Nothing , jSONWebKeyDp = Nothing , jSONWebKeyDq = Nothing , jSONWebKeyE = Nothing , jSONWebKeyK = Nothing , jSONWebKeyKid , jSONWebKeyKty , jSONWebKeyN = Nothing , jSONWebKeyP = Nothing , jSONWebKeyQ = Nothing , jSONWebKeyQi = Nothing , jSONWebKeyUse , jSONWebKeyX = Nothing , jSONWebKeyX5c = Nothing , jSONWebKeyY = Nothing } -- ** JSONWebKeySet -- | JSONWebKeySet -- It is important that this model object is named JSONWebKeySet for \"swagger generate spec\" to generate only on definition of a JSONWebKeySet. Since one with the same name is previously defined as client.Client.JSONWebKeys and this one is last, this one will be effectively written in the swagger spec. data JSONWebKeySet = JSONWebKeySet { jSONWebKeySetKeys :: Maybe [JSONWebKey] -- ^ "keys" - The value of the \"keys\" parameter is an array of JWK values. By default, the order of the JWK values within the array does not imply an order of preference among them, although applications of JWK Sets can choose to assign a meaning to the order for their purposes, if desired. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON JSONWebKeySet instance A.FromJSON JSONWebKeySet where parseJSON = A.withObject "JSONWebKeySet" $ \o -> JSONWebKeySet <$> (o .:? "keys") -- | ToJSON JSONWebKeySet instance A.ToJSON JSONWebKeySet where toJSON JSONWebKeySet {..} = _omitNulls [ "keys" .= jSONWebKeySetKeys ] -- | Construct a value of type 'JSONWebKeySet' (by applying it's required fields, if any) mkJSONWebKeySet :: JSONWebKeySet mkJSONWebKeySet = JSONWebKeySet { jSONWebKeySetKeys = Nothing } -- ** JsonWebKeySetGeneratorRequest -- | JsonWebKeySetGeneratorRequest data JsonWebKeySetGeneratorRequest = JsonWebKeySetGeneratorRequest { jsonWebKeySetGeneratorRequestAlg :: Text -- ^ /Required/ "alg" - The algorithm to be used for creating the key. Supports \"RS256\", \"ES512\", \"HS512\", and \"HS256\" , jsonWebKeySetGeneratorRequestKid :: Text -- ^ /Required/ "kid" - The kid of the key to be created , jsonWebKeySetGeneratorRequestUse :: Text -- ^ /Required/ "use" - The \"use\" (public key use) parameter identifies the intended use of the public key. The \"use\" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Valid values are \"enc\" and \"sig\". } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON JsonWebKeySetGeneratorRequest instance A.FromJSON JsonWebKeySetGeneratorRequest where parseJSON = A.withObject "JsonWebKeySetGeneratorRequest" $ \o -> JsonWebKeySetGeneratorRequest <$> (o .: "alg") <*> (o .: "kid") <*> (o .: "use") -- | ToJSON JsonWebKeySetGeneratorRequest instance A.ToJSON JsonWebKeySetGeneratorRequest where toJSON JsonWebKeySetGeneratorRequest {..} = _omitNulls [ "alg" .= jsonWebKeySetGeneratorRequestAlg , "kid" .= jsonWebKeySetGeneratorRequestKid , "use" .= jsonWebKeySetGeneratorRequestUse ] -- | Construct a value of type 'JsonWebKeySetGeneratorRequest' (by applying it's required fields, if any) mkJsonWebKeySetGeneratorRequest :: Text -- ^ 'jsonWebKeySetGeneratorRequestAlg': The algorithm to be used for creating the key. Supports \"RS256\", \"ES512\", \"HS512\", and \"HS256\" -> Text -- ^ 'jsonWebKeySetGeneratorRequestKid': The kid of the key to be created -> Text -- ^ 'jsonWebKeySetGeneratorRequestUse': The \"use\" (public key use) parameter identifies the intended use of the public key. The \"use\" parameter is employed to indicate whether a public key is used for encrypting data or verifying the signature on data. Valid values are \"enc\" and \"sig\". -> JsonWebKeySetGeneratorRequest mkJsonWebKeySetGeneratorRequest jsonWebKeySetGeneratorRequestAlg jsonWebKeySetGeneratorRequestKid jsonWebKeySetGeneratorRequestUse = JsonWebKeySetGeneratorRequest { jsonWebKeySetGeneratorRequestAlg , jsonWebKeySetGeneratorRequestKid , jsonWebKeySetGeneratorRequestUse } -- ** LoginRequest -- | LoginRequest -- Contains information on an ongoing login request. -- data LoginRequest = LoginRequest { loginRequestChallenge :: Text -- ^ /Required/ "challenge" - ID is the identifier (\"login challenge\") of the login request. It is used to identify the session. , loginRequestClient :: OAuth2Client -- ^ /Required/ "client" , loginRequestOidcContext :: Maybe OpenIDConnectContext -- ^ "oidc_context" , loginRequestRequestUrl :: Text -- ^ /Required/ "request_url" - RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth 2.0 client. It is the URL which initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but might come in handy if you want to deal with additional request parameters. , loginRequestRequestedAccessTokenAudience :: [Text] -- ^ /Required/ "requested_access_token_audience" , loginRequestRequestedScope :: [Text] -- ^ /Required/ "requested_scope" , loginRequestSessionId :: Maybe Text -- ^ "session_id" - SessionID is the login session ID. If the user-agent reuses a login session (via cookie / remember flag) this ID will remain the same. If the user-agent did not have an existing authentication session (e.g. remember is false) this will be a new random value. This value is used as the \"sid\" parameter in the ID Token and in OIDC Front-/Back- channel logout. It's value can generally be used to associate consecutive login requests by a certain user. , loginRequestSkip :: Bool -- ^ /Required/ "skip" - Skip, if true, implies that the client has requested the same scopes from the same user previously. If true, you can skip asking the user to grant the requested scopes, and simply forward the user to the redirect URL. This feature allows you to update / set session information. , loginRequestSubject :: Text -- ^ /Required/ "subject" - Subject is the user ID of the end-user that authenticated. Now, that end user needs to grant or deny the scope requested by the OAuth 2.0 client. If this value is set and `skip` is true, you MUST include this subject type when accepting the login request, or the request will fail. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON LoginRequest instance A.FromJSON LoginRequest where parseJSON = A.withObject "LoginRequest" $ \o -> LoginRequest <$> (o .: "challenge") <*> (o .: "client") <*> (o .:? "oidc_context") <*> (o .: "request_url") <*> (o .: "requested_access_token_audience") <*> (o .: "requested_scope") <*> (o .:? "session_id") <*> (o .: "skip") <*> (o .: "subject") -- | ToJSON LoginRequest instance A.ToJSON LoginRequest where toJSON LoginRequest {..} = _omitNulls [ "challenge" .= loginRequestChallenge , "client" .= loginRequestClient , "oidc_context" .= loginRequestOidcContext , "request_url" .= loginRequestRequestUrl , "requested_access_token_audience" .= loginRequestRequestedAccessTokenAudience , "requested_scope" .= loginRequestRequestedScope , "session_id" .= loginRequestSessionId , "skip" .= loginRequestSkip , "subject" .= loginRequestSubject ] -- | Construct a value of type 'LoginRequest' (by applying it's required fields, if any) mkLoginRequest :: Text -- ^ 'loginRequestChallenge': ID is the identifier (\"login challenge\") of the login request. It is used to identify the session. -> OAuth2Client -- ^ 'loginRequestClient' -> Text -- ^ 'loginRequestRequestUrl': RequestURL is the original OAuth 2.0 Authorization URL requested by the OAuth 2.0 client. It is the URL which initiates the OAuth 2.0 Authorization Code or OAuth 2.0 Implicit flow. This URL is typically not needed, but might come in handy if you want to deal with additional request parameters. -> [Text] -- ^ 'loginRequestRequestedAccessTokenAudience' -> [Text] -- ^ 'loginRequestRequestedScope' -> Bool -- ^ 'loginRequestSkip': Skip, if true, implies that the client has requested the same scopes from the same user previously. If true, you can skip asking the user to grant the requested scopes, and simply forward the user to the redirect URL. This feature allows you to update / set session information. -> Text -- ^ 'loginRequestSubject': Subject is the user ID of the end-user that authenticated. Now, that end user needs to grant or deny the scope requested by the OAuth 2.0 client. If this value is set and `skip` is true, you MUST include this subject type when accepting the login request, or the request will fail. -> LoginRequest mkLoginRequest loginRequestChallenge loginRequestClient loginRequestRequestUrl loginRequestRequestedAccessTokenAudience loginRequestRequestedScope loginRequestSkip loginRequestSubject = LoginRequest { loginRequestChallenge , loginRequestClient , loginRequestOidcContext = Nothing , loginRequestRequestUrl , loginRequestRequestedAccessTokenAudience , loginRequestRequestedScope , loginRequestSessionId = Nothing , loginRequestSkip , loginRequestSubject } -- ** LogoutRequest -- | LogoutRequest -- Contains information about an ongoing logout request. -- data LogoutRequest = LogoutRequest { logoutRequestRequestUrl :: Maybe Text -- ^ "request_url" - RequestURL is the original Logout URL requested. , logoutRequestRpInitiated :: Maybe Bool -- ^ "rp_initiated" - RPInitiated is set to true if the request was initiated by a Relying Party (RP), also known as an OAuth 2.0 Client. , logoutRequestSid :: Maybe Text -- ^ "sid" - SessionID is the login session ID that was requested to log out. , logoutRequestSubject :: Maybe Text -- ^ "subject" - Subject is the user for whom the logout was request. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON LogoutRequest instance A.FromJSON LogoutRequest where parseJSON = A.withObject "LogoutRequest" $ \o -> LogoutRequest <$> (o .:? "request_url") <*> (o .:? "rp_initiated") <*> (o .:? "sid") <*> (o .:? "subject") -- | ToJSON LogoutRequest instance A.ToJSON LogoutRequest where toJSON LogoutRequest {..} = _omitNulls [ "request_url" .= logoutRequestRequestUrl , "rp_initiated" .= logoutRequestRpInitiated , "sid" .= logoutRequestSid , "subject" .= logoutRequestSubject ] -- | Construct a value of type 'LogoutRequest' (by applying it's required fields, if any) mkLogoutRequest :: LogoutRequest mkLogoutRequest = LogoutRequest { logoutRequestRequestUrl = Nothing , logoutRequestRpInitiated = Nothing , logoutRequestSid = Nothing , logoutRequestSubject = Nothing } -- ** OAuth2Client -- | OAuth2Client -- Client represents an OAuth 2.0 Client. -- data OAuth2Client = OAuth2Client { oAuth2ClientAllowedCorsOrigins :: Maybe [Text] -- ^ "allowed_cors_origins" , oAuth2ClientAudience :: Maybe [Text] -- ^ "audience" , oAuth2ClientBackchannelLogoutSessionRequired :: Maybe Bool -- ^ "backchannel_logout_session_required" - Boolean value specifying whether the RP requires that a sid (session ID) Claim be included in the Logout Token to identify the RP session with the OP when the backchannel_logout_uri is used. If omitted, the default value is false. , oAuth2ClientBackchannelLogoutUri :: Maybe Text -- ^ "backchannel_logout_uri" - RP URL that will cause the RP to log itself out when sent a Logout Token by the OP. , oAuth2ClientClientId :: Maybe Text -- ^ "client_id" - ID is the id for this client. , oAuth2ClientClientName :: Maybe Text -- ^ "client_name" - Name is the human-readable string name of the client to be presented to the end-user during authorization. , oAuth2ClientClientSecret :: Maybe Text -- ^ "client_secret" - Secret is the client's secret. The secret will be included in the create request as cleartext, and then never again. The secret is stored using BCrypt so it is impossible to recover it. Tell your users that they need to write the secret down as it will not be made available again. , oAuth2ClientClientSecretExpiresAt :: Maybe Integer -- ^ "client_secret_expires_at" - SecretExpiresAt is an integer holding the time at which the client secret will expire or 0 if it will not expire. The time is represented as the number of seconds from 1970-01-01T00:00:00Z as measured in UTC until the date/time of expiration. This feature is currently not supported and it's value will always be set to 0. , oAuth2ClientClientUri :: Maybe Text -- ^ "client_uri" - ClientURI is an URL string of a web page providing information about the client. If present, the server SHOULD display this URL to the end-user in a clickable fashion. , oAuth2ClientContacts :: Maybe [Text] -- ^ "contacts" , oAuth2ClientCreatedAt :: Maybe DateTime -- ^ "created_at" - CreatedAt returns the timestamp of the client's creation. , oAuth2ClientFrontchannelLogoutSessionRequired :: Maybe Bool -- ^ "frontchannel_logout_session_required" - Boolean value specifying whether the RP requires that iss (issuer) and sid (session ID) query parameters be included to identify the RP session with the OP when the frontchannel_logout_uri is used. If omitted, the default value is false. , oAuth2ClientFrontchannelLogoutUri :: Maybe Text -- ^ "frontchannel_logout_uri" - RP URL that will cause the RP to log itself out when rendered in an iframe by the OP. An iss (issuer) query parameter and a sid (session ID) query parameter MAY be included by the OP to enable the RP to validate the request and to determine which of the potentially multiple sessions is to be logged out; if either is included, both MUST be. , oAuth2ClientGrantTypes :: Maybe [Text] -- ^ "grant_types" , oAuth2ClientJwks :: Maybe A.Value -- ^ "jwks" , oAuth2ClientJwksUri :: Maybe Text -- ^ "jwks_uri" - URL for the Client's JSON Web Key Set [JWK] document. If the Client signs requests to the Server, it contains the signing key(s) the Server uses to validate signatures from the Client. The JWK Set MAY also contain the Client's encryption keys(s), which are used by the Server to encrypt responses to the Client. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key's intended usage. Although some algorithms allow the same key to be used for both signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. , oAuth2ClientLogoUri :: Maybe Text -- ^ "logo_uri" - LogoURI is an URL string that references a logo for the client. , oAuth2ClientMetadata :: Maybe A.Value -- ^ "metadata" , oAuth2ClientOwner :: Maybe Text -- ^ "owner" - Owner is a string identifying the owner of the OAuth 2.0 Client. , oAuth2ClientPolicyUri :: Maybe Text -- ^ "policy_uri" - PolicyURI is a URL string that points to a human-readable privacy policy document that describes how the deployment organization collects, uses, retains, and discloses personal data. , oAuth2ClientPostLogoutRedirectUris :: Maybe [Text] -- ^ "post_logout_redirect_uris" , oAuth2ClientRedirectUris :: Maybe [Text] -- ^ "redirect_uris" , oAuth2ClientRequestObjectSigningAlg :: Maybe Text -- ^ "request_object_signing_alg" - JWS [JWS] alg algorithm [JWA] that MUST be used for signing Request Objects sent to the OP. All Request Objects from this Client MUST be rejected, if not signed with this algorithm. , oAuth2ClientRequestUris :: Maybe [Text] -- ^ "request_uris" , oAuth2ClientResponseTypes :: Maybe [Text] -- ^ "response_types" , oAuth2ClientScope :: Maybe Text -- ^ "scope" - Scope is a string containing a space-separated list of scope values (as described in Section 3.3 of OAuth 2.0 [RFC6749]) that the client can use when requesting access tokens. , oAuth2ClientSectorIdentifierUri :: Maybe Text -- ^ "sector_identifier_uri" - URL using the https scheme to be used in calculating Pseudonymous Identifiers by the OP. The URL references a file with a single JSON array of redirect_uri values. , oAuth2ClientSubjectType :: Maybe Text -- ^ "subject_type" - SubjectType requested for responses to this Client. The subject_types_supported Discovery parameter contains a list of the supported subject_type values for this server. Valid types include `pairwise` and `public`. , oAuth2ClientTokenEndpointAuthMethod :: Maybe Text -- ^ "token_endpoint_auth_method" - Requested Client Authentication method for the Token Endpoint. The options are client_secret_post, client_secret_basic, private_key_jwt, and none. , oAuth2ClientTokenEndpointAuthSigningAlg :: Maybe Text -- ^ "token_endpoint_auth_signing_alg" - Requested Client Authentication signing algorithm for the Token Endpoint. , oAuth2ClientTosUri :: Maybe Text -- ^ "tos_uri" - TermsOfServiceURI is a URL string that points to a human-readable terms of service document for the client that describes a contractual relationship between the end-user and the client that the end-user accepts when authorizing the client. , oAuth2ClientUpdatedAt :: Maybe DateTime -- ^ "updated_at" - UpdatedAt returns the timestamp of the last update. , oAuth2ClientUserinfoSignedResponseAlg :: Maybe Text -- ^ "userinfo_signed_response_alg" - JWS alg algorithm [JWA] REQUIRED for signing UserInfo Responses. If this is specified, the response will be JWT [JWT] serialized, and signed using JWS. The default, if omitted, is for the UserInfo Response to return the Claims as a UTF-8 encoded JSON object using the application/json content-type. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON OAuth2Client instance A.FromJSON OAuth2Client where parseJSON = A.withObject "OAuth2Client" $ \o -> OAuth2Client <$> (o .:? "allowed_cors_origins") <*> (o .:? "audience") <*> (o .:? "backchannel_logout_session_required") <*> (o .:? "backchannel_logout_uri") <*> (o .:? "client_id") <*> (o .:? "client_name") <*> (o .:? "client_secret") <*> (o .:? "client_secret_expires_at") <*> (o .:? "client_uri") <*> (o .:? "contacts") <*> (o .:? "created_at") <*> (o .:? "frontchannel_logout_session_required") <*> (o .:? "frontchannel_logout_uri") <*> (o .:? "grant_types") <*> (o .:? "jwks") <*> (o .:? "jwks_uri") <*> (o .:? "logo_uri") <*> (o .:? "metadata") <*> (o .:? "owner") <*> (o .:? "policy_uri") <*> (o .:? "post_logout_redirect_uris") <*> (o .:? "redirect_uris") <*> (o .:? "request_object_signing_alg") <*> (o .:? "request_uris") <*> (o .:? "response_types") <*> (o .:? "scope") <*> (o .:? "sector_identifier_uri") <*> (o .:? "subject_type") <*> (o .:? "token_endpoint_auth_method") <*> (o .:? "token_endpoint_auth_signing_alg") <*> (o .:? "tos_uri") <*> (o .:? "updated_at") <*> (o .:? "userinfo_signed_response_alg") -- | ToJSON OAuth2Client instance A.ToJSON OAuth2Client where toJSON OAuth2Client {..} = _omitNulls [ "allowed_cors_origins" .= oAuth2ClientAllowedCorsOrigins , "audience" .= oAuth2ClientAudience , "backchannel_logout_session_required" .= oAuth2ClientBackchannelLogoutSessionRequired , "backchannel_logout_uri" .= oAuth2ClientBackchannelLogoutUri , "client_id" .= oAuth2ClientClientId , "client_name" .= oAuth2ClientClientName , "client_secret" .= oAuth2ClientClientSecret , "client_secret_expires_at" .= oAuth2ClientClientSecretExpiresAt , "client_uri" .= oAuth2ClientClientUri , "contacts" .= oAuth2ClientContacts , "created_at" .= oAuth2ClientCreatedAt , "frontchannel_logout_session_required" .= oAuth2ClientFrontchannelLogoutSessionRequired , "frontchannel_logout_uri" .= oAuth2ClientFrontchannelLogoutUri , "grant_types" .= oAuth2ClientGrantTypes , "jwks" .= oAuth2ClientJwks , "jwks_uri" .= oAuth2ClientJwksUri , "logo_uri" .= oAuth2ClientLogoUri , "metadata" .= oAuth2ClientMetadata , "owner" .= oAuth2ClientOwner , "policy_uri" .= oAuth2ClientPolicyUri , "post_logout_redirect_uris" .= oAuth2ClientPostLogoutRedirectUris , "redirect_uris" .= oAuth2ClientRedirectUris , "request_object_signing_alg" .= oAuth2ClientRequestObjectSigningAlg , "request_uris" .= oAuth2ClientRequestUris , "response_types" .= oAuth2ClientResponseTypes , "scope" .= oAuth2ClientScope , "sector_identifier_uri" .= oAuth2ClientSectorIdentifierUri , "subject_type" .= oAuth2ClientSubjectType , "token_endpoint_auth_method" .= oAuth2ClientTokenEndpointAuthMethod , "token_endpoint_auth_signing_alg" .= oAuth2ClientTokenEndpointAuthSigningAlg , "tos_uri" .= oAuth2ClientTosUri , "updated_at" .= oAuth2ClientUpdatedAt , "userinfo_signed_response_alg" .= oAuth2ClientUserinfoSignedResponseAlg ] -- | Construct a value of type 'OAuth2Client' (by applying it's required fields, if any) mkOAuth2Client :: OAuth2Client mkOAuth2Client = OAuth2Client { oAuth2ClientAllowedCorsOrigins = Nothing , oAuth2ClientAudience = Nothing , oAuth2ClientBackchannelLogoutSessionRequired = Nothing , oAuth2ClientBackchannelLogoutUri = Nothing , oAuth2ClientClientId = Nothing , oAuth2ClientClientName = Nothing , oAuth2ClientClientSecret = Nothing , oAuth2ClientClientSecretExpiresAt = Nothing , oAuth2ClientClientUri = Nothing , oAuth2ClientContacts = Nothing , oAuth2ClientCreatedAt = Nothing , oAuth2ClientFrontchannelLogoutSessionRequired = Nothing , oAuth2ClientFrontchannelLogoutUri = Nothing , oAuth2ClientGrantTypes = Nothing , oAuth2ClientJwks = Nothing , oAuth2ClientJwksUri = Nothing , oAuth2ClientLogoUri = Nothing , oAuth2ClientMetadata = Nothing , oAuth2ClientOwner = Nothing , oAuth2ClientPolicyUri = Nothing , oAuth2ClientPostLogoutRedirectUris = Nothing , oAuth2ClientRedirectUris = Nothing , oAuth2ClientRequestObjectSigningAlg = Nothing , oAuth2ClientRequestUris = Nothing , oAuth2ClientResponseTypes = Nothing , oAuth2ClientScope = Nothing , oAuth2ClientSectorIdentifierUri = Nothing , oAuth2ClientSubjectType = Nothing , oAuth2ClientTokenEndpointAuthMethod = Nothing , oAuth2ClientTokenEndpointAuthSigningAlg = Nothing , oAuth2ClientTosUri = Nothing , oAuth2ClientUpdatedAt = Nothing , oAuth2ClientUserinfoSignedResponseAlg = Nothing } -- ** OAuth2TokenIntrospection -- | OAuth2TokenIntrospection -- Introspection contains an access token's session data as specified by IETF RFC 7662, see: -- -- https://tools.ietf.org/html/rfc7662 data OAuth2TokenIntrospection = OAuth2TokenIntrospection { oAuth2TokenIntrospectionActive :: Bool -- ^ /Required/ "active" - Active is a boolean indicator of whether or not the presented token is currently active. The specifics of a token's \"active\" state will vary depending on the implementation of the authorization server and the information it keeps about its tokens, but a \"true\" value return for the \"active\" property will generally indicate that a given token has been issued by this authorization server, has not been revoked by the resource owner, and is within its given time window of validity (e.g., after its issuance time and before its expiration time). , oAuth2TokenIntrospectionAud :: Maybe [Text] -- ^ "aud" - Audience contains a list of the token's intended audiences. , oAuth2TokenIntrospectionClientId :: Maybe Text -- ^ "client_id" - ID is aclient identifier for the OAuth 2.0 client that requested this token. , oAuth2TokenIntrospectionExp :: Maybe Integer -- ^ "exp" - Expires at is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire. , oAuth2TokenIntrospectionExt :: Maybe A.Value -- ^ "ext" - Extra is arbitrary data set by the session. , oAuth2TokenIntrospectionIat :: Maybe Integer -- ^ "iat" - Issued at is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token was originally issued. , oAuth2TokenIntrospectionIss :: Maybe Text -- ^ "iss" - IssuerURL is a string representing the issuer of this token , oAuth2TokenIntrospectionNbf :: Maybe Integer -- ^ "nbf" - NotBefore is an integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token is not to be used before. , oAuth2TokenIntrospectionObfuscatedSubject :: Maybe Text -- ^ "obfuscated_subject" - ObfuscatedSubject is set when the subject identifier algorithm was set to \"pairwise\" during authorization. It is the `sub` value of the ID Token that was issued. , oAuth2TokenIntrospectionScope :: Maybe Text -- ^ "scope" - Scope is a JSON string containing a space-separated list of scopes associated with this token. , oAuth2TokenIntrospectionSub :: Maybe Text -- ^ "sub" - Subject of the token, as defined in JWT [RFC7519]. Usually a machine-readable identifier of the resource owner who authorized this token. , oAuth2TokenIntrospectionTokenType :: Maybe Text -- ^ "token_type" - TokenType is the introspected token's type, typically `Bearer`. , oAuth2TokenIntrospectionTokenUse :: Maybe Text -- ^ "token_use" - TokenUse is the introspected token's use, for example `access_token` or `refresh_token`. , oAuth2TokenIntrospectionUsername :: Maybe Text -- ^ "username" - Username is a human-readable identifier for the resource owner who authorized this token. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON OAuth2TokenIntrospection instance A.FromJSON OAuth2TokenIntrospection where parseJSON = A.withObject "OAuth2TokenIntrospection" $ \o -> OAuth2TokenIntrospection <$> (o .: "active") <*> (o .:? "aud") <*> (o .:? "client_id") <*> (o .:? "exp") <*> (o .:? "ext") <*> (o .:? "iat") <*> (o .:? "iss") <*> (o .:? "nbf") <*> (o .:? "obfuscated_subject") <*> (o .:? "scope") <*> (o .:? "sub") <*> (o .:? "token_type") <*> (o .:? "token_use") <*> (o .:? "username") -- | ToJSON OAuth2TokenIntrospection instance A.ToJSON OAuth2TokenIntrospection where toJSON OAuth2TokenIntrospection {..} = _omitNulls [ "active" .= oAuth2TokenIntrospectionActive , "aud" .= oAuth2TokenIntrospectionAud , "client_id" .= oAuth2TokenIntrospectionClientId , "exp" .= oAuth2TokenIntrospectionExp , "ext" .= oAuth2TokenIntrospectionExt , "iat" .= oAuth2TokenIntrospectionIat , "iss" .= oAuth2TokenIntrospectionIss , "nbf" .= oAuth2TokenIntrospectionNbf , "obfuscated_subject" .= oAuth2TokenIntrospectionObfuscatedSubject , "scope" .= oAuth2TokenIntrospectionScope , "sub" .= oAuth2TokenIntrospectionSub , "token_type" .= oAuth2TokenIntrospectionTokenType , "token_use" .= oAuth2TokenIntrospectionTokenUse , "username" .= oAuth2TokenIntrospectionUsername ] -- | Construct a value of type 'OAuth2TokenIntrospection' (by applying it's required fields, if any) mkOAuth2TokenIntrospection :: Bool -- ^ 'oAuth2TokenIntrospectionActive': Active is a boolean indicator of whether or not the presented token is currently active. The specifics of a token's \"active\" state will vary depending on the implementation of the authorization server and the information it keeps about its tokens, but a \"true\" value return for the \"active\" property will generally indicate that a given token has been issued by this authorization server, has not been revoked by the resource owner, and is within its given time window of validity (e.g., after its issuance time and before its expiration time). -> OAuth2TokenIntrospection mkOAuth2TokenIntrospection oAuth2TokenIntrospectionActive = OAuth2TokenIntrospection { oAuth2TokenIntrospectionActive , oAuth2TokenIntrospectionAud = Nothing , oAuth2TokenIntrospectionClientId = Nothing , oAuth2TokenIntrospectionExp = Nothing , oAuth2TokenIntrospectionExt = Nothing , oAuth2TokenIntrospectionIat = Nothing , oAuth2TokenIntrospectionIss = Nothing , oAuth2TokenIntrospectionNbf = Nothing , oAuth2TokenIntrospectionObfuscatedSubject = Nothing , oAuth2TokenIntrospectionScope = Nothing , oAuth2TokenIntrospectionSub = Nothing , oAuth2TokenIntrospectionTokenType = Nothing , oAuth2TokenIntrospectionTokenUse = Nothing , oAuth2TokenIntrospectionUsername = Nothing } -- ** Oauth2TokenResponse -- | Oauth2TokenResponse -- The Access Token Response data Oauth2TokenResponse = Oauth2TokenResponse { oauth2TokenResponseAccessToken :: Maybe Text -- ^ "access_token" , oauth2TokenResponseExpiresIn :: Maybe Integer -- ^ "expires_in" , oauth2TokenResponseIdToken :: Maybe Text -- ^ "id_token" , oauth2TokenResponseRefreshToken :: Maybe Text -- ^ "refresh_token" , oauth2TokenResponseScope :: Maybe Text -- ^ "scope" , oauth2TokenResponseTokenType :: Maybe Text -- ^ "token_type" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Oauth2TokenResponse instance A.FromJSON Oauth2TokenResponse where parseJSON = A.withObject "Oauth2TokenResponse" $ \o -> Oauth2TokenResponse <$> (o .:? "access_token") <*> (o .:? "expires_in") <*> (o .:? "id_token") <*> (o .:? "refresh_token") <*> (o .:? "scope") <*> (o .:? "token_type") -- | ToJSON Oauth2TokenResponse instance A.ToJSON Oauth2TokenResponse where toJSON Oauth2TokenResponse {..} = _omitNulls [ "access_token" .= oauth2TokenResponseAccessToken , "expires_in" .= oauth2TokenResponseExpiresIn , "id_token" .= oauth2TokenResponseIdToken , "refresh_token" .= oauth2TokenResponseRefreshToken , "scope" .= oauth2TokenResponseScope , "token_type" .= oauth2TokenResponseTokenType ] -- | Construct a value of type 'Oauth2TokenResponse' (by applying it's required fields, if any) mkOauth2TokenResponse :: Oauth2TokenResponse mkOauth2TokenResponse = Oauth2TokenResponse { oauth2TokenResponseAccessToken = Nothing , oauth2TokenResponseExpiresIn = Nothing , oauth2TokenResponseIdToken = Nothing , oauth2TokenResponseRefreshToken = Nothing , oauth2TokenResponseScope = Nothing , oauth2TokenResponseTokenType = Nothing } -- ** OpenIDConnectContext -- | OpenIDConnectContext -- Contains optional information about the OpenID Connect request. -- data OpenIDConnectContext = OpenIDConnectContext { openIDConnectContextAcrValues :: Maybe [Text] -- ^ "acr_values" - ACRValues is the Authentication AuthorizationContext Class Reference requested in the OAuth 2.0 Authorization request. It is a parameter defined by OpenID Connect and expresses which level of authentication (e.g. 2FA) is required. OpenID Connect defines it as follows: > Requested Authentication AuthorizationContext Class Reference values. Space-separated string that specifies the acr values that the Authorization Server is being requested to use for processing this Authentication Request, with the values appearing in order of preference. The Authentication AuthorizationContext Class satisfied by the authentication performed is returned as the acr Claim Value, as specified in Section 2. The acr Claim is requested as a Voluntary Claim by this parameter. , openIDConnectContextDisplay :: Maybe Text -- ^ "display" - Display is a string value that specifies how the Authorization Server displays the authentication and consent user interface pages to the End-User. The defined values are: page: The Authorization Server SHOULD display the authentication and consent UI consistent with a full User Agent page view. If the display parameter is not specified, this is the default display mode. popup: The Authorization Server SHOULD display the authentication and consent UI consistent with a popup User Agent window. The popup User Agent window should be of an appropriate size for a login-focused dialog and should not obscure the entire window that it is popping up over. touch: The Authorization Server SHOULD display the authentication and consent UI consistent with a device that leverages a touch interface. wap: The Authorization Server SHOULD display the authentication and consent UI consistent with a \"feature phone\" type display. The Authorization Server MAY also attempt to detect the capabilities of the User Agent and present an appropriate display. , openIDConnectContextIdTokenHintClaims :: Maybe A.Value -- ^ "id_token_hint_claims" - IDTokenHintClaims are the claims of the ID Token previously issued by the Authorization Server being passed as a hint about the End-User's current or past authenticated session with the Client. , openIDConnectContextLoginHint :: Maybe Text -- ^ "login_hint" - LoginHint hints about the login identifier the End-User might use to log in (if necessary). This hint can be used by an RP if it first asks the End-User for their e-mail address (or other identifier) and then wants to pass that value as a hint to the discovered authorization service. This value MAY also be a phone number in the format specified for the phone_number Claim. The use of this parameter is optional. , openIDConnectContextUiLocales :: Maybe [Text] -- ^ "ui_locales" - UILocales is the End-User'id preferred languages and scripts for the user interface, represented as a space-separated list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value \"fr-CA fr en\" represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested locales are not supported by the OpenID Provider. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON OpenIDConnectContext instance A.FromJSON OpenIDConnectContext where parseJSON = A.withObject "OpenIDConnectContext" $ \o -> OpenIDConnectContext <$> (o .:? "acr_values") <*> (o .:? "display") <*> (o .:? "id_token_hint_claims") <*> (o .:? "login_hint") <*> (o .:? "ui_locales") -- | ToJSON OpenIDConnectContext instance A.ToJSON OpenIDConnectContext where toJSON OpenIDConnectContext {..} = _omitNulls [ "acr_values" .= openIDConnectContextAcrValues , "display" .= openIDConnectContextDisplay , "id_token_hint_claims" .= openIDConnectContextIdTokenHintClaims , "login_hint" .= openIDConnectContextLoginHint , "ui_locales" .= openIDConnectContextUiLocales ] -- | Construct a value of type 'OpenIDConnectContext' (by applying it's required fields, if any) mkOpenIDConnectContext :: OpenIDConnectContext mkOpenIDConnectContext = OpenIDConnectContext { openIDConnectContextAcrValues = Nothing , openIDConnectContextDisplay = Nothing , openIDConnectContextIdTokenHintClaims = Nothing , openIDConnectContextLoginHint = Nothing , openIDConnectContextUiLocales = Nothing } -- ** PluginConfig -- | PluginConfig -- PluginConfig The config of a plugin. -- data PluginConfig = PluginConfig { pluginConfigArgs :: PluginConfigArgs -- ^ /Required/ "Args" , pluginConfigDescription :: Text -- ^ /Required/ "Description" - description , pluginConfigDockerVersion :: Maybe Text -- ^ "DockerVersion" - Docker Version used to create the plugin , pluginConfigDocumentation :: Text -- ^ /Required/ "Documentation" - documentation , pluginConfigEntrypoint :: [Text] -- ^ /Required/ "Entrypoint" - entrypoint , pluginConfigEnv :: [PluginEnv] -- ^ /Required/ "Env" - env , pluginConfigInterface :: PluginConfigInterface -- ^ /Required/ "Interface" , pluginConfigIpcHost :: Bool -- ^ /Required/ "IpcHost" - ipc host , pluginConfigLinux :: PluginConfigLinux -- ^ /Required/ "Linux" , pluginConfigMounts :: [PluginMount] -- ^ /Required/ "Mounts" - mounts , pluginConfigNetwork :: PluginConfigNetwork -- ^ /Required/ "Network" , pluginConfigPidHost :: Bool -- ^ /Required/ "PidHost" - pid host , pluginConfigPropagatedMount :: Text -- ^ /Required/ "PropagatedMount" - propagated mount , pluginConfigUser :: Maybe PluginConfigUser -- ^ "User" , pluginConfigWorkDir :: Text -- ^ /Required/ "WorkDir" - work dir , pluginConfigRootfs :: Maybe PluginConfigRootfs -- ^ "rootfs" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginConfig instance A.FromJSON PluginConfig where parseJSON = A.withObject "PluginConfig" $ \o -> PluginConfig <$> (o .: "Args") <*> (o .: "Description") <*> (o .:? "DockerVersion") <*> (o .: "Documentation") <*> (o .: "Entrypoint") <*> (o .: "Env") <*> (o .: "Interface") <*> (o .: "IpcHost") <*> (o .: "Linux") <*> (o .: "Mounts") <*> (o .: "Network") <*> (o .: "PidHost") <*> (o .: "PropagatedMount") <*> (o .:? "User") <*> (o .: "WorkDir") <*> (o .:? "rootfs") -- | ToJSON PluginConfig instance A.ToJSON PluginConfig where toJSON PluginConfig {..} = _omitNulls [ "Args" .= pluginConfigArgs , "Description" .= pluginConfigDescription , "DockerVersion" .= pluginConfigDockerVersion , "Documentation" .= pluginConfigDocumentation , "Entrypoint" .= pluginConfigEntrypoint , "Env" .= pluginConfigEnv , "Interface" .= pluginConfigInterface , "IpcHost" .= pluginConfigIpcHost , "Linux" .= pluginConfigLinux , "Mounts" .= pluginConfigMounts , "Network" .= pluginConfigNetwork , "PidHost" .= pluginConfigPidHost , "PropagatedMount" .= pluginConfigPropagatedMount , "User" .= pluginConfigUser , "WorkDir" .= pluginConfigWorkDir , "rootfs" .= pluginConfigRootfs ] -- | Construct a value of type 'PluginConfig' (by applying it's required fields, if any) mkPluginConfig :: PluginConfigArgs -- ^ 'pluginConfigArgs' -> Text -- ^ 'pluginConfigDescription': description -> Text -- ^ 'pluginConfigDocumentation': documentation -> [Text] -- ^ 'pluginConfigEntrypoint': entrypoint -> [PluginEnv] -- ^ 'pluginConfigEnv': env -> PluginConfigInterface -- ^ 'pluginConfigInterface' -> Bool -- ^ 'pluginConfigIpcHost': ipc host -> PluginConfigLinux -- ^ 'pluginConfigLinux' -> [PluginMount] -- ^ 'pluginConfigMounts': mounts -> PluginConfigNetwork -- ^ 'pluginConfigNetwork' -> Bool -- ^ 'pluginConfigPidHost': pid host -> Text -- ^ 'pluginConfigPropagatedMount': propagated mount -> Text -- ^ 'pluginConfigWorkDir': work dir -> PluginConfig mkPluginConfig pluginConfigArgs pluginConfigDescription pluginConfigDocumentation pluginConfigEntrypoint pluginConfigEnv pluginConfigInterface pluginConfigIpcHost pluginConfigLinux pluginConfigMounts pluginConfigNetwork pluginConfigPidHost pluginConfigPropagatedMount pluginConfigWorkDir = PluginConfig { pluginConfigArgs , pluginConfigDescription , pluginConfigDockerVersion = Nothing , pluginConfigDocumentation , pluginConfigEntrypoint , pluginConfigEnv , pluginConfigInterface , pluginConfigIpcHost , pluginConfigLinux , pluginConfigMounts , pluginConfigNetwork , pluginConfigPidHost , pluginConfigPropagatedMount , pluginConfigUser = Nothing , pluginConfigWorkDir , pluginConfigRootfs = Nothing } -- ** PluginConfigArgs -- | PluginConfigArgs -- PluginConfigArgs plugin config args data PluginConfigArgs = PluginConfigArgs { pluginConfigArgsDescription :: Text -- ^ /Required/ "Description" - description , pluginConfigArgsName :: Text -- ^ /Required/ "Name" - name , pluginConfigArgsSettable :: [Text] -- ^ /Required/ "Settable" - settable , pluginConfigArgsValue :: [Text] -- ^ /Required/ "Value" - value } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginConfigArgs instance A.FromJSON PluginConfigArgs where parseJSON = A.withObject "PluginConfigArgs" $ \o -> PluginConfigArgs <$> (o .: "Description") <*> (o .: "Name") <*> (o .: "Settable") <*> (o .: "Value") -- | ToJSON PluginConfigArgs instance A.ToJSON PluginConfigArgs where toJSON PluginConfigArgs {..} = _omitNulls [ "Description" .= pluginConfigArgsDescription , "Name" .= pluginConfigArgsName , "Settable" .= pluginConfigArgsSettable , "Value" .= pluginConfigArgsValue ] -- | Construct a value of type 'PluginConfigArgs' (by applying it's required fields, if any) mkPluginConfigArgs :: Text -- ^ 'pluginConfigArgsDescription': description -> Text -- ^ 'pluginConfigArgsName': name -> [Text] -- ^ 'pluginConfigArgsSettable': settable -> [Text] -- ^ 'pluginConfigArgsValue': value -> PluginConfigArgs mkPluginConfigArgs pluginConfigArgsDescription pluginConfigArgsName pluginConfigArgsSettable pluginConfigArgsValue = PluginConfigArgs { pluginConfigArgsDescription , pluginConfigArgsName , pluginConfigArgsSettable , pluginConfigArgsValue } -- ** PluginConfigInterface -- | PluginConfigInterface -- PluginConfigInterface The interface between Docker and the plugin data PluginConfigInterface = PluginConfigInterface { pluginConfigInterfaceProtocolScheme :: Maybe Text -- ^ "ProtocolScheme" - Protocol to use for clients connecting to the plugin. , pluginConfigInterfaceSocket :: Text -- ^ /Required/ "Socket" - socket , pluginConfigInterfaceTypes :: [PluginInterfaceType] -- ^ /Required/ "Types" - types } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginConfigInterface instance A.FromJSON PluginConfigInterface where parseJSON = A.withObject "PluginConfigInterface" $ \o -> PluginConfigInterface <$> (o .:? "ProtocolScheme") <*> (o .: "Socket") <*> (o .: "Types") -- | ToJSON PluginConfigInterface instance A.ToJSON PluginConfigInterface where toJSON PluginConfigInterface {..} = _omitNulls [ "ProtocolScheme" .= pluginConfigInterfaceProtocolScheme , "Socket" .= pluginConfigInterfaceSocket , "Types" .= pluginConfigInterfaceTypes ] -- | Construct a value of type 'PluginConfigInterface' (by applying it's required fields, if any) mkPluginConfigInterface :: Text -- ^ 'pluginConfigInterfaceSocket': socket -> [PluginInterfaceType] -- ^ 'pluginConfigInterfaceTypes': types -> PluginConfigInterface mkPluginConfigInterface pluginConfigInterfaceSocket pluginConfigInterfaceTypes = PluginConfigInterface { pluginConfigInterfaceProtocolScheme = Nothing , pluginConfigInterfaceSocket , pluginConfigInterfaceTypes } -- ** PluginConfigLinux -- | PluginConfigLinux -- PluginConfigLinux plugin config linux data PluginConfigLinux = PluginConfigLinux { pluginConfigLinuxAllowAllDevices :: Bool -- ^ /Required/ "AllowAllDevices" - allow all devices , pluginConfigLinuxCapabilities :: [Text] -- ^ /Required/ "Capabilities" - capabilities , pluginConfigLinuxDevices :: [PluginDevice] -- ^ /Required/ "Devices" - devices } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginConfigLinux instance A.FromJSON PluginConfigLinux where parseJSON = A.withObject "PluginConfigLinux" $ \o -> PluginConfigLinux <$> (o .: "AllowAllDevices") <*> (o .: "Capabilities") <*> (o .: "Devices") -- | ToJSON PluginConfigLinux instance A.ToJSON PluginConfigLinux where toJSON PluginConfigLinux {..} = _omitNulls [ "AllowAllDevices" .= pluginConfigLinuxAllowAllDevices , "Capabilities" .= pluginConfigLinuxCapabilities , "Devices" .= pluginConfigLinuxDevices ] -- | Construct a value of type 'PluginConfigLinux' (by applying it's required fields, if any) mkPluginConfigLinux :: Bool -- ^ 'pluginConfigLinuxAllowAllDevices': allow all devices -> [Text] -- ^ 'pluginConfigLinuxCapabilities': capabilities -> [PluginDevice] -- ^ 'pluginConfigLinuxDevices': devices -> PluginConfigLinux mkPluginConfigLinux pluginConfigLinuxAllowAllDevices pluginConfigLinuxCapabilities pluginConfigLinuxDevices = PluginConfigLinux { pluginConfigLinuxAllowAllDevices , pluginConfigLinuxCapabilities , pluginConfigLinuxDevices } -- ** PluginConfigNetwork -- | PluginConfigNetwork -- PluginConfigNetwork plugin config network data PluginConfigNetwork = PluginConfigNetwork { pluginConfigNetworkType :: Text -- ^ /Required/ "Type" - type } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginConfigNetwork instance A.FromJSON PluginConfigNetwork where parseJSON = A.withObject "PluginConfigNetwork" $ \o -> PluginConfigNetwork <$> (o .: "Type") -- | ToJSON PluginConfigNetwork instance A.ToJSON PluginConfigNetwork where toJSON PluginConfigNetwork {..} = _omitNulls [ "Type" .= pluginConfigNetworkType ] -- | Construct a value of type 'PluginConfigNetwork' (by applying it's required fields, if any) mkPluginConfigNetwork :: Text -- ^ 'pluginConfigNetworkType': type -> PluginConfigNetwork mkPluginConfigNetwork pluginConfigNetworkType = PluginConfigNetwork { pluginConfigNetworkType } -- ** PluginConfigRootfs -- | PluginConfigRootfs -- PluginConfigRootfs plugin config rootfs data PluginConfigRootfs = PluginConfigRootfs { pluginConfigRootfsDiffIds :: Maybe [Text] -- ^ "diff_ids" - diff ids , pluginConfigRootfsType :: Maybe Text -- ^ "type" - type } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginConfigRootfs instance A.FromJSON PluginConfigRootfs where parseJSON = A.withObject "PluginConfigRootfs" $ \o -> PluginConfigRootfs <$> (o .:? "diff_ids") <*> (o .:? "type") -- | ToJSON PluginConfigRootfs instance A.ToJSON PluginConfigRootfs where toJSON PluginConfigRootfs {..} = _omitNulls [ "diff_ids" .= pluginConfigRootfsDiffIds , "type" .= pluginConfigRootfsType ] -- | Construct a value of type 'PluginConfigRootfs' (by applying it's required fields, if any) mkPluginConfigRootfs :: PluginConfigRootfs mkPluginConfigRootfs = PluginConfigRootfs { pluginConfigRootfsDiffIds = Nothing , pluginConfigRootfsType = Nothing } -- ** PluginConfigUser -- | PluginConfigUser -- PluginConfigUser plugin config user data PluginConfigUser = PluginConfigUser { pluginConfigUserGid :: Maybe Int -- ^ "GID" - g ID , pluginConfigUserUid :: Maybe Int -- ^ "UID" - UID } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginConfigUser instance A.FromJSON PluginConfigUser where parseJSON = A.withObject "PluginConfigUser" $ \o -> PluginConfigUser <$> (o .:? "GID") <*> (o .:? "UID") -- | ToJSON PluginConfigUser instance A.ToJSON PluginConfigUser where toJSON PluginConfigUser {..} = _omitNulls [ "GID" .= pluginConfigUserGid , "UID" .= pluginConfigUserUid ] -- | Construct a value of type 'PluginConfigUser' (by applying it's required fields, if any) mkPluginConfigUser :: PluginConfigUser mkPluginConfigUser = PluginConfigUser { pluginConfigUserGid = Nothing , pluginConfigUserUid = Nothing } -- ** PluginDevice -- | PluginDevice -- PluginDevice plugin device data PluginDevice = PluginDevice { pluginDeviceDescription :: Text -- ^ /Required/ "Description" - description , pluginDeviceName :: Text -- ^ /Required/ "Name" - name , pluginDevicePath :: Text -- ^ /Required/ "Path" - path , pluginDeviceSettable :: [Text] -- ^ /Required/ "Settable" - settable } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginDevice instance A.FromJSON PluginDevice where parseJSON = A.withObject "PluginDevice" $ \o -> PluginDevice <$> (o .: "Description") <*> (o .: "Name") <*> (o .: "Path") <*> (o .: "Settable") -- | ToJSON PluginDevice instance A.ToJSON PluginDevice where toJSON PluginDevice {..} = _omitNulls [ "Description" .= pluginDeviceDescription , "Name" .= pluginDeviceName , "Path" .= pluginDevicePath , "Settable" .= pluginDeviceSettable ] -- | Construct a value of type 'PluginDevice' (by applying it's required fields, if any) mkPluginDevice :: Text -- ^ 'pluginDeviceDescription': description -> Text -- ^ 'pluginDeviceName': name -> Text -- ^ 'pluginDevicePath': path -> [Text] -- ^ 'pluginDeviceSettable': settable -> PluginDevice mkPluginDevice pluginDeviceDescription pluginDeviceName pluginDevicePath pluginDeviceSettable = PluginDevice { pluginDeviceDescription , pluginDeviceName , pluginDevicePath , pluginDeviceSettable } -- ** PluginEnv -- | PluginEnv -- PluginEnv plugin env data PluginEnv = PluginEnv { pluginEnvDescription :: Text -- ^ /Required/ "Description" - description , pluginEnvName :: Text -- ^ /Required/ "Name" - name , pluginEnvSettable :: [Text] -- ^ /Required/ "Settable" - settable , pluginEnvValue :: Text -- ^ /Required/ "Value" - value } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginEnv instance A.FromJSON PluginEnv where parseJSON = A.withObject "PluginEnv" $ \o -> PluginEnv <$> (o .: "Description") <*> (o .: "Name") <*> (o .: "Settable") <*> (o .: "Value") -- | ToJSON PluginEnv instance A.ToJSON PluginEnv where toJSON PluginEnv {..} = _omitNulls [ "Description" .= pluginEnvDescription , "Name" .= pluginEnvName , "Settable" .= pluginEnvSettable , "Value" .= pluginEnvValue ] -- | Construct a value of type 'PluginEnv' (by applying it's required fields, if any) mkPluginEnv :: Text -- ^ 'pluginEnvDescription': description -> Text -- ^ 'pluginEnvName': name -> [Text] -- ^ 'pluginEnvSettable': settable -> Text -- ^ 'pluginEnvValue': value -> PluginEnv mkPluginEnv pluginEnvDescription pluginEnvName pluginEnvSettable pluginEnvValue = PluginEnv { pluginEnvDescription , pluginEnvName , pluginEnvSettable , pluginEnvValue } -- ** PluginInterfaceType -- | PluginInterfaceType -- PluginInterfaceType plugin interface type data PluginInterfaceType = PluginInterfaceType { pluginInterfaceTypeCapability :: Text -- ^ /Required/ "Capability" - capability , pluginInterfaceTypePrefix :: Text -- ^ /Required/ "Prefix" - prefix , pluginInterfaceTypeVersion :: Text -- ^ /Required/ "Version" - version } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginInterfaceType instance A.FromJSON PluginInterfaceType where parseJSON = A.withObject "PluginInterfaceType" $ \o -> PluginInterfaceType <$> (o .: "Capability") <*> (o .: "Prefix") <*> (o .: "Version") -- | ToJSON PluginInterfaceType instance A.ToJSON PluginInterfaceType where toJSON PluginInterfaceType {..} = _omitNulls [ "Capability" .= pluginInterfaceTypeCapability , "Prefix" .= pluginInterfaceTypePrefix , "Version" .= pluginInterfaceTypeVersion ] -- | Construct a value of type 'PluginInterfaceType' (by applying it's required fields, if any) mkPluginInterfaceType :: Text -- ^ 'pluginInterfaceTypeCapability': capability -> Text -- ^ 'pluginInterfaceTypePrefix': prefix -> Text -- ^ 'pluginInterfaceTypeVersion': version -> PluginInterfaceType mkPluginInterfaceType pluginInterfaceTypeCapability pluginInterfaceTypePrefix pluginInterfaceTypeVersion = PluginInterfaceType { pluginInterfaceTypeCapability , pluginInterfaceTypePrefix , pluginInterfaceTypeVersion } -- ** PluginMount -- | PluginMount -- PluginMount plugin mount data PluginMount = PluginMount { pluginMountDescription :: Text -- ^ /Required/ "Description" - description , pluginMountDestination :: Text -- ^ /Required/ "Destination" - destination , pluginMountName :: Text -- ^ /Required/ "Name" - name , pluginMountOptions :: [Text] -- ^ /Required/ "Options" - options , pluginMountSettable :: [Text] -- ^ /Required/ "Settable" - settable , pluginMountSource :: Text -- ^ /Required/ "Source" - source , pluginMountType :: Text -- ^ /Required/ "Type" - type } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginMount instance A.FromJSON PluginMount where parseJSON = A.withObject "PluginMount" $ \o -> PluginMount <$> (o .: "Description") <*> (o .: "Destination") <*> (o .: "Name") <*> (o .: "Options") <*> (o .: "Settable") <*> (o .: "Source") <*> (o .: "Type") -- | ToJSON PluginMount instance A.ToJSON PluginMount where toJSON PluginMount {..} = _omitNulls [ "Description" .= pluginMountDescription , "Destination" .= pluginMountDestination , "Name" .= pluginMountName , "Options" .= pluginMountOptions , "Settable" .= pluginMountSettable , "Source" .= pluginMountSource , "Type" .= pluginMountType ] -- | Construct a value of type 'PluginMount' (by applying it's required fields, if any) mkPluginMount :: Text -- ^ 'pluginMountDescription': description -> Text -- ^ 'pluginMountDestination': destination -> Text -- ^ 'pluginMountName': name -> [Text] -- ^ 'pluginMountOptions': options -> [Text] -- ^ 'pluginMountSettable': settable -> Text -- ^ 'pluginMountSource': source -> Text -- ^ 'pluginMountType': type -> PluginMount mkPluginMount pluginMountDescription pluginMountDestination pluginMountName pluginMountOptions pluginMountSettable pluginMountSource pluginMountType = PluginMount { pluginMountDescription , pluginMountDestination , pluginMountName , pluginMountOptions , pluginMountSettable , pluginMountSource , pluginMountType } -- ** PluginSettings -- | PluginSettings -- PluginSettings Settings that can be modified by users. -- data PluginSettings = PluginSettings { pluginSettingsArgs :: [Text] -- ^ /Required/ "Args" - args , pluginSettingsDevices :: [PluginDevice] -- ^ /Required/ "Devices" - devices , pluginSettingsEnv :: [Text] -- ^ /Required/ "Env" - env , pluginSettingsMounts :: [PluginMount] -- ^ /Required/ "Mounts" - mounts } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PluginSettings instance A.FromJSON PluginSettings where parseJSON = A.withObject "PluginSettings" $ \o -> PluginSettings <$> (o .: "Args") <*> (o .: "Devices") <*> (o .: "Env") <*> (o .: "Mounts") -- | ToJSON PluginSettings instance A.ToJSON PluginSettings where toJSON PluginSettings {..} = _omitNulls [ "Args" .= pluginSettingsArgs , "Devices" .= pluginSettingsDevices , "Env" .= pluginSettingsEnv , "Mounts" .= pluginSettingsMounts ] -- | Construct a value of type 'PluginSettings' (by applying it's required fields, if any) mkPluginSettings :: [Text] -- ^ 'pluginSettingsArgs': args -> [PluginDevice] -- ^ 'pluginSettingsDevices': devices -> [Text] -- ^ 'pluginSettingsEnv': env -> [PluginMount] -- ^ 'pluginSettingsMounts': mounts -> PluginSettings mkPluginSettings pluginSettingsArgs pluginSettingsDevices pluginSettingsEnv pluginSettingsMounts = PluginSettings { pluginSettingsArgs , pluginSettingsDevices , pluginSettingsEnv , pluginSettingsMounts } -- ** PreviousConsentSession -- | PreviousConsentSession -- The response used to return used consent requests same as HandledLoginRequest, just with consent_request exposed as json data PreviousConsentSession = PreviousConsentSession { previousConsentSessionConsentRequest :: Maybe ConsentRequest -- ^ "consent_request" , previousConsentSessionGrantAccessTokenAudience :: Maybe [Text] -- ^ "grant_access_token_audience" , previousConsentSessionGrantScope :: Maybe [Text] -- ^ "grant_scope" , previousConsentSessionHandledAt :: Maybe DateTime -- ^ "handled_at" , previousConsentSessionRemember :: Maybe Bool -- ^ "remember" - Remember, if set to true, tells ORY Hydra to remember this consent authorization and reuse it if the same client asks the same user for the same, or a subset of, scope. , previousConsentSessionRememberFor :: Maybe Integer -- ^ "remember_for" - RememberFor sets how long the consent authorization should be remembered for in seconds. If set to `0`, the authorization will be remembered indefinitely. , previousConsentSessionSession :: Maybe ConsentRequestSession -- ^ "session" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON PreviousConsentSession instance A.FromJSON PreviousConsentSession where parseJSON = A.withObject "PreviousConsentSession" $ \o -> PreviousConsentSession <$> (o .:? "consent_request") <*> (o .:? "grant_access_token_audience") <*> (o .:? "grant_scope") <*> (o .:? "handled_at") <*> (o .:? "remember") <*> (o .:? "remember_for") <*> (o .:? "session") -- | ToJSON PreviousConsentSession instance A.ToJSON PreviousConsentSession where toJSON PreviousConsentSession {..} = _omitNulls [ "consent_request" .= previousConsentSessionConsentRequest , "grant_access_token_audience" .= previousConsentSessionGrantAccessTokenAudience , "grant_scope" .= previousConsentSessionGrantScope , "handled_at" .= previousConsentSessionHandledAt , "remember" .= previousConsentSessionRemember , "remember_for" .= previousConsentSessionRememberFor , "session" .= previousConsentSessionSession ] -- | Construct a value of type 'PreviousConsentSession' (by applying it's required fields, if any) mkPreviousConsentSession :: PreviousConsentSession mkPreviousConsentSession = PreviousConsentSession { previousConsentSessionConsentRequest = Nothing , previousConsentSessionGrantAccessTokenAudience = Nothing , previousConsentSessionGrantScope = Nothing , previousConsentSessionHandledAt = Nothing , previousConsentSessionRemember = Nothing , previousConsentSessionRememberFor = Nothing , previousConsentSessionSession = Nothing } -- ** RejectRequest -- | RejectRequest -- The request payload used to accept a login or consent request. -- data RejectRequest = RejectRequest { rejectRequestError :: Maybe Text -- ^ "error" - The error should follow the OAuth2 error format (e.g. `invalid_request`, `login_required`). Defaults to `request_denied`. , rejectRequestErrorDebug :: Maybe Text -- ^ "error_debug" - Debug contains information to help resolve the problem as a developer. Usually not exposed to the public but only in the server logs. , rejectRequestErrorDescription :: Maybe Text -- ^ "error_description" - Description of the error in a human readable format. , rejectRequestErrorHint :: Maybe Text -- ^ "error_hint" - Hint to help resolve the error. , rejectRequestStatusCode :: Maybe Integer -- ^ "status_code" - Represents the HTTP status code of the error (e.g. 401 or 403) Defaults to 400 } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON RejectRequest instance A.FromJSON RejectRequest where parseJSON = A.withObject "RejectRequest" $ \o -> RejectRequest <$> (o .:? "error") <*> (o .:? "error_debug") <*> (o .:? "error_description") <*> (o .:? "error_hint") <*> (o .:? "status_code") -- | ToJSON RejectRequest instance A.ToJSON RejectRequest where toJSON RejectRequest {..} = _omitNulls [ "error" .= rejectRequestError , "error_debug" .= rejectRequestErrorDebug , "error_description" .= rejectRequestErrorDescription , "error_hint" .= rejectRequestErrorHint , "status_code" .= rejectRequestStatusCode ] -- | FromForm RejectRequest instance WH.FromForm RejectRequest where fromForm f = RejectRequest <$> (WH.parseMaybe "error" f) <*> (WH.parseMaybe "error_debug" f) <*> (WH.parseMaybe "error_description" f) <*> (WH.parseMaybe "error_hint" f) <*> (WH.parseMaybe "status_code" f) -- | ToForm RejectRequest instance WH.ToForm RejectRequest where toForm RejectRequest {..} = WH.Form $ HM.fromList $ P.catMaybes $ [ _toFormItem "error" (rejectRequestError) , _toFormItem "error_debug" (rejectRequestErrorDebug) , _toFormItem "error_description" (rejectRequestErrorDescription) , _toFormItem "error_hint" (rejectRequestErrorHint) , _toFormItem "status_code" (rejectRequestStatusCode) ] -- | Construct a value of type 'RejectRequest' (by applying it's required fields, if any) mkRejectRequest :: RejectRequest mkRejectRequest = RejectRequest { rejectRequestError = Nothing , rejectRequestErrorDebug = Nothing , rejectRequestErrorDescription = Nothing , rejectRequestErrorHint = Nothing , rejectRequestStatusCode = Nothing } -- ** UserinfoResponse -- | UserinfoResponse -- The userinfo response data UserinfoResponse = UserinfoResponse { userinfoResponseBirthdate :: Maybe Text -- ^ "birthdate" - End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format. The year MAY be 0000, indicating that it is omitted. To represent only the year, YYYY format is allowed. Note that depending on the underlying platform's date related function, providing just year can result in varying month and day, so the implementers need to take this factor into account to correctly process the dates. , userinfoResponseEmail :: Maybe Text -- ^ "email" - End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, as discussed in Section 5.7. , userinfoResponseEmailVerified :: Maybe Bool -- ^ "email_verified" - True if the End-User's e-mail address has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this e-mail address was controlled by the End-User at the time the verification was performed. The means by which an e-mail address is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. , userinfoResponseFamilyName :: Maybe Text -- ^ "family_name" - Surname(s) or last name(s) of the End-User. Note that in some cultures, people can have multiple family names or no family name; all can be present, with the names being separated by space characters. , userinfoResponseGender :: Maybe Text -- ^ "gender" - End-User's gender. Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable. , userinfoResponseGivenName :: Maybe Text -- ^ "given_name" - Given name(s) or first name(s) of the End-User. Note that in some cultures, people can have multiple given names; all can be present, with the names being separated by space characters. , userinfoResponseLocale :: Maybe Text -- ^ "locale" - End-User's locale, represented as a BCP47 [RFC5646] language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase, separated by a dash. For example, en-US or fr-CA. As a compatibility note, some implementations have used an underscore as the separator rather than a dash, for example, en_US; Relying Parties MAY choose to accept this locale syntax as well. , userinfoResponseMiddleName :: Maybe Text -- ^ "middle_name" - Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used. , userinfoResponseName :: Maybe Text -- ^ "name" - End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences. , userinfoResponseNickname :: Maybe Text -- ^ "nickname" - Casual name of the End-User that may or may not be the same as the given_name. For instance, a nickname value of Mike might be returned alongside a given_name value of Michael. , userinfoResponsePhoneNumber :: Maybe Text -- ^ "phone_number" - End-User's preferred telephone number. E.164 [E.164] is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400. If the phone number contains an extension, it is RECOMMENDED that the extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678. , userinfoResponsePhoneNumberVerified :: Maybe Bool -- ^ "phone_number_verified" - True if the End-User's phone number has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this phone number was controlled by the End-User at the time the verification was performed. The means by which a phone number is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. When true, the phone_number Claim MUST be in E.164 format and any extensions MUST be represented in RFC 3966 format. , userinfoResponsePicture :: Maybe Text -- ^ "picture" - URL of the End-User's profile picture. This URL MUST refer to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image. Note that this URL SHOULD specifically reference a profile photo of the End-User suitable for displaying when describing the End-User, rather than an arbitrary photo taken by the End-User. , userinfoResponsePreferredUsername :: Maybe Text -- ^ "preferred_username" - Non-unique shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe. This value MAY be any valid JSON string including special characters such as @, /, or whitespace. , userinfoResponseProfile :: Maybe Text -- ^ "profile" - URL of the End-User's profile page. The contents of this Web page SHOULD be about the End-User. , userinfoResponseSub :: Maybe Text -- ^ "sub" - Subject - Identifier for the End-User at the IssuerURL. , userinfoResponseUpdatedAt :: Maybe Integer -- ^ "updated_at" - Time the End-User's information was last updated. Its value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time. , userinfoResponseWebsite :: Maybe Text -- ^ "website" - URL of the End-User's Web page or blog. This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with. , userinfoResponseZoneinfo :: Maybe Text -- ^ "zoneinfo" - String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone. For example, Europe/Paris or America/Los_Angeles. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON UserinfoResponse instance A.FromJSON UserinfoResponse where parseJSON = A.withObject "UserinfoResponse" $ \o -> UserinfoResponse <$> (o .:? "birthdate") <*> (o .:? "email") <*> (o .:? "email_verified") <*> (o .:? "family_name") <*> (o .:? "gender") <*> (o .:? "given_name") <*> (o .:? "locale") <*> (o .:? "middle_name") <*> (o .:? "name") <*> (o .:? "nickname") <*> (o .:? "phone_number") <*> (o .:? "phone_number_verified") <*> (o .:? "picture") <*> (o .:? "preferred_username") <*> (o .:? "profile") <*> (o .:? "sub") <*> (o .:? "updated_at") <*> (o .:? "website") <*> (o .:? "zoneinfo") -- | ToJSON UserinfoResponse instance A.ToJSON UserinfoResponse where toJSON UserinfoResponse {..} = _omitNulls [ "birthdate" .= userinfoResponseBirthdate , "email" .= userinfoResponseEmail , "email_verified" .= userinfoResponseEmailVerified , "family_name" .= userinfoResponseFamilyName , "gender" .= userinfoResponseGender , "given_name" .= userinfoResponseGivenName , "locale" .= userinfoResponseLocale , "middle_name" .= userinfoResponseMiddleName , "name" .= userinfoResponseName , "nickname" .= userinfoResponseNickname , "phone_number" .= userinfoResponsePhoneNumber , "phone_number_verified" .= userinfoResponsePhoneNumberVerified , "picture" .= userinfoResponsePicture , "preferred_username" .= userinfoResponsePreferredUsername , "profile" .= userinfoResponseProfile , "sub" .= userinfoResponseSub , "updated_at" .= userinfoResponseUpdatedAt , "website" .= userinfoResponseWebsite , "zoneinfo" .= userinfoResponseZoneinfo ] -- | Construct a value of type 'UserinfoResponse' (by applying it's required fields, if any) mkUserinfoResponse :: UserinfoResponse mkUserinfoResponse = UserinfoResponse { userinfoResponseBirthdate = Nothing , userinfoResponseEmail = Nothing , userinfoResponseEmailVerified = Nothing , userinfoResponseFamilyName = Nothing , userinfoResponseGender = Nothing , userinfoResponseGivenName = Nothing , userinfoResponseLocale = Nothing , userinfoResponseMiddleName = Nothing , userinfoResponseName = Nothing , userinfoResponseNickname = Nothing , userinfoResponsePhoneNumber = Nothing , userinfoResponsePhoneNumberVerified = Nothing , userinfoResponsePicture = Nothing , userinfoResponsePreferredUsername = Nothing , userinfoResponseProfile = Nothing , userinfoResponseSub = Nothing , userinfoResponseUpdatedAt = Nothing , userinfoResponseWebsite = Nothing , userinfoResponseZoneinfo = Nothing } -- ** Version -- | Version data Version = Version { versionVersion :: Maybe Text -- ^ "version" - Version is the service's version. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Version instance A.FromJSON Version where parseJSON = A.withObject "Version" $ \o -> Version <$> (o .:? "version") -- | ToJSON Version instance A.ToJSON Version where toJSON Version {..} = _omitNulls [ "version" .= versionVersion ] -- | Construct a value of type 'Version' (by applying it's required fields, if any) mkVersion :: Version mkVersion = Version { versionVersion = Nothing } -- ** Volume -- | Volume -- Volume volume data Volume = Volume { volumeCreatedAt :: Maybe Text -- ^ "CreatedAt" - Date/Time the volume was created. , volumeDriver :: Text -- ^ /Required/ "Driver" - Name of the volume driver used by the volume. , volumeLabels :: (Map.Map String Text) -- ^ /Required/ "Labels" - User-defined key/value metadata. , volumeMountpoint :: Text -- ^ /Required/ "Mountpoint" - Mount path of the volume on the host. , volumeName :: Text -- ^ /Required/ "Name" - Name of the volume. , volumeOptions :: (Map.Map String Text) -- ^ /Required/ "Options" - The driver specific options used when creating the volume. , volumeScope :: Text -- ^ /Required/ "Scope" - The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. , volumeStatus :: Maybe A.Value -- ^ "Status" - Low-level details about the volume, provided by the volume driver. Details are returned as a map with key/value pairs: `{\"key\":\"value\",\"key2\":\"value2\"}`. The `Status` field is optional, and is omitted if the volume driver does not support this feature. , volumeUsageData :: Maybe VolumeUsageData -- ^ "UsageData" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Volume instance A.FromJSON Volume where parseJSON = A.withObject "Volume" $ \o -> Volume <$> (o .:? "CreatedAt") <*> (o .: "Driver") <*> (o .: "Labels") <*> (o .: "Mountpoint") <*> (o .: "Name") <*> (o .: "Options") <*> (o .: "Scope") <*> (o .:? "Status") <*> (o .:? "UsageData") -- | ToJSON Volume instance A.ToJSON Volume where toJSON Volume {..} = _omitNulls [ "CreatedAt" .= volumeCreatedAt , "Driver" .= volumeDriver , "Labels" .= volumeLabels , "Mountpoint" .= volumeMountpoint , "Name" .= volumeName , "Options" .= volumeOptions , "Scope" .= volumeScope , "Status" .= volumeStatus , "UsageData" .= volumeUsageData ] -- | Construct a value of type 'Volume' (by applying it's required fields, if any) mkVolume :: Text -- ^ 'volumeDriver': Name of the volume driver used by the volume. -> (Map.Map String Text) -- ^ 'volumeLabels': User-defined key/value metadata. -> Text -- ^ 'volumeMountpoint': Mount path of the volume on the host. -> Text -- ^ 'volumeName': Name of the volume. -> (Map.Map String Text) -- ^ 'volumeOptions': The driver specific options used when creating the volume. -> Text -- ^ 'volumeScope': The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. -> Volume mkVolume volumeDriver volumeLabels volumeMountpoint volumeName volumeOptions volumeScope = Volume { volumeCreatedAt = Nothing , volumeDriver , volumeLabels , volumeMountpoint , volumeName , volumeOptions , volumeScope , volumeStatus = Nothing , volumeUsageData = Nothing } -- ** VolumeUsageData -- | VolumeUsageData -- VolumeUsageData Usage details about the volume. This information is used by the `GET /system/df` endpoint, and omitted in other endpoints. data VolumeUsageData = VolumeUsageData { volumeUsageDataRefCount :: Integer -- ^ /Required/ "RefCount" - The number of containers referencing this volume. This field is set to `-1` if the reference-count is not available. , volumeUsageDataSize :: Integer -- ^ /Required/ "Size" - Amount of disk space used by the volume (in bytes). This information is only available for volumes created with the `\"local\"` volume driver. For volumes created with other volume drivers, this field is set to `-1` (\"not available\") } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON VolumeUsageData instance A.FromJSON VolumeUsageData where parseJSON = A.withObject "VolumeUsageData" $ \o -> VolumeUsageData <$> (o .: "RefCount") <*> (o .: "Size") -- | ToJSON VolumeUsageData instance A.ToJSON VolumeUsageData where toJSON VolumeUsageData {..} = _omitNulls [ "RefCount" .= volumeUsageDataRefCount , "Size" .= volumeUsageDataSize ] -- | Construct a value of type 'VolumeUsageData' (by applying it's required fields, if any) mkVolumeUsageData :: Integer -- ^ 'volumeUsageDataRefCount': The number of containers referencing this volume. This field is set to `-1` if the reference-count is not available. -> Integer -- ^ 'volumeUsageDataSize': Amount of disk space used by the volume (in bytes). This information is only available for volumes created with the `\"local\"` volume driver. For volumes created with other volume drivers, this field is set to `-1` (\"not available\") -> VolumeUsageData mkVolumeUsageData volumeUsageDataRefCount volumeUsageDataSize = VolumeUsageData { volumeUsageDataRefCount , volumeUsageDataSize } -- ** WellKnown -- | WellKnown -- WellKnown represents important OpenID Connect discovery metadata -- -- It includes links to several endpoints (e.g. /oauth2/token) and exposes information on supported signature algorithms among others. data WellKnown = WellKnown { wellKnownAuthorizationEndpoint :: Text -- ^ /Required/ "authorization_endpoint" - URL of the OP's OAuth 2.0 Authorization Endpoint. , wellKnownBackchannelLogoutSessionSupported :: Maybe Bool -- ^ "backchannel_logout_session_supported" - Boolean value specifying whether the OP can pass a sid (session ID) Claim in the Logout Token to identify the RP session with the OP. If supported, the sid Claim is also included in ID Tokens issued by the OP , wellKnownBackchannelLogoutSupported :: Maybe Bool -- ^ "backchannel_logout_supported" - Boolean value specifying whether the OP supports back-channel logout, with true indicating support. , wellKnownClaimsParameterSupported :: Maybe Bool -- ^ "claims_parameter_supported" - Boolean value specifying whether the OP supports use of the claims parameter, with true indicating support. , wellKnownClaimsSupported :: Maybe [Text] -- ^ "claims_supported" - JSON array containing a list of the Claim Names of the Claims that the OpenID Provider MAY be able to supply values for. Note that for privacy or other reasons, this might not be an exhaustive list. , wellKnownEndSessionEndpoint :: Maybe Text -- ^ "end_session_endpoint" - URL at the OP to which an RP can perform a redirect to request that the End-User be logged out at the OP. , wellKnownFrontchannelLogoutSessionSupported :: Maybe Bool -- ^ "frontchannel_logout_session_supported" - Boolean value specifying whether the OP can pass iss (issuer) and sid (session ID) query parameters to identify the RP session with the OP when the frontchannel_logout_uri is used. If supported, the sid Claim is also included in ID Tokens issued by the OP. , wellKnownFrontchannelLogoutSupported :: Maybe Bool -- ^ "frontchannel_logout_supported" - Boolean value specifying whether the OP supports HTTP-based logout, with true indicating support. , wellKnownGrantTypesSupported :: Maybe [Text] -- ^ "grant_types_supported" - JSON array containing a list of the OAuth 2.0 Grant Type values that this OP supports. , wellKnownIdTokenSigningAlgValuesSupported :: [Text] -- ^ /Required/ "id_token_signing_alg_values_supported" - JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for the ID Token to encode the Claims in a JWT. , wellKnownIssuer :: Text -- ^ /Required/ "issuer" - URL using the https scheme with no query or fragment component that the OP asserts as its IssuerURL Identifier. If IssuerURL discovery is supported , this value MUST be identical to the issuer value returned by WebFinger. This also MUST be identical to the iss Claim value in ID Tokens issued from this IssuerURL. , wellKnownJwksUri :: Text -- ^ /Required/ "jwks_uri" - URL of the OP's JSON Web Key Set [JWK] document. This contains the signing key(s) the RP uses to validate signatures from the OP. The JWK Set MAY also contain the Server's encryption key(s), which are used by RPs to encrypt requests to the Server. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key's intended usage. Although some algorithms allow the same key to be used for both signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. , wellKnownRegistrationEndpoint :: Maybe Text -- ^ "registration_endpoint" - URL of the OP's Dynamic Client Registration Endpoint. , wellKnownRequestObjectSigningAlgValuesSupported :: Maybe [Text] -- ^ "request_object_signing_alg_values_supported" - JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for Request Objects, which are described in Section 6.1 of OpenID Connect Core 1.0 [OpenID.Core]. These algorithms are used both when the Request Object is passed by value (using the request parameter) and when it is passed by reference (using the request_uri parameter). , wellKnownRequestParameterSupported :: Maybe Bool -- ^ "request_parameter_supported" - Boolean value specifying whether the OP supports use of the request parameter, with true indicating support. , wellKnownRequestUriParameterSupported :: Maybe Bool -- ^ "request_uri_parameter_supported" - Boolean value specifying whether the OP supports use of the request_uri parameter, with true indicating support. , wellKnownRequireRequestUriRegistration :: Maybe Bool -- ^ "require_request_uri_registration" - Boolean value specifying whether the OP requires any request_uri values used to be pre-registered using the request_uris registration parameter. , wellKnownResponseModesSupported :: Maybe [Text] -- ^ "response_modes_supported" - JSON array containing a list of the OAuth 2.0 response_mode values that this OP supports. , wellKnownResponseTypesSupported :: [Text] -- ^ /Required/ "response_types_supported" - JSON array containing a list of the OAuth 2.0 response_type values that this OP supports. Dynamic OpenID Providers MUST support the code, id_token, and the token id_token Response Type values. , wellKnownRevocationEndpoint :: Maybe Text -- ^ "revocation_endpoint" - URL of the authorization server's OAuth 2.0 revocation endpoint. , wellKnownScopesSupported :: Maybe [Text] -- ^ "scopes_supported" - SON array containing a list of the OAuth 2.0 [RFC6749] scope values that this server supports. The server MUST support the openid scope value. Servers MAY choose not to advertise some supported scope values even when this parameter is used , wellKnownSubjectTypesSupported :: [Text] -- ^ /Required/ "subject_types_supported" - JSON array containing a list of the Subject Identifier types that this OP supports. Valid types include pairwise and public. , wellKnownTokenEndpoint :: Text -- ^ /Required/ "token_endpoint" - URL of the OP's OAuth 2.0 Token Endpoint , wellKnownTokenEndpointAuthMethodsSupported :: Maybe [Text] -- ^ "token_endpoint_auth_methods_supported" - JSON array containing a list of Client Authentication methods supported by this Token Endpoint. The options are client_secret_post, client_secret_basic, client_secret_jwt, and private_key_jwt, as described in Section 9 of OpenID Connect Core 1.0 , wellKnownUserinfoEndpoint :: Maybe Text -- ^ "userinfo_endpoint" - URL of the OP's UserInfo Endpoint. , wellKnownUserinfoSigningAlgValuesSupported :: Maybe [Text] -- ^ "userinfo_signing_alg_values_supported" - JSON array containing a list of the JWS [JWS] signing algorithms (alg values) [JWA] supported by the UserInfo Endpoint to encode the Claims in a JWT [JWT]. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON WellKnown instance A.FromJSON WellKnown where parseJSON = A.withObject "WellKnown" $ \o -> WellKnown <$> (o .: "authorization_endpoint") <*> (o .:? "backchannel_logout_session_supported") <*> (o .:? "backchannel_logout_supported") <*> (o .:? "claims_parameter_supported") <*> (o .:? "claims_supported") <*> (o .:? "end_session_endpoint") <*> (o .:? "frontchannel_logout_session_supported") <*> (o .:? "frontchannel_logout_supported") <*> (o .:? "grant_types_supported") <*> (o .: "id_token_signing_alg_values_supported") <*> (o .: "issuer") <*> (o .: "jwks_uri") <*> (o .:? "registration_endpoint") <*> (o .:? "request_object_signing_alg_values_supported") <*> (o .:? "request_parameter_supported") <*> (o .:? "request_uri_parameter_supported") <*> (o .:? "require_request_uri_registration") <*> (o .:? "response_modes_supported") <*> (o .: "response_types_supported") <*> (o .:? "revocation_endpoint") <*> (o .:? "scopes_supported") <*> (o .: "subject_types_supported") <*> (o .: "token_endpoint") <*> (o .:? "token_endpoint_auth_methods_supported") <*> (o .:? "userinfo_endpoint") <*> (o .:? "userinfo_signing_alg_values_supported") -- | ToJSON WellKnown instance A.ToJSON WellKnown where toJSON WellKnown {..} = _omitNulls [ "authorization_endpoint" .= wellKnownAuthorizationEndpoint , "backchannel_logout_session_supported" .= wellKnownBackchannelLogoutSessionSupported , "backchannel_logout_supported" .= wellKnownBackchannelLogoutSupported , "claims_parameter_supported" .= wellKnownClaimsParameterSupported , "claims_supported" .= wellKnownClaimsSupported , "end_session_endpoint" .= wellKnownEndSessionEndpoint , "frontchannel_logout_session_supported" .= wellKnownFrontchannelLogoutSessionSupported , "frontchannel_logout_supported" .= wellKnownFrontchannelLogoutSupported , "grant_types_supported" .= wellKnownGrantTypesSupported , "id_token_signing_alg_values_supported" .= wellKnownIdTokenSigningAlgValuesSupported , "issuer" .= wellKnownIssuer , "jwks_uri" .= wellKnownJwksUri , "registration_endpoint" .= wellKnownRegistrationEndpoint , "request_object_signing_alg_values_supported" .= wellKnownRequestObjectSigningAlgValuesSupported , "request_parameter_supported" .= wellKnownRequestParameterSupported , "request_uri_parameter_supported" .= wellKnownRequestUriParameterSupported , "require_request_uri_registration" .= wellKnownRequireRequestUriRegistration , "response_modes_supported" .= wellKnownResponseModesSupported , "response_types_supported" .= wellKnownResponseTypesSupported , "revocation_endpoint" .= wellKnownRevocationEndpoint , "scopes_supported" .= wellKnownScopesSupported , "subject_types_supported" .= wellKnownSubjectTypesSupported , "token_endpoint" .= wellKnownTokenEndpoint , "token_endpoint_auth_methods_supported" .= wellKnownTokenEndpointAuthMethodsSupported , "userinfo_endpoint" .= wellKnownUserinfoEndpoint , "userinfo_signing_alg_values_supported" .= wellKnownUserinfoSigningAlgValuesSupported ] -- | Construct a value of type 'WellKnown' (by applying it's required fields, if any) mkWellKnown :: Text -- ^ 'wellKnownAuthorizationEndpoint': URL of the OP's OAuth 2.0 Authorization Endpoint. -> [Text] -- ^ 'wellKnownIdTokenSigningAlgValuesSupported': JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for the ID Token to encode the Claims in a JWT. -> Text -- ^ 'wellKnownIssuer': URL using the https scheme with no query or fragment component that the OP asserts as its IssuerURL Identifier. If IssuerURL discovery is supported , this value MUST be identical to the issuer value returned by WebFinger. This also MUST be identical to the iss Claim value in ID Tokens issued from this IssuerURL. -> Text -- ^ 'wellKnownJwksUri': URL of the OP's JSON Web Key Set [JWK] document. This contains the signing key(s) the RP uses to validate signatures from the OP. The JWK Set MAY also contain the Server's encryption key(s), which are used by RPs to encrypt requests to the Server. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key's intended usage. Although some algorithms allow the same key to be used for both signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. -> [Text] -- ^ 'wellKnownResponseTypesSupported': JSON array containing a list of the OAuth 2.0 response_type values that this OP supports. Dynamic OpenID Providers MUST support the code, id_token, and the token id_token Response Type values. -> [Text] -- ^ 'wellKnownSubjectTypesSupported': JSON array containing a list of the Subject Identifier types that this OP supports. Valid types include pairwise and public. -> Text -- ^ 'wellKnownTokenEndpoint': URL of the OP's OAuth 2.0 Token Endpoint -> WellKnown mkWellKnown wellKnownAuthorizationEndpoint wellKnownIdTokenSigningAlgValuesSupported wellKnownIssuer wellKnownJwksUri wellKnownResponseTypesSupported wellKnownSubjectTypesSupported wellKnownTokenEndpoint = WellKnown { wellKnownAuthorizationEndpoint , wellKnownBackchannelLogoutSessionSupported = Nothing , wellKnownBackchannelLogoutSupported = Nothing , wellKnownClaimsParameterSupported = Nothing , wellKnownClaimsSupported = Nothing , wellKnownEndSessionEndpoint = Nothing , wellKnownFrontchannelLogoutSessionSupported = Nothing , wellKnownFrontchannelLogoutSupported = Nothing , wellKnownGrantTypesSupported = Nothing , wellKnownIdTokenSigningAlgValuesSupported , wellKnownIssuer , wellKnownJwksUri , wellKnownRegistrationEndpoint = Nothing , wellKnownRequestObjectSigningAlgValuesSupported = Nothing , wellKnownRequestParameterSupported = Nothing , wellKnownRequestUriParameterSupported = Nothing , wellKnownRequireRequestUriRegistration = Nothing , wellKnownResponseModesSupported = Nothing , wellKnownResponseTypesSupported , wellKnownRevocationEndpoint = Nothing , wellKnownScopesSupported = Nothing , wellKnownSubjectTypesSupported , wellKnownTokenEndpoint , wellKnownTokenEndpointAuthMethodsSupported = Nothing , wellKnownUserinfoEndpoint = Nothing , wellKnownUserinfoSigningAlgValuesSupported = Nothing } -- * Auth Methods -- ** AuthBasicBasic data AuthBasicBasic = AuthBasicBasic B.ByteString B.ByteString -- ^ username password deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthBasicBasic where applyAuthMethod _ a@(AuthBasicBasic user pw) req = P.pure $ if (P.typeOf a `P.elem` rAuthTypes req) then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) & L.over rAuthTypesL (P.filter (/= P.typeOf a)) else req where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) -- ** AuthOAuthOauth2 data AuthOAuthOauth2 = AuthOAuthOauth2 Text -- ^ secret deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthOAuthOauth2 where applyAuthMethod _ a@(AuthOAuthOauth2 secret) req = P.pure $ if (P.typeOf a `P.elem` rAuthTypes req) then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) & L.over rAuthTypesL (P.filter (/= P.typeOf a)) else req