aws-sdk-s3 1.85.0 → 1.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/aws-sdk-s3.rb +1 -1
- data/lib/aws-sdk-s3/arn/access_point_arn.rb +8 -4
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +7 -3
- data/lib/aws-sdk-s3/bucket.rb +11 -1
- data/lib/aws-sdk-s3/client.rb +175 -114
- data/lib/aws-sdk-s3/client_api.rb +20 -1
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +3 -3
- data/lib/aws-sdk-s3/legacy_signer.rb +15 -25
- data/lib/aws-sdk-s3/object.rb +49 -6
- data/lib/aws-sdk-s3/object_summary.rb +27 -0
- data/lib/aws-sdk-s3/plugins/accelerate.rb +7 -4
- data/lib/aws-sdk-s3/plugins/arn.rb +44 -26
- data/lib/aws-sdk-s3/plugins/dualstack.rb +10 -3
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +1 -2
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +18 -26
- data/lib/aws-sdk-s3/presigner.rb +14 -25
- data/lib/aws-sdk-s3/types.rb +186 -21
- metadata +4 -4
@@ -45,6 +45,7 @@ module Aws::S3
|
|
45
45
|
BucketAlreadyExists = Shapes::StructureShape.new(name: 'BucketAlreadyExists')
|
46
46
|
BucketAlreadyOwnedByYou = Shapes::StructureShape.new(name: 'BucketAlreadyOwnedByYou')
|
47
47
|
BucketCannedACL = Shapes::StringShape.new(name: 'BucketCannedACL')
|
48
|
+
BucketKeyEnabled = Shapes::BooleanShape.new(name: 'BucketKeyEnabled')
|
48
49
|
BucketLifecycleConfiguration = Shapes::StructureShape.new(name: 'BucketLifecycleConfiguration')
|
49
50
|
BucketLocationConstraint = Shapes::StringShape.new(name: 'BucketLocationConstraint')
|
50
51
|
BucketLoggingStatus = Shapes::StructureShape.new(name: 'BucketLoggingStatus')
|
@@ -458,6 +459,8 @@ module Aws::S3
|
|
458
459
|
ReplaceKeyPrefixWith = Shapes::StringShape.new(name: 'ReplaceKeyPrefixWith')
|
459
460
|
ReplaceKeyWith = Shapes::StringShape.new(name: 'ReplaceKeyWith')
|
460
461
|
ReplicaKmsKeyID = Shapes::StringShape.new(name: 'ReplicaKmsKeyID')
|
462
|
+
ReplicaModifications = Shapes::StructureShape.new(name: 'ReplicaModifications')
|
463
|
+
ReplicaModificationsStatus = Shapes::StringShape.new(name: 'ReplicaModificationsStatus')
|
461
464
|
ReplicationConfiguration = Shapes::StructureShape.new(name: 'ReplicationConfiguration')
|
462
465
|
ReplicationRule = Shapes::StructureShape.new(name: 'ReplicationRule')
|
463
466
|
ReplicationRuleAndOperator = Shapes::StructureShape.new(name: 'ReplicationRuleAndOperator')
|
@@ -477,7 +480,7 @@ module Aws::S3
|
|
477
480
|
ResponseContentEncoding = Shapes::StringShape.new(name: 'ResponseContentEncoding')
|
478
481
|
ResponseContentLanguage = Shapes::StringShape.new(name: 'ResponseContentLanguage')
|
479
482
|
ResponseContentType = Shapes::StringShape.new(name: 'ResponseContentType')
|
480
|
-
ResponseExpires = Shapes::TimestampShape.new(name: 'ResponseExpires')
|
483
|
+
ResponseExpires = Shapes::TimestampShape.new(name: 'ResponseExpires', timestampFormat: "rfc822")
|
481
484
|
Restore = Shapes::StringShape.new(name: 'Restore')
|
482
485
|
RestoreObjectOutput = Shapes::StructureShape.new(name: 'RestoreObjectOutput')
|
483
486
|
RestoreObjectRequest = Shapes::StructureShape.new(name: 'RestoreObjectRequest')
|
@@ -676,6 +679,7 @@ module Aws::S3
|
|
676
679
|
CompleteMultipartUploadOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption"))
|
677
680
|
CompleteMultipartUploadOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id"))
|
678
681
|
CompleteMultipartUploadOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
682
|
+
CompleteMultipartUploadOutput.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
679
683
|
CompleteMultipartUploadOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
|
680
684
|
CompleteMultipartUploadOutput.struct_class = Types::CompleteMultipartUploadOutput
|
681
685
|
|
@@ -713,6 +717,7 @@ module Aws::S3
|
|
713
717
|
CopyObjectOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
714
718
|
CopyObjectOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
715
719
|
CopyObjectOutput.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context"))
|
720
|
+
CopyObjectOutput.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
716
721
|
CopyObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
|
717
722
|
CopyObjectOutput.struct_class = Types::CopyObjectOutput
|
718
723
|
CopyObjectOutput[:payload] = :copy_object_result
|
@@ -747,6 +752,7 @@ module Aws::S3
|
|
747
752
|
CopyObjectRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
748
753
|
CopyObjectRequest.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
749
754
|
CopyObjectRequest.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context"))
|
755
|
+
CopyObjectRequest.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
750
756
|
CopyObjectRequest.add_member(:copy_source_sse_customer_algorithm, Shapes::ShapeRef.new(shape: CopySourceSSECustomerAlgorithm, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-algorithm"))
|
751
757
|
CopyObjectRequest.add_member(:copy_source_sse_customer_key, Shapes::ShapeRef.new(shape: CopySourceSSECustomerKey, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-key"))
|
752
758
|
CopyObjectRequest.add_member(:copy_source_sse_customer_key_md5, Shapes::ShapeRef.new(shape: CopySourceSSECustomerKeyMD5, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-key-MD5"))
|
@@ -796,6 +802,7 @@ module Aws::S3
|
|
796
802
|
CreateMultipartUploadOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
797
803
|
CreateMultipartUploadOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
798
804
|
CreateMultipartUploadOutput.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context"))
|
805
|
+
CreateMultipartUploadOutput.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
799
806
|
CreateMultipartUploadOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
|
800
807
|
CreateMultipartUploadOutput.struct_class = Types::CreateMultipartUploadOutput
|
801
808
|
|
@@ -821,6 +828,7 @@ module Aws::S3
|
|
821
828
|
CreateMultipartUploadRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
822
829
|
CreateMultipartUploadRequest.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
823
830
|
CreateMultipartUploadRequest.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context"))
|
831
|
+
CreateMultipartUploadRequest.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
824
832
|
CreateMultipartUploadRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer"))
|
825
833
|
CreateMultipartUploadRequest.add_member(:tagging, Shapes::ShapeRef.new(shape: TaggingHeader, location: "header", location_name: "x-amz-tagging"))
|
826
834
|
CreateMultipartUploadRequest.add_member(:object_lock_mode, Shapes::ShapeRef.new(shape: ObjectLockMode, location: "header", location_name: "x-amz-object-lock-mode"))
|
@@ -1225,6 +1233,7 @@ module Aws::S3
|
|
1225
1233
|
GetObjectOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm"))
|
1226
1234
|
GetObjectOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
1227
1235
|
GetObjectOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
1236
|
+
GetObjectOutput.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
1228
1237
|
GetObjectOutput.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location: "header", location_name: "x-amz-storage-class"))
|
1229
1238
|
GetObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
|
1230
1239
|
GetObjectOutput.add_member(:replication_status, Shapes::ShapeRef.new(shape: ReplicationStatus, location: "header", location_name: "x-amz-replication-status"))
|
@@ -1345,6 +1354,7 @@ module Aws::S3
|
|
1345
1354
|
HeadObjectOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm"))
|
1346
1355
|
HeadObjectOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
1347
1356
|
HeadObjectOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
1357
|
+
HeadObjectOutput.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
1348
1358
|
HeadObjectOutput.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location: "header", location_name: "x-amz-storage-class"))
|
1349
1359
|
HeadObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
|
1350
1360
|
HeadObjectOutput.add_member(:replication_status, Shapes::ShapeRef.new(shape: ReplicationStatus, location: "header", location_name: "x-amz-replication-status"))
|
@@ -2031,6 +2041,7 @@ module Aws::S3
|
|
2031
2041
|
PutObjectOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
2032
2042
|
PutObjectOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
2033
2043
|
PutObjectOutput.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context"))
|
2044
|
+
PutObjectOutput.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
2034
2045
|
PutObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
|
2035
2046
|
PutObjectOutput.struct_class = Types::PutObjectOutput
|
2036
2047
|
|
@@ -2059,6 +2070,7 @@ module Aws::S3
|
|
2059
2070
|
PutObjectRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
2060
2071
|
PutObjectRequest.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
2061
2072
|
PutObjectRequest.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context"))
|
2073
|
+
PutObjectRequest.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
2062
2074
|
PutObjectRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer"))
|
2063
2075
|
PutObjectRequest.add_member(:tagging, Shapes::ShapeRef.new(shape: TaggingHeader, location: "header", location_name: "x-amz-tagging"))
|
2064
2076
|
PutObjectRequest.add_member(:object_lock_mode, Shapes::ShapeRef.new(shape: ObjectLockMode, location: "header", location_name: "x-amz-object-lock-mode"))
|
@@ -2133,6 +2145,9 @@ module Aws::S3
|
|
2133
2145
|
RedirectAllRequestsTo.add_member(:protocol, Shapes::ShapeRef.new(shape: Protocol, location_name: "Protocol"))
|
2134
2146
|
RedirectAllRequestsTo.struct_class = Types::RedirectAllRequestsTo
|
2135
2147
|
|
2148
|
+
ReplicaModifications.add_member(:status, Shapes::ShapeRef.new(shape: ReplicaModificationsStatus, required: true, location_name: "Status"))
|
2149
|
+
ReplicaModifications.struct_class = Types::ReplicaModifications
|
2150
|
+
|
2136
2151
|
ReplicationConfiguration.add_member(:role, Shapes::ShapeRef.new(shape: Role, required: true, location_name: "Role"))
|
2137
2152
|
ReplicationConfiguration.add_member(:rules, Shapes::ShapeRef.new(shape: ReplicationRules, required: true, location_name: "Rule"))
|
2138
2153
|
ReplicationConfiguration.struct_class = Types::ReplicationConfiguration
|
@@ -2275,11 +2290,13 @@ module Aws::S3
|
|
2275
2290
|
ServerSideEncryptionConfiguration.struct_class = Types::ServerSideEncryptionConfiguration
|
2276
2291
|
|
2277
2292
|
ServerSideEncryptionRule.add_member(:apply_server_side_encryption_by_default, Shapes::ShapeRef.new(shape: ServerSideEncryptionByDefault, location_name: "ApplyServerSideEncryptionByDefault"))
|
2293
|
+
ServerSideEncryptionRule.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location_name: "BucketKeyEnabled"))
|
2278
2294
|
ServerSideEncryptionRule.struct_class = Types::ServerSideEncryptionRule
|
2279
2295
|
|
2280
2296
|
ServerSideEncryptionRules.member = Shapes::ShapeRef.new(shape: ServerSideEncryptionRule)
|
2281
2297
|
|
2282
2298
|
SourceSelectionCriteria.add_member(:sse_kms_encrypted_objects, Shapes::ShapeRef.new(shape: SseKmsEncryptedObjects, location_name: "SseKmsEncryptedObjects"))
|
2299
|
+
SourceSelectionCriteria.add_member(:replica_modifications, Shapes::ShapeRef.new(shape: ReplicaModifications, location_name: "ReplicaModifications"))
|
2283
2300
|
SourceSelectionCriteria.struct_class = Types::SourceSelectionCriteria
|
2284
2301
|
|
2285
2302
|
SseKmsEncryptedObjects.add_member(:status, Shapes::ShapeRef.new(shape: SseKmsEncryptedObjectsStatus, required: true, location_name: "Status"))
|
@@ -2348,6 +2365,7 @@ module Aws::S3
|
|
2348
2365
|
UploadPartCopyOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm"))
|
2349
2366
|
UploadPartCopyOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
2350
2367
|
UploadPartCopyOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
2368
|
+
UploadPartCopyOutput.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
2351
2369
|
UploadPartCopyOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
|
2352
2370
|
UploadPartCopyOutput.struct_class = Types::UploadPartCopyOutput
|
2353
2371
|
UploadPartCopyOutput[:payload] = :copy_part_result
|
@@ -2379,6 +2397,7 @@ module Aws::S3
|
|
2379
2397
|
UploadPartOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm"))
|
2380
2398
|
UploadPartOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
2381
2399
|
UploadPartOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id"))
|
2400
|
+
UploadPartOutput.add_member(:bucket_key_enabled, Shapes::ShapeRef.new(shape: BucketKeyEnabled, location: "header", location_name: "x-amz-server-side-encryption-bucket-key-enabled"))
|
2382
2401
|
UploadPartOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged"))
|
2383
2402
|
UploadPartOutput.struct_class = Types::UploadPartOutput
|
2384
2403
|
|
@@ -87,9 +87,9 @@ module Aws
|
|
87
87
|
' kms+context. Please configure the client with the' \
|
88
88
|
' required kms_key_id'
|
89
89
|
else
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
raise ArgumentError, 'Unsupported wrap-alg: ' \
|
91
|
+
"#{envelope['x-amz-wrap-alg']}"
|
92
|
+
end
|
93
93
|
iv = decode64(envelope['x-amz-iv'])
|
94
94
|
Utils.aes_decryption_cipher(:GCM, key, iv)
|
95
95
|
end
|
@@ -4,7 +4,6 @@ require 'set'
|
|
4
4
|
require 'time'
|
5
5
|
require 'openssl'
|
6
6
|
require 'cgi'
|
7
|
-
require 'webrick/httputils'
|
8
7
|
require 'aws-sdk-core/query'
|
9
8
|
|
10
9
|
module Aws
|
@@ -157,33 +156,24 @@ module Aws
|
|
157
156
|
end
|
158
157
|
|
159
158
|
def uri_escape(s)
|
160
|
-
|
161
159
|
#URI.escape(s)
|
162
160
|
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
# (
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
|
178
|
-
# URI.escape(s),
|
179
|
-
# ]
|
180
|
-
# next if e.uniq.length == 1
|
181
|
-
# puts("%5s %5s %5s %5s %5s %5s %5s" % ([s.inspect] + e))
|
182
|
-
# }
|
183
|
-
#
|
184
|
-
WEBrick::HTTPUtils.escape(s).gsub('%5B', '[').gsub('%5D', ']')
|
161
|
+
# (0..255).each {|c|
|
162
|
+
# s = [c].pack("C")
|
163
|
+
# e = [
|
164
|
+
# CGI.escape(s),
|
165
|
+
# ERB::Util.url_encode(s),
|
166
|
+
# URI.encode_www_form_component(s),
|
167
|
+
# WEBrick::HTTPUtils.escape_form(s),
|
168
|
+
# WEBrick::HTTPUtils.escape(s),
|
169
|
+
# URI.escape(s),
|
170
|
+
# URI::DEFAULT_PARSER.escape(s)
|
171
|
+
# ]
|
172
|
+
# next if e.uniq.length == 1
|
173
|
+
# puts("%5s %5s %5s %5s %5s %5s %5s %5s" % ([s.inspect] + e))
|
174
|
+
# }
|
175
|
+
URI::DEFAULT_PARSER.escape(s)
|
185
176
|
end
|
186
|
-
|
187
177
|
end
|
188
178
|
end
|
189
179
|
end
|
data/lib/aws-sdk-s3/object.rb
CHANGED
@@ -224,6 +224,13 @@ module Aws::S3
|
|
224
224
|
data[:ssekms_key_id]
|
225
225
|
end
|
226
226
|
|
227
|
+
# Indicates whether the object uses an S3 Bucket Key for server-side
|
228
|
+
# encryption with AWS KMS (SSE-KMS).
|
229
|
+
# @return [Boolean]
|
230
|
+
def bucket_key_enabled
|
231
|
+
data[:bucket_key_enabled]
|
232
|
+
end
|
233
|
+
|
227
234
|
# Provides storage class information of the object. Amazon S3 returns
|
228
235
|
# this header for all objects except for S3 Standard storage class
|
229
236
|
# objects.
|
@@ -246,12 +253,12 @@ module Aws::S3
|
|
246
253
|
end
|
247
254
|
|
248
255
|
# Amazon S3 can return this header if your request involves a bucket
|
249
|
-
# that is either a source or destination in a replication rule.
|
256
|
+
# that is either a source or a destination in a replication rule.
|
250
257
|
#
|
251
258
|
# In replication, you have a source bucket on which you configure
|
252
|
-
# replication and destination bucket where Amazon S3 stores
|
253
|
-
# replicas. When you request an object (`GetObject`) or object
|
254
|
-
# (`HeadObject`) from these buckets, Amazon S3 will return the
|
259
|
+
# replication and destination bucket or buckets where Amazon S3 stores
|
260
|
+
# object replicas. When you request an object (`GetObject`) or object
|
261
|
+
# metadata (`HeadObject`) from these buckets, Amazon S3 will return the
|
255
262
|
# `x-amz-replication-status` header in the response as follows:
|
256
263
|
#
|
257
264
|
# * If requesting an object from the source bucket — Amazon S3 will
|
@@ -267,9 +274,18 @@ module Aws::S3
|
|
267
274
|
# value PENDING, COMPLETED or FAILED indicating object replication
|
268
275
|
# status.
|
269
276
|
#
|
270
|
-
# * If requesting an object from
|
277
|
+
# * If requesting an object from a destination bucket — Amazon S3 will
|
271
278
|
# return the `x-amz-replication-status` header with value REPLICA if
|
272
|
-
# the object in your request is a replica that Amazon S3 created
|
279
|
+
# the object in your request is a replica that Amazon S3 created and
|
280
|
+
# there is no replica modification replication in progress.
|
281
|
+
#
|
282
|
+
# * When replicating objects to multiple destination buckets the
|
283
|
+
# `x-amz-replication-status` header acts differently. The header of
|
284
|
+
# the source object will only return a value of COMPLETED when
|
285
|
+
# replication is successful to all destinations. The header will
|
286
|
+
# remain at value PENDING until replication has completed for all
|
287
|
+
# destinations. If one or more destinations fails replication the
|
288
|
+
# header will return FAILED.
|
273
289
|
#
|
274
290
|
# For more information, see [Replication][1].
|
275
291
|
#
|
@@ -543,6 +559,7 @@ module Aws::S3
|
|
543
559
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
544
560
|
# ssekms_key_id: "SSEKMSKeyId",
|
545
561
|
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
562
|
+
# bucket_key_enabled: false,
|
546
563
|
# copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm",
|
547
564
|
# copy_source_sse_customer_key: "CopySourceSSECustomerKey",
|
548
565
|
# copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5",
|
@@ -699,6 +716,14 @@ module Aws::S3
|
|
699
716
|
# Specifies the AWS KMS Encryption Context to use for object encryption.
|
700
717
|
# The value of this header is a base64-encoded UTF-8 string holding JSON
|
701
718
|
# with the encryption context key-value pairs.
|
719
|
+
# @option options [Boolean] :bucket_key_enabled
|
720
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
721
|
+
# encryption with server-side encryption using AWS KMS (SSE-KMS).
|
722
|
+
# Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
|
723
|
+
# for object encryption with SSE-KMS.
|
724
|
+
#
|
725
|
+
# Specifying this header with a COPY operation doesn’t affect
|
726
|
+
# bucket-level settings for S3 Bucket Key.
|
702
727
|
# @option options [String] :copy_source_sse_customer_algorithm
|
703
728
|
# Specifies the algorithm to use when decrypting the source object (for
|
704
729
|
# example, AES256).
|
@@ -922,6 +947,7 @@ module Aws::S3
|
|
922
947
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
923
948
|
# ssekms_key_id: "SSEKMSKeyId",
|
924
949
|
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
950
|
+
# bucket_key_enabled: false,
|
925
951
|
# request_payer: "requester", # accepts requester
|
926
952
|
# tagging: "TaggingHeader",
|
927
953
|
# object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
|
@@ -1013,6 +1039,14 @@ module Aws::S3
|
|
1013
1039
|
# Specifies the AWS KMS Encryption Context to use for object encryption.
|
1014
1040
|
# The value of this header is a base64-encoded UTF-8 string holding JSON
|
1015
1041
|
# with the encryption context key-value pairs.
|
1042
|
+
# @option options [Boolean] :bucket_key_enabled
|
1043
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
1044
|
+
# encryption with server-side encryption using AWS KMS (SSE-KMS).
|
1045
|
+
# Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
|
1046
|
+
# for object encryption with SSE-KMS.
|
1047
|
+
#
|
1048
|
+
# Specifying this header with an object operation doesn’t affect
|
1049
|
+
# bucket-level settings for S3 Bucket Key.
|
1016
1050
|
# @option options [String] :request_payer
|
1017
1051
|
# Confirms that the requester knows that they will be charged for the
|
1018
1052
|
# request. Bucket owners need not specify this parameter in their
|
@@ -1081,6 +1115,7 @@ module Aws::S3
|
|
1081
1115
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
1082
1116
|
# ssekms_key_id: "SSEKMSKeyId",
|
1083
1117
|
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
1118
|
+
# bucket_key_enabled: false,
|
1084
1119
|
# request_payer: "requester", # accepts requester
|
1085
1120
|
# tagging: "TaggingHeader",
|
1086
1121
|
# object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
|
@@ -1250,6 +1285,14 @@ module Aws::S3
|
|
1250
1285
|
# Specifies the AWS KMS Encryption Context to use for object encryption.
|
1251
1286
|
# The value of this header is a base64-encoded UTF-8 string holding JSON
|
1252
1287
|
# with the encryption context key-value pairs.
|
1288
|
+
# @option options [Boolean] :bucket_key_enabled
|
1289
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
1290
|
+
# encryption with server-side encryption using AWS KMS (SSE-KMS).
|
1291
|
+
# Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
|
1292
|
+
# for object encryption with SSE-KMS.
|
1293
|
+
#
|
1294
|
+
# Specifying this header with a PUT operation doesn’t affect
|
1295
|
+
# bucket-level settings for S3 Bucket Key.
|
1253
1296
|
# @option options [String] :request_payer
|
1254
1297
|
# Confirms that the requester knows that they will be charged for the
|
1255
1298
|
# request. Bucket owners need not specify this parameter in their
|
@@ -302,6 +302,7 @@ module Aws::S3
|
|
302
302
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
303
303
|
# ssekms_key_id: "SSEKMSKeyId",
|
304
304
|
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
305
|
+
# bucket_key_enabled: false,
|
305
306
|
# copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm",
|
306
307
|
# copy_source_sse_customer_key: "CopySourceSSECustomerKey",
|
307
308
|
# copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5",
|
@@ -458,6 +459,14 @@ module Aws::S3
|
|
458
459
|
# Specifies the AWS KMS Encryption Context to use for object encryption.
|
459
460
|
# The value of this header is a base64-encoded UTF-8 string holding JSON
|
460
461
|
# with the encryption context key-value pairs.
|
462
|
+
# @option options [Boolean] :bucket_key_enabled
|
463
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
464
|
+
# encryption with server-side encryption using AWS KMS (SSE-KMS).
|
465
|
+
# Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
|
466
|
+
# for object encryption with SSE-KMS.
|
467
|
+
#
|
468
|
+
# Specifying this header with a COPY operation doesn’t affect
|
469
|
+
# bucket-level settings for S3 Bucket Key.
|
461
470
|
# @option options [String] :copy_source_sse_customer_algorithm
|
462
471
|
# Specifies the algorithm to use when decrypting the source object (for
|
463
472
|
# example, AES256).
|
@@ -681,6 +690,7 @@ module Aws::S3
|
|
681
690
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
682
691
|
# ssekms_key_id: "SSEKMSKeyId",
|
683
692
|
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
693
|
+
# bucket_key_enabled: false,
|
684
694
|
# request_payer: "requester", # accepts requester
|
685
695
|
# tagging: "TaggingHeader",
|
686
696
|
# object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
|
@@ -772,6 +782,14 @@ module Aws::S3
|
|
772
782
|
# Specifies the AWS KMS Encryption Context to use for object encryption.
|
773
783
|
# The value of this header is a base64-encoded UTF-8 string holding JSON
|
774
784
|
# with the encryption context key-value pairs.
|
785
|
+
# @option options [Boolean] :bucket_key_enabled
|
786
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
787
|
+
# encryption with server-side encryption using AWS KMS (SSE-KMS).
|
788
|
+
# Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
|
789
|
+
# for object encryption with SSE-KMS.
|
790
|
+
#
|
791
|
+
# Specifying this header with an object operation doesn’t affect
|
792
|
+
# bucket-level settings for S3 Bucket Key.
|
775
793
|
# @option options [String] :request_payer
|
776
794
|
# Confirms that the requester knows that they will be charged for the
|
777
795
|
# request. Bucket owners need not specify this parameter in their
|
@@ -840,6 +858,7 @@ module Aws::S3
|
|
840
858
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
841
859
|
# ssekms_key_id: "SSEKMSKeyId",
|
842
860
|
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
861
|
+
# bucket_key_enabled: false,
|
843
862
|
# request_payer: "requester", # accepts requester
|
844
863
|
# tagging: "TaggingHeader",
|
845
864
|
# object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
|
@@ -1009,6 +1028,14 @@ module Aws::S3
|
|
1009
1028
|
# Specifies the AWS KMS Encryption Context to use for object encryption.
|
1010
1029
|
# The value of this header is a base64-encoded UTF-8 string holding JSON
|
1011
1030
|
# with the encryption context key-value pairs.
|
1031
|
+
# @option options [Boolean] :bucket_key_enabled
|
1032
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
1033
|
+
# encryption with server-side encryption using AWS KMS (SSE-KMS).
|
1034
|
+
# Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
|
1035
|
+
# for object encryption with SSE-KMS.
|
1036
|
+
#
|
1037
|
+
# Specifying this header with a PUT operation doesn’t affect
|
1038
|
+
# bucket-level settings for S3 Bucket Key.
|
1012
1039
|
# @option options [String] :request_payer
|
1013
1040
|
# Confirms that the requester knows that they will be charged for the
|
1014
1041
|
# request. Bucket owners need not specify this parameter in their
|
@@ -29,7 +29,7 @@ each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/
|
|
29
29
|
OptionHandler, step: :initialize, operations: operations
|
30
30
|
)
|
31
31
|
handlers.add(
|
32
|
-
AccelerateHandler, step: :build, priority:
|
32
|
+
AccelerateHandler, step: :build, priority: 11, operations: operations
|
33
33
|
)
|
34
34
|
end
|
35
35
|
|
@@ -40,8 +40,11 @@ each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/
|
|
40
40
|
if context.params.is_a?(Hash)
|
41
41
|
accelerate = context.params.delete(:use_accelerate_endpoint)
|
42
42
|
end
|
43
|
-
if accelerate.nil?
|
44
|
-
|
43
|
+
accelerate = context.config.use_accelerate_endpoint if accelerate.nil?
|
44
|
+
# Raise if :endpoint and dualstack are both provided
|
45
|
+
if accelerate && !context.config.regional_endpoint
|
46
|
+
raise ArgumentError,
|
47
|
+
'Cannot use both :use_accelerate_endpoint and :endpoint'
|
45
48
|
end
|
46
49
|
context[:use_accelerate_endpoint] = accelerate
|
47
50
|
@handler.call(context)
|
@@ -51,7 +54,7 @@ each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/
|
|
51
54
|
# @api private
|
52
55
|
class AccelerateHandler < Seahorse::Client::Handler
|
53
56
|
def call(context)
|
54
|
-
if context[:use_accelerate_endpoint]
|
57
|
+
if context.config.regional_endpoint && context[:use_accelerate_endpoint]
|
55
58
|
dualstack = !!context[:use_dualstack_endpoint]
|
56
59
|
use_accelerate_endpoint(context, dualstack)
|
57
60
|
end
|
@@ -22,11 +22,35 @@ be made. Set to `false` to use the client's region instead.
|
|
22
22
|
resolve_s3_use_arn_region(cfg)
|
23
23
|
end
|
24
24
|
|
25
|
+
# param validator is validate:50 (required to add account_id from arn)
|
26
|
+
# endpoint is build:90 (populates the URI for the first time)
|
27
|
+
# endpoint pattern is build:10 (prefix account id to host)
|
25
28
|
def add_handlers(handlers, _config)
|
26
|
-
handlers.add(
|
29
|
+
handlers.add(ARNHandler, step: :validate, priority: 75)
|
30
|
+
handlers.add(UrlHandler)
|
27
31
|
end
|
28
32
|
|
29
|
-
|
33
|
+
# After extracting out any ARN input, resolve a new URL with it.
|
34
|
+
class UrlHandler < Seahorse::Client::Handler
|
35
|
+
def call(context)
|
36
|
+
if context.metadata[:s3_arn]
|
37
|
+
ARN.resolve_url!(
|
38
|
+
context.http_request.endpoint,
|
39
|
+
context.metadata[:s3_arn][:arn],
|
40
|
+
context.metadata[:s3_arn][:resolved_region],
|
41
|
+
context.metadata[:s3_arn][:dualstack],
|
42
|
+
# if regional_endpoint is false, a custom endpoint was provided
|
43
|
+
# in this case, we want to prefix the endpoint using the ARN
|
44
|
+
!context.config.regional_endpoint
|
45
|
+
)
|
46
|
+
end
|
47
|
+
@handler.call(context)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# This plugin will extract out any ARN input and set context for other
|
52
|
+
# plugins to use without having to translate the ARN again.
|
53
|
+
class ARNHandler < Seahorse::Client::Handler
|
30
54
|
def call(context)
|
31
55
|
bucket_member = _bucket_member(context.operation.input.shape)
|
32
56
|
if bucket_member && (bucket = context.params[bucket_member])
|
@@ -38,12 +62,11 @@ be made. Set to `false` to use the client's region instead.
|
|
38
62
|
if arn
|
39
63
|
validate_config!(context, arn)
|
40
64
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
)
|
65
|
+
context.metadata[:s3_arn] = {
|
66
|
+
arn: arn,
|
67
|
+
resolved_region: resolved_region,
|
68
|
+
dualstack: extract_dualstack_config!(context)
|
69
|
+
}
|
47
70
|
end
|
48
71
|
end
|
49
72
|
@handler.call(context)
|
@@ -66,28 +89,22 @@ be made. Set to `false` to use the client's region instead.
|
|
66
89
|
end
|
67
90
|
|
68
91
|
def validate_config!(context, arn)
|
69
|
-
unless context.config.regional_endpoint
|
70
|
-
raise ArgumentError,
|
71
|
-
'Cannot provide both an Access Point ARN and setting '\
|
72
|
-
':endpoint.'
|
73
|
-
end
|
74
|
-
|
75
92
|
if context.config.force_path_style
|
76
93
|
raise ArgumentError,
|
77
|
-
'Cannot provide
|
78
|
-
'
|
94
|
+
'Cannot provide an Access Point ARN when '\
|
95
|
+
'`:force_path_style` is set to true.'
|
79
96
|
end
|
80
97
|
|
81
98
|
if context.config.use_accelerate_endpoint
|
82
99
|
raise ArgumentError,
|
83
|
-
'Cannot provide
|
84
|
-
'
|
100
|
+
'Cannot provide an Access Point ARN when '\
|
101
|
+
'`:use_accelerate_endpoint` is set to true.'
|
85
102
|
end
|
86
103
|
|
87
104
|
if !arn.support_dualstack? && context[:use_dualstack_endpoint]
|
88
105
|
raise ArgumentError,
|
89
|
-
'Cannot provide
|
90
|
-
'
|
106
|
+
'Cannot provide an Outpost Access Point ARN when '\
|
107
|
+
'`:use_dualstack_endpoint` is set to true.'
|
91
108
|
end
|
92
109
|
end
|
93
110
|
end
|
@@ -116,8 +133,9 @@ be made. Set to `false` to use the client's region instead.
|
|
116
133
|
end
|
117
134
|
|
118
135
|
# @api private
|
119
|
-
def resolve_url!(url, arn, region, dualstack = false)
|
120
|
-
url.host
|
136
|
+
def resolve_url!(url, arn, region, dualstack = false, has_custom_endpoint = false)
|
137
|
+
custom_endpoint = url.host if has_custom_endpoint
|
138
|
+
url.host = arn.host_url(region, dualstack, custom_endpoint)
|
121
139
|
url.path = url_path(url.path, arn)
|
122
140
|
url
|
123
141
|
end
|
@@ -132,9 +150,9 @@ be made. Set to `false` to use the client's region instead.
|
|
132
150
|
# Raise if provided value is not true or false
|
133
151
|
if value.nil?
|
134
152
|
raise ArgumentError,
|
135
|
-
'Must provide either `true` or `false` for '\
|
136
|
-
's3_use_arn_region profile option or for '\
|
137
|
-
"ENV['AWS_S3_USE_ARN_REGION']"
|
153
|
+
'Must provide either `true` or `false` for the '\
|
154
|
+
'`s3_use_arn_region` profile option or for '\
|
155
|
+
"ENV['AWS_S3_USE_ARN_REGION']."
|
138
156
|
end
|
139
157
|
value
|
140
158
|
end
|
@@ -163,7 +181,7 @@ be made. Set to `false` to use the client's region instead.
|
|
163
181
|
if !fips && !use_arn_region && region.include?('fips')
|
164
182
|
raise ArgumentError,
|
165
183
|
'FIPS client regions are not supported for this type of '\
|
166
|
-
'ARN without s3_use_arn_region
|
184
|
+
'ARN without `:s3_use_arn_region`.'
|
167
185
|
end
|
168
186
|
|
169
187
|
# if it's a fips region, attempt to normalize it
|