@aws-sdk/credential-provider-ini 3.972.38 → 3.972.40

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
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var sharedIniFileLoader = require('@smithy/shared-ini-file-loader');
4
- var propertyProvider = require('@smithy/property-provider');
3
+ var config = require('@smithy/core/config');
5
4
  var client = require('@aws-sdk/core/client');
6
5
  var credentialProviderLogin = require('@aws-sdk/credential-provider-login');
7
6
 
@@ -11,7 +10,7 @@ const resolveCredentialSource = (credentialSource, profileName, logger) => {
11
10
  const { fromHttp } = await import('@aws-sdk/credential-provider-http');
12
11
  const { fromContainerMetadata } = await import('@smithy/credential-provider-imds');
13
12
  logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
14
- return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
13
+ return async () => config.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
15
14
  },
16
15
  Ec2InstanceMetadata: async (options) => {
17
16
  logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
@@ -28,7 +27,7 @@ const resolveCredentialSource = (credentialSource, profileName, logger) => {
28
27
  return sourceProvidersMap[credentialSource];
29
28
  }
30
29
  else {
31
- throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` +
30
+ throw new config.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` +
32
31
  `expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });
33
32
  }
34
33
  };
@@ -74,8 +73,8 @@ const resolveAssumeRoleCredentials = async (profileName, profiles, options, call
74
73
  }, options.clientPlugins);
75
74
  }
76
75
  if (source_profile && source_profile in visitedProfiles) {
77
- throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` +
78
- ` ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` +
76
+ throw new config.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` +
77
+ ` ${config.getProfileName(options)}. Profiles visited: ` +
79
78
  Object.keys(visitedProfiles).join(", "), { logger: options.logger });
80
79
  }
81
80
  options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);
@@ -98,7 +97,7 @@ const resolveAssumeRoleCredentials = async (profileName, profiles, options, call
98
97
  const { mfa_serial } = profileData;
99
98
  if (mfa_serial) {
100
99
  if (!options.mfaCodeProvider) {
101
- throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });
100
+ throw new config.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });
102
101
  }
103
102
  params.SerialNumber = mfa_serial;
104
103
  params.TokenCode = await options.mfaCodeProvider(mfa_serial);
@@ -210,13 +209,13 @@ const resolveProfileData = async (profileName, profiles, options, callerClientCo
210
209
  if (isLoginProfile(data)) {
211
210
  return resolveLoginCredentials(profileName, options, callerClientConfig);
212
211
  }
213
- throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });
212
+ throw new config.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });
214
213
  };
215
214
 
216
215
  const fromIni = (init = {}) => async ({ callerClientConfig } = {}) => {
217
216
  init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
218
- const profiles = await sharedIniFileLoader.parseKnownFiles(init);
219
- return resolveProfileData(sharedIniFileLoader.getProfileName({
217
+ const profiles = await config.parseKnownFiles(init);
218
+ return resolveProfileData(config.getProfileName({
220
219
  profile: init.profile ?? callerClientConfig?.profile,
221
220
  }), profiles, init, callerClientConfig);
222
221
  };
@@ -1,4 +1,4 @@
1
- import { getProfileName, parseKnownFiles } from "@smithy/shared-ini-file-loader";
1
+ import { getProfileName, parseKnownFiles } from "@smithy/core/config";
2
2
  import { resolveProfileData } from "./resolveProfileData";
3
3
  export const fromIni = (init = {}) => async ({ callerClientConfig } = {}) => {
4
4
  init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
@@ -1,6 +1,5 @@
1
1
  import { setCredentialFeature } from "@aws-sdk/core/client";
2
- import { CredentialsProviderError } from "@smithy/property-provider";
3
- import { getProfileName } from "@smithy/shared-ini-file-loader";
2
+ import { CredentialsProviderError, getProfileName } from "@smithy/core/config";
4
3
  import { resolveCredentialSource } from "./resolveCredentialSource";
5
4
  export const isAssumeRoleProfile = (arg, { profile = "default", logger } = {}) => {
6
5
  return (Boolean(arg) &&
@@ -1,5 +1,5 @@
1
1
  import { setCredentialFeature } from "@aws-sdk/core/client";
2
- import { chain, CredentialsProviderError } from "@smithy/property-provider";
2
+ import { chain, CredentialsProviderError } from "@smithy/core/config";
3
3
  export const resolveCredentialSource = (credentialSource, profileName, logger) => {
4
4
  const sourceProvidersMap = {
5
5
  EcsContainer: async (options) => {
@@ -1,4 +1,4 @@
1
- import { CredentialsProviderError } from "@smithy/property-provider";
1
+ import { CredentialsProviderError } from "@smithy/core/config";
2
2
  import { isAssumeRoleProfile, resolveAssumeRoleCredentials } from "./resolveAssumeRoleCredentials";
3
3
  import { isLoginProfile, resolveLoginCredentials } from "./resolveLoginCredentials";
4
4
  import { isProcessProfile, resolveProcessCredentials } from "./resolveProcessCredentials";
@@ -1,7 +1,7 @@
1
1
  import type { FromLoginCredentialsInit } from "@aws-sdk/credential-provider-login";
2
2
  import type { AssumeRoleWithWebIdentityParams } from "@aws-sdk/credential-provider-web-identity";
3
3
  import type { CredentialProviderOptions, RuntimeConfigAwsCredentialIdentityProvider } from "@aws-sdk/types";
4
- import type { SourceProfileInit } from "@smithy/shared-ini-file-loader";
4
+ import type { SourceProfileInit } from "@smithy/core/config";
5
5
  import type { AwsCredentialIdentity, Pluggable } from "@smithy/types";
6
6
  import type { AssumeRoleParams } from "./resolveAssumeRoleCredentials";
7
7
  /**
@@ -4,7 +4,7 @@ import {
4
4
  CredentialProviderOptions,
5
5
  RuntimeConfigAwsCredentialIdentityProvider,
6
6
  } from "@aws-sdk/types";
7
- import { SourceProfileInit } from "@smithy/shared-ini-file-loader";
7
+ import { SourceProfileInit } from "@smithy/core/config";
8
8
  import { AwsCredentialIdentity, Pluggable } from "@smithy/types";
9
9
  import { AssumeRoleParams } from "./resolveAssumeRoleCredentials";
10
10
  export interface FromIniInit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-ini",
3
- "version": "3.972.38",
3
+ "version": "3.972.40",
4
4
  "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -28,18 +28,17 @@
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@aws-sdk/core": "^3.974.8",
32
- "@aws-sdk/credential-provider-env": "^3.972.34",
33
- "@aws-sdk/credential-provider-http": "^3.972.36",
34
- "@aws-sdk/credential-provider-login": "^3.972.38",
35
- "@aws-sdk/credential-provider-process": "^3.972.34",
36
- "@aws-sdk/credential-provider-sso": "^3.972.38",
37
- "@aws-sdk/credential-provider-web-identity": "^3.972.38",
38
- "@aws-sdk/nested-clients": "^3.997.6",
31
+ "@aws-sdk/core": "^3.974.10",
32
+ "@aws-sdk/credential-provider-env": "^3.972.36",
33
+ "@aws-sdk/credential-provider-http": "^3.972.38",
34
+ "@aws-sdk/credential-provider-login": "^3.972.40",
35
+ "@aws-sdk/credential-provider-process": "^3.972.36",
36
+ "@aws-sdk/credential-provider-sso": "^3.972.40",
37
+ "@aws-sdk/credential-provider-web-identity": "^3.972.40",
38
+ "@aws-sdk/nested-clients": "^3.997.8",
39
39
  "@aws-sdk/types": "^3.973.8",
40
- "@smithy/credential-provider-imds": "^4.2.14",
41
- "@smithy/property-provider": "^4.2.14",
42
- "@smithy/shared-ini-file-loader": "^4.4.9",
40
+ "@smithy/core": "^3.24.1",
41
+ "@smithy/credential-provider-imds": "^4.3.1",
43
42
  "@smithy/types": "^4.14.1",
44
43
  "tslib": "^2.6.2"
45
44
  },