-
Notifications
You must be signed in to change notification settings - Fork 632
Open
Labels
v2-v3-inconsistencyBehavior has changed from v2 to v3, or feature is missing altogetherBehavior has changed from v2 to v3, or feature is missing altogether
Description
Pre-Migration Checklist
- I've read the Migration Guide.
- I've reviewed the upgrading notes and major version differences mentioned in
UPGRADING.md
. - I've checked AWS Forums and StackOverflow for similar migration issues.
Which JavaScript Runtime is this issue in?
Node.js (includes AWS Lambda)
AWS Lambda Usage
- Yes, my application is running on AWS Lambda.
- No, my application is not running on AWS Lambda.
Describe the Migration Issue
After upgrading from AWS SDK v2 to v3, there are differences in signature calculation for requests that have a path containing a wildcard (*
)
See the associated issue on OpenSearch-Dashboards repo here: opensearch-project/OpenSearch-Dashboards#9679 (comment)
If I add a snippet to encode the wildcard before signing, then the request succeeds:
if (request.path) {
request.path = request.path.replace(/\*/g, '%2A');
}
I have tried setting uriEscapePath
to true
when creating the SignatureV4 signer, but it does not resolve the issue.
Code Comparison
v2 (link to connector)
signRequest(request, creds) {
const signer = new AWS.Signers.V4(request, this.service);
signer.addAuthorization(creds, new Date());
}
v3 (link to connector)
import { SignatureV4 } from '@aws-sdk/signature-v4';
async signRequest(request, credentials) {
const signer = new SignatureV4({
credentials,
region: this.awsConfig.region,
service: this.service,
sha256: Sha256,
});
return signer.sign(request);
}
Observed Differences/Errors
In v2 the requests that had paths containing wildcard would succeed, but the same requests fail after upgrading AWS SDK to v3
Additional Context
No response
Metadata
Metadata
Assignees
Labels
v2-v3-inconsistencyBehavior has changed from v2 to v3, or feature is missing altogetherBehavior has changed from v2 to v3, or feature is missing altogether