pusher-http-haskell-0.3.0.0: Haskell client library for the Pusher HTTP API

Copyright(c) Will Sewell, 2015
LicenseMIT
Maintainerme@willsewell.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Network.Pusher.Internal.Auth

Description

This module contains helper functions for authenticating HTTP requests, as well as publically facing functions for authentication private and presence channel users; these functions are re-exported in the main Pusher module.

Synopsis

Documentation

authenticatePresence :: ToJSON a => Credentials -> ByteString -> ByteString -> a -> ByteString Source

Generate an auth signature of the form "app_key:auth_sig" for a user of a presence channel.

authenticatePresenceWithEncoder Source

Arguments

:: ToJSON a 
=> (a -> ByteString)

The encoder of the user data.

-> Credentials 
-> ByteString 
-> ByteString 
-> a 
-> ByteString 

As above, but allows the encoder of the user data to be specified. This is useful for testing because the encoder can be mocked; aeson's encoder enodes JSON object fields in arbitrary orders, which makes it impossible to test.

authenticatePrivate :: Credentials -> ByteString -> ByteString -> ByteString Source

Generate an auth signature of the form "app_key:auth_sig" for a user of a private channel.

makeQS Source

Arguments

:: ByteString 
-> ByteString 
-> Text 
-> Text 
-> [(ByteString, ByteString)]

Any additional parameters

-> ByteString 
-> Int

Current UNIX timestamp

-> [(ByteString, ByteString)] 

Generate the required query string parameters required to send API requests to Pusher.