Skip to content

Commit 06e5890

Browse files
Amazon Simple Storage Service / Features: Add support for ETag based conditional writes in PutObject and CompleteMultiPartUpload APIs to prevent unintended object modifications.
1 parent 2715757 commit 06e5890

17 files changed

+219
-101
lines changed

generator/ServiceModels/s3/s3-2006-03-01.api.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,11 @@
18701870
"location":"header",
18711871
"locationName":"x-amz-expected-bucket-owner"
18721872
},
1873+
"IfMatch":{
1874+
"shape":"IfMatch",
1875+
"location":"header",
1876+
"locationName":"If-Match"
1877+
},
18731878
"IfNoneMatch":{
18741879
"shape":"IfNoneMatch",
18751880
"location":"header",
@@ -7711,6 +7716,11 @@
77117716
"location":"header",
77127717
"locationName":"Expires"
77137718
},
7719+
"IfMatch":{
7720+
"shape":"IfMatch",
7721+
"location":"header",
7722+
"locationName":"If-Match"
7723+
},
77147724
"IfNoneMatch":{
77157725
"shape":"IfNoneMatch",
77167726
"location":"header",

generator/ServiceModels/s3/s3-2006-03-01.docs.json

Lines changed: 4 additions & 2 deletions
Large diffs are not rendered by default.

generator/ServiceModels/s3/s3-2006-03-01.examples.json

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -257,35 +257,35 @@
257257
"DeleteObject": [
258258
{
259259
"input": {
260-
"Bucket": "examplebucket",
261-
"Key": "objectkey.jpg"
262-
},
263-
"output": {
260+
"Bucket": "ExampleBucket",
261+
"Key": "HappyFace.jpg"
264262
},
265263
"comments": {
266264
"input": {
267265
},
268266
"output": {
269267
}
270268
},
271-
"description": "The following example deletes an object from an S3 bucket.",
272-
"id": "to-delete-an-object-1472850136595",
273-
"title": "To delete an object"
269+
"description": "The following example deletes an object from a non-versioned bucket.",
270+
"id": "to-delete-an-object-from-a-non-versioned-bucket-1481588533089",
271+
"title": "To delete an object (from a non-versioned bucket)"
274272
},
275273
{
276274
"input": {
277-
"Bucket": "ExampleBucket",
278-
"Key": "HappyFace.jpg"
275+
"Bucket": "examplebucket",
276+
"Key": "objectkey.jpg"
277+
},
278+
"output": {
279279
},
280280
"comments": {
281281
"input": {
282282
},
283283
"output": {
284284
}
285285
},
286-
"description": "The following example deletes an object from a non-versioned bucket.",
287-
"id": "to-delete-an-object-from-a-non-versioned-bucket-1481588533089",
288-
"title": "To delete an object (from a non-versioned bucket)"
286+
"description": "The following example deletes an object from an S3 bucket.",
287+
"id": "to-delete-an-object-1472850136595",
288+
"title": "To delete an object"
289289
}
290290
],
291291
"DeleteObjectTagging": [
@@ -728,18 +728,17 @@
728728
{
729729
"input": {
730730
"Bucket": "examplebucket",
731-
"Key": "SampleFile.txt",
732-
"Range": "bytes=0-9"
731+
"Key": "HappyFace.jpg"
733732
},
734733
"output": {
735734
"AcceptRanges": "bytes",
736-
"ContentLength": "10",
737-
"ContentRange": "bytes 0-9/43",
738-
"ContentType": "text/plain",
739-
"ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
740-
"LastModified": "2014-10-09T22:57:28.000Z",
735+
"ContentLength": "3191",
736+
"ContentType": "image/jpeg",
737+
"ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
738+
"LastModified": "2016-12-15T01:19:41.000Z",
741739
"Metadata": {
742740
},
741+
"TagCount": 2,
743742
"VersionId": "null"
744743
},
745744
"comments": {
@@ -748,24 +747,25 @@
748747
"output": {
749748
}
750749
},
751-
"description": "The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.",
752-
"id": "to-retrieve-a-byte-range-of-an-object--1481832674603",
753-
"title": "To retrieve a byte range of an object "
750+
"description": "The following example retrieves an object for an S3 bucket.",
751+
"id": "to-retrieve-an-object-1481827837012",
752+
"title": "To retrieve an object"
754753
},
755754
{
756755
"input": {
757756
"Bucket": "examplebucket",
758-
"Key": "HappyFace.jpg"
757+
"Key": "SampleFile.txt",
758+
"Range": "bytes=0-9"
759759
},
760760
"output": {
761761
"AcceptRanges": "bytes",
762-
"ContentLength": "3191",
763-
"ContentType": "image/jpeg",
764-
"ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
765-
"LastModified": "2016-12-15T01:19:41.000Z",
762+
"ContentLength": "10",
763+
"ContentRange": "bytes 0-9/43",
764+
"ContentType": "text/plain",
765+
"ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
766+
"LastModified": "2014-10-09T22:57:28.000Z",
766767
"Metadata": {
767768
},
768-
"TagCount": 2,
769769
"VersionId": "null"
770770
},
771771
"comments": {
@@ -774,9 +774,9 @@
774774
"output": {
775775
}
776776
},
777-
"description": "The following example retrieves an object for an S3 bucket.",
778-
"id": "to-retrieve-an-object-1481827837012",
779-
"title": "To retrieve an object"
777+
"description": "The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.",
778+
"id": "to-retrieve-a-byte-range-of-an-object--1481832674603",
779+
"title": "To retrieve a byte range of an object "
780780
}
781781
],
782782
"GetObjectAcl": [
@@ -840,55 +840,55 @@
840840
{
841841
"input": {
842842
"Bucket": "examplebucket",
843-
"Key": "HappyFace.jpg"
843+
"Key": "exampleobject",
844+
"VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
844845
},
845846
"output": {
846847
"TagSet": [
847848
{
848-
"Key": "Key4",
849-
"Value": "Value4"
850-
},
851-
{
852-
"Key": "Key3",
853-
"Value": "Value3"
849+
"Key": "Key1",
850+
"Value": "Value1"
854851
}
855852
],
856-
"VersionId": "null"
853+
"VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
857854
},
858855
"comments": {
859856
"input": {
860857
},
861858
"output": {
862859
}
863860
},
864-
"description": "The following example retrieves tag set of an object.",
865-
"id": "to-retrieve-tag-set-of-an-object-1481833847896",
866-
"title": "To retrieve tag set of an object"
861+
"description": "The following example retrieves tag set of an object. The request specifies object version.",
862+
"id": "to-retrieve-tag-set-of-a-specific-object-version-1483400283663",
863+
"title": "To retrieve tag set of a specific object version"
867864
},
868865
{
869866
"input": {
870867
"Bucket": "examplebucket",
871-
"Key": "exampleobject",
872-
"VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
868+
"Key": "HappyFace.jpg"
873869
},
874870
"output": {
875871
"TagSet": [
876872
{
877-
"Key": "Key1",
878-
"Value": "Value1"
873+
"Key": "Key4",
874+
"Value": "Value4"
875+
},
876+
{
877+
"Key": "Key3",
878+
"Value": "Value3"
879879
}
880880
],
881-
"VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
881+
"VersionId": "null"
882882
},
883883
"comments": {
884884
"input": {
885885
},
886886
"output": {
887887
}
888888
},
889-
"description": "The following example retrieves tag set of an object. The request specifies object version.",
890-
"id": "to-retrieve-tag-set-of-a-specific-object-version-1483400283663",
891-
"title": "To retrieve tag set of a specific object version"
889+
"description": "The following example retrieves tag set of an object.",
890+
"id": "to-retrieve-tag-set-of-an-object-1481833847896",
891+
"title": "To retrieve tag set of an object"
892892
}
893893
],
894894
"GetObjectTorrent": [
@@ -1567,65 +1567,67 @@
15671567
"PutObject": [
15681568
{
15691569
"input": {
1570-
"Body": "c:\\HappyFace.jpg",
1570+
"Body": "filetoupload",
15711571
"Bucket": "examplebucket",
1572-
"Key": "HappyFace.jpg",
1572+
"Key": "exampleobject",
1573+
"ServerSideEncryption": "AES256",
15731574
"Tagging": "key1=value1&key2=value2"
15741575
},
15751576
"output": {
15761577
"ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
1577-
"VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
1578+
"ServerSideEncryption": "AES256",
1579+
"VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
15781580
},
15791581
"comments": {
15801582
"input": {
15811583
},
15821584
"output": {
15831585
}
15841586
},
1585-
"description": "The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object.",
1586-
"id": "to-upload-an-object-and-specify-optional-tags-1481762310955",
1587-
"title": "To upload an object and specify optional tags"
1587+
"description": "The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.",
1588+
"id": "to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831",
1589+
"title": "To upload an object and specify server-side encryption and object tags"
15881590
},
15891591
{
15901592
"input": {
1591-
"ACL": "authenticated-read",
1592-
"Body": "filetoupload",
1593+
"Body": "HappyFace.jpg",
15931594
"Bucket": "examplebucket",
1594-
"Key": "exampleobject"
1595+
"Key": "HappyFace.jpg"
15951596
},
15961597
"output": {
15971598
"ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
1598-
"VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr"
1599+
"VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk"
15991600
},
16001601
"comments": {
16011602
"input": {
16021603
},
16031604
"output": {
16041605
}
16051606
},
1606-
"description": "The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.",
1607-
"id": "to-upload-an-object-and-specify-canned-acl-1483397779571",
1608-
"title": "To upload an object and specify canned ACL."
1607+
"description": "The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object.",
1608+
"id": "to-upload-an-object-1481760101010",
1609+
"title": "To upload an object"
16091610
},
16101611
{
16111612
"input": {
1612-
"Body": "HappyFace.jpg",
1613+
"Body": "c:\\HappyFace.jpg",
16131614
"Bucket": "examplebucket",
1614-
"Key": "HappyFace.jpg"
1615+
"Key": "HappyFace.jpg",
1616+
"Tagging": "key1=value1&key2=value2"
16151617
},
16161618
"output": {
16171619
"ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
1618-
"VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk"
1620+
"VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
16191621
},
16201622
"comments": {
16211623
"input": {
16221624
},
16231625
"output": {
16241626
}
16251627
},
1626-
"description": "The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object.",
1627-
"id": "to-upload-an-object-1481760101010",
1628-
"title": "To upload an object"
1628+
"description": "The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object.",
1629+
"id": "to-upload-an-object-and-specify-optional-tags-1481762310955",
1630+
"title": "To upload an object and specify optional tags"
16291631
},
16301632
{
16311633
"input": {
@@ -1653,23 +1655,24 @@
16531655
},
16541656
{
16551657
"input": {
1658+
"ACL": "authenticated-read",
16561659
"Body": "filetoupload",
16571660
"Bucket": "examplebucket",
1658-
"Key": "objectkey"
1661+
"Key": "exampleobject"
16591662
},
16601663
"output": {
16611664
"ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
1662-
"VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
1665+
"VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr"
16631666
},
16641667
"comments": {
16651668
"input": {
16661669
},
16671670
"output": {
16681671
}
16691672
},
1670-
"description": "The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.",
1671-
"id": "to-create-an-object-1483147613675",
1672-
"title": "To create an object."
1673+
"description": "The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.",
1674+
"id": "to-upload-an-object-and-specify-canned-acl-1483397779571",
1675+
"title": "To upload an object and specify canned ACL."
16731676
},
16741677
{
16751678
"input": {
@@ -1698,24 +1701,21 @@
16981701
"input": {
16991702
"Body": "filetoupload",
17001703
"Bucket": "examplebucket",
1701-
"Key": "exampleobject",
1702-
"ServerSideEncryption": "AES256",
1703-
"Tagging": "key1=value1&key2=value2"
1704+
"Key": "objectkey"
17041705
},
17051706
"output": {
17061707
"ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
1707-
"ServerSideEncryption": "AES256",
1708-
"VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
1708+
"VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
17091709
},
17101710
"comments": {
17111711
"input": {
17121712
},
17131713
"output": {
17141714
}
17151715
},
1716-
"description": "The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.",
1717-
"id": "to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831",
1718-
"title": "To upload an object and specify server-side encryption and object tags"
1716+
"description": "The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.",
1717+
"id": "to-create-an-object-1483147613675",
1718+
"title": "To create an object."
17191719
}
17201720
],
17211721
"PutObjectAcl": [

0 commit comments

Comments
 (0)