1 | import { SignatureV4CryptoInit, SignatureV4Init } from "@smithy/signature-v4";
|
2 | import { AuthScheme, AwsCredentialIdentity, ChecksumConstructor, HashConstructor, Logger, MemoizedProvider, Provider, RegionInfoProvider, RequestSigner } from "@smithy/types";
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export interface AwsAuthInputConfig {
|
8 | |
9 |
|
10 |
|
11 | credentials?: AwsCredentialIdentity | Provider<AwsCredentialIdentity>;
|
12 | |
13 |
|
14 |
|
15 | signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise<RequestSigner>);
|
16 | /**
|
17 | * Whether to escape request path when signing the request.
|
18 | */
|
19 | signingEscapePath?: boolean;
|
20 | /**
|
21 | * An offset value in milliseconds to apply to all signing times.
|
22 | */
|
23 | systemClockOffset?: number;
|
24 | /**
|
25 | * The region where you want to sign your request against. This
|
26 | * can be different to the region in the endpoint.
|
27 | */
|
28 | signingRegion?: string;
|
29 | /**
|
30 | * The injectable SigV4-compatible signer class constructor. If not supplied,
|
31 | * regular SignatureV4 constructor will be used.
|
32 | *
|
33 | * @internal
|
34 | */
|
35 | signerConstructor?: new (options: SignatureV4Init & SignatureV4CryptoInit) => RequestSigner;
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | export interface SigV4AuthInputConfig {
|
42 | |
43 |
|
44 |
|
45 | credentials?: AwsCredentialIdentity | Provider<AwsCredentialIdentity>;
|
46 | |
47 |
|
48 |
|
49 | signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise<RequestSigner>);
|
50 | /**
|
51 | * Whether to escape request path when signing the request.
|
52 | */
|
53 | signingEscapePath?: boolean;
|
54 | /**
|
55 | * An offset value in milliseconds to apply to all signing times.
|
56 | */
|
57 | systemClockOffset?: number;
|
58 | }
|
59 | /**
|
60 | * @internal
|
61 | * @deprecated only used in legacy auth.
|
62 | */
|
63 | interface PreviouslyResolved {
|
64 | credentialDefaultProvider: (input: any) => MemoizedProvider<AwsCredentialIdentity>;
|
65 | region: string | Provider<string>;
|
66 | regionInfoProvider?: RegionInfoProvider;
|
67 | signingName?: string;
|
68 | defaultSigningName?: string;
|
69 | serviceId: string;
|
70 | sha256: ChecksumConstructor | HashConstructor;
|
71 | useFipsEndpoint: Provider<boolean>;
|
72 | useDualstackEndpoint: Provider<boolean>;
|
73 | }
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | interface SigV4PreviouslyResolved {
|
79 | credentialDefaultProvider: (input: any) => MemoizedProvider<AwsCredentialIdentity>;
|
80 | region: string | Provider<string>;
|
81 | signingName: string;
|
82 | sha256: ChecksumConstructor | HashConstructor;
|
83 | logger?: Logger;
|
84 | }
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | export interface AwsAuthResolvedConfig {
|
90 | |
91 |
|
92 |
|
93 |
|
94 |
|
95 | credentials: MemoizedProvider<AwsCredentialIdentity>;
|
96 | |
97 |
|
98 |
|
99 | signer: (authScheme?: AuthScheme) => Promise<RequestSigner>;
|
100 | |
101 |
|
102 |
|
103 | signingEscapePath: boolean;
|
104 | |
105 |
|
106 |
|
107 | systemClockOffset: number;
|
108 | }
|
109 |
|
110 |
|
111 |
|
112 |
|
113 | export interface SigV4AuthResolvedConfig extends AwsAuthResolvedConfig {
|
114 | }
|
115 |
|
116 |
|
117 |
|
118 |
|
119 | export declare const resolveAwsAuthConfig: <T>(input: T & AwsAuthInputConfig & PreviouslyResolved) => T & AwsAuthResolvedConfig;
|
120 |
|
121 |
|
122 |
|
123 |
|
124 | export declare const resolveSigV4AuthConfig: <T>(input: T & SigV4AuthInputConfig & SigV4PreviouslyResolved) => T & SigV4AuthResolvedConfig;
|
125 | export {};
|