{-# OPTIONS_GHC -Wno-orphans #-}

module Data.OpenApi.Compare.Validate.OAuth2Flows
  ( Step (..),
    Issue (..),
    Behave (..),
  )
where

import Control.Monad
import Data.Function
import Data.Functor
import qualified Data.HashMap.Strict.InsOrd as IOHM
import Data.OpenApi
import Data.OpenApi.Compare.Behavior
import Data.OpenApi.Compare.Orphans ()
import Data.OpenApi.Compare.Subtree
import Data.Proxy
import Data.Set (Set)
import qualified Data.Set as S
import Data.Text (Text)
import Text.Pandoc.Builder

instance Subtree OAuth2Flows where
  type CheckEnv OAuth2Flows = '[]
  type SubtreeLevel OAuth2Flows = 'SecuritySchemeLevel
  checkStructuralCompatibility :: HList (CheckEnv OAuth2Flows)
-> ProdCons (Traced OAuth2Flows) -> StructuralCompatFormula ()
checkStructuralCompatibility HList (CheckEnv OAuth2Flows)
_ = ProdCons (Traced OAuth2Flows) -> StructuralCompatFormula ()
forall a (w :: * -> *).
(Eq a, Comonad w) =>
ProdCons (w a) -> StructuralCompatFormula ()
structuralEq
  checkSemanticCompatibility :: HList (CheckEnv OAuth2Flows)
-> Behavior (SubtreeLevel OAuth2Flows)
-> ProdCons (Traced OAuth2Flows)
-> SemanticCompatFormula ()
checkSemanticCompatibility HList (CheckEnv OAuth2Flows)
env Behavior (SubtreeLevel OAuth2Flows)
bhv ProdCons (Traced OAuth2Flows)
pc = do
    let supportFlow ::
          (Subtree t, SubtreeLevel t ~ SubtreeLevel OAuth2Flows, CheckEnv OAuth2Flows ~ CheckEnv t) =>
          Issue 'SecuritySchemeLevel ->
          ProdCons (Maybe (Traced t)) ->
          SemanticCompatFormula ()
        supportFlow :: Issue 'SecuritySchemeLevel
-> ProdCons (Maybe (Traced t)) -> SemanticCompatFormula ()
supportFlow Issue 'SecuritySchemeLevel
i ProdCons (Maybe (Traced t))
x = case ProdCons (Maybe (Traced t))
x of
          -- producer will not attempt this flow
          (ProdCons Maybe (Traced t)
Nothing Maybe (Traced t)
_) -> () -> SemanticCompatFormula ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
          -- producer can attempt a flow the consumer does not know about
          (ProdCons (Just Traced t
_) Maybe (Traced t)
Nothing) -> Paths Behave 'APILevel 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> SemanticCompatFormula ()
forall (l :: BehaviorLevel)
       (q :: BehaviorLevel -> BehaviorLevel -> *) (r :: BehaviorLevel) a.
Issuable l =>
Paths q r l -> Issue l -> CompatFormula' q AnIssue r a
issueAt Paths Behave 'APILevel 'SecuritySchemeLevel
Behavior (SubtreeLevel OAuth2Flows)
bhv Issue 'SecuritySchemeLevel
i
          (ProdCons (Just Traced t
p) (Just Traced t
c)) ->
            Behavior (SubtreeLevel t)
-> HList '[] -> ProdCons (Traced t) -> SemanticCompatFormula ()
forall t (xs :: [*]).
(ReassembleHList xs (CheckEnv t), Subtree t) =>
Behavior (SubtreeLevel t)
-> HList xs -> ProdCons (Traced t) -> SemanticCompatFormula ()
checkCompatibility Behavior (SubtreeLevel t)
Behavior (SubtreeLevel OAuth2Flows)
bhv HList '[]
HList (CheckEnv OAuth2Flows)
env (ProdCons (Traced t) -> SemanticCompatFormula ())
-> ProdCons (Traced t) -> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ Traced t -> Traced t -> ProdCons (Traced t)
forall a. a -> a -> ProdCons a
ProdCons Traced t
p Traced t
c
        getFlow ::
          Typeable x =>
          (OAuth2Flows -> Maybe (OAuth2Flow x)) ->
          Traced OAuth2Flows ->
          Maybe (Traced (OAuth2Flow x))
        getFlow :: (OAuth2Flows -> Maybe (OAuth2Flow x))
-> Traced OAuth2Flows -> Maybe (Traced (OAuth2Flow x))
getFlow OAuth2Flows -> Maybe (OAuth2Flow x)
f (Traced Trace OAuth2Flows
t OAuth2Flows
a) = Trace (OAuth2Flow x) -> OAuth2Flow x -> Traced (OAuth2Flow x)
forall a b. Trace a -> b -> Traced' a b
Traced (Trace OAuth2Flows
t Trace OAuth2Flows
-> Paths Step OAuth2Flows (OAuth2Flow x) -> Trace (OAuth2Flow x)
forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k).
Category cat =>
cat a b -> cat b c -> cat a c
>>> Step OAuth2Flows (OAuth2Flow x)
-> Paths Step OAuth2Flows (OAuth2Flow x)
forall k (q :: k -> k -> *) (a :: k) (b :: k).
NiceQuiver q a b =>
q a b -> Paths q a b
step (Proxy x -> Step OAuth2Flows (OAuth2Flow x)
forall t. Proxy t -> Step OAuth2Flows (OAuth2Flow t)
OAuth2FlowsFlow Proxy x
forall k (t :: k). Proxy t
Proxy)) (OAuth2Flow x -> Traced (OAuth2Flow x))
-> Maybe (OAuth2Flow x) -> Maybe (Traced (OAuth2Flow x))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> OAuth2Flows -> Maybe (OAuth2Flow x)
f OAuth2Flows
a
    Issue 'SecuritySchemeLevel
-> ProdCons (Maybe (Traced (OAuth2Flow OAuth2ImplicitFlow)))
-> SemanticCompatFormula ()
forall t.
(Subtree t, SubtreeLevel t ~ SubtreeLevel OAuth2Flows,
 CheckEnv OAuth2Flows ~ CheckEnv t) =>
Issue 'SecuritySchemeLevel
-> ProdCons (Maybe (Traced t)) -> SemanticCompatFormula ()
supportFlow Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportImplicitFlow (ProdCons (Maybe (Traced (OAuth2Flow OAuth2ImplicitFlow)))
 -> SemanticCompatFormula ())
-> ProdCons (Maybe (Traced (OAuth2Flow OAuth2ImplicitFlow)))
-> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ (OAuth2Flows -> Maybe (OAuth2Flow OAuth2ImplicitFlow))
-> Traced OAuth2Flows
-> Maybe (Traced (OAuth2Flow OAuth2ImplicitFlow))
forall x.
Typeable x =>
(OAuth2Flows -> Maybe (OAuth2Flow x))
-> Traced OAuth2Flows -> Maybe (Traced (OAuth2Flow x))
getFlow OAuth2Flows -> Maybe (OAuth2Flow OAuth2ImplicitFlow)
_oAuth2FlowsImplicit (Traced OAuth2Flows
 -> Maybe (Traced (OAuth2Flow OAuth2ImplicitFlow)))
-> ProdCons (Traced OAuth2Flows)
-> ProdCons (Maybe (Traced (OAuth2Flow OAuth2ImplicitFlow)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ProdCons (Traced OAuth2Flows)
pc
    Issue 'SecuritySchemeLevel
-> ProdCons (Maybe (Traced (OAuth2Flow OAuth2PasswordFlow)))
-> SemanticCompatFormula ()
forall t.
(Subtree t, SubtreeLevel t ~ SubtreeLevel OAuth2Flows,
 CheckEnv OAuth2Flows ~ CheckEnv t) =>
Issue 'SecuritySchemeLevel
-> ProdCons (Maybe (Traced t)) -> SemanticCompatFormula ()
supportFlow Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportPasswordFlow (ProdCons (Maybe (Traced (OAuth2Flow OAuth2PasswordFlow)))
 -> SemanticCompatFormula ())
-> ProdCons (Maybe (Traced (OAuth2Flow OAuth2PasswordFlow)))
-> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ (OAuth2Flows -> Maybe (OAuth2Flow OAuth2PasswordFlow))
-> Traced OAuth2Flows
-> Maybe (Traced (OAuth2Flow OAuth2PasswordFlow))
forall x.
Typeable x =>
(OAuth2Flows -> Maybe (OAuth2Flow x))
-> Traced OAuth2Flows -> Maybe (Traced (OAuth2Flow x))
getFlow OAuth2Flows -> Maybe (OAuth2Flow OAuth2PasswordFlow)
_oAuth2FlowsPassword (Traced OAuth2Flows
 -> Maybe (Traced (OAuth2Flow OAuth2PasswordFlow)))
-> ProdCons (Traced OAuth2Flows)
-> ProdCons (Maybe (Traced (OAuth2Flow OAuth2PasswordFlow)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ProdCons (Traced OAuth2Flows)
pc
    Issue 'SecuritySchemeLevel
-> ProdCons
     (Maybe (Traced (OAuth2Flow OAuth2ClientCredentialsFlow)))
-> SemanticCompatFormula ()
forall t.
(Subtree t, SubtreeLevel t ~ SubtreeLevel OAuth2Flows,
 CheckEnv OAuth2Flows ~ CheckEnv t) =>
Issue 'SecuritySchemeLevel
-> ProdCons (Maybe (Traced t)) -> SemanticCompatFormula ()
supportFlow Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportClientCridentialsFlow (ProdCons (Maybe (Traced (OAuth2Flow OAuth2ClientCredentialsFlow)))
 -> SemanticCompatFormula ())
-> ProdCons
     (Maybe (Traced (OAuth2Flow OAuth2ClientCredentialsFlow)))
-> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ (OAuth2Flows -> Maybe (OAuth2Flow OAuth2ClientCredentialsFlow))
-> Traced OAuth2Flows
-> Maybe (Traced (OAuth2Flow OAuth2ClientCredentialsFlow))
forall x.
Typeable x =>
(OAuth2Flows -> Maybe (OAuth2Flow x))
-> Traced OAuth2Flows -> Maybe (Traced (OAuth2Flow x))
getFlow OAuth2Flows -> Maybe (OAuth2Flow OAuth2ClientCredentialsFlow)
_oAuth2FlowsClientCredentials (Traced OAuth2Flows
 -> Maybe (Traced (OAuth2Flow OAuth2ClientCredentialsFlow)))
-> ProdCons (Traced OAuth2Flows)
-> ProdCons
     (Maybe (Traced (OAuth2Flow OAuth2ClientCredentialsFlow)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ProdCons (Traced OAuth2Flows)
pc
    Issue 'SecuritySchemeLevel
-> ProdCons
     (Maybe (Traced (OAuth2Flow OAuth2AuthorizationCodeFlow)))
-> SemanticCompatFormula ()
forall t.
(Subtree t, SubtreeLevel t ~ SubtreeLevel OAuth2Flows,
 CheckEnv OAuth2Flows ~ CheckEnv t) =>
Issue 'SecuritySchemeLevel
-> ProdCons (Maybe (Traced t)) -> SemanticCompatFormula ()
supportFlow Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportAuthorizationCodeFlow (ProdCons (Maybe (Traced (OAuth2Flow OAuth2AuthorizationCodeFlow)))
 -> SemanticCompatFormula ())
-> ProdCons
     (Maybe (Traced (OAuth2Flow OAuth2AuthorizationCodeFlow)))
-> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ (OAuth2Flows -> Maybe (OAuth2Flow OAuth2AuthorizationCodeFlow))
-> Traced OAuth2Flows
-> Maybe (Traced (OAuth2Flow OAuth2AuthorizationCodeFlow))
forall x.
Typeable x =>
(OAuth2Flows -> Maybe (OAuth2Flow x))
-> Traced OAuth2Flows -> Maybe (Traced (OAuth2Flow x))
getFlow OAuth2Flows -> Maybe (OAuth2Flow OAuth2AuthorizationCodeFlow)
_oAuth2FlowsAuthorizationCode (Traced OAuth2Flows
 -> Maybe (Traced (OAuth2Flow OAuth2AuthorizationCodeFlow)))
-> ProdCons (Traced OAuth2Flows)
-> ProdCons
     (Maybe (Traced (OAuth2Flow OAuth2AuthorizationCodeFlow)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ProdCons (Traced OAuth2Flows)
pc
    pure ()

instance Typeable t => Steppable OAuth2Flows (OAuth2Flow t) where
  data Step OAuth2Flows (OAuth2Flow t) = OAuth2FlowsFlow (Proxy t)
    deriving stock (Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
(Step OAuth2Flows (OAuth2Flow t)
 -> Step OAuth2Flows (OAuth2Flow t) -> Bool)
-> (Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t) -> Bool)
-> Eq (Step OAuth2Flows (OAuth2Flow t))
forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
$c/= :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
== :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
$c== :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
Eq, Eq (Step OAuth2Flows (OAuth2Flow t))
Eq (Step OAuth2Flows (OAuth2Flow t))
-> (Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t) -> Ordering)
-> (Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t) -> Bool)
-> (Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t) -> Bool)
-> (Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t) -> Bool)
-> (Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t) -> Bool)
-> (Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t))
-> (Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t)
    -> Step OAuth2Flows (OAuth2Flow t))
-> Ord (Step OAuth2Flows (OAuth2Flow t))
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Ordering
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
forall t. Eq (Step OAuth2Flows (OAuth2Flow t))
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Ordering
forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
min :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
$cmin :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
max :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
$cmax :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t)
>= :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
$c>= :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
> :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
$c> :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
<= :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
$c<= :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
< :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
$c< :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Bool
compare :: Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Ordering
$ccompare :: forall t.
Step OAuth2Flows (OAuth2Flow t)
-> Step OAuth2Flows (OAuth2Flow t) -> Ordering
$cp1Ord :: forall t. Eq (Step OAuth2Flows (OAuth2Flow t))
Ord, Int -> Step OAuth2Flows (OAuth2Flow t) -> ShowS
[Step OAuth2Flows (OAuth2Flow t)] -> ShowS
Step OAuth2Flows (OAuth2Flow t) -> String
(Int -> Step OAuth2Flows (OAuth2Flow t) -> ShowS)
-> (Step OAuth2Flows (OAuth2Flow t) -> String)
-> ([Step OAuth2Flows (OAuth2Flow t)] -> ShowS)
-> Show (Step OAuth2Flows (OAuth2Flow t))
forall t. Int -> Step OAuth2Flows (OAuth2Flow t) -> ShowS
forall t. [Step OAuth2Flows (OAuth2Flow t)] -> ShowS
forall t. Step OAuth2Flows (OAuth2Flow t) -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Step OAuth2Flows (OAuth2Flow t)] -> ShowS
$cshowList :: forall t. [Step OAuth2Flows (OAuth2Flow t)] -> ShowS
show :: Step OAuth2Flows (OAuth2Flow t) -> String
$cshow :: forall t. Step OAuth2Flows (OAuth2Flow t) -> String
showsPrec :: Int -> Step OAuth2Flows (OAuth2Flow t) -> ShowS
$cshowsPrec :: forall t. Int -> Step OAuth2Flows (OAuth2Flow t) -> ShowS
Show)

instance (Typeable t, Subtree t, SubtreeLevel (OAuth2Flow t) ~ SubtreeLevel t) => Subtree (OAuth2Flow t) where
  type CheckEnv (OAuth2Flow t) = CheckEnv t
  type SubtreeLevel (OAuth2Flow t) = 'SecuritySchemeLevel
  checkStructuralCompatibility :: HList (CheckEnv (OAuth2Flow t))
-> ProdCons (Traced (OAuth2Flow t)) -> StructuralCompatFormula ()
checkStructuralCompatibility = HList (CheckEnv (OAuth2Flow t))
-> ProdCons (Traced (OAuth2Flow t)) -> StructuralCompatFormula ()
forall a. HasCallStack => a
undefined
  checkSemanticCompatibility :: HList (CheckEnv (OAuth2Flow t))
-> Behavior (SubtreeLevel (OAuth2Flow t))
-> ProdCons (Traced (OAuth2Flow t))
-> SemanticCompatFormula ()
checkSemanticCompatibility HList (CheckEnv (OAuth2Flow t))
env Behavior (SubtreeLevel (OAuth2Flow t))
bhv prodCons :: ProdCons (Traced (OAuth2Flow t))
prodCons@(ProdCons Traced (OAuth2Flow t)
p Traced (OAuth2Flow t)
c) = do
    let ProdCons Set Text
pScopes Set Text
cScopes = [Text] -> Set Text
forall a. Ord a => [a] -> Set a
S.fromList ([Text] -> Set Text)
-> (Traced (OAuth2Flow t) -> [Text])
-> Traced (OAuth2Flow t)
-> Set Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InsOrdHashMap Text Text -> [Text]
forall k v. InsOrdHashMap k v -> [k]
IOHM.keys (InsOrdHashMap Text Text -> [Text])
-> (Traced (OAuth2Flow t) -> InsOrdHashMap Text Text)
-> Traced (OAuth2Flow t)
-> [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OAuth2Flow t -> InsOrdHashMap Text Text
forall p. OAuth2Flow p -> InsOrdHashMap Text Text
_oAuth2Scopes (OAuth2Flow t -> InsOrdHashMap Text Text)
-> (Traced (OAuth2Flow t) -> OAuth2Flow t)
-> Traced (OAuth2Flow t)
-> InsOrdHashMap Text Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Traced (OAuth2Flow t) -> OAuth2Flow t
forall (w :: * -> *) a. Comonad w => w a -> a
extract (Traced (OAuth2Flow t) -> Set Text)
-> ProdCons (Traced (OAuth2Flow t)) -> ProdCons (Set Text)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ProdCons (Traced (OAuth2Flow t))
prodCons
        missingScopes :: Set Text
missingScopes = Set Text
cScopes Set Text -> Set Text -> Set Text
forall a. Ord a => Set a -> Set a -> Set a
S.\\ Set Text
pScopes
    Bool -> SemanticCompatFormula () -> SemanticCompatFormula ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Set Text -> Bool
forall a. Set a -> Bool
S.null Set Text
missingScopes) (Paths Behave 'APILevel 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> SemanticCompatFormula ()
forall (l :: BehaviorLevel)
       (q :: BehaviorLevel -> BehaviorLevel -> *) (r :: BehaviorLevel) a.
Issuable l =>
Paths q r l -> Issue l -> CompatFormula' q AnIssue r a
issueAt Paths Behave 'APILevel 'SecuritySchemeLevel
Behavior (SubtreeLevel (OAuth2Flow t))
bhv (Issue 'SecuritySchemeLevel -> SemanticCompatFormula ())
-> Issue 'SecuritySchemeLevel -> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ Set Text -> Issue 'SecuritySchemeLevel
ScopesMissing Set Text
missingScopes)
    Behavior (SubtreeLevel t)
-> HList (CheckEnv t)
-> ProdCons (Traced t)
-> SemanticCompatFormula ()
forall t (xs :: [*]).
(ReassembleHList xs (CheckEnv t), Subtree t) =>
Behavior (SubtreeLevel t)
-> HList xs -> ProdCons (Traced t) -> SemanticCompatFormula ()
checkCompatibility Behavior (SubtreeLevel t)
Behavior (SubtreeLevel (OAuth2Flow t))
bhv HList (CheckEnv t)
HList (CheckEnv (OAuth2Flow t))
env (ProdCons (Traced t) -> SemanticCompatFormula ())
-> ProdCons (Traced t) -> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ (Trace (OAuth2Flow t) -> Trace t)
-> Traced' (OAuth2Flow t) t -> Traced t
forall a a' b. (Trace a -> Trace a') -> Traced' a b -> Traced' a' b
retraced (Trace (OAuth2Flow t) -> Paths Step (OAuth2Flow t) t -> Trace t
forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k).
Category cat =>
cat a b -> cat b c -> cat a c
>>> Step (OAuth2Flow t) t -> Paths Step (OAuth2Flow t) t
forall k (q :: k -> k -> *) (a :: k) (b :: k).
NiceQuiver q a b =>
q a b -> Paths q a b
step (Proxy t -> Step (OAuth2Flow t) t
forall t. Proxy t -> Step (OAuth2Flow t) t
OAuth2FlowParamsStep Proxy t
forall k (t :: k). Proxy t
Proxy)) (Traced' (OAuth2Flow t) t -> Traced t)
-> (Traced (OAuth2Flow t) -> Traced' (OAuth2Flow t) t)
-> Traced (OAuth2Flow t)
-> Traced t
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (OAuth2Flow t -> t)
-> Traced (OAuth2Flow t) -> Traced' (OAuth2Flow t) t
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap OAuth2Flow t -> t
forall p. OAuth2Flow p -> p
_oAuth2Params (Traced (OAuth2Flow t) -> Traced t)
-> ProdCons (Traced (OAuth2Flow t)) -> ProdCons (Traced t)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ProdCons (Traced (OAuth2Flow t))
prodCons
    Bool -> SemanticCompatFormula () -> SemanticCompatFormula ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((Maybe URL -> Maybe URL -> Bool
forall a. Eq a => a -> a -> Bool
(==) (Maybe URL -> Maybe URL -> Bool)
-> (Traced (OAuth2Flow t) -> Maybe URL)
-> Traced (OAuth2Flow t)
-> Traced (OAuth2Flow t)
-> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` OAuth2Flow t -> Maybe URL
forall p. OAuth2Flow p -> Maybe URL
_oAath2RefreshUrl (OAuth2Flow t -> Maybe URL)
-> (Traced (OAuth2Flow t) -> OAuth2Flow t)
-> Traced (OAuth2Flow t)
-> Maybe URL
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Traced (OAuth2Flow t) -> OAuth2Flow t
forall (w :: * -> *) a. Comonad w => w a -> a
extract) Traced (OAuth2Flow t)
p Traced (OAuth2Flow t)
c) (SemanticCompatFormula () -> SemanticCompatFormula ())
-> SemanticCompatFormula () -> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ Paths Behave 'APILevel 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> SemanticCompatFormula ()
forall (l :: BehaviorLevel)
       (q :: BehaviorLevel -> BehaviorLevel -> *) (r :: BehaviorLevel) a.
Issuable l =>
Paths q r l -> Issue l -> CompatFormula' q AnIssue r a
issueAt Paths Behave 'APILevel 'SecuritySchemeLevel
Behavior (SubtreeLevel (OAuth2Flow t))
bhv Issue 'SecuritySchemeLevel
RefreshUrlsDontMatch
    pure ()

instance Typeable t => Steppable (OAuth2Flow t) t where
  data Step (OAuth2Flow t) t = OAuth2FlowParamsStep (Proxy t)
    deriving stock (Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
(Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool)
-> (Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool)
-> Eq (Step (OAuth2Flow t) t)
forall t. Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
$c/= :: forall t. Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
== :: Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
$c== :: forall t. Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
Eq, Eq (Step (OAuth2Flow t) t)
Eq (Step (OAuth2Flow t) t)
-> (Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Ordering)
-> (Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool)
-> (Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool)
-> (Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool)
-> (Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool)
-> (Step (OAuth2Flow t) t
    -> Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t)
-> (Step (OAuth2Flow t) t
    -> Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t)
-> Ord (Step (OAuth2Flow t) t)
Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Ordering
Step (OAuth2Flow t) t
-> Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t
forall t. Eq (Step (OAuth2Flow t) t)
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall t. Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
forall t.
Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Ordering
forall t.
Step (OAuth2Flow t) t
-> Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t
min :: Step (OAuth2Flow t) t
-> Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t
$cmin :: forall t.
Step (OAuth2Flow t) t
-> Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t
max :: Step (OAuth2Flow t) t
-> Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t
$cmax :: forall t.
Step (OAuth2Flow t) t
-> Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t
>= :: Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
$c>= :: forall t. Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
> :: Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
$c> :: forall t. Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
<= :: Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
$c<= :: forall t. Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
< :: Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
$c< :: forall t. Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Bool
compare :: Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Ordering
$ccompare :: forall t.
Step (OAuth2Flow t) t -> Step (OAuth2Flow t) t -> Ordering
$cp1Ord :: forall t. Eq (Step (OAuth2Flow t) t)
Ord, Int -> Step (OAuth2Flow t) t -> ShowS
[Step (OAuth2Flow t) t] -> ShowS
Step (OAuth2Flow t) t -> String
(Int -> Step (OAuth2Flow t) t -> ShowS)
-> (Step (OAuth2Flow t) t -> String)
-> ([Step (OAuth2Flow t) t] -> ShowS)
-> Show (Step (OAuth2Flow t) t)
forall t. Int -> Step (OAuth2Flow t) t -> ShowS
forall t. [Step (OAuth2Flow t) t] -> ShowS
forall t. Step (OAuth2Flow t) t -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Step (OAuth2Flow t) t] -> ShowS
$cshowList :: forall t. [Step (OAuth2Flow t) t] -> ShowS
show :: Step (OAuth2Flow t) t -> String
$cshow :: forall t. Step (OAuth2Flow t) t -> String
showsPrec :: Int -> Step (OAuth2Flow t) t -> ShowS
$cshowsPrec :: forall t. Int -> Step (OAuth2Flow t) t -> ShowS
Show)

instance Subtree OAuth2ImplicitFlow where
  type SubtreeLevel OAuth2ImplicitFlow = 'SecuritySchemeLevel
  type CheckEnv OAuth2ImplicitFlow = '[]
  checkStructuralCompatibility :: HList (CheckEnv OAuth2ImplicitFlow)
-> ProdCons (Traced OAuth2ImplicitFlow)
-> StructuralCompatFormula ()
checkStructuralCompatibility = HList (CheckEnv OAuth2ImplicitFlow)
-> ProdCons (Traced OAuth2ImplicitFlow)
-> StructuralCompatFormula ()
forall a. HasCallStack => a
undefined
  checkSemanticCompatibility :: HList (CheckEnv OAuth2ImplicitFlow)
-> Behavior (SubtreeLevel OAuth2ImplicitFlow)
-> ProdCons (Traced OAuth2ImplicitFlow)
-> SemanticCompatFormula ()
checkSemanticCompatibility HList (CheckEnv OAuth2ImplicitFlow)
_ Behavior (SubtreeLevel OAuth2ImplicitFlow)
bhv (ProdCons Traced OAuth2ImplicitFlow
p Traced OAuth2ImplicitFlow
c) =
    Bool -> SemanticCompatFormula () -> SemanticCompatFormula ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Traced OAuth2ImplicitFlow -> OAuth2ImplicitFlow
forall (w :: * -> *) a. Comonad w => w a -> a
extract Traced OAuth2ImplicitFlow
p OAuth2ImplicitFlow -> OAuth2ImplicitFlow -> Bool
forall a. Eq a => a -> a -> Bool
== Traced OAuth2ImplicitFlow -> OAuth2ImplicitFlow
forall (w :: * -> *) a. Comonad w => w a -> a
extract Traced OAuth2ImplicitFlow
c) (SemanticCompatFormula () -> SemanticCompatFormula ())
-> SemanticCompatFormula () -> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ Paths Behave 'APILevel 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> SemanticCompatFormula ()
forall (l :: BehaviorLevel)
       (q :: BehaviorLevel -> BehaviorLevel -> *) (r :: BehaviorLevel) a.
Issuable l =>
Paths q r l -> Issue l -> CompatFormula' q AnIssue r a
issueAt Paths Behave 'APILevel 'SecuritySchemeLevel
Behavior (SubtreeLevel OAuth2ImplicitFlow)
bhv Issue 'SecuritySchemeLevel
OAuth2ImplicitFlowNotEqual

instance Subtree OAuth2PasswordFlow where
  type SubtreeLevel OAuth2PasswordFlow = 'SecuritySchemeLevel
  type CheckEnv OAuth2PasswordFlow = '[]
  checkStructuralCompatibility :: HList (CheckEnv OAuth2PasswordFlow)
-> ProdCons (Traced OAuth2PasswordFlow)
-> StructuralCompatFormula ()
checkStructuralCompatibility = HList (CheckEnv OAuth2PasswordFlow)
-> ProdCons (Traced OAuth2PasswordFlow)
-> StructuralCompatFormula ()
forall a. HasCallStack => a
undefined
  checkSemanticCompatibility :: HList (CheckEnv OAuth2PasswordFlow)
-> Behavior (SubtreeLevel OAuth2PasswordFlow)
-> ProdCons (Traced OAuth2PasswordFlow)
-> SemanticCompatFormula ()
checkSemanticCompatibility HList (CheckEnv OAuth2PasswordFlow)
_ Behavior (SubtreeLevel OAuth2PasswordFlow)
bhv (ProdCons Traced OAuth2PasswordFlow
p Traced OAuth2PasswordFlow
c) =
    Bool -> SemanticCompatFormula () -> SemanticCompatFormula ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Traced OAuth2PasswordFlow -> OAuth2PasswordFlow
forall (w :: * -> *) a. Comonad w => w a -> a
extract Traced OAuth2PasswordFlow
p OAuth2PasswordFlow -> OAuth2PasswordFlow -> Bool
forall a. Eq a => a -> a -> Bool
== Traced OAuth2PasswordFlow -> OAuth2PasswordFlow
forall (w :: * -> *) a. Comonad w => w a -> a
extract Traced OAuth2PasswordFlow
c) (SemanticCompatFormula () -> SemanticCompatFormula ())
-> SemanticCompatFormula () -> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ Paths Behave 'APILevel 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> SemanticCompatFormula ()
forall (l :: BehaviorLevel)
       (q :: BehaviorLevel -> BehaviorLevel -> *) (r :: BehaviorLevel) a.
Issuable l =>
Paths q r l -> Issue l -> CompatFormula' q AnIssue r a
issueAt Paths Behave 'APILevel 'SecuritySchemeLevel
Behavior (SubtreeLevel OAuth2PasswordFlow)
bhv Issue 'SecuritySchemeLevel
OAuth2PasswordFlowNotEqual

instance Subtree OAuth2ClientCredentialsFlow where
  type SubtreeLevel OAuth2ClientCredentialsFlow = 'SecuritySchemeLevel
  type CheckEnv OAuth2ClientCredentialsFlow = '[]
  checkStructuralCompatibility :: HList (CheckEnv OAuth2ClientCredentialsFlow)
-> ProdCons (Traced OAuth2ClientCredentialsFlow)
-> StructuralCompatFormula ()
checkStructuralCompatibility = HList (CheckEnv OAuth2ClientCredentialsFlow)
-> ProdCons (Traced OAuth2ClientCredentialsFlow)
-> StructuralCompatFormula ()
forall a. HasCallStack => a
undefined
  checkSemanticCompatibility :: HList (CheckEnv OAuth2ClientCredentialsFlow)
-> Behavior (SubtreeLevel OAuth2ClientCredentialsFlow)
-> ProdCons (Traced OAuth2ClientCredentialsFlow)
-> SemanticCompatFormula ()
checkSemanticCompatibility HList (CheckEnv OAuth2ClientCredentialsFlow)
_ Behavior (SubtreeLevel OAuth2ClientCredentialsFlow)
bhv (ProdCons Traced OAuth2ClientCredentialsFlow
p Traced OAuth2ClientCredentialsFlow
c) =
    Bool -> SemanticCompatFormula () -> SemanticCompatFormula ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Traced OAuth2ClientCredentialsFlow -> OAuth2ClientCredentialsFlow
forall (w :: * -> *) a. Comonad w => w a -> a
extract Traced OAuth2ClientCredentialsFlow
p OAuth2ClientCredentialsFlow -> OAuth2ClientCredentialsFlow -> Bool
forall a. Eq a => a -> a -> Bool
== Traced OAuth2ClientCredentialsFlow -> OAuth2ClientCredentialsFlow
forall (w :: * -> *) a. Comonad w => w a -> a
extract Traced OAuth2ClientCredentialsFlow
c) (SemanticCompatFormula () -> SemanticCompatFormula ())
-> SemanticCompatFormula () -> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ Paths Behave 'APILevel 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> SemanticCompatFormula ()
forall (l :: BehaviorLevel)
       (q :: BehaviorLevel -> BehaviorLevel -> *) (r :: BehaviorLevel) a.
Issuable l =>
Paths q r l -> Issue l -> CompatFormula' q AnIssue r a
issueAt Paths Behave 'APILevel 'SecuritySchemeLevel
Behavior (SubtreeLevel OAuth2ClientCredentialsFlow)
bhv Issue 'SecuritySchemeLevel
OAuth2ClientCredentialsFlowNotEqual

instance Subtree OAuth2AuthorizationCodeFlow where
  type SubtreeLevel OAuth2AuthorizationCodeFlow = 'SecuritySchemeLevel
  type CheckEnv OAuth2AuthorizationCodeFlow = '[]
  checkStructuralCompatibility :: HList (CheckEnv OAuth2AuthorizationCodeFlow)
-> ProdCons (Traced OAuth2AuthorizationCodeFlow)
-> StructuralCompatFormula ()
checkStructuralCompatibility = HList (CheckEnv OAuth2AuthorizationCodeFlow)
-> ProdCons (Traced OAuth2AuthorizationCodeFlow)
-> StructuralCompatFormula ()
forall a. HasCallStack => a
undefined
  checkSemanticCompatibility :: HList (CheckEnv OAuth2AuthorizationCodeFlow)
-> Behavior (SubtreeLevel OAuth2AuthorizationCodeFlow)
-> ProdCons (Traced OAuth2AuthorizationCodeFlow)
-> SemanticCompatFormula ()
checkSemanticCompatibility HList (CheckEnv OAuth2AuthorizationCodeFlow)
_ Behavior (SubtreeLevel OAuth2AuthorizationCodeFlow)
bhv (ProdCons Traced OAuth2AuthorizationCodeFlow
p Traced OAuth2AuthorizationCodeFlow
c) =
    Bool -> SemanticCompatFormula () -> SemanticCompatFormula ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Traced OAuth2AuthorizationCodeFlow -> OAuth2AuthorizationCodeFlow
forall (w :: * -> *) a. Comonad w => w a -> a
extract Traced OAuth2AuthorizationCodeFlow
p OAuth2AuthorizationCodeFlow -> OAuth2AuthorizationCodeFlow -> Bool
forall a. Eq a => a -> a -> Bool
== Traced OAuth2AuthorizationCodeFlow -> OAuth2AuthorizationCodeFlow
forall (w :: * -> *) a. Comonad w => w a -> a
extract Traced OAuth2AuthorizationCodeFlow
c) (SemanticCompatFormula () -> SemanticCompatFormula ())
-> SemanticCompatFormula () -> SemanticCompatFormula ()
forall a b. (a -> b) -> a -> b
$ Paths Behave 'APILevel 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> SemanticCompatFormula ()
forall (l :: BehaviorLevel)
       (q :: BehaviorLevel -> BehaviorLevel -> *) (r :: BehaviorLevel) a.
Issuable l =>
Paths q r l -> Issue l -> CompatFormula' q AnIssue r a
issueAt Paths Behave 'APILevel 'SecuritySchemeLevel
Behavior (SubtreeLevel OAuth2AuthorizationCodeFlow)
bhv Issue 'SecuritySchemeLevel
OAuth2AuthorizationCodeFlowNotEqual

instance Issuable 'SecurityRequirementLevel where
  data Issue 'SecurityRequirementLevel
    = SecurityRequirementNotMet
    | UndefinedSecurityScheme Text
    deriving stock (Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
(Issue 'SecurityRequirementLevel
 -> Issue 'SecurityRequirementLevel -> Bool)
-> (Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel -> Bool)
-> Eq (Issue 'SecurityRequirementLevel)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
$c/= :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
== :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
$c== :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
Eq, Eq (Issue 'SecurityRequirementLevel)
Eq (Issue 'SecurityRequirementLevel)
-> (Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel -> Ordering)
-> (Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel -> Bool)
-> (Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel -> Bool)
-> (Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel -> Bool)
-> (Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel -> Bool)
-> (Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel)
-> (Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel
    -> Issue 'SecurityRequirementLevel)
-> Ord (Issue 'SecurityRequirementLevel)
Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Ordering
Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
$cmin :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
max :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
$cmax :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel
>= :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
$c>= :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
> :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
$c> :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
<= :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
$c<= :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
< :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
$c< :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Bool
compare :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Ordering
$ccompare :: Issue 'SecurityRequirementLevel
-> Issue 'SecurityRequirementLevel -> Ordering
$cp1Ord :: Eq (Issue 'SecurityRequirementLevel)
Ord, Int -> Issue 'SecurityRequirementLevel -> ShowS
[Issue 'SecurityRequirementLevel] -> ShowS
Issue 'SecurityRequirementLevel -> String
(Int -> Issue 'SecurityRequirementLevel -> ShowS)
-> (Issue 'SecurityRequirementLevel -> String)
-> ([Issue 'SecurityRequirementLevel] -> ShowS)
-> Show (Issue 'SecurityRequirementLevel)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Issue 'SecurityRequirementLevel] -> ShowS
$cshowList :: [Issue 'SecurityRequirementLevel] -> ShowS
show :: Issue 'SecurityRequirementLevel -> String
$cshow :: Issue 'SecurityRequirementLevel -> String
showsPrec :: Int -> Issue 'SecurityRequirementLevel -> ShowS
$cshowsPrec :: Int -> Issue 'SecurityRequirementLevel -> ShowS
Show)
  issueKind :: Issue 'SecurityRequirementLevel -> IssueKind
issueKind = \case
    Issue 'SecurityRequirementLevel
SecurityRequirementNotMet -> IssueKind
CertainIssue
    UndefinedSecurityScheme _ -> IssueKind
SchemaInvalid
  describeIssue :: Orientation -> Issue 'SecurityRequirementLevel -> Blocks
describeIssue Orientation
Forward Issue 'SecurityRequirementLevel
SecurityRequirementNotMet = Inlines -> Blocks
para Inlines
"Security scheme has been removed."
  describeIssue Orientation
Backward Issue 'SecurityRequirementLevel
SecurityRequirementNotMet = Inlines -> Blocks
para Inlines
"Security scheme was added."
  describeIssue Orientation
_ (UndefinedSecurityScheme k) = Inlines -> Blocks
para (Inlines -> Blocks) -> Inlines -> Blocks
forall a b. (a -> b) -> a -> b
$ Inlines
"Security scheme " Inlines -> Inlines -> Inlines
forall a. Semigroup a => a -> a -> a
<> Text -> Inlines
code Text
k Inlines -> Inlines -> Inlines
forall a. Semigroup a => a -> a -> a
<> Inlines
" is not defined."

instance Issuable 'SecuritySchemeLevel where
  data Issue 'SecuritySchemeLevel
    = RefreshUrlsDontMatch
    | HttpSchemeTypesDontMatch HttpSchemeType HttpSchemeType
    | ApiKeyParamsDontMatch ApiKeyParams ApiKeyParams
    | OpenIdConnectUrlsDontMatch URL URL
    | CustomHttpSchemesDontMatch Text Text
    | ConsumerDoesNotSupportImplicitFlow
    | ConsumerDoesNotSupportPasswordFlow
    | ConsumerDoesNotSupportClientCridentialsFlow
    | ConsumerDoesNotSupportAuthorizationCodeFlow
    | SecuritySchemeNotMatched
    | OAuth2ImplicitFlowNotEqual
    | OAuth2PasswordFlowNotEqual
    | OAuth2ClientCredentialsFlowNotEqual
    | OAuth2AuthorizationCodeFlowNotEqual
    | ScopesMissing (Set Text)
    | DifferentSecuritySchemes
    | CanNotHaveScopes
    | ScopeNotDefined Text
    deriving stock (Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
(Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool)
-> (Issue 'SecuritySchemeLevel
    -> Issue 'SecuritySchemeLevel -> Bool)
-> Eq (Issue 'SecuritySchemeLevel)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
$c/= :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
== :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
$c== :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
Eq, Eq (Issue 'SecuritySchemeLevel)
Eq (Issue 'SecuritySchemeLevel)
-> (Issue 'SecuritySchemeLevel
    -> Issue 'SecuritySchemeLevel -> Ordering)
-> (Issue 'SecuritySchemeLevel
    -> Issue 'SecuritySchemeLevel -> Bool)
-> (Issue 'SecuritySchemeLevel
    -> Issue 'SecuritySchemeLevel -> Bool)
-> (Issue 'SecuritySchemeLevel
    -> Issue 'SecuritySchemeLevel -> Bool)
-> (Issue 'SecuritySchemeLevel
    -> Issue 'SecuritySchemeLevel -> Bool)
-> (Issue 'SecuritySchemeLevel
    -> Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel)
-> (Issue 'SecuritySchemeLevel
    -> Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel)
-> Ord (Issue 'SecuritySchemeLevel)
Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
Issue 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> Ordering
Issue 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Issue 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel
$cmin :: Issue 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel
max :: Issue 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel
$cmax :: Issue 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel
>= :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
$c>= :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
> :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
$c> :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
<= :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
$c<= :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
< :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
$c< :: Issue 'SecuritySchemeLevel -> Issue 'SecuritySchemeLevel -> Bool
compare :: Issue 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> Ordering
$ccompare :: Issue 'SecuritySchemeLevel
-> Issue 'SecuritySchemeLevel -> Ordering
$cp1Ord :: Eq (Issue 'SecuritySchemeLevel)
Ord, Int -> Issue 'SecuritySchemeLevel -> ShowS
[Issue 'SecuritySchemeLevel] -> ShowS
Issue 'SecuritySchemeLevel -> String
(Int -> Issue 'SecuritySchemeLevel -> ShowS)
-> (Issue 'SecuritySchemeLevel -> String)
-> ([Issue 'SecuritySchemeLevel] -> ShowS)
-> Show (Issue 'SecuritySchemeLevel)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Issue 'SecuritySchemeLevel] -> ShowS
$cshowList :: [Issue 'SecuritySchemeLevel] -> ShowS
show :: Issue 'SecuritySchemeLevel -> String
$cshow :: Issue 'SecuritySchemeLevel -> String
showsPrec :: Int -> Issue 'SecuritySchemeLevel -> ShowS
$cshowsPrec :: Int -> Issue 'SecuritySchemeLevel -> ShowS
Show)
  issueKind :: Issue 'SecuritySchemeLevel -> IssueKind
issueKind = \case
    Issue 'SecuritySchemeLevel
CanNotHaveScopes -> IssueKind
SchemaInvalid
    ScopeNotDefined _ -> IssueKind
SchemaInvalid
    Issue 'SecuritySchemeLevel
_ -> IssueKind
CertainIssue
  describeIssue :: Orientation -> Issue 'SecuritySchemeLevel -> Blocks
describeIssue Orientation
_ Issue 'SecuritySchemeLevel
RefreshUrlsDontMatch = Inlines -> Blocks
para Inlines
"Refresh URL changed."
  describeIssue Orientation
_ (HttpSchemeTypesDontMatch _ _) = Inlines -> Blocks
para Inlines
"HTTP scheme type changed."
  describeIssue Orientation
_ (ApiKeyParamsDontMatch _ _) = Inlines -> Blocks
para Inlines
"API Key parameters changed."
  describeIssue Orientation
_ (OpenIdConnectUrlsDontMatch _ _) = Inlines -> Blocks
para Inlines
"OpenID Connect URL changed."
  describeIssue Orientation
_ (CustomHttpSchemesDontMatch e a) =
    Inlines -> Blocks
para (Inlines -> Blocks) -> Inlines -> Blocks
forall a b. (a -> b) -> a -> b
$ Inlines
"Changed HTTP scheme from " Inlines -> Inlines -> Inlines
forall a. Semigroup a => a -> a -> a
<> Text -> Inlines
code Text
e Inlines -> Inlines -> Inlines
forall a. Semigroup a => a -> a -> a
<> Inlines
" to " Inlines -> Inlines -> Inlines
forall a. Semigroup a => a -> a -> a
<> Text -> Inlines
code Text
a Inlines -> Inlines -> Inlines
forall a. Semigroup a => a -> a -> a
<> Inlines
"."
  describeIssue Orientation
Forward Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportImplicitFlow = Inlines -> Blocks
para Inlines
"Implicit flow support has been removed."
  describeIssue Orientation
Backward Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportImplicitFlow = Inlines -> Blocks
para Inlines
"Implicit flow support has been added."
  describeIssue Orientation
Forward Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportPasswordFlow = Inlines -> Blocks
para Inlines
"Password flow support has been removed."
  describeIssue Orientation
Backward Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportPasswordFlow = Inlines -> Blocks
para Inlines
"Password flow support has been added."
  describeIssue Orientation
Forward Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportClientCridentialsFlow = Inlines -> Blocks
para Inlines
"Client Cridentials flow support has been removed."
  describeIssue Orientation
Backward Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportClientCridentialsFlow = Inlines -> Blocks
para Inlines
"Client Cridentials flow support has been added."
  describeIssue Orientation
Forward Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportAuthorizationCodeFlow = Inlines -> Blocks
para Inlines
"Authorization Code flow support has been removed."
  describeIssue Orientation
Backward Issue 'SecuritySchemeLevel
ConsumerDoesNotSupportAuthorizationCodeFlow = Inlines -> Blocks
para Inlines
"Authorization Code flow support has been added."
  describeIssue Orientation
Forward Issue 'SecuritySchemeLevel
SecuritySchemeNotMatched = Inlines -> Blocks
para Inlines
"Security scheme has been removed."
  describeIssue Orientation
Backward Issue 'SecuritySchemeLevel
SecuritySchemeNotMatched = Inlines -> Blocks
para Inlines
"Security scheme has been added."
  describeIssue Orientation
_ Issue 'SecuritySchemeLevel
OAuth2ImplicitFlowNotEqual = Inlines -> Blocks
para Inlines
"Implicit Flow changed."
  describeIssue Orientation
_ Issue 'SecuritySchemeLevel
OAuth2PasswordFlowNotEqual = Inlines -> Blocks
para Inlines
"Password Flow changed."
  describeIssue Orientation
_ Issue 'SecuritySchemeLevel
OAuth2ClientCredentialsFlowNotEqual = Inlines -> Blocks
para Inlines
"Client Cridentials Flow changed."
  describeIssue Orientation
_ Issue 'SecuritySchemeLevel
OAuth2AuthorizationCodeFlowNotEqual = Inlines -> Blocks
para Inlines
"Authorization Code Flow changed."
  describeIssue Orientation
Forward (ScopesMissing ss) =
    Inlines -> Blocks
para Inlines
"New scopes required:" Blocks -> Blocks -> Blocks
forall a. Semigroup a => a -> a -> a
<> [Blocks] -> Blocks
bulletList (Set Text -> [Text]
forall a. Set a -> [a]
S.toList Set Text
ss [Text] -> (Text -> Blocks) -> [Blocks]
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> Text -> Blocks
codeBlock)
  describeIssue Orientation
Backward (ScopesMissing ss) =
    Inlines -> Blocks
para Inlines
"Scopes no longer required:" Blocks -> Blocks -> Blocks
forall a. Semigroup a => a -> a -> a
<> [Blocks] -> Blocks
bulletList (Set Text -> [Text]
forall a. Set a -> [a]
S.toList Set Text
ss [Text] -> (Text -> Blocks) -> [Blocks]
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> Text -> Blocks
codeBlock)
  describeIssue Orientation
_ Issue 'SecuritySchemeLevel
DifferentSecuritySchemes = Inlines -> Blocks
para Inlines
"Completely different security scheme types."
  describeIssue Orientation
_ Issue 'SecuritySchemeLevel
CanNotHaveScopes = Inlines -> Blocks
para Inlines
"The specified security scheme can not have scopes."
  describeIssue Orientation
_ (ScopeNotDefined k) = Inlines -> Blocks
para (Inlines -> Blocks) -> Inlines -> Blocks
forall a b. (a -> b) -> a -> b
$ Inlines
"Scope with key " Inlines -> Inlines -> Inlines
forall a. Semigroup a => a -> a -> a
<> Text -> Inlines
code Text
k Inlines -> Inlines -> Inlines
forall a. Semigroup a => a -> a -> a
<> Inlines
" is not defined."

instance Behavable 'SecurityRequirementLevel 'SecuritySchemeLevel where
  data Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    = SecuritySchemeStep Text
    deriving stock (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
(Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
 -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool)
-> Eq (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
$c/= :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
== :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
$c== :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
Eq, Eq (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel)
Eq (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Ordering)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel)
-> Ord (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel)
Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Ordering
Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
$cmin :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
max :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
$cmax :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
>= :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
$c>= :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
> :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
$c> :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
<= :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
$c<= :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
< :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
$c< :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Bool
compare :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Ordering
$ccompare :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
-> Ordering
$cp1Ord :: Eq (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel)
Ord, Int
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> ShowS
[Behave 'SecurityRequirementLevel 'SecuritySchemeLevel] -> ShowS
Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> String
(Int
 -> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> ShowS)
-> (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel
    -> String)
-> ([Behave 'SecurityRequirementLevel 'SecuritySchemeLevel]
    -> ShowS)
-> Show (Behave 'SecurityRequirementLevel 'SecuritySchemeLevel)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Behave 'SecurityRequirementLevel 'SecuritySchemeLevel] -> ShowS
$cshowList :: [Behave 'SecurityRequirementLevel 'SecuritySchemeLevel] -> ShowS
show :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> String
$cshow :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> String
showsPrec :: Int
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> ShowS
$cshowsPrec :: Int
-> Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> ShowS
Show)
  describeBehavior :: Behave 'SecurityRequirementLevel 'SecuritySchemeLevel -> Inlines
describeBehavior (SecuritySchemeStep s) = Text -> Inlines
text Text
s