hsoz-0.0.0.3: Iron, Hawk, Oz: Web auth protocols

Safe HaskellNone
LanguageHaskell2010

Network.Hawk.Client

Description

Functions for making Hawk-authenticated request headers and verifying responses from the server.

Synopsis

Documentation

header Source #

Arguments

:: Text

The request URL

-> Method

The request method

-> Credentials

Credentials used to generate the header

-> Maybe PayloadInfo

Optional request payload

-> Maybe Text

ext data

-> 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.

data ServerAuthorizationCheck Source #

Whether the client wants to check the received Server-Authorization header depends on the application.

data Credentials Source #

ID and key used for encrypting Hawk Authorization header.

Constructors

Credentials 

data Header Source #

The result of Hawk header generation.

Constructors

Header 

Fields

Instances

Show Header Source # 
Generic Header Source # 

Associated Types

type Rep Header :: * -> * #

Methods

from :: Header -> Rep Header x #

to :: Rep Header x -> Header #

type Rep Header Source # 
type Rep Header = D1 (MetaData "Header" "Network.Hawk.Client.Types" "hsoz-0.0.0.3-Ie80R7owbceLSvk8BcdUmT" False) (C1 (MetaCons "Header" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "hdrField") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Authorization)) (S1 (MetaSel (Just Symbol "hdrArtifacts") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 HeaderArtifacts))))

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.