Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a unit test that shows this problem more clearly? This will allow fixing the underlying issue more easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I just saw #648 (comment). I'm trying to understand the intention from AWS -- do the
Date
parameters/headers only apply to unauthenticated requests and theExpires
parameters apply to authenticated requests?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Date Header: Used in both unauthenticated and authenticated requests. For authenticated requests, it's part of the signing process.
Expires Parameter: Used for pre-signed URLs to specify how long the URL is valid. It applies to authenticated requests where temporary access is provided.
When using pre-signed URLs in AWS, the
Date
header is generally not required as the timestamp and expiration are included in the URL parameters themselves. The crucial components in a pre-signed URL are theExpires
parameter and the signature, which are used to validate the request.Even if the
Date
header is not included, AWS validates the pre-signed URL based on the following:Expires
parameter in the URL. If the current time is beyond the expiration time specified, the request is denied.AWS verifies that the signature is correct by recalculating the expected signature using the provided parameters (including
Expires
).This ensures the URL has not been altered since it was generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if we use a pre-signed URL with no Date header, but even with Date parameters in the request, we don't need to validate the timestamp, because if we do, we will always get an error when maximumTimeSkew expires, which is 15 minutes by default.