Copyright | (c) Will Sewell, 2015 |
---|---|
License | MIT |
Maintainer | [email protected] |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
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.
- authenticatePresence :: ToJSON a => Credentials -> ByteString -> ByteString -> a -> ByteString
- authenticatePresenceWithEncoder :: ToJSON a => (a -> ByteString) -> Credentials -> ByteString -> ByteString -> a -> ByteString
- authenticatePrivate :: Credentials -> ByteString -> ByteString -> ByteString
- makeQS :: ByteString -> ByteString -> Text -> Text -> [(ByteString, ByteString)] -> ByteString -> Int -> [(ByteString, ByteString)]
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.
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.