fix: Signing and presigning s3-object-lambda requests fail#2459
Merged
stobrien89 merged 5 commits intoaws:masterfrom Jul 6, 2022
Merged
fix: Signing and presigning s3-object-lambda requests fail#2459stobrien89 merged 5 commits intoaws:masterfrom
stobrien89 merged 5 commits intoaws:masterfrom
Conversation
When signing and presigning s3-object-lambda requests we get an invalid signature error, due to that the signature provider was not resolving the right signature class implementation, which handle s3-object-lambda requests; The name for that class is S3SignatureV4 and the reason why was not resolved is that the s3-object-lambda service name was not in the s3-v4-signed-services-list "$s3v4SignedServices", so that to fix this behavior I added the desired services in that array. This fix also add a special handling in the presigning proccess that validates if the service is s3-object-lambda, then that is the service used for the signature, otherwise the default signing service is used.
stobrien89
requested changes
Jun 23, 2022
Member
stobrien89
left a comment
There was a problem hiding this comment.
Looks good. I like the refactor and addition of the new method. I made one comment about adding a test case and would like us to have a separate test in the S3ClientTest file for presigning object-lambda requests.
ValeroYiqqi
added a commit
to ValeroYiqqi/aws-sdk-php
that referenced
this pull request
Jun 29, 2022
Add a test case in Signature/SignatureProviderTest that validates if when the service is s3-object-lambda the right signature provider is resolved, and add another test case in S3/S3ClientTest that evaluate creating presigned url for s3-object-lambda service.
stobrien89
approved these changes
Jul 6, 2022
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue #2328
Description of changes:
When signing and presigning s3-object-lambda requests we get an invalid signature error, due to that the signature provider was not resolving the right signature class implementation, which handle s3-object-lambda requests; The name for that class is S3SignatureV4 and the reason why was not resolved is that the s3-object-lambda service name was not in the s3-v4-signed-services-list "$s3v4SignedServices", so that to fix this behavior I added the desired services in that array. This fix also add a special handling in the presigning proccess that validates if the service is s3-object-lambda, then that is the service used for the signature, otherwise the default signing service is used.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.