File: OAuth1.hs

package info (click to toggle)
haskell-wreq 0.5.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: haskell: 2,992; makefile: 25
file content (12 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
module Network.Wreq.Internal.OAuth1 (signRequest) where

import Network.HTTP.Client (Request(..))
import Web.Authenticate.OAuth ( signOAuth, newOAuth, oauthConsumerKey
                              , oauthConsumerSecret, newCredential)
import qualified Data.ByteString as S

signRequest :: S.ByteString -> S.ByteString -> S.ByteString -> S.ByteString -> Request -> IO Request
signRequest consumerToken consumerSecret token tokenSecret = signOAuth app creds
  where
    app = newOAuth { oauthConsumerKey = consumerToken, oauthConsumerSecret = consumerSecret }
    creds = newCredential token tokenSecret