1 | import { AwsCredentialIdentity, ChecksumConstructor, EventSigner, EventSigningArguments, FormattedEvent, HashConstructor, HttpRequest, Provider, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments, SigningArguments, StringSigner } from "@aws-sdk/types";
|
2 | export interface SignatureV4Init {
|
3 | |
4 |
|
5 |
|
6 | service: string;
|
7 | |
8 |
|
9 |
|
10 |
|
11 | region: string | Provider<string>;
|
12 | |
13 |
|
14 |
|
15 |
|
16 | credentials: AwsCredentialIdentity | Provider<AwsCredentialIdentity>;
|
17 | |
18 |
|
19 |
|
20 |
|
21 | sha256?: ChecksumConstructor | HashConstructor;
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | uriEscapePath?: boolean;
|
30 | |
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | applyChecksum?: boolean;
|
39 | }
|
40 | export interface SignatureV4CryptoInit {
|
41 | sha256: ChecksumConstructor | HashConstructor;
|
42 | }
|
43 | export declare class SignatureV4 implements RequestPresigner, RequestSigner, StringSigner, EventSigner {
|
44 | private readonly service;
|
45 | private readonly regionProvider;
|
46 | private readonly credentialProvider;
|
47 | private readonly sha256;
|
48 | private readonly uriEscapePath;
|
49 | private readonly applyChecksum;
|
50 | constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath, }: SignatureV4Init & SignatureV4CryptoInit);
|
51 | presign(originalRequest: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
|
52 | sign(stringToSign: string, options?: SigningArguments): Promise<string>;
|
53 | sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;
|
54 | sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
|
55 | private signEvent;
|
56 | private signString;
|
57 | private signRequest;
|
58 | private createCanonicalRequest;
|
59 | private createStringToSign;
|
60 | private getCanonicalPath;
|
61 | private getSignature;
|
62 | private getSigningKey;
|
63 | private validateResolvedCredentials;
|
64 | }
|