-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Pre-signed Amazon S3 URLs
--   
--   s3-signer creates cryptographically secure Amazon S3 URLs that expire
--   within a user-defined period. It allows uploading and downloading of
--   content from Amazon S3. Ideal for AJAX direct-to-s3 uploads via CORS
--   and secure downloads. Web framework agnostic with minimal
--   dependencies.
--   
--   <pre>
--   module Main where
--   import           Network.S3
--   main :: IO ()
--   main = print =&lt;&lt; generateS3URL credentials request
--     where
--       credentials = S3Keys "&lt;public-key-goes-here&gt;" "&lt;secret-key-goes-here&gt;"
--       request     = S3Request S3GET "application/extension" "bucket-name" "file-name.extension" 3 -- three seconds until expiration
--   </pre>
--   
--   Result
--   
--   <pre>
--   S3URL "https://bucket-name.s3.amazonaws.com/file-name.extension?AWSAccessKeyId=&lt;public-key-goes-here&gt;&amp;Expires=1402346638&amp;Signature=1XraY%2Bhp117I5CTKNKPc6%2BiihRA%3D"
--   </pre>
@package s3-signer
@version 0.3.0.0

module Network.S3

-- | Generates a cryptographically secure URL that expires within a user
--   defined period
--   
--   See README for use cases and examples:
--   <a>https://github.com/dmjio/s3-signer/blob/master/README.md</a>
generateS3URL :: S3Keys -> S3Request -> IO S3URL
newtype S3URL
S3URL :: ByteString -> S3URL

-- | Generated URL
[signedRequest] :: S3URL -> ByteString
data S3Keys
S3Keys :: ByteString -> ByteString -> S3Keys

-- | AWS Public Key
[publicKey] :: S3Keys -> ByteString

-- | AWS Private Key
[secretKey] :: S3Keys -> ByteString
data S3Method

-- | GET Request
S3GET :: S3Method

-- | PUT Request
S3PUT :: S3Method
data S3Request
S3Request :: S3Method -> ByteString -> ByteString -> ByteString -> Integer -> S3Request

-- | Type of HTTP Method
[s3method] :: S3Request -> S3Method

-- | MIME Type
[mimeType] :: S3Request -> ByteString

-- | Name of Amazon S3 Bucket
[bucketName] :: S3Request -> ByteString

-- | Name of Amazon S3 File
[objectName] :: S3Request -> ByteString

-- | Number of seconds until expiration
[secondsToExpire] :: S3Request -> Integer
