{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module SAML2.Core.Identifiers where
import Data.Default (Default(..))
import SAML2.XML
import SAML2.Core.Namespaces
import SAML2.Core.Versioning
data ActionNamespace
= ActionNamespaceRWEDC
| ActionNamespaceRWEDCNegation
| ActionNamespaceGHPP
| ActionNamespaceUNIX
deriving (ActionNamespace -> ActionNamespace -> Bool
(ActionNamespace -> ActionNamespace -> Bool)
-> (ActionNamespace -> ActionNamespace -> Bool)
-> Eq ActionNamespace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ActionNamespace -> ActionNamespace -> Bool
== :: ActionNamespace -> ActionNamespace -> Bool
$c/= :: ActionNamespace -> ActionNamespace -> Bool
/= :: ActionNamespace -> ActionNamespace -> Bool
Eq, Int -> ActionNamespace
ActionNamespace -> Int
ActionNamespace -> [ActionNamespace]
ActionNamespace -> ActionNamespace
ActionNamespace -> ActionNamespace -> [ActionNamespace]
ActionNamespace
-> ActionNamespace -> ActionNamespace -> [ActionNamespace]
(ActionNamespace -> ActionNamespace)
-> (ActionNamespace -> ActionNamespace)
-> (Int -> ActionNamespace)
-> (ActionNamespace -> Int)
-> (ActionNamespace -> [ActionNamespace])
-> (ActionNamespace -> ActionNamespace -> [ActionNamespace])
-> (ActionNamespace -> ActionNamespace -> [ActionNamespace])
-> (ActionNamespace
-> ActionNamespace -> ActionNamespace -> [ActionNamespace])
-> Enum ActionNamespace
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ActionNamespace -> ActionNamespace
succ :: ActionNamespace -> ActionNamespace
$cpred :: ActionNamespace -> ActionNamespace
pred :: ActionNamespace -> ActionNamespace
$ctoEnum :: Int -> ActionNamespace
toEnum :: Int -> ActionNamespace
$cfromEnum :: ActionNamespace -> Int
fromEnum :: ActionNamespace -> Int
$cenumFrom :: ActionNamespace -> [ActionNamespace]
enumFrom :: ActionNamespace -> [ActionNamespace]
$cenumFromThen :: ActionNamespace -> ActionNamespace -> [ActionNamespace]
enumFromThen :: ActionNamespace -> ActionNamespace -> [ActionNamespace]
$cenumFromTo :: ActionNamespace -> ActionNamespace -> [ActionNamespace]
enumFromTo :: ActionNamespace -> ActionNamespace -> [ActionNamespace]
$cenumFromThenTo :: ActionNamespace
-> ActionNamespace -> ActionNamespace -> [ActionNamespace]
enumFromThenTo :: ActionNamespace
-> ActionNamespace -> ActionNamespace -> [ActionNamespace]
Enum, ActionNamespace
ActionNamespace -> ActionNamespace -> Bounded ActionNamespace
forall a. a -> a -> Bounded a
$cminBound :: ActionNamespace
minBound :: ActionNamespace
$cmaxBound :: ActionNamespace
maxBound :: ActionNamespace
Bounded, Int -> ActionNamespace -> ShowS
[ActionNamespace] -> ShowS
ActionNamespace -> String
(Int -> ActionNamespace -> ShowS)
-> (ActionNamespace -> String)
-> ([ActionNamespace] -> ShowS)
-> Show ActionNamespace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ActionNamespace -> ShowS
showsPrec :: Int -> ActionNamespace -> ShowS
$cshow :: ActionNamespace -> String
show :: ActionNamespace -> String
$cshowList :: [ActionNamespace] -> ShowS
showList :: [ActionNamespace] -> ShowS
Show)
instance Identifiable URI ActionNamespace where
identifier :: ActionNamespace -> URI
identifier = String -> (SAMLVersion, String) -> URI
samlURNIdentifier String
"action" ((SAMLVersion, String) -> URI)
-> (ActionNamespace -> (SAMLVersion, String))
-> ActionNamespace
-> URI
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ActionNamespace -> (SAMLVersion, String)
f where
f :: ActionNamespace -> (SAMLVersion, String)
f ActionNamespace
ActionNamespaceRWEDC = (SAMLVersion
SAML10, String
"rwedc")
f ActionNamespace
ActionNamespaceRWEDCNegation = (SAMLVersion
SAML10, String
"rwedc-negation")
f ActionNamespace
ActionNamespaceGHPP = (SAMLVersion
SAML10, String
"ghpp")
f ActionNamespace
ActionNamespaceUNIX = (SAMLVersion
SAML10, String
"unix")
data AttributeNameFormat
= AttributeNameFormatUnspecified
| AttributeNameFormatURI
| AttributeNameFormatBasic
deriving (AttributeNameFormat -> AttributeNameFormat -> Bool
(AttributeNameFormat -> AttributeNameFormat -> Bool)
-> (AttributeNameFormat -> AttributeNameFormat -> Bool)
-> Eq AttributeNameFormat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AttributeNameFormat -> AttributeNameFormat -> Bool
== :: AttributeNameFormat -> AttributeNameFormat -> Bool
$c/= :: AttributeNameFormat -> AttributeNameFormat -> Bool
/= :: AttributeNameFormat -> AttributeNameFormat -> Bool
Eq, Int -> AttributeNameFormat
AttributeNameFormat -> Int
AttributeNameFormat -> [AttributeNameFormat]
AttributeNameFormat -> AttributeNameFormat
AttributeNameFormat -> AttributeNameFormat -> [AttributeNameFormat]
AttributeNameFormat
-> AttributeNameFormat
-> AttributeNameFormat
-> [AttributeNameFormat]
(AttributeNameFormat -> AttributeNameFormat)
-> (AttributeNameFormat -> AttributeNameFormat)
-> (Int -> AttributeNameFormat)
-> (AttributeNameFormat -> Int)
-> (AttributeNameFormat -> [AttributeNameFormat])
-> (AttributeNameFormat
-> AttributeNameFormat -> [AttributeNameFormat])
-> (AttributeNameFormat
-> AttributeNameFormat -> [AttributeNameFormat])
-> (AttributeNameFormat
-> AttributeNameFormat
-> AttributeNameFormat
-> [AttributeNameFormat])
-> Enum AttributeNameFormat
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: AttributeNameFormat -> AttributeNameFormat
succ :: AttributeNameFormat -> AttributeNameFormat
$cpred :: AttributeNameFormat -> AttributeNameFormat
pred :: AttributeNameFormat -> AttributeNameFormat
$ctoEnum :: Int -> AttributeNameFormat
toEnum :: Int -> AttributeNameFormat
$cfromEnum :: AttributeNameFormat -> Int
fromEnum :: AttributeNameFormat -> Int
$cenumFrom :: AttributeNameFormat -> [AttributeNameFormat]
enumFrom :: AttributeNameFormat -> [AttributeNameFormat]
$cenumFromThen :: AttributeNameFormat -> AttributeNameFormat -> [AttributeNameFormat]
enumFromThen :: AttributeNameFormat -> AttributeNameFormat -> [AttributeNameFormat]
$cenumFromTo :: AttributeNameFormat -> AttributeNameFormat -> [AttributeNameFormat]
enumFromTo :: AttributeNameFormat -> AttributeNameFormat -> [AttributeNameFormat]
$cenumFromThenTo :: AttributeNameFormat
-> AttributeNameFormat
-> AttributeNameFormat
-> [AttributeNameFormat]
enumFromThenTo :: AttributeNameFormat
-> AttributeNameFormat
-> AttributeNameFormat
-> [AttributeNameFormat]
Enum, AttributeNameFormat
AttributeNameFormat
-> AttributeNameFormat -> Bounded AttributeNameFormat
forall a. a -> a -> Bounded a
$cminBound :: AttributeNameFormat
minBound :: AttributeNameFormat
$cmaxBound :: AttributeNameFormat
maxBound :: AttributeNameFormat
Bounded, Int -> AttributeNameFormat -> ShowS
[AttributeNameFormat] -> ShowS
AttributeNameFormat -> String
(Int -> AttributeNameFormat -> ShowS)
-> (AttributeNameFormat -> String)
-> ([AttributeNameFormat] -> ShowS)
-> Show AttributeNameFormat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AttributeNameFormat -> ShowS
showsPrec :: Int -> AttributeNameFormat -> ShowS
$cshow :: AttributeNameFormat -> String
show :: AttributeNameFormat -> String
$cshowList :: [AttributeNameFormat] -> ShowS
showList :: [AttributeNameFormat] -> ShowS
Show)
instance Identifiable URI AttributeNameFormat where
identifier :: AttributeNameFormat -> URI
identifier = String -> (SAMLVersion, String) -> URI
samlURNIdentifier String
"attrname-format" ((SAMLVersion, String) -> URI)
-> (AttributeNameFormat -> (SAMLVersion, String))
-> AttributeNameFormat
-> URI
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AttributeNameFormat -> (SAMLVersion, String)
f where
f :: AttributeNameFormat -> (SAMLVersion, String)
f AttributeNameFormat
AttributeNameFormatUnspecified = (SAMLVersion
SAML20, String
"unspecified")
f AttributeNameFormat
AttributeNameFormatURI = (SAMLVersion
SAML20, String
"uri")
f AttributeNameFormat
AttributeNameFormatBasic = (SAMLVersion
SAML20, String
"basic")
data NameIDFormat
= NameIDFormatUnspecified
| NameIDFormatEmail
| NameIDFormatX509
| NameIDFormatWindows
| NameIDFormatKerberos
| NameIDFormatEntity
| NameIDFormatPersistent
| NameIDFormatTransient
| NameIDFormatEncrypted
deriving (NameIDFormat -> NameIDFormat -> Bool
(NameIDFormat -> NameIDFormat -> Bool)
-> (NameIDFormat -> NameIDFormat -> Bool) -> Eq NameIDFormat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NameIDFormat -> NameIDFormat -> Bool
== :: NameIDFormat -> NameIDFormat -> Bool
$c/= :: NameIDFormat -> NameIDFormat -> Bool
/= :: NameIDFormat -> NameIDFormat -> Bool
Eq, Int -> NameIDFormat
NameIDFormat -> Int
NameIDFormat -> [NameIDFormat]
NameIDFormat -> NameIDFormat
NameIDFormat -> NameIDFormat -> [NameIDFormat]
NameIDFormat -> NameIDFormat -> NameIDFormat -> [NameIDFormat]
(NameIDFormat -> NameIDFormat)
-> (NameIDFormat -> NameIDFormat)
-> (Int -> NameIDFormat)
-> (NameIDFormat -> Int)
-> (NameIDFormat -> [NameIDFormat])
-> (NameIDFormat -> NameIDFormat -> [NameIDFormat])
-> (NameIDFormat -> NameIDFormat -> [NameIDFormat])
-> (NameIDFormat -> NameIDFormat -> NameIDFormat -> [NameIDFormat])
-> Enum NameIDFormat
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: NameIDFormat -> NameIDFormat
succ :: NameIDFormat -> NameIDFormat
$cpred :: NameIDFormat -> NameIDFormat
pred :: NameIDFormat -> NameIDFormat
$ctoEnum :: Int -> NameIDFormat
toEnum :: Int -> NameIDFormat
$cfromEnum :: NameIDFormat -> Int
fromEnum :: NameIDFormat -> Int
$cenumFrom :: NameIDFormat -> [NameIDFormat]
enumFrom :: NameIDFormat -> [NameIDFormat]
$cenumFromThen :: NameIDFormat -> NameIDFormat -> [NameIDFormat]
enumFromThen :: NameIDFormat -> NameIDFormat -> [NameIDFormat]
$cenumFromTo :: NameIDFormat -> NameIDFormat -> [NameIDFormat]
enumFromTo :: NameIDFormat -> NameIDFormat -> [NameIDFormat]
$cenumFromThenTo :: NameIDFormat -> NameIDFormat -> NameIDFormat -> [NameIDFormat]
enumFromThenTo :: NameIDFormat -> NameIDFormat -> NameIDFormat -> [NameIDFormat]
Enum, NameIDFormat
NameIDFormat -> NameIDFormat -> Bounded NameIDFormat
forall a. a -> a -> Bounded a
$cminBound :: NameIDFormat
minBound :: NameIDFormat
$cmaxBound :: NameIDFormat
maxBound :: NameIDFormat
Bounded, Int -> NameIDFormat -> ShowS
[NameIDFormat] -> ShowS
NameIDFormat -> String
(Int -> NameIDFormat -> ShowS)
-> (NameIDFormat -> String)
-> ([NameIDFormat] -> ShowS)
-> Show NameIDFormat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NameIDFormat -> ShowS
showsPrec :: Int -> NameIDFormat -> ShowS
$cshow :: NameIDFormat -> String
show :: NameIDFormat -> String
$cshowList :: [NameIDFormat] -> ShowS
showList :: [NameIDFormat] -> ShowS
Show)
instance Default NameIDFormat where
def :: NameIDFormat
def = NameIDFormat
NameIDFormatUnspecified
instance Identifiable URI NameIDFormat where
identifier :: NameIDFormat -> URI
identifier = String -> (SAMLVersion, String) -> URI
samlURNIdentifier String
"nameid-format" ((SAMLVersion, String) -> URI)
-> (NameIDFormat -> (SAMLVersion, String)) -> NameIDFormat -> URI
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NameIDFormat -> (SAMLVersion, String)
f where
f :: NameIDFormat -> (SAMLVersion, String)
f NameIDFormat
NameIDFormatUnspecified = (SAMLVersion
SAML11, String
"unspecified")
f NameIDFormat
NameIDFormatEmail = (SAMLVersion
SAML11, String
"emailAddress")
f NameIDFormat
NameIDFormatX509 = (SAMLVersion
SAML11, String
"X509SubjectName")
f NameIDFormat
NameIDFormatWindows = (SAMLVersion
SAML11, String
"WindowsDomainQualifiedName")
f NameIDFormat
NameIDFormatKerberos = (SAMLVersion
SAML20, String
"kerberos")
f NameIDFormat
NameIDFormatEntity = (SAMLVersion
SAML20, String
"entity")
f NameIDFormat
NameIDFormatPersistent = (SAMLVersion
SAML20, String
"persistent")
f NameIDFormat
NameIDFormatTransient = (SAMLVersion
SAML20, String
"transient")
f NameIDFormat
NameIDFormatEncrypted = (SAMLVersion
SAML20, String
"encrypted")
data Consent
= ConsentUnspecified
| ConsentObtained
| ConsentPrior
| ConsentImplicit
| ConsentExplicit
| ConsentUnavailable
| ConsentInapplicable
deriving (Consent -> Consent -> Bool
(Consent -> Consent -> Bool)
-> (Consent -> Consent -> Bool) -> Eq Consent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Consent -> Consent -> Bool
== :: Consent -> Consent -> Bool
$c/= :: Consent -> Consent -> Bool
/= :: Consent -> Consent -> Bool
Eq, Int -> Consent
Consent -> Int
Consent -> [Consent]
Consent -> Consent
Consent -> Consent -> [Consent]
Consent -> Consent -> Consent -> [Consent]
(Consent -> Consent)
-> (Consent -> Consent)
-> (Int -> Consent)
-> (Consent -> Int)
-> (Consent -> [Consent])
-> (Consent -> Consent -> [Consent])
-> (Consent -> Consent -> [Consent])
-> (Consent -> Consent -> Consent -> [Consent])
-> Enum Consent
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Consent -> Consent
succ :: Consent -> Consent
$cpred :: Consent -> Consent
pred :: Consent -> Consent
$ctoEnum :: Int -> Consent
toEnum :: Int -> Consent
$cfromEnum :: Consent -> Int
fromEnum :: Consent -> Int
$cenumFrom :: Consent -> [Consent]
enumFrom :: Consent -> [Consent]
$cenumFromThen :: Consent -> Consent -> [Consent]
enumFromThen :: Consent -> Consent -> [Consent]
$cenumFromTo :: Consent -> Consent -> [Consent]
enumFromTo :: Consent -> Consent -> [Consent]
$cenumFromThenTo :: Consent -> Consent -> Consent -> [Consent]
enumFromThenTo :: Consent -> Consent -> Consent -> [Consent]
Enum, Consent
Consent -> Consent -> Bounded Consent
forall a. a -> a -> Bounded a
$cminBound :: Consent
minBound :: Consent
$cmaxBound :: Consent
maxBound :: Consent
Bounded, Int -> Consent -> ShowS
[Consent] -> ShowS
Consent -> String
(Int -> Consent -> ShowS)
-> (Consent -> String) -> ([Consent] -> ShowS) -> Show Consent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Consent -> ShowS
showsPrec :: Int -> Consent -> ShowS
$cshow :: Consent -> String
show :: Consent -> String
$cshowList :: [Consent] -> ShowS
showList :: [Consent] -> ShowS
Show)
instance Default Consent where
def :: Consent
def = Consent
ConsentUnspecified
instance Identifiable URI Consent where
identifier :: Consent -> URI
identifier = String -> (SAMLVersion, String) -> URI
samlURNIdentifier String
"consent" ((SAMLVersion, String) -> URI)
-> (Consent -> (SAMLVersion, String)) -> Consent -> URI
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Consent -> (SAMLVersion, String)
f where
f :: Consent -> (SAMLVersion, String)
f Consent
ConsentUnspecified = (SAMLVersion
SAML20, String
"unspecified")
f Consent
ConsentObtained = (SAMLVersion
SAML20, String
"obtained")
f Consent
ConsentPrior = (SAMLVersion
SAML20, String
"prior")
f Consent
ConsentImplicit = (SAMLVersion
SAML20, String
"current-implicit")
f Consent
ConsentExplicit = (SAMLVersion
SAML20, String
"current-explicit")
f Consent
ConsentUnavailable = (SAMLVersion
SAML20, String
"unavailable")
f Consent
ConsentInapplicable = (SAMLVersion
SAML20, String
"inapplicable")