1 | import { GaxiosOptions } from 'gaxios';
|
2 | /**
|
3 | * Interface defining AWS security credentials.
|
4 | * These are either determined from AWS security_credentials endpoint or
|
5 | * AWS environment variables.
|
6 | */
|
7 | export interface AwsSecurityCredentials {
|
8 | accessKeyId: string;
|
9 | secretAccessKey: string;
|
10 | token?: string;
|
11 | }
|
12 | /**
|
13 | * Implements an AWS API request signer based on the AWS Signature Version 4
|
14 | * signing process.
|
15 | * https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
|
16 | */
|
17 | export declare class AwsRequestSigner {
|
18 | private readonly getCredentials;
|
19 | private readonly region;
|
20 | private readonly crypto;
|
21 | /**
|
22 | * Instantiates an AWS API request signer used to send authenticated signed
|
23 | * requests to AWS APIs based on the AWS Signature Version 4 signing process.
|
24 | * This also provides a mechanism to generate the signed request without
|
25 | * sending it.
|
26 | * @param getCredentials A mechanism to retrieve AWS security credentials
|
27 | * when needed.
|
28 | * @param region The AWS region to use.
|
29 | */
|
30 | constructor(getCredentials: () => Promise<AwsSecurityCredentials>, region: string);
|
31 | /**
|
32 | * Generates the signed request for the provided HTTP request for calling
|
33 | * an AWS API. This follows the steps described at:
|
34 | * https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
|
35 | * @param amzOptions The AWS request options that need to be signed.
|
36 | * @return A promise that resolves with the GaxiosOptions containing the
|
37 | * signed HTTP request parameters.
|
38 | */
|
39 | getRequestOptions(amzOptions: GaxiosOptions): Promise<GaxiosOptions>;
|
40 | }
|