Ь_      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ License :None(c) Greg Heartsfield 2007BSD3 Safe-Inferred ^An Amazon Web Services connection. Everything needed to connect and authenticate requests.Service provider hostnameService provider port number Access Key ID Secret Access Key @Hostname used for connecting to Amazon's production S3 service (s3.amazonaws.com). CPort number used for connecting to Amazon's production S3 service (80). TCreate 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 IDSecret Access KeyConnection to Amazon S3    (c) Greg Heartsfield 2007BSD3 Safe-InferredOAn error from an S3 request, either at the network layer, or from S3 itself.AWSError code message8 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.NA result from processing a request to S3. Either some success value, or a .Pretty print an error message.(c) Greg Heartsfield 2007BSD3None(#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 sendBody of action, if sending dataType of action, `, a, etc.b Transform an  into an HTTP request. Does not add 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-LengthA header with the correct length, if it does not already exist.f1Add AWS authentication header to an HTTP request.g1Sign a string using the given authentication datahKGenerate 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. 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 headerkeGive the string representation of a (key,value) header pair. Uses rules for authenticated headers.l7Replace CRLF followed by whitespace with a single spacem!strip leading/trailing whitespacenCombine same-named headers.o1Headers 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.1Determine if a header belongs in the StringToSigns)is the first list a prefix of the second?t&Prefix used by Amazon metadata headersu/Extract resource name, as required for signing.vAdd a date string to a request.w$Add an expiration date to a request.x#Attach an HTTP header to a request.y7Get hostname to connect to. Needed for european bucketszGet current time in HTTP 1.1 format (RFC 2616) Numeric time zones should be used, but I'd rather not subvert the 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-SHA1uConstruct the request specified by an S3Action, send to Amazon, and return the response. Todo: add MD5 signature.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.|Inspect a response for network errors, HTTP error codes, and Amazon error messages. 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 .xDecode a mime string, we know about quoted printable and base64 encoded UTF-8 S3 may convert quoted printable to base640bAction to transform&Action represented as an HTTP Request.cefAction with authentication dataRequest to transformAuthenticated requestgAction with authentication dataString to signBase-64 encoded signaturehijklmnopqrstuvRequest to modifyDate string, in RFC 2616 formatRequest with date header addedwxyz{Action with resourceDExpiration time, in seconds since 00:00:00 UTC on January 1, 1970URI of resource|}~   (bcefghijklmnopqrstuvwxyz{|}~ (c) Greg Heartsfield 2007BSD3None$3An 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.(RA standard MIME type describing the format of the contents. If not specified, binary/octet-stream is used.)JObject metadata in (key,value) pairs. Key names should use the prefix  x-amz-meta-h to be stored with the object. The total HTTP request must be under 4KB, including these headers.* Object data.+LAdd required headers for the storage class. Use this in combination with .N for new objects. To modify the storage class of existing objects, use -Z. Using reduced redundancy for object storage trades off redundancy for storage costs.,\Retrieve the storage class of a local S3Object. Does not work for objects retrieved with 2@, since the required header values are not returned. Use getObjectStorageClass or  listObjectsH from S3Bucket module to determine storage class of existing objects.-JChange the storage class (and only the storage class) of an existing object. This actually performs a copy to the same location, preserving metadata. It is not clear to me whether ACLs are preserved when copying to the same location. For best performance, we must not change other headers during storage class changes..*Send data for an object. If the header Content-LengthF is not set, all content must be read into memory prior to sending./Send data for an object, with message integrity check. This version of sendObject will add an MD5 message integrity check so that transmission errors will be detected, but requires the message be read into memory before being sent.0gCreate a pre-signed request URI. Anyone can use this to request an object until the specified date.1rCreate a pre-signed request URI. Anyone can use this to request 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.4Delete an object. Only bucket and object name need to be specified in the S3Object. Deletion of a non-existent object does not return an error.5nCopy object from one bucket to another (or the same bucket), preserving the original headers. Headers from destobj0 are sent, while only the bucket and name of srcobjY are used. For the best performance, when changing headers during a copy, use the 6l 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.6dCopy 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 requestObject to modify7Object with storage class headers set, ready to be sent,Object to inspect/Requested storage class, Nothing if unspecified-AWS connection informationNew storage class for objectObject to modifyServer response.AWS connection informationObject to add to a bucketServer response/AWS connection informationObject to add to a bucketServer response0AWS connection informationObject to be made availableDExpiration time, in seconds since 00:00:00 UTC on January 1, 1970URI for the object1AWS connection informationObject to be made available.How many seconds until this request expiresURI for the object2AWS connection informationObject to retrieveServer response3AWS connection information!Object to retrieve information onServer response&Method to use for retrieval (GET/HEAD)AWS connectionObject to request4AWS connection informationObject to deleteServer response5AWS connection information Source object (bucket+name only)Destination object4Server response, headers include version information6AWS connection information Source object (bucket+name only)Destination object4Server response, headers include version information!"#$%&'()*+,-./0123456./5623410+,-$%&'()*!#"!#"$%&'()*+,-./0123456(c) Greg Heartsfield 2007BSD3None7#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 parametersQCreate 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.R6see createBucketWithPrefixIn, but hardcoded for the USS.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 EUV`Delete a bucket with the given name on S3. The bucket must be empty for deletion to succeed.WEmpty a bucket of all objects. Iterates through all objects issuing delete commands, so time is proportional to number of objects in the bucket. At this time, delete requests are free from Amazon.BDelete a list of objects, stop as soon as an error is encountered.XfReturn 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 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.htmlZFRepeatedly query the server for all objects in a bucket, ignoring the max_keys field.[Retrieve the storage class of an object from S3. For checking more than one object's storage class efficiently, use listObjects.Determine 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.\KCheck Amazon guidelines on bucket naming. (missing test for IP-like names)]ESet the versioning configuration of a bucket (MFA not yet supported).^3Check versioning and MFA configuration of a bucket.Remove quote characters from a .8789:;<=>?@ABCDEFGHIJKLMNOPQAWS connection informationBucket name prefix Location (US, EU , "us-west-1", "ap-southeast-1")BServer response, if successful, the bucket name is returned.RAWS connection informationBucket name prefix!Server response, with bucket nameSAWS connection informationProposed bucket name Location (US, EU , "us-west-1", "ap-southeast-1")Server responseTAWS connection informationProposed bucket nameServer responseUAWS connection information Bucket nameServer response (US, EU&, "us-west-1", "ap-southeast-1", etc.)VAWS connection informationBucket name to deleteServer responseWAWS connection informationBucket name to emptyServer responseXAWS connection informationServer responseYAWS connection informationBucket name to searchList parametersServer responseZAWS connection informationBucket name to searchList parametersServer response[\]AWS connection informationBucket to modify Desired versioning configurationServer response^AWS connection informationBucket name to inquire onServer response(789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^(STQRVUWXYZ\[^]MNOP?@ABCD89:;<=>7IJKLEHGF$789:;<=>?@ABCDEHGFIJKLMNOPQRSTUVWXYZ[\]^       !"#$%&'())*+,-./0123456789:;<<=>?@ABBCDEFGHIJKKLMNNOPQRSTUVWXYZ[\]^_`abcdbcefgbhijklmnopqrstuvwxyz{|}~_ hS3-0.5.9Network.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.MaybeNothingHTTP-4000.2.18Network.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