@smithy/credential-provider-imds 4.2.12 → 4.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/package.json +9 -10
- package/dist-types/ts3.4/config/Endpoint.d.ts +0 -7
- package/dist-types/ts3.4/config/EndpointConfigOptions.d.ts +0 -13
- package/dist-types/ts3.4/config/EndpointMode.d.ts +0 -7
- package/dist-types/ts3.4/config/EndpointModeConfigOptions.d.ts +0 -13
- package/dist-types/ts3.4/error/InstanceMetadataV1FallbackError.d.ts +0 -12
- package/dist-types/ts3.4/fromContainerMetadata.d.ts +0 -21
- package/dist-types/ts3.4/fromInstanceMetadata.d.ts +0 -10
- package/dist-types/ts3.4/index.d.ts +0 -28
- package/dist-types/ts3.4/remoteProvider/ImdsCredentials.d.ts +0 -19
- package/dist-types/ts3.4/remoteProvider/RemoteProviderInit.d.ts +0 -40
- package/dist-types/ts3.4/remoteProvider/httpRequest.d.ts +0 -6
- package/dist-types/ts3.4/remoteProvider/index.d.ts +0 -8
- package/dist-types/ts3.4/remoteProvider/retry.d.ts +0 -10
- package/dist-types/ts3.4/types.d.ts +0 -7
- package/dist-types/ts3.4/utils/getExtendedInstanceMetadataCredentials.d.ts +0 -6
- package/dist-types/ts3.4/utils/getInstanceMetadataEndpoint.d.ts +0 -21
- package/dist-types/ts3.4/utils/staticStabilityProvider.d.ts +0 -16
package/README.md
CHANGED
|
@@ -3,9 +3,18 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@smithy/credential-provider-imds)
|
|
4
4
|
[](https://www.npmjs.com/package/@smithy/credential-provider-imds)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
### :warning: Internal API :warning:
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
> This is an internal package.
|
|
9
|
+
> That means this is used as a dependency for other, public packages, but
|
|
10
|
+
> should not be taken directly as a dependency in your application's `package.json`.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
> If you are updating the version of this package, for example to bring in a
|
|
13
|
+
> bug-fix, you should do so by updating your application lockfile with
|
|
14
|
+
> e.g. `npm up @scope/package` or equivalent command in another
|
|
15
|
+
> package manager, rather than taking a direct dependency.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
Please use [@smithy/credential-providers](https://www.npmjs.com/package/@smithy/credential-providers)
|
|
11
20
|
instead.
|
package/package.json
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/credential-provider-imds",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.14",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "concurrently 'yarn:build:
|
|
9
|
-
"build:cjs": "node ../../scripts/inline credential-provider-imds",
|
|
10
|
-
"build:es": "yarn g:tsc -p tsconfig.es.json",
|
|
8
|
+
"build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
|
|
9
|
+
"build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline credential-provider-imds",
|
|
11
10
|
"build:types": "yarn g:tsc -p tsconfig.types.json",
|
|
12
11
|
"build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
|
|
13
|
-
"stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
|
|
14
12
|
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
|
|
15
|
-
"lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
|
|
16
13
|
"format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
|
|
14
|
+
"lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
|
|
15
|
+
"stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
|
|
17
16
|
"test": "yarn g:vitest run",
|
|
18
17
|
"test:watch": "yarn g:vitest watch"
|
|
19
18
|
},
|
|
@@ -28,10 +27,10 @@
|
|
|
28
27
|
"license": "Apache-2.0",
|
|
29
28
|
"sideEffects": false,
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"@smithy/node-config-provider": "^4.3.
|
|
32
|
-
"@smithy/property-provider": "^4.2.
|
|
33
|
-
"@smithy/types": "^4.
|
|
34
|
-
"@smithy/url-parser": "^4.2.
|
|
30
|
+
"@smithy/node-config-provider": "^4.3.14",
|
|
31
|
+
"@smithy/property-provider": "^4.2.14",
|
|
32
|
+
"@smithy/types": "^4.14.1",
|
|
33
|
+
"@smithy/url-parser": "^4.2.14",
|
|
35
34
|
"tslib": "^2.6.2"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LoadedConfigSelectors } from "@smithy/node-config-provider";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare const ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare const CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare const ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors<string | undefined>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LoadedConfigSelectors } from "@smithy/node-config-provider";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare const ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare const CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode";
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare const ENDPOINT_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<string | undefined>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CredentialsProviderError } from "@smithy/property-provider";
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
*
|
|
5
|
-
* A specific sub-case of CredentialsProviderError, when the IMDSv1 fallback
|
|
6
|
-
* has been attempted but shut off by SDK configuration.
|
|
7
|
-
*/
|
|
8
|
-
export declare class InstanceMetadataV1FallbackError extends CredentialsProviderError {
|
|
9
|
-
readonly tryNextLink: boolean;
|
|
10
|
-
name: string;
|
|
11
|
-
constructor(message: string, tryNextLink?: boolean);
|
|
12
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AwsCredentialIdentityProvider } from "@smithy/types";
|
|
2
|
-
import { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare const ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export declare const ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare const ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*
|
|
18
|
-
* Creates a credential provider that will source credentials from the ECS
|
|
19
|
-
* Container Metadata Service
|
|
20
|
-
*/
|
|
21
|
-
export declare const fromContainerMetadata: (init?: RemoteProviderInit) => AwsCredentialIdentityProvider;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Provider } from "@smithy/types";
|
|
2
|
-
import { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit";
|
|
3
|
-
import { InstanceMetadataCredentials } from "./types";
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*
|
|
7
|
-
* Creates a credential provider that will source credentials from the EC2
|
|
8
|
-
* Instance Metadata Service
|
|
9
|
-
*/
|
|
10
|
-
export declare const fromInstanceMetadata: (init?: RemoteProviderInit) => Provider<InstanceMetadataCredentials>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export * from "./fromContainerMetadata";
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export * from "./fromInstanceMetadata";
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export * from "./remoteProvider/RemoteProviderInit";
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export * from "./types";
|
|
17
|
-
/**
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export { httpRequest } from "./remoteProvider/httpRequest";
|
|
21
|
-
/**
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
export { getInstanceMetadataEndpoint } from "./utils/getInstanceMetadataEndpoint";
|
|
25
|
-
/**
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
export { Endpoint } from "./config/Endpoint";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AwsCredentialIdentity } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export interface ImdsCredentials {
|
|
6
|
-
AccessKeyId: string;
|
|
7
|
-
SecretAccessKey: string;
|
|
8
|
-
Token: string;
|
|
9
|
-
Expiration: string;
|
|
10
|
-
AccountId?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare const isImdsCredentials: (arg: any) => arg is ImdsCredentials;
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export declare const fromImdsCredentials: (creds: ImdsCredentials) => AwsCredentialIdentity;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Logger } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare const DEFAULT_TIMEOUT = 1000;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare const DEFAULT_MAX_RETRIES = 0;
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export interface RemoteProviderConfig {
|
|
14
|
-
/**
|
|
15
|
-
* The connection timeout (in milliseconds)
|
|
16
|
-
*/
|
|
17
|
-
timeout: number;
|
|
18
|
-
/**
|
|
19
|
-
* The maximum number of times the HTTP connection should be retried
|
|
20
|
-
*/
|
|
21
|
-
maxRetries: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export interface RemoteProviderInit extends Partial<RemoteProviderConfig> {
|
|
27
|
-
logger?: Logger;
|
|
28
|
-
/**
|
|
29
|
-
* Only used in the IMDS credential provider.
|
|
30
|
-
*/
|
|
31
|
-
ec2MetadataV1Disabled?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* AWS_PROFILE.
|
|
34
|
-
*/
|
|
35
|
-
profile?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @internal
|
|
39
|
-
*/
|
|
40
|
-
export declare const providerConfigFromInit: ({ maxRetries, timeout, }: RemoteProviderInit) => RemoteProviderConfig;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Logger } from "@smithy/types";
|
|
2
|
-
import { InstanceMetadataCredentials } from "../types";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare const getExtendedInstanceMetadataCredentials: (credentials: InstanceMetadataCredentials, logger: Logger) => InstanceMetadataCredentials;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Endpoint } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* Returns the host to use for instance metadata service call.
|
|
4
|
-
*
|
|
5
|
-
* The host is read from endpoint which can be set either in
|
|
6
|
-
* {@link ENV_ENDPOINT_NAME} environment variable or {@link CONFIG_ENDPOINT_NAME}
|
|
7
|
-
* configuration property.
|
|
8
|
-
*
|
|
9
|
-
* If endpoint is not set, then endpoint mode is read either from
|
|
10
|
-
* {@link ENV_ENDPOINT_MODE_NAME} environment variable or {@link CONFIG_ENDPOINT_MODE_NAME}
|
|
11
|
-
* configuration property. If endpoint mode is not set, then default endpoint mode
|
|
12
|
-
* {@link EndpointMode.IPv4} is used.
|
|
13
|
-
*
|
|
14
|
-
* If endpoint mode is set to {@link EndpointMode.IPv4}, then the host is {@link Endpoint.IPv4}.
|
|
15
|
-
* If endpoint mode is set to {@link EndpointMode.IPv6}, then the host is {@link Endpoint.IPv6}.
|
|
16
|
-
*
|
|
17
|
-
* @returns Host to use for instance metadata service call.
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export declare const getInstanceMetadataEndpoint: () => Promise<Endpoint>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Logger, Provider } from "@smithy/types";
|
|
2
|
-
import { InstanceMetadataCredentials } from "../types";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*
|
|
6
|
-
* IMDS credential supports static stability feature. When used, the expiration
|
|
7
|
-
* of recently issued credentials is extended. The server side allows using
|
|
8
|
-
* the recently expired credentials. This mitigates impact when clients using
|
|
9
|
-
* refreshable credentials are unable to retrieve updates.
|
|
10
|
-
*
|
|
11
|
-
* @param provider Credential provider
|
|
12
|
-
* @returns A credential provider that supports static stability
|
|
13
|
-
*/
|
|
14
|
-
export declare const staticStabilityProvider: (provider: Provider<InstanceMetadataCredentials>, options?: {
|
|
15
|
-
logger?: Logger;
|
|
16
|
-
}) => Provider<InstanceMetadataCredentials>;
|