{-# 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 (Eq, Enum, Bounded, Show)
instance Identifiable URI ActionNamespace where
identifier = samlURNIdentifier "action" . f where
f ActionNamespaceRWEDC = (SAML10, "rwedc")
f ActionNamespaceRWEDCNegation = (SAML10, "rwedc-negation")
f ActionNamespaceGHPP = (SAML10, "ghpp")
f ActionNamespaceUNIX = (SAML10, "unix")
data AttributeNameFormat
= AttributeNameFormatUnspecified
| AttributeNameFormatURI
| AttributeNameFormatBasic
deriving (Eq, Enum, Bounded, Show)
instance Identifiable URI AttributeNameFormat where
identifier = samlURNIdentifier "attrname-format" . f where
f AttributeNameFormatUnspecified = (SAML20, "unspecified")
f AttributeNameFormatURI = (SAML20, "uri")
f AttributeNameFormatBasic = (SAML20, "basic")
data NameIDFormat
= NameIDFormatUnspecified
| NameIDFormatEmail
| NameIDFormatX509
| NameIDFormatWindows
| NameIDFormatKerberos
| NameIDFormatEntity
| NameIDFormatPersistent
| NameIDFormatTransient
| NameIDFormatEncrypted
deriving (Eq, Enum, Bounded, Show)
instance Default NameIDFormat where
def = NameIDFormatUnspecified
instance Identifiable URI NameIDFormat where
identifier = samlURNIdentifier "nameid-format" . f where
f NameIDFormatUnspecified = (SAML11, "unspecified")
f NameIDFormatEmail = (SAML11, "emailAddress")
f NameIDFormatX509 = (SAML11, "X509SubjectName")
f NameIDFormatWindows = (SAML11, "WindowsDomainQualifiedName")
f NameIDFormatKerberos = (SAML20, "kerberos")
f NameIDFormatEntity = (SAML20, "entity")
f NameIDFormatPersistent = (SAML20, "persistent")
f NameIDFormatTransient = (SAML20, "transient")
f NameIDFormatEncrypted = (SAML20, "encrypted")
data Consent
= ConsentUnspecified
| ConsentObtained
| ConsentPrior
| ConsentImplicit
| ConsentExplicit
| ConsentUnavailable
| ConsentInapplicable
deriving (Eq, Enum, Bounded, Show)
instance Default Consent where
def = ConsentUnspecified
instance Identifiable URI Consent where
identifier = samlURNIdentifier "consent" . f where
f ConsentUnspecified = (SAML20, "unspecified")
f ConsentObtained = (SAML20, "obtained")
f ConsentPrior = (SAML20, "prior")
f ConsentImplicit = (SAML20, "current-implicit")
f ConsentExplicit = (SAML20, "current-explicit")
f ConsentUnavailable = (SAML20, "unavailable")
f ConsentInapplicable = (SAML20, "inapplicable")