@aws-sdk/credential-provider-ini 3.54.0 → 3.56.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 +24 -0
- package/dist-cjs/fromIni.js +3 -3
- package/dist-cjs/resolveAssumeRoleCredentials.js +4 -4
- package/dist-cjs/resolveProfileData.js +10 -10
- package/dist-cjs/resolveSsoCredentials.js +2 -2
- package/dist-cjs/resolveWebIdentityCredentials.js +1 -1
- package/dist-es/fromIni.js +2 -2
- package/dist-es/resolveAssumeRoleCredentials.js +5 -5
- package/dist-es/resolveCredentialSource.js +1 -1
- package/dist-es/resolveProfileData.js +1 -1
- package/dist-types/fromIni.d.ts +1 -1
- package/dist-types/resolveAssumeRoleCredentials.d.ts +1 -1
- package/dist-types/resolveProfileData.d.ts +1 -2
- package/dist-types/resolveStaticCredentials.d.ts +1 -2
- package/dist-types/resolveWebIdentityCredentials.d.ts +1 -2
- package/dist-types/ts3.4/fromIni.d.ts +1 -1
- package/dist-types/ts3.4/resolveAssumeRoleCredentials.d.ts +1 -1
- package/dist-types/ts3.4/resolveProfileData.d.ts +1 -2
- package/dist-types/ts3.4/resolveStaticCredentials.d.ts +1 -2
- package/dist-types/ts3.4/resolveWebIdentityCredentials.d.ts +1 -2
- package/package.json +10 -11
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.56.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.55.0...v3.56.0) (2022-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-ini
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-ini
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.54.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.0...v3.54.1) (2022-03-15)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @aws-sdk/credential-provider-ini
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [3.54.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.53.1...v3.54.0) (2022-03-11)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @aws-sdk/credential-provider-ini
|
package/dist-cjs/fromIni.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fromIni = void 0;
|
|
4
|
-
const
|
|
4
|
+
const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader");
|
|
5
5
|
const resolveProfileData_1 = require("./resolveProfileData");
|
|
6
6
|
const fromIni = (init = {}) => async () => {
|
|
7
|
-
const profiles = await
|
|
8
|
-
return resolveProfileData_1.resolveProfileData(
|
|
7
|
+
const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init);
|
|
8
|
+
return (0, resolveProfileData_1.resolveProfileData)((0, shared_ini_file_loader_1.getProfileName)(init), profiles, init);
|
|
9
9
|
};
|
|
10
10
|
exports.fromIni = fromIni;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveAssumeRoleCredentials = exports.isAssumeRoleProfile = void 0;
|
|
4
4
|
const property_provider_1 = require("@aws-sdk/property-provider");
|
|
5
|
-
const
|
|
5
|
+
const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader");
|
|
6
6
|
const resolveCredentialSource_1 = require("./resolveCredentialSource");
|
|
7
7
|
const resolveProfileData_1 = require("./resolveProfileData");
|
|
8
8
|
const isAssumeRoleProfile = (arg) => Boolean(arg) &&
|
|
@@ -23,15 +23,15 @@ const resolveAssumeRoleCredentials = async (profileName, profiles, options, visi
|
|
|
23
23
|
const { source_profile } = data;
|
|
24
24
|
if (source_profile && source_profile in visitedProfiles) {
|
|
25
25
|
throw new property_provider_1.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` +
|
|
26
|
-
` ${
|
|
26
|
+
` ${(0, shared_ini_file_loader_1.getProfileName)(options)}. Profiles visited: ` +
|
|
27
27
|
Object.keys(visitedProfiles).join(", "), false);
|
|
28
28
|
}
|
|
29
29
|
const sourceCredsProvider = source_profile
|
|
30
|
-
? resolveProfileData_1.resolveProfileData(source_profile, profiles, options, {
|
|
30
|
+
? (0, resolveProfileData_1.resolveProfileData)(source_profile, profiles, options, {
|
|
31
31
|
...visitedProfiles,
|
|
32
32
|
[source_profile]: true,
|
|
33
33
|
})
|
|
34
|
-
: resolveCredentialSource_1.resolveCredentialSource(data.credential_source, profileName)();
|
|
34
|
+
: (0, resolveCredentialSource_1.resolveCredentialSource)(data.credential_source, profileName)();
|
|
35
35
|
const params = {
|
|
36
36
|
RoleArn: data.role_arn,
|
|
37
37
|
RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`,
|
|
@@ -8,20 +8,20 @@ const resolveStaticCredentials_1 = require("./resolveStaticCredentials");
|
|
|
8
8
|
const resolveWebIdentityCredentials_1 = require("./resolveWebIdentityCredentials");
|
|
9
9
|
const resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}) => {
|
|
10
10
|
const data = profiles[profileName];
|
|
11
|
-
if (Object.keys(visitedProfiles).length > 0 && resolveStaticCredentials_1.isStaticCredsProfile(data)) {
|
|
12
|
-
return resolveStaticCredentials_1.resolveStaticCredentials(data);
|
|
11
|
+
if (Object.keys(visitedProfiles).length > 0 && (0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) {
|
|
12
|
+
return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data);
|
|
13
13
|
}
|
|
14
|
-
if (resolveAssumeRoleCredentials_1.isAssumeRoleProfile(data)) {
|
|
15
|
-
return resolveAssumeRoleCredentials_1.resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles);
|
|
14
|
+
if ((0, resolveAssumeRoleCredentials_1.isAssumeRoleProfile)(data)) {
|
|
15
|
+
return (0, resolveAssumeRoleCredentials_1.resolveAssumeRoleCredentials)(profileName, profiles, options, visitedProfiles);
|
|
16
16
|
}
|
|
17
|
-
if (resolveStaticCredentials_1.isStaticCredsProfile(data)) {
|
|
18
|
-
return resolveStaticCredentials_1.resolveStaticCredentials(data);
|
|
17
|
+
if ((0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) {
|
|
18
|
+
return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data);
|
|
19
19
|
}
|
|
20
|
-
if (resolveWebIdentityCredentials_1.isWebIdentityProfile(data)) {
|
|
21
|
-
return resolveWebIdentityCredentials_1.resolveWebIdentityCredentials(data, options);
|
|
20
|
+
if ((0, resolveWebIdentityCredentials_1.isWebIdentityProfile)(data)) {
|
|
21
|
+
return (0, resolveWebIdentityCredentials_1.resolveWebIdentityCredentials)(data, options);
|
|
22
22
|
}
|
|
23
|
-
if (resolveSsoCredentials_1.isSsoProfile(data)) {
|
|
24
|
-
return resolveSsoCredentials_1.resolveSsoCredentials(data);
|
|
23
|
+
if ((0, resolveSsoCredentials_1.isSsoProfile)(data)) {
|
|
24
|
+
return (0, resolveSsoCredentials_1.resolveSsoCredentials)(data);
|
|
25
25
|
}
|
|
26
26
|
throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found or parsed in shared credentials file.`);
|
|
27
27
|
};
|
|
@@ -5,8 +5,8 @@ const credential_provider_sso_1 = require("@aws-sdk/credential-provider-sso");
|
|
|
5
5
|
var credential_provider_sso_2 = require("@aws-sdk/credential-provider-sso");
|
|
6
6
|
Object.defineProperty(exports, "isSsoProfile", { enumerable: true, get: function () { return credential_provider_sso_2.isSsoProfile; } });
|
|
7
7
|
const resolveSsoCredentials = (data) => {
|
|
8
|
-
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = credential_provider_sso_1.validateSsoProfile(data);
|
|
9
|
-
return credential_provider_sso_1.fromSSO({
|
|
8
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = (0, credential_provider_sso_1.validateSsoProfile)(data);
|
|
9
|
+
return (0, credential_provider_sso_1.fromSSO)({
|
|
10
10
|
ssoStartUrl: sso_start_url,
|
|
11
11
|
ssoAccountId: sso_account_id,
|
|
12
12
|
ssoRegion: sso_region,
|
|
@@ -8,7 +8,7 @@ const isWebIdentityProfile = (arg) => Boolean(arg) &&
|
|
|
8
8
|
typeof arg.role_arn === "string" &&
|
|
9
9
|
["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
|
|
10
10
|
exports.isWebIdentityProfile = isWebIdentityProfile;
|
|
11
|
-
const resolveWebIdentityCredentials = async (profile, options) => credential_provider_web_identity_1.fromTokenFile({
|
|
11
|
+
const resolveWebIdentityCredentials = async (profile, options) => (0, credential_provider_web_identity_1.fromTokenFile)({
|
|
12
12
|
webIdentityTokenFile: profile.web_identity_token_file,
|
|
13
13
|
roleArn: profile.role_arn,
|
|
14
14
|
roleSessionName: profile.role_session_name,
|
package/dist-es/fromIni.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter, __generator } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { getProfileName, parseKnownFiles } from "@aws-sdk/shared-ini-file-loader";
|
|
3
3
|
import { resolveProfileData } from "./resolveProfileData";
|
|
4
4
|
export var fromIni = function (init) {
|
|
5
5
|
if (init === void 0) { init = {}; }
|
|
@@ -10,7 +10,7 @@ export var fromIni = function (init) {
|
|
|
10
10
|
case 0: return [4, parseKnownFiles(init)];
|
|
11
11
|
case 1:
|
|
12
12
|
profiles = _a.sent();
|
|
13
|
-
return [2, resolveProfileData(
|
|
13
|
+
return [2, resolveProfileData(getProfileName(init), profiles, init)];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
}); };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
2
|
import { CredentialsProviderError } from "@aws-sdk/property-provider";
|
|
3
|
-
import {
|
|
3
|
+
import { getProfileName } from "@aws-sdk/shared-ini-file-loader";
|
|
4
4
|
import { resolveCredentialSource } from "./resolveCredentialSource";
|
|
5
5
|
import { resolveProfileData } from "./resolveProfileData";
|
|
6
6
|
export var isAssumeRoleProfile = function (arg) {
|
|
@@ -28,12 +28,12 @@ export var resolveAssumeRoleCredentials = function (profileName, profiles, optio
|
|
|
28
28
|
case 0:
|
|
29
29
|
data = profiles[profileName];
|
|
30
30
|
if (!options.roleAssumer) {
|
|
31
|
-
throw new CredentialsProviderError("Profile "
|
|
31
|
+
throw new CredentialsProviderError("Profile ".concat(profileName, " requires a role to be assumed, but no role assumption callback was provided."), false);
|
|
32
32
|
}
|
|
33
33
|
source_profile = data.source_profile;
|
|
34
34
|
if (source_profile && source_profile in visitedProfiles) {
|
|
35
35
|
throw new CredentialsProviderError("Detected a cycle attempting to resolve credentials for profile" +
|
|
36
|
-
|
|
36
|
+
" ".concat(getProfileName(options), ". Profiles visited: ") +
|
|
37
37
|
Object.keys(visitedProfiles).join(", "), false);
|
|
38
38
|
}
|
|
39
39
|
sourceCredsProvider = source_profile
|
|
@@ -41,13 +41,13 @@ export var resolveAssumeRoleCredentials = function (profileName, profiles, optio
|
|
|
41
41
|
: resolveCredentialSource(data.credential_source, profileName)();
|
|
42
42
|
params = {
|
|
43
43
|
RoleArn: data.role_arn,
|
|
44
|
-
RoleSessionName: data.role_session_name || "aws-sdk-js-"
|
|
44
|
+
RoleSessionName: data.role_session_name || "aws-sdk-js-".concat(Date.now()),
|
|
45
45
|
ExternalId: data.external_id,
|
|
46
46
|
};
|
|
47
47
|
mfa_serial = data.mfa_serial;
|
|
48
48
|
if (!mfa_serial) return [3, 2];
|
|
49
49
|
if (!options.mfaCodeProvider) {
|
|
50
|
-
throw new CredentialsProviderError("Profile "
|
|
50
|
+
throw new CredentialsProviderError("Profile ".concat(profileName, " requires multi-factor authentication, but no MFA code callback was provided."), false);
|
|
51
51
|
}
|
|
52
52
|
params.SerialNumber = mfa_serial;
|
|
53
53
|
_a = params;
|
|
@@ -11,7 +11,7 @@ export var resolveCredentialSource = function (credentialSource, profileName) {
|
|
|
11
11
|
return sourceProvidersMap[credentialSource]();
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
|
-
throw new CredentialsProviderError("Unsupported credential source in profile "
|
|
14
|
+
throw new CredentialsProviderError("Unsupported credential source in profile ".concat(profileName, ". Got ").concat(credentialSource, ", ") +
|
|
15
15
|
"expected EcsContainer or Ec2InstanceMetadata or Environment.");
|
|
16
16
|
}
|
|
17
17
|
};
|
|
@@ -25,7 +25,7 @@ export var resolveProfileData = function (profileName, profiles, options, visite
|
|
|
25
25
|
if (isSsoProfile(data)) {
|
|
26
26
|
return [2, resolveSsoCredentials(data)];
|
|
27
27
|
}
|
|
28
|
-
throw new CredentialsProviderError("Profile "
|
|
28
|
+
throw new CredentialsProviderError("Profile ".concat(profileName, " could not be found or parsed in shared credentials file."));
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
};
|
package/dist-types/fromIni.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssumeRoleWithWebIdentityParams } from "@aws-sdk/credential-provider-web-identity";
|
|
2
|
+
import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader";
|
|
2
3
|
import { CredentialProvider, Credentials } from "@aws-sdk/types";
|
|
3
|
-
import { SourceProfileInit } from "@aws-sdk/util-credentials";
|
|
4
4
|
import { AssumeRoleParams } from "./resolveAssumeRoleCredentials";
|
|
5
5
|
export interface FromIniInit extends SourceProfileInit {
|
|
6
6
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ParsedIniData } from "@aws-sdk/
|
|
2
|
-
import { Credentials } from "@aws-sdk/types";
|
|
1
|
+
import { Credentials, ParsedIniData } from "@aws-sdk/types";
|
|
3
2
|
import { FromIniInit } from "./fromIni";
|
|
4
3
|
export declare const resolveProfileData: (profileName: string, profiles: ParsedIniData, options: FromIniInit, visitedProfiles?: {
|
|
5
4
|
[profileName: string]: true;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Profile } from "@aws-sdk/
|
|
2
|
-
import { Credentials } from "@aws-sdk/types";
|
|
1
|
+
import { Credentials, Profile } from "@aws-sdk/types";
|
|
3
2
|
export interface StaticCredsProfile extends Profile {
|
|
4
3
|
aws_access_key_id: string;
|
|
5
4
|
aws_secret_access_key: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Profile } from "@aws-sdk/
|
|
2
|
-
import { Credentials } from "@aws-sdk/types";
|
|
1
|
+
import { Credentials, Profile } from "@aws-sdk/types";
|
|
3
2
|
import { FromIniInit } from "./fromIni";
|
|
4
3
|
export interface WebIdentityProfile extends Profile {
|
|
5
4
|
web_identity_token_file: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssumeRoleWithWebIdentityParams } from "@aws-sdk/credential-provider-web-identity";
|
|
2
|
+
import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader";
|
|
2
3
|
import { CredentialProvider, Credentials } from "@aws-sdk/types";
|
|
3
|
-
import { SourceProfileInit } from "@aws-sdk/util-credentials";
|
|
4
4
|
import { AssumeRoleParams } from "./resolveAssumeRoleCredentials";
|
|
5
5
|
export interface FromIniInit extends SourceProfileInit {
|
|
6
6
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ParsedIniData } from "@aws-sdk/
|
|
2
|
-
import { Credentials } from "@aws-sdk/types";
|
|
1
|
+
import { Credentials, ParsedIniData } from "@aws-sdk/types";
|
|
3
2
|
import { FromIniInit } from "./fromIni";
|
|
4
3
|
export declare const resolveProfileData: (profileName: string, profiles: ParsedIniData, options: FromIniInit, visitedProfiles?: {
|
|
5
4
|
[profileName: string]: true;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Profile } from "@aws-sdk/
|
|
2
|
-
import { Credentials } from "@aws-sdk/types";
|
|
1
|
+
import { Credentials, Profile } from "@aws-sdk/types";
|
|
3
2
|
export interface StaticCredsProfile extends Profile {
|
|
4
3
|
aws_access_key_id: string;
|
|
5
4
|
aws_secret_access_key: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Profile } from "@aws-sdk/
|
|
2
|
-
import { Credentials } from "@aws-sdk/types";
|
|
1
|
+
import { Credentials, Profile } from "@aws-sdk/types";
|
|
3
2
|
import { FromIniInit } from "./fromIni";
|
|
4
3
|
export interface WebIdentityProfile extends Profile {
|
|
5
4
|
web_identity_token_file: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-ini",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.56.0",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -23,15 +23,14 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/credential-provider-env": "3.
|
|
27
|
-
"@aws-sdk/credential-provider-imds": "3.
|
|
28
|
-
"@aws-sdk/credential-provider-sso": "3.
|
|
29
|
-
"@aws-sdk/credential-provider-web-identity": "3.
|
|
30
|
-
"@aws-sdk/property-provider": "3.
|
|
31
|
-
"@aws-sdk/shared-ini-file-loader": "3.
|
|
32
|
-
"@aws-sdk/types": "3.
|
|
33
|
-
"
|
|
34
|
-
"tslib": "^2.3.0"
|
|
26
|
+
"@aws-sdk/credential-provider-env": "3.55.0",
|
|
27
|
+
"@aws-sdk/credential-provider-imds": "3.56.0",
|
|
28
|
+
"@aws-sdk/credential-provider-sso": "3.56.0",
|
|
29
|
+
"@aws-sdk/credential-provider-web-identity": "3.55.0",
|
|
30
|
+
"@aws-sdk/property-provider": "3.55.0",
|
|
31
|
+
"@aws-sdk/shared-ini-file-loader": "3.56.0",
|
|
32
|
+
"@aws-sdk/types": "3.55.0",
|
|
33
|
+
"tslib": "^2.3.1"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@tsconfig/recommended": "1.0.1",
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
"downlevel-dts": "0.7.0",
|
|
41
40
|
"rimraf": "3.0.2",
|
|
42
41
|
"typedoc": "0.19.2",
|
|
43
|
-
"typescript": "~4.
|
|
42
|
+
"typescript": "~4.6.2"
|
|
44
43
|
},
|
|
45
44
|
"types": "./dist-types/index.d.ts",
|
|
46
45
|
"engines": {
|