Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions for making Hawk-authenticated request headers and verifying responses from the server.
- header :: Text -> Method -> Credentials -> Maybe PayloadInfo -> Maybe Text -> IO Header
- headerOz :: Text -> Method -> Credentials -> Maybe PayloadInfo -> Maybe Text -> Text -> Maybe Text -> IO Header
- getBewit :: Credentials -> NominalDiffTime -> Maybe ByteString -> NominalDiffTime -> ByteString -> IO (Maybe ByteString)
- authenticate :: Response body -> Credentials -> HeaderArtifacts -> Maybe ByteString -> ServerAuthorizationCheck -> IO (Either String ())
- data ServerAuthorizationCheck
- data Credentials = Credentials {}
- data Header = Header {}
- type Authorization = ByteString
- data HeaderArtifacts
- module Network.Hawk.Types
Documentation
:: Text | The request URL |
-> Method | The request method |
-> Credentials | Credentials used to generate the header |
-> Maybe PayloadInfo | Optional request payload |
-> Maybe Text |
|
-> IO Header |
Generates the Hawk authentication header for a request.
headerOz :: Text -> Method -> Credentials -> Maybe PayloadInfo -> Maybe Text -> Text -> Maybe Text -> IO Header Source #
Generates the Hawk authentication header for an Oz request. Oz requires another attribute -- the application id. It also has an optional delegated-by attribute, which is the application id of the application the credentials were directly issued to.
getBewit :: Credentials -> NominalDiffTime -> Maybe ByteString -> NominalDiffTime -> ByteString -> IO (Maybe ByteString) Source #
Generate a bewit value for a given URI.
authenticate :: Response body -> Credentials -> HeaderArtifacts -> Maybe ByteString -> ServerAuthorizationCheck -> IO (Either String ()) Source #
Validates the server response.
data ServerAuthorizationCheck Source #
Whether the client wants to check the received
Server-Authorization
header depends on the application.
The result of Hawk header generation.
Header | |
|
type Authorization = ByteString Source #
The value of an Authorization
header.
data HeaderArtifacts Source #
Struct for attributes which will be encoded in the Hawk
Authorization
header. The term "artifacts" comes from the
original Javascript implementation of Hawk.
module Network.Hawk.Types