Safe Haskell | None |
---|
- data QueryString
- type Method = ByteString
- type Endpoint = ByteString
- type Path = ByteString
- type SecretKey = ByteString
- data SignatureMethod = HmacSHA256
- toString :: QueryString -> ByteString
- queryString :: [(ByteString, ByteString)] -> QueryString
- queryStringFromMap :: Map ByteString ByteString -> QueryString
- stringToSign :: Method -> Endpoint -> Path -> [(ByteString, ByteString)] -> ByteString
- stringToSign' :: Method -> Endpoint -> Path -> QueryString -> ByteString
- signature :: Method -> Endpoint -> Path -> SecretKey -> SignatureMethod -> [(ByteString, ByteString)] -> ByteString
- signature' :: Method -> Endpoint -> Path -> SecretKey -> SignatureMethod -> QueryString -> ByteString
Types
data QueryString Source
A query string for HTTP.
"param1=value1¶m2=value2"
type Method = ByteStringSource
type Endpoint = ByteStringSource
type Path = ByteStringSource
type SecretKey = ByteStringSource
Building signature
queryString :: [(ByteString, ByteString)] -> QueryStringSource
Convert a parameter list to QueryString
.
>>>
toString $ queryString [("param1", "value1"), ("param2", "value2")]
"param1=value1¶m2=value2"
queryStringFromMap :: Map ByteString ByteString -> QueryStringSource
Convert a parameter map to QueryString
.
stringToSign :: Method -> Endpoint -> Path -> [(ByteString, ByteString)] -> ByteStringSource
Make a string for making signature.
>>>
stringToSign "GET" "ec2.amazonaws.com" "/" [("key1", "value1"), ("key2", "value2")]
"GET\nec2.amazonaws.com\n/\nkey1=value1&key2=value2"
stringToSign' :: Method -> Endpoint -> Path -> QueryString -> ByteStringSource
signature :: Method -> Endpoint -> Path -> SecretKey -> SignatureMethod -> [(ByteString, ByteString)] -> ByteStringSource
Make signature from a parameter list.
signature' :: Method -> Endpoint -> Path -> SecretKey -> SignatureMethod -> QueryString -> ByteStringSource
Make signature from a QueryString
.