Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add s3 invalid expires protocol test #2094

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zoewangg
Copy link

@zoewangg zoewangg commented Jan 8, 2024

Issue #, if available:
N/A
Description of changes:
Add S3 protocol test to validate the request doesn't fail with invalid expires header

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@zoewangg zoewangg marked this pull request as ready for review July 11, 2024 23:22
@zoewangg zoewangg requested a review from a team as a code owner July 11, 2024 23:22
@zoewangg zoewangg requested a review from syall July 11, 2024 23:22
@kstich kstich requested review from a team and milesziemer and removed request for syall and a team July 12, 2024 15:45
protocol: restXml
}])
@http(uri: "/{Bucket}/{Key+}", method: "GET")
@s3UnwrappedXmlOutput
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the actual S3 model has s3UnwrappedXmlOutput on GetObject

string Delimiter

string DisplayName

string Expires
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a timestamp? From what I understand, clients should try deserializing as a timestamp, but not fail Expires is invalid, right?

Comment on lines +386 to +388
S3 clients should not fail the request with invalid expires.
GA SDKs should verify the value in ExpiresString param and
new SDKs should verifiy the value in Expires param
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reword suggestion, if accurate:

Suggested change
S3 clients should not fail the request with invalid expires.
GA SDKs should verify the value in ExpiresString param and
new SDKs should verifiy the value in Expires param
S3 clients should not fail deserialization of the `Expires` header its
value is not a valid timestamp. Instead, the `Expires` parameter of
the response should be left empty, and the `ExpiresString` parameter
should be populated with the raw value of the header.

code: 200,
headers: {
"Expires": "foobar1234"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an idea, but we could add an ExpiresString member to GetObjectOutput, and update this test to have the following:

Suggested change
},
},
params: {
ExpiresString: "foobar1234"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants