Skip to content

Commit

Permalink
feat(client-s3): Fix an issue where the SDK can fail to unmarshall re…
Browse files Browse the repository at this point in the history
…sponse due to NumberFormatException
  • Loading branch information
awstools committed Sep 20, 2023
1 parent 76370a8 commit f2b4b67
Show file tree
Hide file tree
Showing 35 changed files with 982 additions and 873 deletions.
12 changes: 6 additions & 6 deletions clients/client-s3/src/commands/CompleteMultipartUploadCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
* <p>Completes a multipart upload by assembling previously uploaded parts.</p>
* <p>You first initiate the multipart upload and then upload all parts using the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html">UploadPart</a>
* operation. After successfully uploading all relevant parts of an upload, you call this
* action to complete the upload. Upon receiving this request, Amazon S3 concatenates all the
* parts in ascending order by part number to create a new object. In the Complete Multipart
* Upload request, you must provide the parts list. You must ensure that the parts list is
* complete. This action concatenates the parts that you provide in the list. For each part in
* the list, you must provide the part number and the <code>ETag</code> value, returned after
* that part was uploaded.</p>
* action to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts
* in ascending order by part number to create a new object. In the Complete Multipart Upload
* request, you must provide the parts list. You must ensure that the parts list is complete.
* This action concatenates the parts that you provide in the list. For each part in the list,
* you must provide the part number and the <code>ETag</code> value, returned after that part
* was uploaded.</p>
* <p>Processing of a Complete Multipart Upload request could take several minutes to
* complete. After Amazon S3 begins processing the request, it sends an HTTP response header that
* specifies a 200 OK response. While processing is in progress, Amazon S3 periodically sends white
Expand Down
166 changes: 90 additions & 76 deletions clients/client-s3/src/commands/CopyObjectCommand.ts

Large diffs are not rendered by default.

100 changes: 63 additions & 37 deletions clients/client-s3/src/commands/CreateBucketCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,69 +45,95 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
* rules</a>.</p>
* <p>If you want to create an Amazon S3 on Outposts bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html">Create Bucket</a>. </p>
* <p>By default, the bucket is created in the US East (N. Virginia) Region. You can
* optionally specify a Region in the request body. You might choose a Region to optimize
* latency, minimize costs, or address regulatory requirements. For example, if you reside in
* Europe, you will probably find it advantageous to create buckets in the Europe (Ireland)
* Region. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro">Accessing a
* optionally specify a Region in the request body. To constrain the bucket creation to a
* specific Region, you can use <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketConfiguration.html">
* <code>LocationConstraint</code>
* </a> condition key. You might choose a Region to
* optimize latency, minimize costs, or address regulatory requirements. For example, if you
* reside in Europe, you will probably find it advantageous to create buckets in the Europe
* (Ireland) Region. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro">Accessing a
* bucket</a>.</p>
* <note>
* <p>If you send your create bucket request to the <code>s3.amazonaws.com</code> endpoint,
* the request goes to the <code>us-east-1</code> Region. Accordingly, the signature calculations in
* Signature Version 4 must use <code>us-east-1</code> as the Region, even if the location constraint in
* the request specifies another Region where the bucket is to be created. If you create a
* bucket in a Region other than US East (N. Virginia), your application must be able to
* handle 307 redirect. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html">Virtual hosting of
* buckets</a>.</p>
* the request goes to the <code>us-east-1</code> Region. Accordingly, the signature
* calculations in Signature Version 4 must use <code>us-east-1</code> as the Region, even
* if the location constraint in the request specifies another Region where the bucket is
* to be created. If you create a bucket in a Region other than US East (N. Virginia), your
* application must be able to handle 307 redirect. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html">Virtual hosting of
* buckets</a>.</p>
* </note>
* <dl>
* <dt>Permissions</dt>
* <dd>
* <p>In addition to <code>s3:CreateBucket</code>, the following permissions are required when
* your <code>CreateBucket</code> request includes specific headers:</p>
* <p>In addition to <code>s3:CreateBucket</code>, the following permissions are
* required when your <code>CreateBucket</code> request includes specific
* headers:</p>
* <ul>
* <li>
* <p>
* <b>Access control lists (ACLs)</b> - If your <code>CreateBucket</code> request
* specifies access control list (ACL) permissions and the ACL is public-read, public-read-write,
* authenticated-read, or if you specify access permissions explicitly through any other
* ACL, both <code>s3:CreateBucket</code> and <code>s3:PutBucketAcl</code> permissions
* are needed. If the ACL for the <code>CreateBucket</code> request is private or if the request doesn't
* specify any ACLs, only <code>s3:CreateBucket</code> permission is needed. </p>
* <b>Access control lists (ACLs)</b> - If your
* <code>CreateBucket</code> request specifies access control list (ACL)
* permissions and the ACL is public-read, public-read-write,
* authenticated-read, or if you specify access permissions explicitly through
* any other ACL, both <code>s3:CreateBucket</code> and
* <code>s3:PutBucketAcl</code> permissions are needed. If the ACL for the
* <code>CreateBucket</code> request is private or if the request doesn't
* specify any ACLs, only <code>s3:CreateBucket</code> permission is needed.
* </p>
* </li>
* <li>
* <p>
* <b>Object Lock</b> - If <code>ObjectLockEnabledForBucket</code> is set to true in your
* <code>CreateBucket</code> request,
* <code>s3:PutBucketObjectLockConfiguration</code> and
* <code>s3:PutBucketVersioning</code> permissions are required.</p>
* <b>Object Lock</b> - If
* <code>ObjectLockEnabledForBucket</code> is set to true in your
* <code>CreateBucket</code> request,
* <code>s3:PutBucketObjectLockConfiguration</code> and
* <code>s3:PutBucketVersioning</code> permissions are required.</p>
* </li>
* <li>
* <p>
* <b>S3 Object Ownership</b> - If your <code>CreateBucket</code> request includes the <code>x-amz-object-ownership</code> header, then the
* <code>s3:PutBucketOwnershipControls</code> permission is required. By default, <code>ObjectOwnership</code> is set to <code>BucketOWnerEnforced</code> and ACLs are disabled. We recommend keeping
* ACLs disabled, except in uncommon use cases where you must control access for each object individually. If you want to change the <code>ObjectOwnership</code> setting, you can use the
* <code>x-amz-object-ownership</code> header in your <code>CreateBucket</code> request to set the <code>ObjectOwnership</code> setting of your choice.
* For more information about S3 Object Ownership, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling object
* ownership </a> in the <i>Amazon S3 User Guide</i>.</p>
* <b>S3 Object Ownership</b> - If your
* <code>CreateBucket</code> request includes the
* <code>x-amz-object-ownership</code> header, then the
* <code>s3:PutBucketOwnershipControls</code> permission is required. By
* default, <code>ObjectOwnership</code> is set to
* <code>BucketOWnerEnforced</code> and ACLs are disabled. We recommend
* keeping ACLs disabled, except in uncommon use cases where you must control
* access for each object individually. If you want to change the
* <code>ObjectOwnership</code> setting, you can use the
* <code>x-amz-object-ownership</code> header in your
* <code>CreateBucket</code> request to set the <code>ObjectOwnership</code>
* setting of your choice. For more information about S3 Object Ownership, see
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling
* object ownership </a> in the
* <i>Amazon S3 User Guide</i>.</p>
* </li>
* <li>
* <p>
* <b>S3 Block Public Access</b> - If your specific use case requires granting public access to your S3 resources, you can disable Block Public Access. You can create a new bucket with Block Public Access enabled, then separately call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html">
* <b>S3 Block Public Access</b> - If your
* specific use case requires granting public access to your S3 resources, you
* can disable Block Public Access. You can create a new bucket with Block
* Public Access enabled, then separately call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html">
* <code>DeletePublicAccessBlock</code>
* </a> API. To use this operation, you must have the
* <code>s3:PutBucketPublicAccessBlock</code> permission. By default, all Block
* Public Access settings are enabled for new buckets. To avoid inadvertent exposure of
* your resources, we recommend keeping the S3 Block Public Access settings enabled. For more information about S3 Block Public Access, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Blocking public
* access to your Amazon S3 storage </a> in the <i>Amazon S3 User Guide</i>. </p>
* <code>s3:PutBucketPublicAccessBlock</code> permission. By default, all
* Block Public Access settings are enabled for new buckets. To avoid
* inadvertent exposure of your resources, we recommend keeping the S3 Block
* Public Access settings enabled. For more information about S3 Block Public
* Access, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Blocking
* public access to your Amazon S3 storage </a> in the
* <i>Amazon S3 User Guide</i>. </p>
* </li>
* </ul>
* </dd>
* </dl>
* <important>
* <p> If your <code>CreateBucket</code> request sets <code>BucketOwnerEnforced</code> for Amazon S3 Object Ownership
* and specifies a bucket ACL that provides access to an external Amazon Web Services account, your request fails with a <code>400</code> error and returns the <code>InvalidBucketAcLWithObjectOwnership</code> error code. For more information,
* see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-ownership-existing-bucket.html">Setting Object
* Ownership on an existing bucket </a> in the <i>Amazon S3 User Guide</i>. </p>
* <p> If your <code>CreateBucket</code> request sets <code>BucketOwnerEnforced</code> for
* Amazon S3 Object Ownership and specifies a bucket ACL that provides access to an external
* Amazon Web Services account, your request fails with a <code>400</code> error and returns the
* <code>InvalidBucketAcLWithObjectOwnership</code> error code. For more information,
* see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-ownership-existing-bucket.html">Setting Object
* Ownership on an existing bucket </a> in the <i>Amazon S3 User Guide</i>.
* </p>
* </important>
* <p>The following operations are related to <code>CreateBucket</code>:</p>
* <ul>
Expand Down
26 changes: 14 additions & 12 deletions clients/client-s3/src/commands/CreateMultipartUploadCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export interface CreateMultipartUploadCommandOutput extends CreateMultipartUploa
* <p>If you have configured a lifecycle rule to abort incomplete multipart uploads, the
* upload must complete within the number of days specified in the bucket lifecycle
* configuration. Otherwise, the incomplete multipart upload becomes eligible for an abort
* action and Amazon S3 aborts the multipart upload. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config">Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration</a>.</p>
* action and Amazon S3 aborts the multipart upload. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config">Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle
* Configuration</a>.</p>
* <p>For information about the permissions required to use the multipart upload API, see
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart
* Upload and Permissions</a>.</p>
Expand Down Expand Up @@ -126,19 +127,19 @@ export interface CreateMultipartUploadCommandOutput extends CreateMultipartUploa
* </dd>
* <dt>Server-Side- Encryption-Specific Request Headers</dt>
* <dd>
* <p>Amazon S3 encrypts data
* by using server-side encryption with an Amazon S3 managed key (SSE-S3) by default. Server-side encryption is for data encryption at rest. Amazon S3 encrypts
* your data as it writes it to disks in its data centers and decrypts it when you
* access it. You can request that Amazon S3 encrypts
* data at rest by using server-side encryption with other key options. The option you use depends on
* <p>Amazon S3 encrypts data by using server-side encryption with an Amazon S3 managed key
* (SSE-S3) by default. Server-side encryption is for data encryption at rest. Amazon S3
* encrypts your data as it writes it to disks in its data centers and decrypts it
* when you access it. You can request that Amazon S3 encrypts data at rest by using
* server-side encryption with other key options. The option you use depends on
* whether you want to use KMS keys (SSE-KMS) or provide your own encryption keys
* (SSE-C).</p>
* <ul>
* <li>
* <p>Use KMS keys (SSE-KMS) that include the Amazon Web Services managed key
* (<code>aws/s3</code>) and KMS customer managed keys stored in Key Management Service (KMS) – If you
* want Amazon Web Services to manage the keys used to encrypt data, specify the following
* headers in the request.</p>
* (<code>aws/s3</code>) and KMS customer managed keys stored in Key Management Service (KMS) –
* If you want Amazon Web Services to manage the keys used to encrypt data, specify the
* following headers in the request.</p>
* <ul>
* <li>
* <p>
Expand All @@ -163,9 +164,10 @@ export interface CreateMultipartUploadCommandOutput extends CreateMultipartUploa
* protect the data.</p>
* </note>
* <important>
* <p>All <code>GET</code> and <code>PUT</code> requests for an object protected
* by KMS fail if you don't make them by using Secure Sockets Layer (SSL),
* Transport Layer Security (TLS), or Signature Version 4.</p>
* <p>All <code>GET</code> and <code>PUT</code> requests for an object
* protected by KMS fail if you don't make them by using Secure Sockets
* Layer (SSL), Transport Layer Security (TLS), or Signature Version
* 4.</p>
* </important>
* <p>For more information about server-side encryption with KMS keys
* (SSE-KMS), see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html">Protecting Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export interface DeleteBucketEncryptionCommandOutput extends __MetadataBearer {}

/**
* @public
* <p>This implementation of the DELETE action resets the default encryption for the
* bucket as server-side encryption with Amazon S3 managed keys (SSE-S3). For information about the
* bucket default encryption feature, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon S3 Bucket Default Encryption</a>
* <p>This implementation of the DELETE action resets the default encryption for the bucket as
* server-side encryption with Amazon S3 managed keys (SSE-S3). For information about the bucket
* default encryption feature, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon S3 Bucket Default Encryption</a>
* in the <i>Amazon S3 User Guide</i>.</p>
* <p>To use this operation, you must have permissions to perform the
* <code>s3:PutEncryptionConfiguration</code> action. The bucket owner has this permission
Expand Down
Loading

0 comments on commit f2b4b67

Please sign in to comment.