Skip to content

Commit ba6f17c

Browse files
dependabot[bot]GitHub Actions
andauthored
chore: Bump @aws-sdk/client-ecs from 3.890.0 to 3.923.0 (#426)
* chore: Bump @aws-sdk/client-ecs from 3.890.0 to 3.923.0 Bumps [@aws-sdk/client-ecs](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-ecs) from 3.890.0 to 3.923.0. - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-ecs/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.923.0/clients/client-ecs) --- updated-dependencies: - dependency-name: "@aws-sdk/client-ecs" dependency-version: 3.923.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: Update dist --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: GitHub Actions <runner@runnervmf2e7y.z4xzv4jlyv2effazjvmryp4z0b.phxx.internal.cloudapp.net>
1 parent 2f9848c commit ba6f17c

File tree

12 files changed

+21525
-24286
lines changed

12 files changed

+21525
-24286
lines changed

dist/136.index.js

Lines changed: 1235 additions & 0 deletions
Large diffs are not rendered by default.

dist/360.index.js

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
"use strict";
2+
exports.id = 360;
3+
exports.ids = [360];
4+
exports.modules = {
5+
6+
/***/ 5360:
7+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8+
9+
10+
11+
var sharedIniFileLoader = __webpack_require__(4964);
12+
var propertyProvider = __webpack_require__(1238);
13+
var child_process = __webpack_require__(5317);
14+
var util = __webpack_require__(9023);
15+
var client = __webpack_require__(5152);
16+
17+
const getValidatedProcessCredentials = (profileName, data, profiles) => {
18+
if (data.Version !== 1) {
19+
throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
20+
}
21+
if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) {
22+
throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
23+
}
24+
if (data.Expiration) {
25+
const currentTime = new Date();
26+
const expireTime = new Date(data.Expiration);
27+
if (expireTime < currentTime) {
28+
throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
29+
}
30+
}
31+
let accountId = data.AccountId;
32+
if (!accountId && profiles?.[profileName]?.aws_account_id) {
33+
accountId = profiles[profileName].aws_account_id;
34+
}
35+
const credentials = {
36+
accessKeyId: data.AccessKeyId,
37+
secretAccessKey: data.SecretAccessKey,
38+
...(data.SessionToken && { sessionToken: data.SessionToken }),
39+
...(data.Expiration && { expiration: new Date(data.Expiration) }),
40+
...(data.CredentialScope && { credentialScope: data.CredentialScope }),
41+
...(accountId && { accountId }),
42+
};
43+
client.setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
44+
return credentials;
45+
};
46+
47+
const resolveProcessCredentials = async (profileName, profiles, logger) => {
48+
const profile = profiles[profileName];
49+
if (profiles[profileName]) {
50+
const credentialProcess = profile["credential_process"];
51+
if (credentialProcess !== undefined) {
52+
const execPromise = util.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? child_process.exec);
53+
try {
54+
const { stdout } = await execPromise(credentialProcess);
55+
let data;
56+
try {
57+
data = JSON.parse(stdout.trim());
58+
}
59+
catch {
60+
throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
61+
}
62+
return getValidatedProcessCredentials(profileName, data, profiles);
63+
}
64+
catch (error) {
65+
throw new propertyProvider.CredentialsProviderError(error.message, { logger });
66+
}
67+
}
68+
else {
69+
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });
70+
}
71+
}
72+
else {
73+
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
74+
logger,
75+
});
76+
}
77+
};
78+
79+
const fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {
80+
init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
81+
const profiles = await sharedIniFileLoader.parseKnownFiles(init);
82+
return resolveProcessCredentials(sharedIniFileLoader.getProfileName({
83+
profile: init.profile ?? callerClientConfig?.profile,
84+
}), profiles, init.logger);
85+
};
86+
87+
exports.fromProcess = fromProcess;
88+
89+
90+
/***/ })
91+
92+
};
93+
;

0 commit comments

Comments
 (0)