HTTP-4000.0.9: A library for client-side HTTPSource codeContentsIndex
Network.HTTP.Auth
Portabilitynon-portable (not tested)
Stabilityexperimental
MaintainerSigbjorn Finne <sigbjorn.finne@gmail.com>
Description
Representing HTTP Auth values in Haskell. Right now, it contains mostly functionality needed by Network.Browser.
Synopsis
data Authority
= AuthBasic {
auRealm :: String
auUsername :: String
auPassword :: String
auSite :: URI
}
| AuthDigest {
auRealm :: String
auUsername :: String
auPassword :: String
auNonce :: String
auAlgorithm :: Maybe Algorithm
auDomain :: [URI]
auOpaque :: Maybe String
auQop :: [Qop]
}
data Algorithm
= AlgMD5
| AlgMD5sess
data Challenge
= ChalBasic {
chRealm :: String
}
| ChalDigest {
chRealm :: String
chDomain :: [URI]
chNonce :: String
chOpaque :: Maybe String
chStale :: Bool
chAlgorithm :: Maybe Algorithm
chQop :: [Qop]
}
data Qop
= QopAuth
| QopAuthInt
headerToChallenge :: URI -> Header -> Maybe Challenge
withAuthority :: Authority -> Request ty -> String
Documentation
data Authority Source
Authority specifies the HTTP Authentication method to use for a given domain/realm; Basic or Digest.
Constructors
AuthBasic
auRealm :: String
auUsername :: String
auPassword :: String
auSite :: URI
AuthDigest
auRealm :: String
auUsername :: String
auPassword :: String
auNonce :: String
auAlgorithm :: Maybe Algorithm
auDomain :: [URI]
auOpaque :: Maybe String
auQop :: [Qop]
data Algorithm Source
Algorithm controls the digest algorithm to, MD5 or MD5Session.
Constructors
AlgMD5
AlgMD5sess
show/hide Instances
data Challenge Source
Constructors
ChalBasic
chRealm :: String
ChalDigest
chRealm :: String
chDomain :: [URI]
chNonce :: String
chOpaque :: Maybe String
chStale :: Bool
chAlgorithm :: Maybe Algorithm
chQop :: [Qop]
data Qop Source
Constructors
QopAuth
QopAuthInt
show/hide Instances
headerToChallenge :: URI -> Header -> Maybe ChallengeSource
headerToChallenge base www_auth tries to convert the WWW-Authenticate header www_auth into a Challenge value.
withAuthority :: Authority -> Request ty -> StringSource

withAuthority auth req generates a credentials value from the auth Authority, in the context of the given request.

If a client nonce was to be used then this function might need to be of type ... -> BrowserAction String

Produced by Haddock version 2.4.2