@aws-sdk/credential-provider-sso 3.484.0 → 3.485.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.
@@ -7,6 +7,7 @@ const property_provider_1 = require("@smithy/property-provider");
7
7
  const shared_ini_file_loader_1 = require("@smithy/shared-ini-file-loader");
8
8
  const SHOULD_FAIL_CREDENTIAL_CHAIN = false;
9
9
  const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }) => {
10
+ var _a;
10
11
  let token;
11
12
  const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
12
13
  if (ssoSession) {
@@ -46,9 +47,10 @@ const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ss
46
47
  throw property_provider_1.CredentialsProviderError.from(e, SHOULD_FAIL_CREDENTIAL_CHAIN);
47
48
  }
48
49
  const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration } = {} } = ssoResp;
50
+ const credentialScope = (_a = ssoResp === null || ssoResp === void 0 ? void 0 : ssoResp.roleCredentials) === null || _a === void 0 ? void 0 : _a.credentialScope;
49
51
  if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
50
52
  throw new property_provider_1.CredentialsProviderError("SSO returns an invalid temporary credential.", SHOULD_FAIL_CREDENTIAL_CHAIN);
51
53
  }
52
- return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration) };
54
+ return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration), credentialScope };
53
55
  };
54
56
  exports.resolveSSOCredentials = resolveSSOCredentials;
@@ -43,8 +43,9 @@ export const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccoun
43
43
  throw CredentialsProviderError.from(e, SHOULD_FAIL_CREDENTIAL_CHAIN);
44
44
  }
45
45
  const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration } = {} } = ssoResp;
46
+ const credentialScope = ssoResp?.roleCredentials?.credentialScope;
46
47
  if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
47
48
  throw new CredentialsProviderError("SSO returns an invalid temporary credential.", SHOULD_FAIL_CREDENTIAL_CHAIN);
48
49
  }
49
- return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration) };
50
+ return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration), credentialScope };
50
51
  };
@@ -1,6 +1,6 @@
1
1
  import { AwsCredentialIdentity } from "@smithy/types";
2
2
  import { FromSSOInit, SsoCredentialsParameters } from "./fromSSO";
3
3
  /**
4
- * @private
4
+ * @internal
5
5
  */
6
6
  export declare const resolveSSOCredentials: ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }: 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.484.0",
3
+ "version": "3.485.0",
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",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/client-sso": "3.484.0",
28
- "@aws-sdk/token-providers": "3.484.0",
29
- "@aws-sdk/types": "3.468.0",
27
+ "@aws-sdk/client-sso": "3.485.0",
28
+ "@aws-sdk/token-providers": "3.485.0",
29
+ "@aws-sdk/types": "3.485.0",
30
30
  "@smithy/property-provider": "^2.0.0",
31
31
  "@smithy/shared-ini-file-loader": "^2.0.6",
32
- "@smithy/types": "^2.7.0",
32
+ "@smithy/types": "^2.8.0",
33
33
  "tslib": "^2.5.0"
34
34
  },
35
35
  "devDependencies": {