fix(middleware-websocket): pass options to presign in WebsocketSignatureV4 sign #5015
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
Fixes: #5011
Description
When systemClockOffset is set for RekognitionStreamingClient, the updated signingDate is not passed in presigned URL, and the presigner uses default Date.now(). This results in InvalidSignatureException on a websocket connection.
This PR passes the signing options while presigning the URL which includes updated signing date.
Testing
Used repro from #5011
No system clock offset
System time is 8:28am Pacific, and X-Amz-Date is 152800 UTC. No errors are returned
System Clock Offset of one hour
In this setup, the system time is manually set ahead by one hour, and a systemClockOffset of negative one hour (-3600000) passed in RekognitionStreamingClient.
The System time is 9:29am Pacific, but X-Amz-Date is 152918 UTC as required. No errors are returned.
Enabled client-transcribe-streaming E2E test which uses websocket, and verified that it's succeessful.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.