Skip to content

SHA256 implementation missing from browser client #460

@zoellner

Description

@zoellner

Describe the bug
It looks like signature v4 isn't properly initialized with sha256 when using the browser client

TypeError: hashConstructor is not a constructor
    at Object.getPayloadHash ([...]/node_modules/@aws-sdk/signature-v4/build/getPayloadHash.js:21:26)
    at SignatureV4.signRequest ([...]/node_modules/@aws-sdk/signature-v4/build/SignatureV4.js:94:52)
    at SignatureV4.sign ([...]/node_modules/@aws-sdk/signature-v4/build/SignatureV4.js:76:25)

SDK version number
"@aws-sdk/client-cognito-identity-provider-browser": "0.1.0-preview.2"

Is the issue in the browser/Node.js?
Browser

Details of the browser/Node.js version
Chrome: 78.0.3904.108

To Reproduce (observed behavior)

const {
  CognitoIdentityProviderClient,
  ListUsersCommand
} = require('@aws-sdk/client-cognito-identity-provider-browser');
​
const credentials = {
  accessKeyId: 'ABC',
  sessionToken: 'ABCDE',
  secretAccessKey: '12345',
  identityId: 'us-east-1:abcde-1234-4444-9999-666666666666',
  authenticated: true
};
​
const UserPoolId = 'us-east-1_ABCDEF';
const region = 'us-east-1';
​
const cognitoIdentityProvider = new CognitoIdentityProviderClient({ credentials, region });
const cmd = new ListUsersCommand({ UserPoolId });
cognitoIdentityProvider.send(cmd).then((res) => {
  console.log('success', res);
}).catch((err) => {
  console.log('err', err, err.$metadata);
});

Expected behavior
Request is signed and sent.

Screenshots
n/a

Additional context
#36 mentions that sha256 would be hooked up already but that doesn't seem to be the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions