@smithy/credential-provider-imds 4.0.6 → 4.1.0

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/dist-cjs/index.js CHANGED
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES,
24
24
  DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT,
25
25
  ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN,
@@ -32,7 +32,7 @@ __export(src_exports, {
32
32
  httpRequest: () => httpRequest,
33
33
  providerConfigFromInit: () => providerConfigFromInit
34
34
  });
35
- module.exports = __toCommonJS(src_exports);
35
+ module.exports = __toCommonJS(index_exports);
36
36
 
37
37
  // src/fromContainerMetadata.ts
38
38
 
@@ -215,8 +215,8 @@ var Endpoint = /* @__PURE__ */ ((Endpoint2) => {
215
215
  var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
216
216
  var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
217
217
  var ENDPOINT_CONFIG_OPTIONS = {
218
- environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME],
219
- configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME],
218
+ environmentVariableSelector: /* @__PURE__ */ __name((env) => env[ENV_ENDPOINT_NAME], "environmentVariableSelector"),
219
+ configFileSelector: /* @__PURE__ */ __name((profile) => profile[CONFIG_ENDPOINT_NAME], "configFileSelector"),
220
220
  default: void 0
221
221
  };
222
222
 
@@ -231,8 +231,8 @@ var EndpointMode = /* @__PURE__ */ ((EndpointMode2) => {
231
231
  var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE";
232
232
  var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode";
233
233
  var ENDPOINT_MODE_CONFIG_OPTIONS = {
234
- environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME],
235
- configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME],
234
+ environmentVariableSelector: /* @__PURE__ */ __name((env) => env[ENV_ENDPOINT_MODE_NAME], "environmentVariableSelector"),
235
+ configFileSelector: /* @__PURE__ */ __name((profile) => profile[CONFIG_ENDPOINT_MODE_NAME], "configFileSelector"),
236
236
  default: "IPv4" /* IPv4 */
237
237
  };
238
238
 
@@ -312,7 +312,7 @@ var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => {
312
312
  let fallbackBlockedFromProcessEnv = false;
313
313
  const configValue = await (0, import_node_config_provider.loadConfig)(
314
314
  {
315
- environmentVariableSelector: (env) => {
315
+ environmentVariableSelector: /* @__PURE__ */ __name((env) => {
316
316
  const envValue = env[AWS_EC2_METADATA_V1_DISABLED];
317
317
  fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false";
318
318
  if (envValue === void 0) {
@@ -322,12 +322,12 @@ var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => {
322
322
  );
323
323
  }
324
324
  return fallbackBlockedFromProcessEnv;
325
- },
326
- configFileSelector: (profile2) => {
325
+ }, "environmentVariableSelector"),
326
+ configFileSelector: /* @__PURE__ */ __name((profile2) => {
327
327
  const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED];
328
328
  fallbackBlockedFromProfile = !!profileValue && profileValue !== "false";
329
329
  return fallbackBlockedFromProfile;
330
- },
330
+ }, "configFileSelector"),
331
331
  default: false
332
332
  },
333
333
  {
@@ -338,8 +338,7 @@ var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => {
338
338
  const causes = [];
339
339
  if (init.ec2MetadataV1Disabled)
340
340
  causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");
341
- if (fallbackBlockedFromProfile)
342
- causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);
341
+ if (fallbackBlockedFromProfile) causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);
343
342
  if (fallbackBlockedFromProcessEnv)
344
343
  causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);
345
344
  throw new InstanceMetadataV1FallbackError(
@@ -1,4 +1,4 @@
1
- import { LoadedConfigSelectors } from "@smithy/node-config-provider";
1
+ import type { LoadedConfigSelectors } from "@smithy/node-config-provider";
2
2
  /**
3
3
  * @internal
4
4
  */
@@ -1,4 +1,4 @@
1
- import { LoadedConfigSelectors } from "@smithy/node-config-provider";
1
+ import type { LoadedConfigSelectors } from "@smithy/node-config-provider";
2
2
  /**
3
3
  * @internal
4
4
  */
@@ -1,5 +1,5 @@
1
- import { AwsCredentialIdentityProvider } from "@smithy/types";
2
- import { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit";
1
+ import type { AwsCredentialIdentityProvider } from "@smithy/types";
2
+ import type { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit";
3
3
  /**
4
4
  * @internal
5
5
  */
@@ -1,6 +1,6 @@
1
- import { Provider } from "@smithy/types";
2
- import { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit";
3
- import { InstanceMetadataCredentials } from "./types";
1
+ import type { Provider } from "@smithy/types";
2
+ import type { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit";
3
+ import type { InstanceMetadataCredentials } from "./types";
4
4
  /**
5
5
  * @internal
6
6
  *
@@ -1,4 +1,4 @@
1
- import { AwsCredentialIdentity } from "@smithy/types";
1
+ import type { AwsCredentialIdentity } from "@smithy/types";
2
2
  /**
3
3
  * @internal
4
4
  */
@@ -1,4 +1,4 @@
1
- import { Logger } from "@smithy/types";
1
+ import type { Logger } from "@smithy/types";
2
2
  /**
3
3
  * @internal
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { Buffer } from "buffer";
2
- import { RequestOptions } from "http";
2
+ import type { RequestOptions } from "http";
3
3
  /**
4
4
  * @internal
5
5
  */
@@ -1,4 +1,4 @@
1
- import { AwsCredentialIdentity } from "@smithy/types";
1
+ import type { AwsCredentialIdentity } from "@smithy/types";
2
2
  /**
3
3
  * @internal
4
4
  */
@@ -1,5 +1,5 @@
1
- import { Logger } from "@smithy/types";
2
- import { InstanceMetadataCredentials } from "../types";
1
+ import type { Logger } from "@smithy/types";
2
+ import type { InstanceMetadataCredentials } from "../types";
3
3
  /**
4
4
  * @internal
5
5
  */
@@ -1,4 +1,4 @@
1
- import { Endpoint } from "@smithy/types";
1
+ import type { Endpoint } from "@smithy/types";
2
2
  /**
3
3
  * Returns the host to use for instance metadata service call.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { Logger, Provider } from "@smithy/types";
2
- import { InstanceMetadataCredentials } from "../types";
1
+ import type { Logger, Provider } from "@smithy/types";
2
+ import type { InstanceMetadataCredentials } from "../types";
3
3
  /**
4
4
  * @internal
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/credential-provider-imds",
3
- "version": "4.0.6",
3
+ "version": "4.1.0",
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",
@@ -26,11 +26,12 @@
26
26
  "url": "https://aws.amazon.com/javascript/"
27
27
  },
28
28
  "license": "Apache-2.0",
29
+ "sideEffects": false,
29
30
  "dependencies": {
30
- "@smithy/node-config-provider": "^4.1.3",
31
- "@smithy/property-provider": "^4.0.4",
32
- "@smithy/types": "^4.3.1",
33
- "@smithy/url-parser": "^4.0.4",
31
+ "@smithy/node-config-provider": "^4.2.0",
32
+ "@smithy/property-provider": "^4.1.0",
33
+ "@smithy/types": "^4.4.0",
34
+ "@smithy/url-parser": "^4.1.0",
34
35
  "tslib": "^2.6.2"
35
36
  },
36
37
  "devDependencies": {