pusher-http-haskell-2.1.0.17: Haskell client library for the Pusher Channels HTTP API
Copyright(c) Will Sewell 2016
LicenseMIT
Maintainerme@willsewell.com
Stabilitystable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.Pusher.Internal.Auth

Description

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

Synopsis

Documentation

authenticatePresence :: ToJSON a => Token -> Text -> Text -> a -> ByteString Source #

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

authenticatePresenceWithEncoder Source #

Arguments

:: (a -> Text)

The encoder of the user data.

-> Token 
-> Text 
-> Text 
-> 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 :: Token -> Text -> Text -> ByteString Source #

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

makeQS Source #

Arguments

:: Token 
-> ByteString 
-> ByteString 
-> Query

Any additional parameters.

-> ByteString 
-> Word64 
-> Query 

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