@aws-sdk/credential-provider-sso 3.502.0 → 3.503.1

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
@@ -61,6 +61,7 @@ var resolveSSOCredentials = /* @__PURE__ */ __name(async ({
61
61
  ssoRegion,
62
62
  ssoRoleName,
63
63
  ssoClient,
64
+ clientConfig,
64
65
  profile
65
66
  }) => {
66
67
  let token;
@@ -93,7 +94,11 @@ var resolveSSOCredentials = /* @__PURE__ */ __name(async ({
93
94
  }
94
95
  const { accessToken } = token;
95
96
  const { SSOClient: SSOClient2, GetRoleCredentialsCommand: GetRoleCredentialsCommand2 } = await Promise.resolve().then(() => (init_loadSso(), loadSso_exports));
96
- const sso = ssoClient || new SSOClient2({ region: ssoRegion });
97
+ const sso = ssoClient || new SSOClient2(
98
+ Object.assign({}, clientConfig ?? {}, {
99
+ region: (clientConfig == null ? void 0 : clientConfig.region) ?? ssoRegion
100
+ })
101
+ );
97
102
  let ssoResp;
98
103
  try {
99
104
  ssoResp = await sso.send(
@@ -134,11 +139,7 @@ var fromSSO = /* @__PURE__ */ __name((init = {}) => async () => {
134
139
  var _a;
135
140
  (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-sso", "fromSSO");
136
141
  const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
137
- let { ssoClient } = init;
138
- if (!ssoClient) {
139
- const { SSOClient: SSOClient2 } = await Promise.resolve().then(() => (init_loadSso(), loadSso_exports));
140
- ssoClient = new SSOClient2(init.clientConfig ?? {});
141
- }
142
+ const { ssoClient } = init;
142
143
  const profileName = (0, import_shared_ini_file_loader.getProfileName)(init);
143
144
  if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
144
145
  const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
@@ -170,6 +171,7 @@ var fromSSO = /* @__PURE__ */ __name((init = {}) => async () => {
170
171
  ssoRegion: sso_region,
171
172
  ssoRoleName: sso_role_name,
172
173
  ssoClient,
174
+ clientConfig: init.clientConfig,
173
175
  profile: profileName
174
176
  });
175
177
  } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
@@ -184,6 +186,7 @@ var fromSSO = /* @__PURE__ */ __name((init = {}) => async () => {
184
186
  ssoRegion,
185
187
  ssoRoleName,
186
188
  ssoClient,
189
+ clientConfig: init.clientConfig,
187
190
  profile: profileName
188
191
  });
189
192
  }
@@ -6,11 +6,7 @@ import { validateSsoProfile } from "./validateSsoProfile";
6
6
  export const fromSSO = (init = {}) => async () => {
7
7
  init.logger?.debug("@aws-sdk/credential-provider-sso", "fromSSO");
8
8
  const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
9
- let { ssoClient } = init;
10
- if (!ssoClient) {
11
- const { SSOClient } = await import("./loadSso");
12
- ssoClient = new SSOClient(init.clientConfig ?? {});
13
- }
9
+ const { ssoClient } = init;
14
10
  const profileName = getProfileName(init);
15
11
  if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
16
12
  const profiles = await parseKnownFiles(init);
@@ -42,6 +38,7 @@ export const fromSSO = (init = {}) => async () => {
42
38
  ssoRegion: sso_region,
43
39
  ssoRoleName: sso_role_name,
44
40
  ssoClient: ssoClient,
41
+ clientConfig: init.clientConfig,
45
42
  profile: profileName,
46
43
  });
47
44
  }
@@ -57,6 +54,7 @@ export const fromSSO = (init = {}) => async () => {
57
54
  ssoRegion,
58
55
  ssoRoleName,
59
56
  ssoClient,
57
+ clientConfig: init.clientConfig,
60
58
  profile: profileName,
61
59
  });
62
60
  }
@@ -2,7 +2,7 @@ import { fromSso as getSsoTokenProvider } from "@aws-sdk/token-providers";
2
2
  import { CredentialsProviderError } from "@smithy/property-provider";
3
3
  import { getSSOTokenFromFile } from "@smithy/shared-ini-file-loader";
4
4
  const SHOULD_FAIL_CREDENTIAL_CHAIN = false;
5
- export const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }) => {
5
+ export const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, profile, }) => {
6
6
  let token;
7
7
  const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
8
8
  if (ssoSession) {
@@ -30,7 +30,10 @@ export const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccoun
30
30
  }
31
31
  const { accessToken } = token;
32
32
  const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso");
33
- const sso = ssoClient || new SSOClient({ region: ssoRegion });
33
+ const sso = ssoClient ||
34
+ new SSOClient(Object.assign({}, clientConfig ?? {}, {
35
+ region: clientConfig?.region ?? ssoRegion,
36
+ }));
34
37
  let ssoResp;
35
38
  try {
36
39
  ssoResp = await sso.send(new GetRoleCredentialsCommand({
@@ -3,4 +3,4 @@ import { FromSSOInit, SsoCredentialsParameters } from "./fromSSO";
3
3
  /**
4
4
  * @internal
5
5
  */
6
- export declare const resolveSSOCredentials: ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }: FromSSOInit & SsoCredentialsParameters) => Promise<AwsCredentialIdentity>;
6
+ export declare const resolveSSOCredentials: ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, profile, }: FromSSOInit & SsoCredentialsParameters) => Promise<AwsCredentialIdentity>;
@@ -7,5 +7,6 @@ export declare const resolveSSOCredentials: ({
7
7
  ssoRegion,
8
8
  ssoRoleName,
9
9
  ssoClient,
10
+ clientConfig,
10
11
  profile,
11
12
  }: FromSSOInit & SsoCredentialsParameters) => Promise<AwsCredentialIdentity>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-sso",
3
- "version": "3.502.0",
3
+ "version": "3.503.1",
4
4
  "description": "AWS credential provider that exchanges a resolved SSO login token file for temporary AWS credentials",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",