amazonka-s3 1.3.5 → 1.3.6
raw patch · 13 files changed
+105/−59 lines, 13 filesdep ~amazonka-coredep ~amazonka-s3dep ~amazonka-testPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: amazonka-core, amazonka-s3, amazonka-test
API changes (from Hackage documentation)
- Network.AWS.S3: UPRSSEAES256 :: UploadPartRequestServerSideEncryption
- Network.AWS.S3: data UploadPartRequestServerSideEncryption
- Network.AWS.S3.Types: UPRSSEAES256 :: UploadPartRequestServerSideEncryption
- Network.AWS.S3.Types: data UploadPartRequestServerSideEncryption
- Network.AWS.S3.UploadPart: instance GHC.Generics.Selector Network.AWS.S3.UploadPart.S1_0_11UploadPart
- Network.AWS.S3.UploadPart: upServerSideEncryption :: Lens' UploadPart (Maybe UploadPartRequestServerSideEncryption)
+ Network.AWS.S3: LocationConstraint :: Region -> LocationConstraint
+ Network.AWS.S3: [constraintRegion] :: LocationConstraint -> Region
+ Network.AWS.S3: _LocationConstraint :: Iso' LocationConstraint Region
+ Network.AWS.S3: newtype LocationConstraint
+ Network.AWS.S3.Types: LocationConstraint :: Region -> LocationConstraint
+ Network.AWS.S3.Types: [constraintRegion] :: LocationConstraint -> Region
+ Network.AWS.S3.Types: _LocationConstraint :: Iso' LocationConstraint Region
+ Network.AWS.S3.Types: newtype LocationConstraint
- Network.AWS.S3: cbcLocationConstraint :: Lens' CreateBucketConfiguration (Maybe Region)
+ Network.AWS.S3: cbcLocationConstraint :: Lens' CreateBucketConfiguration (Maybe LocationConstraint)
- Network.AWS.S3.GetBucketLocation: getBucketLocationResponse :: Int -> Region -> GetBucketLocationResponse
+ Network.AWS.S3.GetBucketLocation: getBucketLocationResponse :: Int -> LocationConstraint -> GetBucketLocationResponse
- Network.AWS.S3.GetBucketLocation: grsLocationConstraint :: Lens' GetBucketLocationResponse Region
+ Network.AWS.S3.GetBucketLocation: grsLocationConstraint :: Lens' GetBucketLocationResponse LocationConstraint
- Network.AWS.S3.Types: cbcLocationConstraint :: Lens' CreateBucketConfiguration (Maybe Region)
+ Network.AWS.S3.Types: cbcLocationConstraint :: Lens' CreateBucketConfiguration (Maybe LocationConstraint)
Files
- README.md +1/−1
- amazonka-s3.cabal +5/−5
- fixture/PutObjectACLWithBody.yaml +10/−0
- fixture/PutObjectACLWithHeaders.yaml +10/−0
- gen/Network/AWS/S3.hs +0/−3
- gen/Network/AWS/S3/GetBucketLocation.hs +3/−3
- gen/Network/AWS/S3/Types.hs +0/−3
- gen/Network/AWS/S3/Types/Product.hs +2/−2
- gen/Network/AWS/S3/Types/Sum.hs +0/−24
- gen/Network/AWS/S3/UploadPart.hs +1/−12
- src/Network/AWS/S3/Internal.hs +49/−5
- test/Test/AWS/S3.hs +12/−1
- test/Test/AWS/S3/Internal.hs +12/−0
README.md view
@@ -8,7 +8,7 @@ ## Version -`1.3.5`+`1.3.6` ## Description
amazonka-s3.cabal view
@@ -1,5 +1,5 @@ name: amazonka-s3-version: 1.3.5+version: 1.3.6 synopsis: Amazon Simple Storage Service SDK. homepage: https://github.com/brendanhay/amazonka bug-reports: https://github.com/brendanhay/amazonka/issues@@ -108,7 +108,7 @@ , Network.AWS.S3.Types.Sum build-depends:- amazonka-core == 1.3.5.*+ amazonka-core == 1.3.6.* , base >= 4.7 && < 5 , lens >= 4.4 , text >= 1.1@@ -130,9 +130,9 @@ , Test.AWS.S3.Internal build-depends:- amazonka-core == 1.3.5.*- , amazonka-test == 1.3.5.*- , amazonka-s3 == 1.3.5.*+ amazonka-core == 1.3.6.*+ , amazonka-test == 1.3.6.*+ , amazonka-s3 == 1.3.6.* , base , bytestring , lens
+ fixture/PutObjectACLWithBody.yaml view
@@ -0,0 +1,10 @@+---+method: PUT+path: /bucket-body/key-body+query: ?acl=+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=da48913e8c9c160827cf36c4de3d3e414f946dcde4311926a7bbf7a6ef5cdd7a+ Host: s3.amazonaws.com+ X-Amz-Date: 20091028T223200Z+ X-Amz-Content-SHA256: d4c88048f8806fddc4b32ec5901ba6c1f390cb13f65ce695d30da0905d47fc98+body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><AccessControlPolicy xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><AccessControlList><Grant><Permission>WRITE</Permission></Grant></AccessControlList><Owner><ID>foo-oid</ID></Owner></AccessControlPolicy>"
+ fixture/PutObjectACLWithHeaders.yaml view
@@ -0,0 +1,10 @@+---+method: PUT+path: /bucket-headers/key-headers+query: ?acl=+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-acl;x-amz-content-sha256;x-amz-date, Signature=1a314ae21378ddf88489174a6f73a72506621bda8016520fa9e8efb24c6be9c2+ Host: s3.amazonaws.com+ X-Amz-Date: 20091028T223200Z+ X-Amz-Content-SHA256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855+ X-Amz-ACL: bucket-owner-read
gen/Network/AWS/S3.hs view
@@ -297,9 +297,6 @@ -- ** Type , Type (..) - -- ** UploadPartRequestServerSideEncryption- , UploadPartRequestServerSideEncryption (..)- -- ** AccessControlPolicy , AccessControlPolicy , accessControlPolicy
gen/Network/AWS/S3/GetBucketLocation.hs view
@@ -87,7 +87,7 @@ -- | /See:/ 'getBucketLocationResponse' smart constructor. data GetBucketLocationResponse = GetBucketLocationResponse' { _grsResponseStatus :: !Int- , _grsLocationConstraint :: !Region+ , _grsLocationConstraint :: !LocationConstraint } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'GetBucketLocationResponse' with the minimum fields required to make a request.@@ -99,7 +99,7 @@ -- * 'grsLocationConstraint' getBucketLocationResponse :: Int -- ^ 'grsResponseStatus'- -> Region -- ^ 'grsLocationConstraint'+ -> LocationConstraint -- ^ 'grsLocationConstraint' -> GetBucketLocationResponse getBucketLocationResponse pResponseStatus_ pLocationConstraint_ = GetBucketLocationResponse'@@ -112,5 +112,5 @@ grsResponseStatus = lens _grsResponseStatus (\ s a -> s{_grsResponseStatus = a}); -- | Undocumented member.-grsLocationConstraint :: Lens' GetBucketLocationResponse Region+grsLocationConstraint :: Lens' GetBucketLocationResponse LocationConstraint grsLocationConstraint = lens _grsLocationConstraint (\ s a -> s{_grsLocationConstraint = a});
gen/Network/AWS/S3/Types.hs view
@@ -98,9 +98,6 @@ -- * Type , Type (..) - -- * UploadPartRequestServerSideEncryption- , UploadPartRequestServerSideEncryption (..)- -- * AccessControlPolicy , AccessControlPolicy , accessControlPolicy
gen/Network/AWS/S3/Types/Product.hs view
@@ -454,7 +454,7 @@ -- | /See:/ 'createBucketConfiguration' smart constructor. newtype CreateBucketConfiguration = CreateBucketConfiguration'- { _cbcLocationConstraint :: Maybe Region+ { _cbcLocationConstraint :: Maybe LocationConstraint } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'CreateBucketConfiguration' with the minimum fields required to make a request.@@ -471,7 +471,7 @@ -- | Specifies the region where the bucket will be created. If you don\'t -- specify a region, the bucket will be created in US Standard.-cbcLocationConstraint :: Lens' CreateBucketConfiguration (Maybe Region)+cbcLocationConstraint :: Lens' CreateBucketConfiguration (Maybe LocationConstraint) cbcLocationConstraint = lens _cbcLocationConstraint (\ s a -> s{_cbcLocationConstraint = a}); instance ToXML CreateBucketConfiguration where
gen/Network/AWS/S3/Types/Sum.hs view
@@ -732,27 +732,3 @@ instance ToXML Type where toXML = toXMLText---- | The Server-side encryption algorithm used when storing this object in S3--- (e.g., AES256).-data UploadPartRequestServerSideEncryption =- UPRSSEAES256- deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)--instance FromText UploadPartRequestServerSideEncryption where- parser = takeLowerText >>= \case- "aes256" -> pure UPRSSEAES256- e -> fromTextError $ "Failure parsing UploadPartRequestServerSideEncryption from value: '" <> e- <> "'. Accepted values: AES256"--instance ToText UploadPartRequestServerSideEncryption where- toText = \case- UPRSSEAES256 -> "AES256"--instance Hashable UploadPartRequestServerSideEncryption-instance ToByteString UploadPartRequestServerSideEncryption-instance ToQuery UploadPartRequestServerSideEncryption-instance ToHeader UploadPartRequestServerSideEncryption--instance ToXML UploadPartRequestServerSideEncryption where- toXML = toXMLText
gen/Network/AWS/S3/UploadPart.hs view
@@ -39,7 +39,6 @@ , upRequestPayer , upSSECustomerKeyMD5 , upContentMD5- , upServerSideEncryption , upBucket , upKey , upPartNumber@@ -73,7 +72,6 @@ , _upRequestPayer :: !(Maybe RequestPayer) , _upSSECustomerKeyMD5 :: !(Maybe Text) , _upContentMD5 :: !(Maybe Text)- , _upServerSideEncryption :: !(Maybe UploadPartRequestServerSideEncryption) , _upBucket :: !BucketName , _upKey :: !ObjectKey , _upPartNumber :: !Int@@ -97,8 +95,6 @@ -- -- * 'upContentMD5' ----- * 'upServerSideEncryption'--- -- * 'upBucket' -- -- * 'upKey'@@ -123,7 +119,6 @@ , _upRequestPayer = Nothing , _upSSECustomerKeyMD5 = Nothing , _upContentMD5 = Nothing- , _upServerSideEncryption = Nothing , _upBucket = pBucket_ , _upKey = pKey_ , _upPartNumber = pPartNumber_@@ -166,10 +161,6 @@ upContentMD5 = lens _upContentMD5 (\ s a -> s{_upContentMD5 = a}); -- | Undocumented member.-upServerSideEncryption :: Lens' UploadPart (Maybe UploadPartRequestServerSideEncryption)-upServerSideEncryption = lens _upServerSideEncryption (\ s a -> s{_upServerSideEncryption = a});---- | Undocumented member. upBucket :: Lens' UploadPart BucketName upBucket = lens _upBucket (\ s a -> s{_upBucket = a}); @@ -223,9 +214,7 @@ "x-amz-request-payer" =# _upRequestPayer, "x-amz-server-side-encryption-customer-key-MD5" =# _upSSECustomerKeyMD5,- "Content-MD5" =# _upContentMD5,- "x-amz-server-side-encryption" =#- _upServerSideEncryption]+ "Content-MD5" =# _upContentMD5] instance ToPath UploadPart where toPath UploadPart'{..}
src/Network/AWS/S3/Internal.hs view
@@ -3,7 +3,9 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiWayIf #-}+{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} -- |@@ -15,12 +17,18 @@ -- Portability : non-portable (GHC extensions) -- module Network.AWS.S3.Internal- ( Region (..)- , BucketName (..)- , ETag (..)- , ObjectVersionId (..)+ ( Region (..)+ , BucketName (..)+ , ETag (..)+ , ObjectVersionId (..)++ -- * Bucket Location+ , LocationConstraint (..)+ , _LocationConstraint++ -- * Object Key , Delimiter- , ObjectKey (..)+ , ObjectKey (..) , _ObjectKey , keyPrefix , keyName@@ -92,6 +100,42 @@ , ToQuery , ToLog )++newtype LocationConstraint = LocationConstraint { constraintRegion :: Region }+ deriving+ ( Eq+ , Ord+ , Read+ , Show+ , Data+ , Typeable+ , Generic+ , ToText+ , ToByteString+ , ToLog+ )++_LocationConstraint :: Iso' LocationConstraint Region+_LocationConstraint = iso constraintRegion LocationConstraint++instance FromText LocationConstraint where+ parser = LocationConstraint <$> (parser <|> go)+ where+ go = takeLowerText >>= \case+ "" -> pure NorthVirginia+ "eu" -> pure Ireland+ e -> fromTextError $+ "Failure parsing LocationConstraint from " <> e++instance FromXML LocationConstraint where+ parseXML = \case+ [] -> pure (LocationConstraint NorthVirginia)+ ns -> parseXMLText "LocationConstraint" ns++instance ToXML LocationConstraint where+ toXML = \case+ LocationConstraint NorthVirginia -> XNull+ LocationConstraint r -> toXMLText r newtype ObjectKey = ObjectKey Text deriving
test/Test/AWS/S3.hs view
@@ -20,7 +20,6 @@ import Test.AWS.Gen.S3 import Test.AWS.Prelude import Test.AWS.S3.Internal-import Test.Tasty tests :: [TestTree] tests =@@ -39,6 +38,18 @@ , testListMultipartUploads $ listMultipartUploads "foo-bucket" & lmuMaxUploads ?~ 3++ , testPutObjectACLWithBody $+ putObjectACL "bucket-body" "key-body"+ & poaAccessControlPolicy ?~+ ( accessControlPolicy+ & acpGrants .~ [grant & gPermission ?~ PWrite]+ & acpOwner ?~ (owner & oId ?~ "foo-oid")+ )++ , testPutObjectACLWithHeaders $+ putObjectACL "bucket-headers" "key-headers"+ & poaACL ?~ OBucketOwnerRead ] , testGroup "response"
test/Test/AWS/S3/Internal.hs view
@@ -13,8 +13,10 @@ module Test.AWS.S3.Internal where +import Data.Time import Network.AWS.Prelude import Network.AWS.S3+import Test.AWS.Fixture import Test.AWS.Prelude import Test.Tasty import Test.Tasty.HUnit@@ -43,3 +45,13 @@ where enc :: ObjectKey -> ByteString enc = toBS . escapePath . rawPath++testPutObjectACLWithBody :: PutObjectACL -> TestTree+testPutObjectACLWithBody = req+ "PutObjectACLWithBody"+ "fixture/PutObjectACLWithBody.yaml"++testPutObjectACLWithHeaders :: PutObjectACL -> TestTree+testPutObjectACLWithHeaders = req+ "PutObjectACLWithHeaders"+ "fixture/PutObjectACLWithHeaders.yaml"