aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.05k stars 573 forks source link

signature-v4 misses README doc #3615

Open AllanZhengYP opened 2 years ago

AllanZhengYP commented 2 years ago

Describe the issue with documentation

We suggests users to consume standalone package @aws-sdk/signature-v4 for signing any request with Signature v4 algorithm. But it doesn't provide any README doc

Expected behavior

The package should include a doc demonstrating signing a basic request.

ajredniwja commented 2 years ago
    // Create the HTTP request
  var request = new HttpRequest({
      body: JSON.stringify(document),
      headers: {
          'Content-Type': 'application/json',
          'host': domain
      },
      hostname: domain,
      method: 'PUT',
      path: 'path'
  });

  // Sign the request
  var signer = new SignatureV4({
      credentials: defaultProvider(),
      region: region,
      service: 'es',
      sha256: Sha256
  });

  var signedRequest = await signer.sign(request);
ShivamJoker commented 1 year ago

@ajredniwja where will we get Sha256 in react native?