@granite-js/pulumi-aws 0.1.19 → 0.1.21

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/chunk-5W7B34BN.js +3307 -0
  3. package/dist/chunk-64IS37V6.js +17 -0
  4. package/dist/chunk-AEOST5WF.js +63 -0
  5. package/dist/chunk-B7OAPHPY.js +46 -0
  6. package/dist/chunk-FO7L563E.js +13695 -0
  7. package/dist/chunk-FRWSD3YQ.js +1722 -0
  8. package/dist/chunk-IEZY5C3G.js +120 -0
  9. package/dist/chunk-ITI6QA2Q.js +12 -0
  10. package/dist/chunk-IUKLHJNE.js +49 -0
  11. package/dist/chunk-JBVMOFGH.js +152 -0
  12. package/dist/chunk-JSBRDJBE.js +30 -0
  13. package/dist/chunk-KGNTV362.js +209 -0
  14. package/dist/chunk-KRJS4RAS.js +1732 -0
  15. package/dist/chunk-M5GUUX64.js +63 -0
  16. package/dist/chunk-QAE2S7MG.js +3351 -0
  17. package/dist/chunk-SX6SVQKS.js +67 -0
  18. package/dist/chunk-TJ744C2T.js +198 -0
  19. package/dist/chunk-UNXXS5FM.js +120 -0
  20. package/dist/chunk-UT2RMOJS.js +2447 -0
  21. package/dist/chunk-VOTRVWIB.js +1965 -0
  22. package/dist/chunk-W3VXP3A3.js +119 -0
  23. package/dist/chunk-WCHHWTND.js +113 -0
  24. package/dist/chunk-X6XO7USX.js +110 -0
  25. package/dist/chunk-XLUI7RQ4.js +115 -0
  26. package/dist/dist-es-2M7RLZ5O.js +200 -0
  27. package/dist/dist-es-ADTONJUN-RVFWNZHO.js +67 -0
  28. package/dist/dist-es-CDFIYJVE.js +163 -0
  29. package/dist/dist-es-GHYMLBON.js +379 -0
  30. package/dist/dist-es-HJVOMDYC-PIAMWMAL.js +87 -0
  31. package/dist/dist-es-IDBDK36G-Y6TQMRO5.js +299 -0
  32. package/dist/dist-es-OCQVKISC-TNAJ62WG.js +161 -0
  33. package/dist/dist-es-OZGLUDWT.js +305 -0
  34. package/dist/dist-es-PRWCVZGQ-HTTVI42T.js +21 -0
  35. package/dist/dist-es-S75EKWRJ.js +88 -0
  36. package/dist/dist-es-SUPEA6VE-3B5JSW5C.js +368 -0
  37. package/dist/dist-es-WQHDOVD7.js +21 -0
  38. package/dist/dist-es-XQME5F6W.js +67 -0
  39. package/dist/dist-es-Y7VN37H5-WQ3GYROF.js +196 -0
  40. package/dist/lambda/auto-cache-removal.d.cts +17 -0
  41. package/dist/lambda/auto-cache-removal.d.ts +17 -0
  42. package/dist/lambda/auto-cache-removal.js +5313 -0
  43. package/dist/lambda/origin-request.d.cts +14 -0
  44. package/dist/lambda/origin-request.d.ts +14 -0
  45. package/dist/lambda/origin-request.js +113 -0
  46. package/dist/lambda/origin-response.d.cts +6 -0
  47. package/dist/lambda/origin-response.d.ts +6 -0
  48. package/dist/lambda/origin-response.js +52 -0
  49. package/dist/loadSso-CZSSLFH6-SA5HOQAX.js +645 -0
  50. package/dist/loadSso-T7GJVVO2.js +655 -0
  51. package/dist/sso-oidc-55SJ27II.js +827 -0
  52. package/dist/sso-oidc-PKO5GYK5-LC65L46O.js +820 -0
  53. package/dist/sts-OPF4H3GL.js +1162 -0
  54. package/dist/sts-P7Q3MYTS-BKGWHQE4.js +1152 -0
  55. package/lambda/auto-cache-removal.d.ts +1 -0
  56. package/lambda/origin-request.d.ts +1 -0
  57. package/lambda/origin-response.d.ts +1 -0
  58. package/package.json +37 -10
@@ -0,0 +1,305 @@
1
+ import {
2
+ getProfileName,
3
+ getSSOTokenFilepath,
4
+ getSSOTokenFromFile,
5
+ loadSsoSessionData,
6
+ parseKnownFiles
7
+ } from "./chunk-KGNTV362.js";
8
+ import {
9
+ setCredentialFeature
10
+ } from "./chunk-ITI6QA2Q.js";
11
+ import "./chunk-M5GUUX64.js";
12
+ import {
13
+ CredentialsProviderError,
14
+ TokenProviderError
15
+ } from "./chunk-W3VXP3A3.js";
16
+ import "./chunk-JSBRDJBE.js";
17
+
18
+ // ../../.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.817.0-594516ea78-5f5d4569c9.zip/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
19
+ var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
20
+
21
+ // ../../.yarn/cache/@aws-sdk-token-providers-npm-3.817.0-fe7c07f79c-fdb06b3bb2.zip/node_modules/@aws-sdk/token-providers/dist-es/constants.js
22
+ var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
23
+ var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
24
+
25
+ // ../../.yarn/cache/@aws-sdk-token-providers-npm-3.817.0-fe7c07f79c-fdb06b3bb2.zip/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
26
+ var getSsoOidcClient = async (ssoRegion, init = {}) => {
27
+ const { SSOOIDCClient } = await import("./sso-oidc-55SJ27II.js");
28
+ const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
29
+ region: ssoRegion ?? init.clientConfig?.region,
30
+ logger: init.clientConfig?.logger ?? init.parentClientConfig?.logger
31
+ }));
32
+ return ssoOidcClient;
33
+ };
34
+
35
+ // ../../.yarn/cache/@aws-sdk-token-providers-npm-3.817.0-fe7c07f79c-fdb06b3bb2.zip/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
36
+ var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}) => {
37
+ const { CreateTokenCommand } = await import("./sso-oidc-55SJ27II.js");
38
+ const ssoOidcClient = await getSsoOidcClient(ssoRegion, init);
39
+ return ssoOidcClient.send(new CreateTokenCommand({
40
+ clientId: ssoToken.clientId,
41
+ clientSecret: ssoToken.clientSecret,
42
+ refreshToken: ssoToken.refreshToken,
43
+ grantType: "refresh_token"
44
+ }));
45
+ };
46
+
47
+ // ../../.yarn/cache/@aws-sdk-token-providers-npm-3.817.0-fe7c07f79c-fdb06b3bb2.zip/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
48
+ var validateTokenExpiry = (token) => {
49
+ if (token.expiration && token.expiration.getTime() < Date.now()) {
50
+ throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
51
+ }
52
+ };
53
+
54
+ // ../../.yarn/cache/@aws-sdk-token-providers-npm-3.817.0-fe7c07f79c-fdb06b3bb2.zip/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
55
+ var validateTokenKey = (key, value, forRefresh = false) => {
56
+ if (typeof value === "undefined") {
57
+ throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
58
+ }
59
+ };
60
+
61
+ // ../../.yarn/cache/@aws-sdk-token-providers-npm-3.817.0-fe7c07f79c-fdb06b3bb2.zip/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
62
+ import { promises as fsPromises } from "fs";
63
+ var { writeFile } = fsPromises;
64
+ var writeSSOTokenToFile = (id, ssoToken) => {
65
+ const tokenFilepath = getSSOTokenFilepath(id);
66
+ const tokenString = JSON.stringify(ssoToken, null, 2);
67
+ return writeFile(tokenFilepath, tokenString);
68
+ };
69
+
70
+ // ../../.yarn/cache/@aws-sdk-token-providers-npm-3.817.0-fe7c07f79c-fdb06b3bb2.zip/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
71
+ var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
72
+ var fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => {
73
+ const init = {
74
+ ..._init,
75
+ parentClientConfig: {
76
+ ...callerClientConfig,
77
+ ..._init.parentClientConfig
78
+ }
79
+ };
80
+ init.logger?.debug("@aws-sdk/token-providers - fromSso");
81
+ const profiles = await parseKnownFiles(init);
82
+ const profileName = getProfileName({
83
+ profile: init.profile ?? callerClientConfig?.profile
84
+ });
85
+ const profile = profiles[profileName];
86
+ if (!profile) {
87
+ throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
88
+ } else if (!profile["sso_session"]) {
89
+ throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
90
+ }
91
+ const ssoSessionName = profile["sso_session"];
92
+ const ssoSessions = await loadSsoSessionData(init);
93
+ const ssoSession = ssoSessions[ssoSessionName];
94
+ if (!ssoSession) {
95
+ throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
96
+ }
97
+ for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
98
+ if (!ssoSession[ssoSessionRequiredKey]) {
99
+ throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
100
+ }
101
+ }
102
+ const ssoStartUrl = ssoSession["sso_start_url"];
103
+ const ssoRegion = ssoSession["sso_region"];
104
+ let ssoToken;
105
+ try {
106
+ ssoToken = await getSSOTokenFromFile(ssoSessionName);
107
+ } catch (e) {
108
+ throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
109
+ }
110
+ validateTokenKey("accessToken", ssoToken.accessToken);
111
+ validateTokenKey("expiresAt", ssoToken.expiresAt);
112
+ const { accessToken, expiresAt } = ssoToken;
113
+ const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
114
+ if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
115
+ return existingToken;
116
+ }
117
+ if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
118
+ validateTokenExpiry(existingToken);
119
+ return existingToken;
120
+ }
121
+ validateTokenKey("clientId", ssoToken.clientId, true);
122
+ validateTokenKey("clientSecret", ssoToken.clientSecret, true);
123
+ validateTokenKey("refreshToken", ssoToken.refreshToken, true);
124
+ try {
125
+ lastRefreshAttemptTime.setTime(Date.now());
126
+ const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init);
127
+ validateTokenKey("accessToken", newSsoOidcToken.accessToken);
128
+ validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
129
+ const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
130
+ try {
131
+ await writeSSOTokenToFile(ssoSessionName, {
132
+ ...ssoToken,
133
+ accessToken: newSsoOidcToken.accessToken,
134
+ expiresAt: newTokenExpiration.toISOString(),
135
+ refreshToken: newSsoOidcToken.refreshToken
136
+ });
137
+ } catch (error) {
138
+ }
139
+ return {
140
+ token: newSsoOidcToken.accessToken,
141
+ expiration: newTokenExpiration
142
+ };
143
+ } catch (error) {
144
+ validateTokenExpiry(existingToken);
145
+ return existingToken;
146
+ }
147
+ };
148
+
149
+ // ../../.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.817.0-594516ea78-5f5d4569c9.zip/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
150
+ var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
151
+ var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, logger }) => {
152
+ let token;
153
+ const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
154
+ if (ssoSession) {
155
+ try {
156
+ const _token = await fromSso({ profile })();
157
+ token = {
158
+ accessToken: _token.token,
159
+ expiresAt: new Date(_token.expiration).toISOString()
160
+ };
161
+ } catch (e) {
162
+ throw new CredentialsProviderError(e.message, {
163
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
164
+ logger
165
+ });
166
+ }
167
+ } else {
168
+ try {
169
+ token = await getSSOTokenFromFile(ssoStartUrl);
170
+ } catch (e) {
171
+ throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
172
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
173
+ logger
174
+ });
175
+ }
176
+ }
177
+ if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
178
+ throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
179
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
180
+ logger
181
+ });
182
+ }
183
+ const { accessToken } = token;
184
+ const { SSOClient, GetRoleCredentialsCommand } = await import("./loadSso-T7GJVVO2.js");
185
+ const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig ?? {}, {
186
+ logger: clientConfig?.logger ?? parentClientConfig?.logger,
187
+ region: clientConfig?.region ?? ssoRegion
188
+ }));
189
+ let ssoResp;
190
+ try {
191
+ ssoResp = await sso.send(new GetRoleCredentialsCommand({
192
+ accountId: ssoAccountId,
193
+ roleName: ssoRoleName,
194
+ accessToken
195
+ }));
196
+ } catch (e) {
197
+ throw new CredentialsProviderError(e, {
198
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
199
+ logger
200
+ });
201
+ }
202
+ const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
203
+ if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
204
+ throw new CredentialsProviderError("SSO returns an invalid temporary credential.", {
205
+ tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
206
+ logger
207
+ });
208
+ }
209
+ const credentials = {
210
+ accessKeyId,
211
+ secretAccessKey,
212
+ sessionToken,
213
+ expiration: new Date(expiration),
214
+ ...credentialScope && { credentialScope },
215
+ ...accountId && { accountId }
216
+ };
217
+ if (ssoSession) {
218
+ setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
219
+ } else {
220
+ setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
221
+ }
222
+ return credentials;
223
+ };
224
+
225
+ // ../../.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.817.0-594516ea78-5f5d4569c9.zip/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
226
+ var validateSsoProfile = (profile, logger) => {
227
+ const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
228
+ if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
229
+ throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}
230
+ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });
231
+ }
232
+ return profile;
233
+ };
234
+
235
+ // ../../.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.817.0-594516ea78-5f5d4569c9.zip/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
236
+ var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
237
+ init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
238
+ const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
239
+ const { ssoClient } = init;
240
+ const profileName = getProfileName({
241
+ profile: init.profile ?? callerClientConfig?.profile
242
+ });
243
+ if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
244
+ const profiles = await parseKnownFiles(init);
245
+ const profile = profiles[profileName];
246
+ if (!profile) {
247
+ throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
248
+ }
249
+ if (!isSsoProfile(profile)) {
250
+ throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
251
+ logger: init.logger
252
+ });
253
+ }
254
+ if (profile?.sso_session) {
255
+ const ssoSessions = await loadSsoSessionData(init);
256
+ const session = ssoSessions[profile.sso_session];
257
+ const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
258
+ if (ssoRegion && ssoRegion !== session.sso_region) {
259
+ throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
260
+ tryNextLink: false,
261
+ logger: init.logger
262
+ });
263
+ }
264
+ if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
265
+ throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
266
+ tryNextLink: false,
267
+ logger: init.logger
268
+ });
269
+ }
270
+ profile.sso_region = session.sso_region;
271
+ profile.sso_start_url = session.sso_start_url;
272
+ }
273
+ const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);
274
+ return resolveSSOCredentials({
275
+ ssoStartUrl: sso_start_url,
276
+ ssoSession: sso_session,
277
+ ssoAccountId: sso_account_id,
278
+ ssoRegion: sso_region,
279
+ ssoRoleName: sso_role_name,
280
+ ssoClient,
281
+ clientConfig: init.clientConfig,
282
+ parentClientConfig: init.parentClientConfig,
283
+ profile: profileName
284
+ });
285
+ } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
286
+ throw new CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger });
287
+ } else {
288
+ return resolveSSOCredentials({
289
+ ssoStartUrl,
290
+ ssoSession,
291
+ ssoAccountId,
292
+ ssoRegion,
293
+ ssoRoleName,
294
+ ssoClient,
295
+ clientConfig: init.clientConfig,
296
+ parentClientConfig: init.parentClientConfig,
297
+ profile: profileName
298
+ });
299
+ }
300
+ };
301
+ export {
302
+ fromSSO,
303
+ isSsoProfile,
304
+ validateSsoProfile
305
+ };
@@ -0,0 +1,21 @@
1
+ import {
2
+ ENV_ACCOUNT_ID,
3
+ ENV_CREDENTIAL_SCOPE,
4
+ ENV_EXPIRATION,
5
+ ENV_KEY,
6
+ ENV_SECRET,
7
+ ENV_SESSION,
8
+ fromEnv
9
+ } from "./chunk-IUKLHJNE.js";
10
+ import "./chunk-64IS37V6.js";
11
+ import "./chunk-JBVMOFGH.js";
12
+ import "./chunk-JSBRDJBE.js";
13
+ export {
14
+ ENV_ACCOUNT_ID,
15
+ ENV_CREDENTIAL_SCOPE,
16
+ ENV_EXPIRATION,
17
+ ENV_KEY,
18
+ ENV_SECRET,
19
+ ENV_SESSION,
20
+ fromEnv
21
+ };
@@ -0,0 +1,88 @@
1
+ import {
2
+ getProfileName,
3
+ parseKnownFiles
4
+ } from "./chunk-KGNTV362.js";
5
+ import {
6
+ setCredentialFeature
7
+ } from "./chunk-ITI6QA2Q.js";
8
+ import "./chunk-M5GUUX64.js";
9
+ import {
10
+ CredentialsProviderError
11
+ } from "./chunk-W3VXP3A3.js";
12
+ import "./chunk-JSBRDJBE.js";
13
+
14
+ // ../../.yarn/cache/@aws-sdk-credential-provider-process-npm-3.816.0-ddba2f8310-fb8356f56b.zip/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
15
+ import { exec } from "child_process";
16
+ import { promisify } from "util";
17
+
18
+ // ../../.yarn/cache/@aws-sdk-credential-provider-process-npm-3.816.0-ddba2f8310-fb8356f56b.zip/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js
19
+ var getValidatedProcessCredentials = (profileName, data, profiles) => {
20
+ if (data.Version !== 1) {
21
+ throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
22
+ }
23
+ if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) {
24
+ throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
25
+ }
26
+ if (data.Expiration) {
27
+ const currentTime = /* @__PURE__ */ new Date();
28
+ const expireTime = new Date(data.Expiration);
29
+ if (expireTime < currentTime) {
30
+ throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
31
+ }
32
+ }
33
+ let accountId = data.AccountId;
34
+ if (!accountId && profiles?.[profileName]?.aws_account_id) {
35
+ accountId = profiles[profileName].aws_account_id;
36
+ }
37
+ const credentials = {
38
+ accessKeyId: data.AccessKeyId,
39
+ secretAccessKey: data.SecretAccessKey,
40
+ ...data.SessionToken && { sessionToken: data.SessionToken },
41
+ ...data.Expiration && { expiration: new Date(data.Expiration) },
42
+ ...data.CredentialScope && { credentialScope: data.CredentialScope },
43
+ ...accountId && { accountId }
44
+ };
45
+ setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
46
+ return credentials;
47
+ };
48
+
49
+ // ../../.yarn/cache/@aws-sdk-credential-provider-process-npm-3.816.0-ddba2f8310-fb8356f56b.zip/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
50
+ var resolveProcessCredentials = async (profileName, profiles, logger) => {
51
+ const profile = profiles[profileName];
52
+ if (profiles[profileName]) {
53
+ const credentialProcess = profile["credential_process"];
54
+ if (credentialProcess !== void 0) {
55
+ const execPromise = promisify(exec);
56
+ try {
57
+ const { stdout } = await execPromise(credentialProcess);
58
+ let data;
59
+ try {
60
+ data = JSON.parse(stdout.trim());
61
+ } catch {
62
+ throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
63
+ }
64
+ return getValidatedProcessCredentials(profileName, data, profiles);
65
+ } catch (error) {
66
+ throw new CredentialsProviderError(error.message, { logger });
67
+ }
68
+ } else {
69
+ throw new CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });
70
+ }
71
+ } else {
72
+ throw new CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
73
+ logger
74
+ });
75
+ }
76
+ };
77
+
78
+ // ../../.yarn/cache/@aws-sdk-credential-provider-process-npm-3.816.0-ddba2f8310-fb8356f56b.zip/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js
79
+ var fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {
80
+ init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
81
+ const profiles = await parseKnownFiles(init);
82
+ return resolveProcessCredentials(getProfileName({
83
+ profile: init.profile ?? callerClientConfig?.profile
84
+ }), profiles, init.logger);
85
+ };
86
+ export {
87
+ fromProcess
88
+ };