1.0.11 • Published 1 year ago

aws-signature-v4-subtle v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

aws-signature-v4-subtle

Sign requests to AWS with their Version 4 Signature algorithm. Uses only crypto.subtle.

Usage

To retrieve a Secret from Secrets Manager:

const response = await fetch(
  ...(await AwsToFetch(
    {
      AWS_REGION: 'us-west-1',
      AWS_ACCESS_KEY_ID: '<Access Key ID>',
      AWS_SECRET_ACCESS_KEY: '<Access Key Secret>',
    },
    'secretsmanager',
    'POST',
    {
      'content-type': 'application/x-amz-json-1.1',
      'X-Amz-Target': 'secretsmanager.GetSecretValue',
    },
    JSON.stringify({
      SecretId: `SLACK_SIGNING_SECRET_${accountId}`,
    }),
  )),
);
if (!response.ok) throw new Error('Error talking to AWS');
const secret = (await response.json<{ SecretString: string }>()).SecretString;
1.0.9

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago