5h_      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^None Safe-Inferred AAn Amazon Web Services connection. Everything needed to connect  and authenticate requests. Service provider hostname Service provider port number Access Key ID Secret Access Key &Hostname used for connecting to Amazon's production S3 service (s3.amazonaws.com). )Port number used for connecting to Amazon's production S3 service (80). >Create an AWSConnection to Amazon from credentials. Uses the  production service. ;Retrieve Access and Secret keys from environment variables > AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, respectively. ; Either variable being undefined or empty will result in  _.  Access Key ID Secret Access Key Connection to Amazon S3     Safe-InferredBAn error from an S3 request, either at the network layer, or from  S3 itself. AWSError code message% constructs an error message from S3  itself. See   Hhttp://docs.amazonwebservices.com/AmazonS3/2006-03-01/ErrorCodeList.html * for a detailed list of possible codes. 'Connection error at the network layer. ?A result from processing a request to S3. Either some success  value, or a . Pretty print an error message. None($An action to be performed using S3. *Connection and authentication information 'Name of bucket to act on (URL encoded) 'Name of object to act on (URL encoded) 'Query parameters (requires a prefix of ?) !Additional header fields to send  Body of action, if sending data Type of action, `, a, etc. b Transform an % into an HTTP request. Does not add A authentication or date information, so it is not suitable for  sending directly to AWS. cCreate d objects from an action. eInspect HTTP body, and add a Content-Length header with the 1 correct length, if it does not already exist. f2Add AWS authentication header to an HTTP request. g2Sign a string using the given authentication data h@Generate text that will be signed and subsequently added to the  request. i(Extract header data needed for signing. jExtract x-amz-* headers needed for signing. B find all headers with type HdrCustom that begin with amzHeader  lowercase key names $ sort lexigraphically by key name " combine headers with same name  unfold multi-line headers % trim whitespace around the header k=Give the string representation of a (key,value) header pair. ) Uses rules for authenticated headers. l8Replace CRLF followed by whitespace with a single space m strip leading/trailing whitespace nCombine same-named headers. o2Headers with same name should have values merged. p"Group headers with the same name. qSort by key name. rMake d* easier to work with, and lowercase keys. 2Determine if a header belongs in the StringToSign s*is the first list a prefix of the second? t'Prefix used by Amazon metadata headers u0Extract resource name, as required for signing. v Add a date string to a request. w%Add an expiration date to a request. x$Attach an HTTP header to a request. y8Get hostname to connect to. Needed for european buckets z/Get current time in HTTP 1.1 format (RFC 2616) + Numeric time zones should be used, but I'd rather not subvert the E intent of ctTZName, so we stick with the name format. Otherwise,  we could send +0000 instead of GMT.  see:   #http://www.ietf.org/rfc/rfc2616.txt   #http://www.ietf.org/rfc/rfc1123.txt   "http://www.ietf.org/rfc/rfc822.txt {'Convenience for dealing with HMAC-SHA1 @Construct the request specified by an S3Action, send to Amazon, 6 and return the response. Todo: add MD5 signature. #Construct a pre-signed URI, but don't act on it. This is useful E for when an expiration date has been set, and the URI needs to be  passed on to a client. |=Inspect a response for network errors, HTTP error codes, and  Amazon error messages. I We need the original action in case we get a 307 (temporary redirect) }=Find the errors embedded in an XML message body from Amazon. ~Find children of Error entity, use their Code and Message  entities to create an . NDecode a mime string, we know about quoted printable and base64 encoded UTF-8 + S3 may convert quoted printable to base64 0bAction to transform 'Action represented as an HTTP Request. cef Action with authentication data Request to transform Authenticated request g Action with authentication data String to sign Base-64 encoded signature hijklmnopqrstuvRequest to modify  Date string, in RFC 2616 format Request with date header added wxyz{Action with resource "Expiration time, in seconds since # 00:00:00 UTC on January 1, 1970 URI of resource |}~   (bcefghijklmnopqrstuvwxyz{|}~ None$4An object that can be stored and retrieved from S3. &*Name of the bucket containing this object '"URI of the object. Subresources (?acl or  | ?torrent%) should be suffixed onto this name. (2A standard MIME type describing the format of the  contents. If not specified, binary/ octet-stream is  used. )1Object metadata in (key,value) pairs. Key names  should use the prefix  x-amz-meta- to be stored with : the object. The total HTTP request must be under 4KB,  including these headers. * Object data. +,Add required headers for the storage class.  Use this in combination with . for new objects. To 5 modify the storage class of existing objects, use  -/. Using reduced redundancy for object storage , trades off redundancy for storage costs. ,0Retrieve the storage class of a local S3Object. , Does not work for objects retrieved with 2 , since the 1 required header values are not returned. Use  getObjectStorageClass or  listObjects from S3Bucket module to 0 determine storage class of existing objects. -MChange the storage class (and only the storage class) of an existing object. L This actually performs a copy to the same location, preserving metadata. W It is not clear to me whether ACLs are preserved when copying to the same location. O For best performance, we must not change other headers during storage class  changes. .Send data for an object.  If the header Content-Length+ is not set, all content must be read into  memory prior to sending. /=Send data for an object, with message integrity check. This D version of sendObject will add an MD5 message integrity check so G that transmission errors will be detected, but requires the message * be read into memory before being sent. 0ACreate a pre-signed request URI. Anyone can use this to request ' an object until the specified date. 1ACreate a pre-signed request URI. Anyone can use this to request 2 an object for the number of seconds specified. 2Retrieve an object. 3=Get object info without retrieving content body from server. %Get an object with specified method. 4:Delete an object. Only bucket and object name need to be A specified in the S3Object. Deletion of a non-existent object  does not return an error. 5^Copy object from one bucket to another (or the same bucket), preserving the original headers.  Headers from destobj are sent, while only the  bucket and name of srcobj are used. For the best = performance, when changing headers during a copy, use the  6) function. For conditional copying, the @ following headers set on the destination object may be used:  x-amz-copy-source-if-match, x-amz-copy-source-if-none-match,  %x-amz-copy-source-if-unmodified-since, or  #x-amz-copy-source-if-modified-since. See   Xhttp://docs.amazonwebservices.com/AmazonS3/2006-03-01/API/index.html?RESTObjectCOPY.html  for more details. 6PCopy object from one bucket to another (or the same bucket), replacing headers.  Any headers from srcobj are ignored, and only those  set in destobj are used. !"#$%&'()*+Storage class to request Object to modify 8Object with storage class headers set, ready to be sent ,Object to inspect 0Requested storage class, Nothing if unspecified -AWS connection information New storage class for object Object to modify Server response .AWS connection information Object to add to a bucket Server response /AWS connection information Object to add to a bucket Server response 0AWS connection information Object to be made available "Expiration time, in seconds since # 00:00:00 UTC on January 1, 1970 URI for the object 1AWS connection information Object to be made available How many seconds until this  request expires URI for the object 2AWS connection information Object to retrieve Server response 3AWS connection information "Object to retrieve information on Server response  Method to use for retrieval (GET/HEAD) AWS connection Object to request 4AWS connection information Object to delete Server response 5AWS connection information !Source object (bucket+name only) Destination object 5Server response, headers include version information 6AWS connection information !Source object (bucket+name only) Destination object 5Server response, headers include version information !"#$%&'()*+,-./0123456./5623410+,-$%&'()*!#"!#"$%&'()*+,-./0123456None7$Is a result set response truncated? 8Result from listing objects. :Name of object ;Last modification date <MD5 =Bytes of object data >Storage class of the object ?List request parameters Q>Create a new bucket on S3 with the given prefix, and a random ? suffix. This can be used to programatically create buckets  without of naming conflicts. R7see createBucketWithPrefixIn, but hardcoded for the US S/Create a new bucket on S3 with the given name. T/Create a new bucket on S3 with the given name. U!Physical location of the bucket. US or EU V?Delete a bucket with the given name on S3. The bucket must be " empty for deletion to succeed. W=Empty a bucket of all objects. Iterates through all objects A issuing delete commands, so time is proportional to number of B objects in the bucket. At this time, delete requests are free  from Amazon. CDelete a list of objects, stop as soon as an error is encountered. X:Return a list of all bucket names and creation dates. S3 - allows a maximum of 100 buckets per user. Y3List objects in a bucket, based on parameters from ?. See E the Amazon S3 developer resources for in depth explanation of how  the fields in ?# can be used to query for objects.   Mhttp://docs.amazonwebservices.com/AmazonS3/2006-03-01/ListingKeysRequest.html ZFRepeatedly query the server for all objects in a bucket, ignoring the max_keys field. [1Retrieve the storage class of an object from S3. $ For checking more than one object's storage class efficiently,  use listObjects. ADetermine if ListBucketResult is truncated. It would make sense > to combine this with the query for list results, so we didn't  have to parse the XML twice. \LCheck Amazon guidelines on bucket naming. (missing test for IP-like names) ]FSet the versioning configuration of a bucket (MFA not yet supported). ^4Check versioning and MFA configuration of a bucket. Remove quote characters from a . 8789:;<=>?@ABCDEFGHIJKLMNOPQAWS connection information Bucket name prefix  Location (US, EU,  us-west-1, ap-southeast-1) Server response, if  successful, the bucket  name is returned. RAWS connection information Bucket name prefix "Server response, with bucket name SAWS connection information Proposed bucket name  Location (US, EU,  us-west-1, ap-southeast-1) Server response TAWS connection information Proposed bucket name Server response UAWS connection information  Bucket name Server response (US, EU,  us-west-1, ap-southeast-1, etc.) VAWS connection information Bucket name to delete Server response WAWS connection information Bucket name to empty Server response XAWS connection information Server response YAWS connection information Bucket name to search List parameters Server response ZAWS connection information Bucket name to search List parameters Server response [\]AWS connection information Bucket to modify !Desired versioning configuration Server response ^AWS connection information Bucket name to inquire on Server response (789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^(STQRVUWXYZ\[^]MNOP?@ABCD89:;<=>7IJKLEHGF$789:;<=>?@ABCDEHGFIJKLMNOPQRSTUVWXYZ[\]^       !"#$%&'())*+,-./0123456789:;<<=>?@ABBCDEFGHIJKKLMNNOPQRSTUVWXYZ[\]^_`abcdbcefgbhijklmnopqrstuvwxyz{|}~_ hS3-0.5.8Network.AWS.ArrowUtilsNetwork.AWS.AWSConnectionNetwork.AWS.AWSResultNetwork.AWS.AuthenticationNetwork.AWS.S3ObjectNetwork.AWS.S3BucketsplitunsplitatTagtext AWSConnectionawsHostawsPort awsAccessKey awsSecretKeydefaultAmazonS3HostdefaultAmazonS3PortamazonS3ConnectionamazonS3ConnectionFromEnvReqErrorAWSError NetworkError AWSResultprettyReqErrorS3Actions3conns3buckets3objects3query s3metadatas3body s3operation isAmzHeader runAction preSignedURI mimeDecode mimeEncodeQP StorageClassREDUCED_REDUNDANCYSTANDARDS3Object obj_bucketobj_name content_type obj_headersobj_datasetStorageClassgetStorageClassrewriteStorageClass sendObject sendObjectMICpublicUriUntilTimepublicUriForSeconds getObject getObjectInfo deleteObject copyObjectcopyObjectWithReplace IsTruncated ListResultkey last_modifiedetagsize storageClass ListRequestprefixmarker delimitermax_keysVersioningStatusVersioningSuspendedVersioningEnabledVersioningDisabledVersioningConfigurationversioningStatusmfaDeleteEnabledS3Bucket bucket_namebucket_creation_datecreateBucketWithPrefixIncreateBucketWithPrefixcreateBucketIn createBucketgetBucketLocation deleteBucket emptyBucket listBuckets listObjectslistAllObjectsgetObjectStorageClassisBucketNameValidsetVersioningConfigurationgetVersioningConfigurationbase Data.MaybeNothing HTTP-4000.2.8Network.HTTP.BasePUTGETrequestFromActionheadersFromActionNetwork.HTTP.HeadersHeaderaddContentLengthHeaderaddAuthenticationHeader makeSignature stringToSigncanonicalizeHeaderscanonicalizeAmzHeaders showHeaderfold_whitespaceremoveLeadingTrailingWhitespacecombineHeadersmergeSameHeaders groupHeaders sortHeadersheaderToLCKeyValueisPrefix amzHeadercanonicalizeResource addDateToReqaddExpirationToReqaddHeaderToReq s3HostnamehttpCurrentDate string2wordscreateAWSResultparseRestErrorXMLprocessRestError runAction' mimeDecodeQP mimeDecodeQP' mimeDecodeB64 mimeEncodeQP' reservedChargetObjectWithMethod storageHeaderheadersFromResponse deleteObjectsisListTruncatedunquoteGHC.BaseString randomNameparseBucketLocationXMLprocessLocationparseBucketListXMLprocessBucketsprocessTruncationgetListResultsprocessListResultsversioningConfigurationToXMLversioningConfigXmlparseVersionConfigXMLprocessVersionConfig$fShowListRequest