@aws-sdk/credential-provider-sso 3.54.1 → 3.58.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.58.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.57.0...v3.58.0) (2022-03-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-sso
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.56.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.55.0...v3.56.0) (2022-03-24)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-sso
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-sso
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [3.54.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.0...v3.54.1) (2022-03-15)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @aws-sdk/credential-provider-sso
|
package/dist-cjs/fromSSO.js
CHANGED
|
@@ -9,14 +9,14 @@ const validateSsoProfile_1 = require("./validateSsoProfile");
|
|
|
9
9
|
const fromSSO = (init = {}) => async () => {
|
|
10
10
|
const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoClient } = init;
|
|
11
11
|
if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName) {
|
|
12
|
-
const profiles = await shared_ini_file_loader_1.parseKnownFiles(init);
|
|
13
|
-
const profileName = shared_ini_file_loader_1.getProfileName(init);
|
|
12
|
+
const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init);
|
|
13
|
+
const profileName = (0, shared_ini_file_loader_1.getProfileName)(init);
|
|
14
14
|
const profile = profiles[profileName];
|
|
15
|
-
if (!isSsoProfile_1.isSsoProfile(profile)) {
|
|
15
|
+
if (!(0, isSsoProfile_1.isSsoProfile)(profile)) {
|
|
16
16
|
throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`);
|
|
17
17
|
}
|
|
18
|
-
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = validateSsoProfile_1.validateSsoProfile(profile);
|
|
19
|
-
return resolveSSOCredentials_1.resolveSSOCredentials({
|
|
18
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = (0, validateSsoProfile_1.validateSsoProfile)(profile);
|
|
19
|
+
return (0, resolveSSOCredentials_1.resolveSSOCredentials)({
|
|
20
20
|
ssoStartUrl: sso_start_url,
|
|
21
21
|
ssoAccountId: sso_account_id,
|
|
22
22
|
ssoRegion: sso_region,
|
|
@@ -29,7 +29,7 @@ const fromSSO = (init = {}) => async () => {
|
|
|
29
29
|
' "ssoAccountId", "ssoRegion", "ssoRoleName"');
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
return resolveSSOCredentials_1.resolveSSOCredentials({ ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoClient });
|
|
32
|
+
return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoClient });
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
exports.fromSSO = fromSSO;
|
|
@@ -10,7 +10,7 @@ const resolveSSOCredentials = async ({ ssoStartUrl, ssoAccountId, ssoRegion, sso
|
|
|
10
10
|
let token;
|
|
11
11
|
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
|
|
12
12
|
try {
|
|
13
|
-
token = await shared_ini_file_loader_1.getSSOTokenFromFile(ssoStartUrl);
|
|
13
|
+
token = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoStartUrl);
|
|
14
14
|
}
|
|
15
15
|
catch (e) {
|
|
16
16
|
throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN);
|
package/dist-es/fromSSO.js
CHANGED
|
@@ -19,7 +19,7 @@ export var fromSSO = function (init) {
|
|
|
19
19
|
profileName = getProfileName(init);
|
|
20
20
|
profile = profiles[profileName];
|
|
21
21
|
if (!isSsoProfile(profile)) {
|
|
22
|
-
throw new CredentialsProviderError("Profile "
|
|
22
|
+
throw new CredentialsProviderError("Profile ".concat(profileName, " is not configured with SSO credentials."));
|
|
23
23
|
}
|
|
24
24
|
_a = validateSsoProfile(profile), sso_start_url = _a.sso_start_url, sso_account_id = _a.sso_account_id, sso_region = _a.sso_region, sso_role_name = _a.sso_role_name;
|
|
25
25
|
return [2, resolveSSOCredentials({
|
|
@@ -21,10 +21,10 @@ export var resolveSSOCredentials = function (_a) {
|
|
|
21
21
|
return [3, 4];
|
|
22
22
|
case 3:
|
|
23
23
|
e_1 = _d.sent();
|
|
24
|
-
throw new CredentialsProviderError("The SSO session associated with this profile is invalid. "
|
|
24
|
+
throw new CredentialsProviderError("The SSO session associated with this profile is invalid. ".concat(refreshMessage), SHOULD_FAIL_CREDENTIAL_CHAIN);
|
|
25
25
|
case 4:
|
|
26
26
|
if (new Date(token.expiresAt).getTime() - Date.now() <= EXPIRE_WINDOW_MS) {
|
|
27
|
-
throw new CredentialsProviderError("The SSO session associated with this profile has expired. "
|
|
27
|
+
throw new CredentialsProviderError("The SSO session associated with this profile has expired. ".concat(refreshMessage), SHOULD_FAIL_CREDENTIAL_CHAIN);
|
|
28
28
|
}
|
|
29
29
|
accessToken = token.accessToken;
|
|
30
30
|
sso = ssoClient || new SSOClient({ region: ssoRegion });
|
|
@@ -3,7 +3,7 @@ export var validateSsoProfile = function (profile) {
|
|
|
3
3
|
var sso_start_url = profile.sso_start_url, sso_account_id = profile.sso_account_id, sso_region = profile.sso_region, sso_role_name = profile.sso_role_name;
|
|
4
4
|
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
|
|
5
5
|
throw new CredentialsProviderError("Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", \"sso_region\", " +
|
|
6
|
-
|
|
6
|
+
"\"sso_role_name\", \"sso_start_url\". Got ".concat(Object.keys(profile).join(", "), "\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html"), false);
|
|
7
7
|
}
|
|
8
8
|
return profile;
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-sso",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.58.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",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/client-sso": "3.
|
|
27
|
-
"@aws-sdk/property-provider": "3.
|
|
28
|
-
"@aws-sdk/shared-ini-file-loader": "3.
|
|
29
|
-
"@aws-sdk/types": "3.
|
|
30
|
-
"tslib": "^2.3.
|
|
26
|
+
"@aws-sdk/client-sso": "3.58.0",
|
|
27
|
+
"@aws-sdk/property-provider": "3.55.0",
|
|
28
|
+
"@aws-sdk/shared-ini-file-loader": "3.58.0",
|
|
29
|
+
"@aws-sdk/types": "3.55.0",
|
|
30
|
+
"tslib": "^2.3.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@tsconfig/recommended": "1.0.1",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"downlevel-dts": "0.7.0",
|
|
37
37
|
"rimraf": "3.0.2",
|
|
38
38
|
"typedoc": "0.19.2",
|
|
39
|
-
"typescript": "~4.
|
|
39
|
+
"typescript": "~4.6.2"
|
|
40
40
|
},
|
|
41
41
|
"types": "./dist-types/index.d.ts",
|
|
42
42
|
"engines": {
|