@aws-sdk/token-providers 3.709.0 → 3.713.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,9 +103,18 @@ 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 () => {
107
- var _a;
108
- (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers - fromSso");
106
+ var fromSso = /* @__PURE__ */ __name((_init = {}) => async (awsIdentityProperties) => {
107
+ var _a, _b, _c;
108
+ const init = {
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
+ } : {}
116
+ };
117
+ (_c = init.logger) == null ? void 0 : _c.debug("@aws-sdk/token-providers - fromSso");
109
118
  const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
110
119
  const profileName = (0, import_shared_ini_file_loader.getProfileName)(init);
111
120
  const profile = profiles[profileName];
@@ -6,7 +6,18 @@ 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 () => {
9
+ export const fromSso = (_init = {}) => async (awsIdentityProperties) => {
10
+ const init = {
11
+ ..._init,
12
+ ...(awsIdentityProperties?.callerClientConfig?.region
13
+ ? {
14
+ parentClientConfig: {
15
+ region: awsIdentityProperties?.callerClientConfig?.region,
16
+ ..._init.parentClientConfig,
17
+ },
18
+ }
19
+ : {}),
20
+ };
10
21
  init.logger?.debug("@aws-sdk/token-providers - fromSso");
11
22
  const profiles = await parseKnownFiles(init);
12
23
  const profileName = getProfileName(init);
@@ -1,4 +1,4 @@
1
- import { CredentialProviderOptions, TokenIdentityProvider } from "@aws-sdk/types";
1
+ import { CredentialProviderOptions, RuntimeConfigIdentityProvider, TokenIdentity } from "@aws-sdk/types";
2
2
  import { SourceProfileInit } from "@smithy/shared-ini-file-loader";
3
3
  export interface FromSsoInit extends SourceProfileInit, CredentialProviderOptions {
4
4
  /**
@@ -9,4 +9,4 @@ export interface FromSsoInit extends SourceProfileInit, CredentialProviderOption
9
9
  /**
10
10
  * Creates a token provider that will read from SSO token cache or ssoOidc.createToken() call.
11
11
  */
12
- export declare const fromSso: (init?: FromSsoInit) => TokenIdentityProvider;
12
+ export declare const fromSso: (_init?: FromSsoInit) => RuntimeConfigIdentityProvider<TokenIdentity>;
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  CredentialProviderOptions,
3
- TokenIdentityProvider,
3
+ RuntimeConfigIdentityProvider,
4
+ TokenIdentity,
4
5
  } from "@aws-sdk/types";
5
6
  import { SourceProfileInit } from "@smithy/shared-ini-file-loader";
6
7
  export interface FromSsoInit
@@ -8,4 +9,6 @@ export interface FromSsoInit
8
9
  CredentialProviderOptions {
9
10
  clientConfig?: any;
10
11
  }
11
- export declare const fromSso: (init?: FromSsoInit) => TokenIdentityProvider;
12
+ export declare const fromSso: (
13
+ _init?: FromSsoInit
14
+ ) => RuntimeConfigIdentityProvider<TokenIdentity>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/token-providers",
3
- "version": "3.709.0",
3
+ "version": "3.713.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.709.0",
30
+ "@aws-sdk/types": "3.713.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.709.0"
45
+ "@aws-sdk/client-sso-oidc": "^3.713.0"
46
46
  },
47
47
  "types": "./dist-types/index.d.ts",
48
48
  "engines": {