@aws-sdk/token-providers 3.713.0 → 3.714.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
@@ -103,20 +103,20 @@ var writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => {
103
103
 
104
104
  // src/fromSso.ts
105
105
  var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
106
- var fromSso = /* @__PURE__ */ __name((_init = {}) => async (awsIdentityProperties) => {
107
- var _a, _b, _c;
106
+ var fromSso = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig } = {}) => {
107
+ var _a;
108
108
  const init = {
109
109
  ..._init,
110
- ...((_a = awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig) == null ? void 0 : _a.region) ? {
111
- parentClientConfig: {
112
- region: (_b = awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig) == null ? void 0 : _b.region,
113
- ..._init.parentClientConfig
114
- }
115
- } : {}
110
+ parentClientConfig: {
111
+ ...callerClientConfig,
112
+ ..._init.parentClientConfig
113
+ }
116
114
  };
117
- (_c = init.logger) == null ? void 0 : _c.debug("@aws-sdk/token-providers - fromSso");
115
+ (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers - fromSso");
118
116
  const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
119
- const profileName = (0, import_shared_ini_file_loader.getProfileName)(init);
117
+ const profileName = (0, import_shared_ini_file_loader.getProfileName)({
118
+ profile: init.profile ?? (callerClientConfig == null ? void 0 : callerClientConfig.profile)
119
+ });
120
120
  const profile = profiles[profileName];
121
121
  if (!profile) {
122
122
  throw new import_property_provider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
@@ -6,21 +6,19 @@ import { validateTokenExpiry } from "./validateTokenExpiry";
6
6
  import { validateTokenKey } from "./validateTokenKey";
7
7
  import { writeSSOTokenToFile } from "./writeSSOTokenToFile";
8
8
  const lastRefreshAttemptTime = new Date(0);
9
- export const fromSso = (_init = {}) => async (awsIdentityProperties) => {
9
+ export const fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => {
10
10
  const init = {
11
11
  ..._init,
12
- ...(awsIdentityProperties?.callerClientConfig?.region
13
- ? {
14
- parentClientConfig: {
15
- region: awsIdentityProperties?.callerClientConfig?.region,
16
- ..._init.parentClientConfig,
17
- },
18
- }
19
- : {}),
12
+ parentClientConfig: {
13
+ ...callerClientConfig,
14
+ ..._init.parentClientConfig,
15
+ },
20
16
  };
21
17
  init.logger?.debug("@aws-sdk/token-providers - fromSso");
22
18
  const profiles = await parseKnownFiles(init);
23
- const profileName = getProfileName(init);
19
+ const profileName = getProfileName({
20
+ profile: init.profile ?? callerClientConfig?.profile,
21
+ });
24
22
  const profile = profiles[profileName];
25
23
  if (!profile) {
26
24
  throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/token-providers",
3
- "version": "3.713.0",
3
+ "version": "3.714.0",
4
4
  "description": "A collection of token providers",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@aws-sdk/types": "3.713.0",
30
+ "@aws-sdk/types": "3.714.0",
31
31
  "@smithy/property-provider": "^3.1.11",
32
32
  "@smithy/shared-ini-file-loader": "^3.1.12",
33
33
  "@smithy/types": "^3.7.2",
@@ -42,7 +42,7 @@
42
42
  "typescript": "~4.9.5"
43
43
  },
44
44
  "peerDependencies": {
45
- "@aws-sdk/client-sso-oidc": "^3.713.0"
45
+ "@aws-sdk/client-sso-oidc": "^3.714.0"
46
46
  },
47
47
  "types": "./dist-types/index.d.ts",
48
48
  "engines": {