@aws-sdk/signature-v4-crt 3.50.0 → 3.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/signature-v4-crt
9
+
10
+
11
+
12
+
13
+
6
14
  # [3.50.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.49.0...v3.50.0) (2022-02-08)
7
15
 
8
16
  **Note:** Version bump only for package @aws-sdk/signature-v4-crt
@@ -0,0 +1,27 @@
1
+ import { SignatureV4CryptoInit, SignatureV4Init } from "@aws-sdk/signature-v4";
2
+ import { HttpRequest, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments } from "@aws-sdk/types";
3
+ import { auth as crtAuth } from "aws-crt";
4
+ export declare type AwsSigningAlgorithm = crtAuth.AwsSigningAlgorithm;
5
+ export interface CrtSignerV4Init extends SignatureV4Init {
6
+
7
+ signingAlgorithm?: AwsSigningAlgorithm;
8
+ }
9
+
10
+ export declare class CrtSignerV4 implements RequestPresigner, RequestSigner {
11
+ private readonly service;
12
+ private readonly regionProvider;
13
+ private readonly credentialProvider;
14
+ private readonly sha256;
15
+ private readonly uriEscapePath;
16
+ private readonly applyChecksum;
17
+ private readonly signingAlgorithm;
18
+ constructor({ credentials, region, service, sha256, applyChecksum, uriEscapePath, signingAlgorithm, }: CrtSignerV4Init & SignatureV4CryptoInit);
19
+ private options2crtConfigure;
20
+ presign(originalRequest: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
21
+ sign(toSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
22
+ private getQueryParam;
23
+ private signRequest;
24
+
25
+ verifySigv4aSigning(request: HttpRequest, signature: string, expectedCanonicalRequest: string, eccPubKeyX: string, eccPubKeyY: string, options?: RequestSigningArguments): Promise<boolean>;
26
+ verifySigv4aPreSigning(request: HttpRequest, signature: string | Array<string> | null, expectedCanonicalRequest: string, eccPubKeyX: string, eccPubKeyY: string, options?: RequestPresigningArguments): Promise<boolean>;
27
+ }
@@ -0,0 +1,43 @@
1
+ export declare const ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
2
+ export declare const CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
3
+ export declare const AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
4
+ export declare const SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
5
+ export declare const EXPIRES_QUERY_PARAM = "X-Amz-Expires";
6
+ export declare const SIGNATURE_QUERY_PARAM = "X-Amz-Signature";
7
+ export declare const TOKEN_QUERY_PARAM = "X-Amz-Security-Token";
8
+ export declare const REGION_SET_PARAM = "X-Amz-Region-Set";
9
+ export declare const AUTH_HEADER = "authorization";
10
+ export declare const AMZ_DATE_HEADER: string;
11
+ export declare const DATE_HEADER = "date";
12
+ export declare const GENERATED_HEADERS: string[];
13
+ export declare const SIGNATURE_HEADER: string;
14
+ export declare const SHA256_HEADER = "x-amz-content-sha256";
15
+ export declare const TOKEN_HEADER: string;
16
+ export declare const HOST_HEADER = "host";
17
+ export declare const ALWAYS_UNSIGNABLE_HEADERS: {
18
+ authorization: boolean;
19
+ "cache-control": boolean;
20
+ connection: boolean;
21
+ expect: boolean;
22
+ from: boolean;
23
+ "keep-alive": boolean;
24
+ "max-forwards": boolean;
25
+ pragma: boolean;
26
+ referer: boolean;
27
+ te: boolean;
28
+ trailer: boolean;
29
+ "transfer-encoding": boolean;
30
+ upgrade: boolean;
31
+ "user-agent": boolean;
32
+ "x-amzn-trace-id": boolean;
33
+ };
34
+ export declare const PROXY_HEADER_PATTERN: RegExp;
35
+ export declare const SEC_HEADER_PATTERN: RegExp;
36
+ export declare const UNSIGNABLE_PATTERNS: RegExp[];
37
+ export declare const ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
38
+ export declare const ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256";
39
+ export declare const EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD";
40
+ export declare const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
41
+ export declare const MAX_CACHE_SIZE = 50;
42
+ export declare const KEY_TYPE_IDENTIFIER = "aws4_request";
43
+ export declare const MAX_PRESIGNED_TTL: number;
@@ -0,0 +1,4 @@
1
+ import { HeaderBag } from "@aws-sdk/types";
2
+ export declare function hasHeader(soughtHeader: string, headers: HeaderBag): boolean;
3
+ export declare function getHeaderValue(soughtHeader: string, headers: HeaderBag): string | undefined;
4
+ export declare function deleteHeader(soughtHeader: string, headers: HeaderBag): void;
@@ -0,0 +1 @@
1
+ export * from "./CrtSignerV4";
@@ -0,0 +1,14 @@
1
+ import { HttpRequest } from "@aws-sdk/types";
2
+ export interface TestCase {
3
+ name: string;
4
+ request: HttpRequest;
5
+ authorization: string;
6
+ }
7
+ export declare const region = "us-east-1";
8
+ export declare const service = "service";
9
+ export declare const credentials: {
10
+ accessKeyId: string;
11
+ secretAccessKey: string;
12
+ };
13
+ export declare const signingDate: Date;
14
+ export declare const requests: Array<TestCase>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/signature-v4-crt",
3
- "version": "3.50.0",
3
+ "version": "3.52.0",
4
4
  "description": "A revision of AWS Signature V4 request signer based on AWS Common Runtime https://github.com/awslabs/aws-crt-nodejs",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -11,7 +11,7 @@
11
11
  "build:es": "tsc -p tsconfig.es.json",
12
12
  "build:types": "tsc -p tsconfig.types.json",
13
13
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
14
- "clean": "rimraf ./dist-*",
14
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
15
15
  "test": "jest --coverage"
16
16
  },
17
17
  "author": {
@@ -20,19 +20,19 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@aws-sdk/is-array-buffer": "3.49.0",
24
- "@aws-sdk/querystring-parser": "3.50.0",
25
- "@aws-sdk/signature-v4": "3.50.0",
26
- "@aws-sdk/util-hex-encoding": "3.49.0",
27
- "@aws-sdk/util-uri-escape": "3.49.0",
23
+ "@aws-sdk/is-array-buffer": "3.52.0",
24
+ "@aws-sdk/querystring-parser": "3.52.0",
25
+ "@aws-sdk/signature-v4": "3.52.0",
26
+ "@aws-sdk/util-hex-encoding": "3.52.0",
27
+ "@aws-sdk/util-uri-escape": "3.52.0",
28
28
  "aws-crt": "^1.9.7",
29
29
  "tslib": "^2.3.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@aws-crypto/sha256-js": "2.0.0",
33
- "@aws-sdk/protocol-http": "3.50.0",
34
- "@aws-sdk/types": "3.50.0",
35
- "@aws-sdk/util-buffer-from": "3.49.0",
33
+ "@aws-sdk/protocol-http": "3.52.0",
34
+ "@aws-sdk/types": "3.52.0",
35
+ "@aws-sdk/util-buffer-from": "3.52.0",
36
36
  "@tsconfig/recommended": "1.0.1",
37
37
  "concurrently": "7.0.0",
38
38
  "downlevel-dts": "0.7.0",