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

Safe HaskellNone
LanguageHaskell2010

Network.Hawk.Types

Contents

Synopsis

Artifacts

data HeaderArtifacts Source #

Struct for attributes which will be encoded in the Hawk Authorization header and included in the verification. The terminology (and spelling) come from the original Javascript implementation of Hawk.

haExt :: HeaderArtifacts -> Maybe ExtData Source #

Optional application-specific data.

haApp :: HeaderArtifacts -> Maybe Text Source #

Oz application, Iron-encoded.

haDlg :: HeaderArtifacts -> Maybe Text Source #

Oz delegated-by application.

type ExtData = ByteString Source #

Extension data included in verification hash. This can be anything or nothing, depending on what the application needs.

data PayloadInfo Source #

Payload data and content type bundled up for convenience.

type ContentType = ByteString Source #

Value of Content-Type HTTP headers.

Credentials

type ClientId = Text Source #

Identifies a particular client so that their credentials can be looked up.

newtype Key Source #

A user-supplied password or generated key.

Constructors

Key ByteString 

Instances

Eq Key Source # 

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Show Key Source # 

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

IsString Key Source # 

Methods

fromString :: String -> Key #

Generic Key Source # 

Associated Types

type Rep Key :: * -> * #

Methods

from :: Key -> Rep Key x #

to :: Rep Key x -> Key #

ByteArrayAccess Key Source # 

Methods

length :: Key -> Int #

withByteArray :: Key -> (Ptr p -> IO a) -> IO a #

type Rep Key Source # 
type Rep Key = D1 (MetaData "Key" "Network.Hawk.Algo" "hsoz-0.0.1.0-5r17DkUA43zE9P6QhuhthQ" True) (C1 (MetaCons "Key" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

data HawkAlgo Source #

A wrapper data type representing one of the supported HMAC algorithms. Use HawkAlgo SHA1 or HawkAlgo SHA256.

Constructors

(HawkAlgoCls alg, Show alg) => HawkAlgo alg 

class HawkAlgoCls a where Source #

The class of HMAC algorithms supported by the Hawk protocol. Users of the Hawk module probably won't directly need this.

Minimal complete definition

hawkHash, hawkMac

Methods

hawkHash :: a -> ByteString -> ByteString Source #

Calculates the hash of a message. The result is encoded in Base64.

hawkMac :: a -> Key -> ByteString -> ByteString Source #

Calculates the hash-based MAC of a message. The result is encoded in Base64.

newtype Key Source #

A user-supplied password or generated key.

Constructors

Key ByteString 

Instances

Eq Key Source # 

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Show Key Source # 

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

IsString Key Source # 

Methods

fromString :: String -> Key #

Generic Key Source # 

Associated Types

type Rep Key :: * -> * #

Methods

from :: Key -> Rep Key x #

to :: Rep Key x -> Key #

ByteArrayAccess Key Source # 

Methods

length :: Key -> Int #

withByteArray :: Key -> (Ptr p -> IO a) -> IO a #

type Rep Key Source # 
type Rep Key = D1 (MetaData "Key" "Network.Hawk.Algo" "hsoz-0.0.1.0-5r17DkUA43zE9P6QhuhthQ" True) (C1 (MetaCons "Key" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

readHawkAlgo :: String -> Maybe HawkAlgo Source #

Inverse of show, for parsing "algorithm" fields in JSON structures.

Headers

data WwwAuthenticateHeader Source #

Represents the WWW-Authenticate header which the server uses to respond when the client isn't authenticated.

Constructors

WwwAuthenticateHeader 

Fields

data ServerAuthorizationHeader Source #

Represents the Server-Authorization header which the server sends back to the client.

Constructors

ServerAuthorizationHeader 

Fields

data MessageAuth Source #

Authorization attributes for a Hawk message. This is generated by message and verified by authenticateMessage.

Constructors

MessageAuth 

Fields