|
|
|
@ -18,7 +18,7 @@ module Network.XMPP.Types |
|
|
|
, IQResponse(..) |
|
|
|
, IQResponse(..) |
|
|
|
, IQResult(..) |
|
|
|
, IQResult(..) |
|
|
|
, IdGenerator(..) |
|
|
|
, IdGenerator(..) |
|
|
|
, LangTag(..) |
|
|
|
, LangTag (..) |
|
|
|
, Message(..) |
|
|
|
, Message(..) |
|
|
|
, MessageError(..) |
|
|
|
, MessageError(..) |
|
|
|
, MessageType(..) |
|
|
|
, MessageType(..) |
|
|
|
@ -474,39 +474,68 @@ instance Read StanzaErrorCondition where |
|
|
|
-- ============================================================================= |
|
|
|
-- ============================================================================= |
|
|
|
|
|
|
|
|
|
|
|
data SASLFailure = SASLFailure { saslFailureCondition :: SASLError |
|
|
|
data SASLFailure = SASLFailure { saslFailureCondition :: SASLError |
|
|
|
, saslFailureText :: Maybe Text } -- TODO: XMLLang |
|
|
|
, saslFailureText :: Maybe ( Maybe LangTag |
|
|
|
|
|
|
|
, Text |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} deriving Show |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data SASLError = -- SASLAborted | -- Client aborted - should not happen |
|
|
|
data SASLError = SASLAborted -- ^ Client aborted |
|
|
|
SASLAccountDisabled | -- ^ The account has been temporarily |
|
|
|
| SASLAccountDisabled -- ^ The account has been temporarily |
|
|
|
-- disabled |
|
|
|
-- disabled |
|
|
|
SASLCredentialsExpired | -- ^ The authentication failed because |
|
|
|
| SASLCredentialsExpired -- ^ The authentication failed because |
|
|
|
-- the credentials have expired |
|
|
|
-- the credentials have expired |
|
|
|
SASLEncryptionRequired | -- ^ The mechanism requested cannot be |
|
|
|
| SASLEncryptionRequired -- ^ The mechanism requested cannot be |
|
|
|
-- used the confidentiality and |
|
|
|
-- used the confidentiality and |
|
|
|
-- integrity of the underlying |
|
|
|
-- integrity of the underlying |
|
|
|
-- stream is protected (typically |
|
|
|
-- stream is protected (typically |
|
|
|
-- with TLS) |
|
|
|
-- with TLS) |
|
|
|
-- SASLIncorrectEncoding | -- The base64 encoding is incorrect |
|
|
|
| SASLIncorrectEncoding -- ^ The base64 encoding is incorrect |
|
|
|
-- - should not happen |
|
|
|
| SASLInvalidAuthzid -- ^ The authzid has an incorrect |
|
|
|
-- SASLInvalidAuthzid | -- The authzid has an incorrect format, |
|
|
|
-- format or the initiating entity does |
|
|
|
-- or the initiating entity does not |
|
|
|
-- not have the appropriate permissions |
|
|
|
-- have the appropriate permissions to |
|
|
|
-- to authorize that ID |
|
|
|
-- authorize that ID |
|
|
|
| SASLInvalidMechanism -- ^ The mechanism is not supported by |
|
|
|
SASLInvalidMechanism | -- ^ The mechanism is not supported by |
|
|
|
|
|
|
|
-- the receiving entity |
|
|
|
-- the receiving entity |
|
|
|
-- SASLMalformedRequest | -- Invalid syntax - should not happen |
|
|
|
| SASLMalformedRequest -- ^ Invalid syntax |
|
|
|
SASLMechanismTooWeak | -- ^ The receiving entity policy |
|
|
|
| SASLMechanismTooWeak -- ^ The receiving entity policy |
|
|
|
-- requires a stronger mechanism |
|
|
|
-- requires a stronger mechanism |
|
|
|
SASLNotAuthorized (Maybe Text) | -- ^ Invalid credentials |
|
|
|
| SASLNotAuthorized -- ^ Invalid credentials |
|
|
|
-- provided, or some |
|
|
|
-- provided, or some |
|
|
|
-- generic authentication |
|
|
|
-- generic authentication |
|
|
|
-- failure has occurred |
|
|
|
-- failure has occurred |
|
|
|
SASLTemporaryAuthFailure -- ^ There receiving entity reported a |
|
|
|
| SASLTemporaryAuthFailure -- ^ There receiving entity reported a |
|
|
|
-- temporary error condition; the |
|
|
|
-- temporary error condition; the |
|
|
|
-- initiating entity is recommended |
|
|
|
-- initiating entity is recommended |
|
|
|
-- to try again later |
|
|
|
-- to try again later |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
instance Show SASLError where |
|
|
|
|
|
|
|
show SASLAborted = "aborted" |
|
|
|
|
|
|
|
show SASLAccountDisabled = "account-disabled" |
|
|
|
|
|
|
|
show SASLCredentialsExpired = "credentials-expired" |
|
|
|
|
|
|
|
show SASLEncryptionRequired = "encryption-required" |
|
|
|
|
|
|
|
show SASLIncorrectEncoding = "incorrect-encoding" |
|
|
|
|
|
|
|
show SASLInvalidAuthzid = "invalid-authzid" |
|
|
|
|
|
|
|
show SASLInvalidMechanism = "invalid-mechanism" |
|
|
|
|
|
|
|
show SASLMalformedRequest = "malformed-request" |
|
|
|
|
|
|
|
show SASLMechanismTooWeak = "mechanism-too-weak" |
|
|
|
|
|
|
|
show SASLNotAuthorized = "not-authorized" |
|
|
|
|
|
|
|
show SASLTemporaryAuthFailure = "temporary-auth-failure" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
instance Read SASLError where |
|
|
|
|
|
|
|
readsPrec _ "aborted" = [(SASLAborted , "")] |
|
|
|
|
|
|
|
readsPrec _ "account-disabled" = [(SASLAccountDisabled , "")] |
|
|
|
|
|
|
|
readsPrec _ "credentials-expired" = [(SASLCredentialsExpired , "")] |
|
|
|
|
|
|
|
readsPrec _ "encryption-required" = [(SASLEncryptionRequired , "")] |
|
|
|
|
|
|
|
readsPrec _ "incorrect-encoding" = [(SASLIncorrectEncoding , "")] |
|
|
|
|
|
|
|
readsPrec _ "invalid-authzid" = [(SASLInvalidAuthzid , "")] |
|
|
|
|
|
|
|
readsPrec _ "invalid-mechanism" = [(SASLInvalidMechanism , "")] |
|
|
|
|
|
|
|
readsPrec _ "malformed-request" = [(SASLMalformedRequest , "")] |
|
|
|
|
|
|
|
readsPrec _ "mechanism-too-weak" = [(SASLMechanismTooWeak , "")] |
|
|
|
|
|
|
|
readsPrec _ "not-authorized" = [(SASLNotAuthorized , "")] |
|
|
|
|
|
|
|
readsPrec _ "temporary-auth-failure" = [(SASLTemporaryAuthFailure , "")] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- | Readability type for host name Texts. |
|
|
|
-- | Readability type for host name Texts. |
|
|
|
|
|
|
|
|
|
|
|
|