1 | import { HttpRequest } from "./http";
|
2 | /**
|
3 | * A {Date} object, a unix (epoch) timestamp in seconds, or a string that can be
|
4 | * understood by the JavaScript {Date} constructor.
|
5 | */
|
6 | export declare type DateInput = number | string | Date;
|
7 | export interface SigningArguments {
|
8 | /**
|
9 | * The date and time to be used as signature metadata. This value should be
|
10 | * a Date object, a unix (epoch) timestamp, or a string that can be
|
11 | * understood by the JavaScript `Date` constructor.If not supplied, the
|
12 | * value returned by `new Date()` will be used.
|
13 | */
|
14 | signingDate?: DateInput;
|
15 | /**
|
16 | * The service signing name. It will override the service name of the signer
|
17 | * in current invocation
|
18 | */
|
19 | signingService?: string;
|
20 | /**
|
21 | * The region name to sign the request. It will override the signing region of the
|
22 | * signer in current invocation
|
23 | */
|
24 | signingRegion?: string;
|
25 | }
|
26 | export interface RequestSigningArguments extends SigningArguments {
|
27 | /**
|
28 | * A set of strings whose members represents headers that cannot be signed.
|
29 | * All headers in the provided request will have their names converted to
|
30 | * lower case and then checked for existence in the unsignableHeaders set.
|
31 | */
|
32 | unsignableHeaders?: Set<string>;
|
33 | /**
|
34 | * A set of strings whose members represents headers that should be signed.
|
35 | * Any values passed here will override those provided via unsignableHeaders,
|
36 | * allowing them to be signed.
|
37 | *
|
38 | * All headers in the provided request will have their names converted to
|
39 | * lower case before signing.
|
40 | */
|
41 | signableHeaders?: Set<string>;
|
42 | }
|
43 | export interface RequestPresigningArguments extends RequestSigningArguments {
|
44 | /**
|
45 | * The number of seconds before the presigned URL expires
|
46 | */
|
47 | expiresIn?: number;
|
48 | /**
|
49 | * A set of strings whose representing headers that should not be hoisted
|
50 | * to presigned request's query string. If not supplied, the presigner
|
51 | * moves all the AWS-specific headers (starting with `x-amz-`) to the request
|
52 | * query string. If supplied, these headers remain in the presigned request's
|
53 | * header.
|
54 | * All headers in the provided request will have their names converted to
|
55 | * lower case and then checked for existence in the unhoistableHeaders set.
|
56 | */
|
57 | unhoistableHeaders?: Set<string>;
|
58 | }
|
59 | export interface EventSigningArguments extends SigningArguments {
|
60 | priorSignature: string;
|
61 | }
|
62 | export interface RequestPresigner {
|
63 | /**
|
64 | * Signs a request for future use.
|
65 | *
|
66 | * The request will be valid until either the provided `expiration` time has
|
67 | * passed or the underlying credentials have expired.
|
68 | *
|
69 | * @param requestToSign The request that should be signed.
|
70 | * @param options Additional signing options.
|
71 | */
|
72 | presign(requestToSign: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
|
73 | }
|
74 | /**
|
75 | * An object that signs request objects with AWS credentials using one of the
|
76 | * AWS authentication protocols.
|
77 | */
|
78 | export interface RequestSigner {
|
79 | /**
|
80 | * Sign the provided request for immediate dispatch.
|
81 | */
|
82 | sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
|
83 | }
|
84 | export interface StringSigner {
|
85 | /**
|
86 | * Sign the provided `stringToSign` for use outside of the context of
|
87 | * request signing. Typical uses include signed policy generation.
|
88 | */
|
89 | sign(stringToSign: string, options?: SigningArguments): Promise<string>;
|
90 | }
|
91 | export interface FormattedEvent {
|
92 | headers: Uint8Array;
|
93 | payload: Uint8Array;
|
94 | }
|
95 | export interface EventSigner {
|
96 | /**
|
97 | * Sign the individual event of the event stream.
|
98 | */
|
99 | sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;
|
100 | }
|