hS3-0.5.7: Interface to Amazon's Simple Storage Service (S3)

Safe Haskell | None

Network.AWS.Authentication

Contents

- Function Types
- Data Types
- Misc functions

Description

Implements authentication and low-level communication with Amazon Web Services, such as S3, EC2, and others. API Version 2006-03-01 http://docs.amazonwebservices.com/AmazonS3/2006-03-01/

Synopsis

- runAction :: S3Action -> IO (AWSResult (HTTPResponse ByteString))
- isAmzHeader :: Header -> Bool
- preSignedURI :: S3Action -> Integer -> URI
- data S3Action = S3Action {
  - s3conn :: AWSConnection
  - s3bucket :: String
  - s3object :: String
  - s3query :: String
  - s3metadata :: [(String, String)]
  - s3body :: ByteString
  - s3operation :: RequestMethod
  }
- mimeEncodeQP :: String -> String
- mimeDecode :: String -> String

# Function Types

runAction :: S3Action -> IO (AWSResult (HTTPResponse ByteString))Source

Construct the request specified by an S3Action, send to Amazon, and return the response. Todo: add MD5 signature.

isAmzHeader :: Header -> Bool Source

Determine if a header belongs in the StringToSign

preSignedURI Source

Arguments

:: S3Action | Action with resource
-> Integer | Expiration time, in seconds since 00:00:00 UTC on January 1, 1970
-> URI | URI of resource

Construct a pre-signed URI, but don't act on it. This is useful for when an expiration date has been set, and the URI needs to be passed on to a client.

# Data Types

data S3Action Source

An action to be performed using S3.

Constructors

S3Action |

Fields

s3conn :: AWSConnection

  Connection and authentication information

s3bucket :: String

  Name of bucket to act on (URL encoded)

s3object :: String

  Name of object to act on (URL encoded)

s3query :: String

  Query parameters (requires a prefix of `?`)

s3metadata :: [(String, String)]

  Additional header fields to send

s3body :: ByteString

  Body of action, if sending data

s3operation :: RequestMethod

  Type of action, `PUT`, `GET`, etc.

Instances

Show S3Action |

# Misc functions

mimeEncodeQP :: String -> String Source

mimeDecode :: String -> String Source

Decode a mime string, we know about quoted printable and base64 encoded UTF-8 S3 may convert quoted printable to base64