UNPKG

2.1 kBTypeScriptView Raw
1import type { AwsCredentialIdentity, AwsCredentialIdentityProvider, Logger, RequestHandler } from "@smithy/types";
2import type { AwsSdkCredentialsFeatures } from "../feature-ids";
3export { AwsCredentialIdentity, AwsCredentialIdentityProvider, IdentityProvider } from "@smithy/types";
4/**
5 * @public
6 */
7export interface AwsIdentityProperties {
8 /**
9 * These are resolved client config values, and may be async providers.
10 */
11 callerClientConfig?: {
12 /**
13 * It is likely a programming error if you use
14 * the caller client config credentials in a credential provider, since
15 * it will recurse.
16 *
17 * @deprecated do not use.
18 */
19 credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider;
20 /**
21 * @internal
22 * @deprecated minimize use.
23 */
24 credentialDefaultProvider?: (input?: any) => AwsCredentialIdentityProvider;
25 logger?: Logger;
26 profile?: string;
27 region(): Promise<string>;
28 requestHandler?: RequestHandler<any, any>;
29 };
30}
31/**
32 * @public
33 *
34 * Variation of {@link IdentityProvider} which accepts a contextual
35 * client configuration that includes an AWS region and potentially other
36 * configurable fields.
37 *
38 * Used to link a credential provider to a client if it is being called
39 * in the context of a client.
40 */
41export type RuntimeConfigIdentityProvider<T> = (awsIdentityProperties?: AwsIdentityProperties) => Promise<T>;
42/**
43 * @public
44 *
45 * Variation of {@link AwsCredentialIdentityProvider} which accepts a contextual
46 * client configuration that includes an AWS region and potentially other
47 * configurable fields.
48 *
49 * Used to link a credential provider to a client if it is being called
50 * in the context of a client.
51 */
52export type RuntimeConfigAwsCredentialIdentityProvider = RuntimeConfigIdentityProvider<AwsCredentialIdentity>;
53/**
54 * @public
55 *
56 * AwsCredentialIdentity with source attribution metadata.
57 */
58export type AttributedAwsCredentialIdentity = AwsCredentialIdentity & {
59 $source?: AwsSdkCredentialsFeatures;
60};