@aws-sdk/types 3.226.0 → 3.257.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/dist-cjs/auth.js CHANGED
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpAuthLocation = void 0;
4
+ var HttpAuthLocation;
5
+ (function (HttpAuthLocation) {
6
+ HttpAuthLocation["HEADER"] = "header";
7
+ HttpAuthLocation["QUERY"] = "query";
8
+ })(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {}));
package/dist-es/auth.js CHANGED
@@ -1 +1,5 @@
1
- export {};
1
+ export var HttpAuthLocation;
2
+ (function (HttpAuthLocation) {
3
+ HttpAuthLocation["HEADER"] = "header";
4
+ HttpAuthLocation["QUERY"] = "query";
5
+ })(HttpAuthLocation || (HttpAuthLocation = {}));
@@ -25,3 +25,23 @@ export interface AuthScheme {
25
25
  signingScope?: never;
26
26
  properties: Record<string, unknown>;
27
27
  }
28
+ export interface HttpAuthDefinition {
29
+ /**
30
+ * Defines the location of where the Auth is serialized.
31
+ */
32
+ in: HttpAuthLocation;
33
+ /**
34
+ * Defines the name of the HTTP header or query string parameter
35
+ * that contains the Auth.
36
+ */
37
+ name: string;
38
+ /**
39
+ * Defines the security scheme to use on the `Authorization` header value.
40
+ * This can only be set if the "in" property is set to {@link HttpAuthLocation.HEADER}.
41
+ */
42
+ scheme?: string;
43
+ }
44
+ export declare enum HttpAuthLocation {
45
+ HEADER = "header",
46
+ QUERY = "query"
47
+ }
@@ -1,3 +1,4 @@
1
+ import { SourceData } from "./crypto";
1
2
  /**
2
3
  * An object that provides a checksum of data provided in chunks to `update`.
3
4
  * The checksum may be performed incrementally as chunks are received or all
@@ -48,3 +49,11 @@ export interface Checksum {
48
49
  */
49
50
  update(chunk: Uint8Array): void;
50
51
  }
52
+ /**
53
+ * A constructor for a Checksum that may be used to calculate an HMAC. Implementing
54
+ * classes should not directly hold the provided key in memory beyond the
55
+ * lexical scope of the constructor.
56
+ */
57
+ export interface ChecksumConstructor {
58
+ new (secret?: SourceData): Checksum;
59
+ }
@@ -26,6 +26,8 @@ export interface Hash {
26
26
  * A constructor for a hash that may be used to calculate an HMAC. Implementing
27
27
  * classes should not directly hold the provided key in memory beyond the
28
28
  * lexical scope of the constructor.
29
+ *
30
+ * @deprecated use {@link ChecksumConstructor}
29
31
  */
30
32
  export interface HashConstructor {
31
33
  new (secret?: SourceData): Hash;
@@ -1,4 +1,4 @@
1
- import { AuthScheme } from "./auth";
1
+ import { AuthScheme, HttpAuthDefinition } from "./auth";
2
2
  import { EndpointV2 } from "./endpoint";
3
3
  import { Logger } from "./logger";
4
4
  import { UserAgent } from "./util";
@@ -343,6 +343,11 @@ export interface HandlerExecutionContext {
343
343
  * Set at the same time as endpointV2.
344
344
  */
345
345
  authSchemes?: AuthScheme[];
346
+ /**
347
+ * The current auth configuration that has been set by any auth middleware and
348
+ * that will prevent from being set more than once.
349
+ */
350
+ currentAuthConfig?: HttpAuthDefinition;
346
351
  /**
347
352
  * Used by DynamoDbDocumentClient.
348
353
  */
@@ -1,9 +1,10 @@
1
+ import { ChecksumConstructor } from "./checksum";
1
2
  import { HashConstructor, StreamHasher } from "./crypto";
2
3
  import { BodyLengthCalculator, Encoder } from "./util";
3
4
  export interface GetAwsChunkedEncodingStreamOptions {
4
5
  base64Encoder?: Encoder;
5
6
  bodyLengthChecker: BodyLengthCalculator;
6
- checksumAlgorithmFn?: HashConstructor;
7
+ checksumAlgorithmFn?: ChecksumConstructor | HashConstructor;
7
8
  checksumLocationName?: string;
8
9
  streamHasher?: StreamHasher;
9
10
  }
@@ -6,3 +6,12 @@ export interface AuthScheme {
6
6
  signingScope?: never;
7
7
  properties: Record<string, unknown>;
8
8
  }
9
+ export interface HttpAuthDefinition {
10
+ in: HttpAuthLocation;
11
+ name: string;
12
+ scheme?: string;
13
+ }
14
+ export declare enum HttpAuthLocation {
15
+ HEADER = "header",
16
+ QUERY = "query",
17
+ }
@@ -1,3 +1,4 @@
1
+ import { SourceData } from "./crypto";
1
2
  export interface Checksum {
2
3
  digestLength?: number;
3
4
  copy?(): Checksum;
@@ -6,3 +7,6 @@ export interface Checksum {
6
7
  reset(): void;
7
8
  update(chunk: Uint8Array): void;
8
9
  }
10
+ export interface ChecksumConstructor {
11
+ new (secret?: SourceData): Checksum;
12
+ }
@@ -1,4 +1,4 @@
1
- import { AuthScheme } from "./auth";
1
+ import { AuthScheme, HttpAuthDefinition } from "./auth";
2
2
  import { EndpointV2 } from "./endpoint";
3
3
  import { Logger } from "./logger";
4
4
  import { UserAgent } from "./util";
@@ -202,6 +202,7 @@ export interface HandlerExecutionContext {
202
202
  userAgent?: UserAgent;
203
203
  endpointV2?: EndpointV2;
204
204
  authSchemes?: AuthScheme[];
205
+ currentAuthConfig?: HttpAuthDefinition;
205
206
  dynamoDbDocumentClientOptions?: Partial<{
206
207
  overrideInputFilterSensitiveLog(...args: any[]): string | void;
207
208
  overrideOutputFilterSensitiveLog(...args: any[]): string | void;
@@ -1,9 +1,10 @@
1
+ import { ChecksumConstructor } from "./checksum";
1
2
  import { HashConstructor, StreamHasher } from "./crypto";
2
3
  import { BodyLengthCalculator, Encoder } from "./util";
3
4
  export interface GetAwsChunkedEncodingStreamOptions {
4
5
  base64Encoder?: Encoder;
5
6
  bodyLengthChecker: BodyLengthCalculator;
6
- checksumAlgorithmFn?: HashConstructor;
7
+ checksumAlgorithmFn?: ChecksumConstructor | HashConstructor;
7
8
  checksumLocationName?: string;
8
9
  streamHasher?: StreamHasher;
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/types",
3
- "version": "3.226.0",
3
+ "version": "3.257.0",
4
4
  "main": "./dist-cjs/index.js",
5
5
  "module": "./dist-es/index.js",
6
6
  "types": "./dist-types/index.d.ts",