@aws-sdk/token-providers 3.709.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,11 +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 () => {
106
+ var fromSso = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig } = {}) => {
107
107
  var _a;
108
+ const init = {
109
+ ..._init,
110
+ parentClientConfig: {
111
+ ...callerClientConfig,
112
+ ..._init.parentClientConfig
113
+ }
114
+ };
108
115
  (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers - fromSso");
109
116
  const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
110
- 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
+ });
111
120
  const profile = profiles[profileName];
112
121
  if (!profile) {
113
122
  throw new import_property_provider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
@@ -6,10 +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 () => {
9
+ export const fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => {
10
+ const init = {
11
+ ..._init,
12
+ parentClientConfig: {
13
+ ...callerClientConfig,
14
+ ..._init.parentClientConfig,
15
+ },
16
+ };
10
17
  init.logger?.debug("@aws-sdk/token-providers - fromSso");
11
18
  const profiles = await parseKnownFiles(init);
12
- const profileName = getProfileName(init);
19
+ const profileName = getProfileName({
20
+ profile: init.profile ?? callerClientConfig?.profile,
21
+ });
13
22
  const profile = profiles[profileName];
14
23
  if (!profile) {
15
24
  throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
@@ -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.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.709.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.709.0"
45
+ "@aws-sdk/client-sso-oidc": "^3.714.0"
46
46
  },
47
47
  "types": "./dist-types/index.d.ts",
48
48
  "engines": {