@kky42/pievo-server 2.4.14 → 3.0.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/.output/nitro.json +1 -1
- package/.output/public/assets/{actionUi-5PtES4q0.js → actionUi-BZrLpgHT.js} +1 -1
- package/.output/public/assets/app-DXLuQNb9.css +2 -0
- package/.output/public/assets/index-Di_wpAtL.js +10 -0
- package/.output/public/assets/loops._loopId-X3ClNPMY.js +67 -0
- package/.output/public/assets/loops._loopId_.runs._runId-ByU2BSyF.js +3 -0
- package/.output/public/assets/preload-helper-hRTYB_ju.js +3 -0
- package/.output/public/assets/{routes-Dm_3J2aV.js → routes-BIOJZsig.js} +1 -1
- package/.output/public/assets/routes-K8D5uBiV.js +1 -0
- package/.output/server/_chunks/ssr-renderer.mjs +1 -1
- package/.output/server/_libs/{drizzle-orm+postgres.mjs → drizzle-orm.mjs} +93 -2218
- package/.output/server/_ssr/{MachinesModal-BaEtzycr.mjs → MachinesModal-CmVMec6B.mjs} +46 -46
- package/.output/server/_ssr/{actionUi-5HOCZnom.mjs → actionUi-DE-Pb2tv.mjs} +1 -2
- package/.output/server/_ssr/{artifactFiles-DO43wwXA.mjs → artifactFiles-Di1xDKvX.mjs} +5 -8
- package/.output/server/_ssr/{artifactKind-DwDr8IYc.mjs → artifactKind-DqpmtxDU.mjs} +3 -9
- package/.output/server/_ssr/{boot-C472kLwY.mjs → boot-CYRi-wez.mjs} +2152 -351
- package/.output/server/_ssr/lifecycleUi-BsbUsi5K.mjs +106 -0
- package/.output/server/_ssr/{loopApi-DT751TJA.mjs → loopApi-Bez1rHV0.mjs} +50 -66
- package/.output/server/_ssr/{loopProjection-qaD2I48a.mjs → loopProjection-esCjyZJg.mjs} +4 -23
- package/.output/server/_ssr/{loops._loopId-CXgw2Rz1.mjs → loops._loopId-KUezNY69.mjs} +8 -23
- package/.output/server/_ssr/{loops._loopId_.runs._runId-Dk94Z0Jq.mjs → loops._loopId_.runs._runId-BFP9oMrp.mjs} +2 -7
- package/.output/server/_ssr/{loops._loopId_.runs._runId-SASSqOfy.mjs → loops._loopId_.runs._runId-DOkUEesG.mjs} +18 -33
- package/.output/server/_ssr/{machineFns-BSrIgn3f.mjs → machineFns-CniGcY8s.mjs} +13 -50
- package/.output/server/_ssr/networkAccess-CIlK3ION.mjs +30 -0
- package/.output/server/_ssr/router-BFIH2UAE.mjs +362 -0
- package/.output/server/_ssr/routes-BSVBANI3.mjs +12 -0
- package/.output/server/_ssr/{routes-Cr-9yDEH.mjs → routes-DnE7XDe_.mjs} +91 -50
- package/.output/server/_ssr/{routes-DRBS4Zi4.mjs → routes-ngpX7h8D.mjs} +2 -4
- package/.output/server/_ssr/ssr.mjs +25 -34
- package/.output/server/_ssr/start-B5_9Z5W-.mjs +35 -0
- package/.output/server/{_tanstack-start-manifest_v-DxLIQ0cc.mjs → _tanstack-start-manifest_v-DnwAupbZ.mjs} +8 -13
- package/.output/server/drizzle/0000_baseline.sql +6 -97
- package/.output/server/drizzle/meta/_journal.json +2 -23
- package/.output/server/index.mjs +45 -52
- package/drizzle/0000_baseline.sql +6 -97
- package/drizzle/meta/_journal.json +2 -23
- package/package.json +4 -8
- package/scripts/pievo-server.mjs +49 -47
- package/scripts/server-cli-lib.mjs +21 -12
- package/scripts/server-network.mjs +139 -0
- package/.output/public/assets/SignIn-CIFwnZtF.js +0 -1
- package/.output/public/assets/app-DvHMhs7S.css +0 -2
- package/.output/public/assets/index-CRX2pu0W.js +0 -10
- package/.output/public/assets/loops._loopId-BsuV-Rmf.js +0 -67
- package/.output/public/assets/loops._loopId_.runs._runId-DpK_fzmZ.js +0 -3
- package/.output/public/assets/preload-helper-sAZOZb3G.js +0 -5
- package/.output/public/assets/routes-DxF_s3cD.js +0 -1
- package/.output/server/_libs/@aws-crypto/crc32+[...].mjs +0 -419
- package/.output/server/_libs/@aws-sdk/checksums+[...].mjs +0 -10732
- package/.output/server/_libs/@aws-sdk/client-s3+[...].mjs +0 -9475
- package/.output/server/_libs/@aws-sdk/credential-provider-http+[...].mjs +0 -137
- package/.output/server/_libs/@aws-sdk/credential-provider-ini+[...].mjs +0 -440
- package/.output/server/_libs/@aws-sdk/credential-provider-process+[...].mjs +0 -62
- package/.output/server/_libs/@aws-sdk/credential-provider-sso+[...].mjs +0 -818
- package/.output/server/_libs/@aws-sdk/credential-provider-web-identity+[...].mjs +0 -59
- package/.output/server/_libs/@smithy/credential-provider-imds+[...].mjs +0 -342
- package/.output/server/_libs/aws-crypto__crc32c.mjs +0 -314
- package/.output/server/_libs/aws-sdk__nested-clients.mjs +0 -2671
- package/.output/server/_ssr/SignIn-sHQaBQJC.mjs +0 -53
- package/.output/server/_ssr/artifacts-Cd7Qx3Qp.mjs +0 -2
- package/.output/server/_ssr/auth-0AamrwHo.mjs +0 -38355
- package/.output/server/_ssr/auth-client-lSMb_Idt.mjs +0 -1070
- package/.output/server/_ssr/bun-sqlite-dialect-BW9W1_Ps-DLIXocA0.mjs +0 -162
- package/.output/server/_ssr/core-RrmWoKne.mjs +0 -5
- package/.output/server/_ssr/d1-sqlite-dialect-BLC8LXE6-BoFMIPr_.mjs +0 -112
- package/.output/server/_ssr/db-BzvMQ2kx.mjs +0 -2
- package/.output/server/_ssr/dist-ClzqkwxD.mjs +0 -342
- package/.output/server/_ssr/factory-ixUjZqJn.mjs +0 -6903
- package/.output/server/_ssr/kysely-adapter-DkZbmKgV.mjs +0 -2
- package/.output/server/_ssr/kysely-migration-tables-JkVUjPF_-bPAX9LR_.mjs +0 -19
- package/.output/server/_ssr/logger-DDjsYB2X.mjs +0 -2
- package/.output/server/_ssr/loopTags-CXx5UdGf.mjs +0 -3356
- package/.output/server/_ssr/node-sqlite-dialect-BbUqnnYv.mjs +0 -162
- package/.output/server/_ssr/router-BlLlhfJe.mjs +0 -543
- package/.output/server/_ssr/routes-DTBltabU.mjs +0 -27
- package/.output/server/_ssr/start-4ifArtKx.mjs +0 -4
- package/.output/server/_ssr/store-vDZ9INSa.mjs +0 -2
- package/.output/server/_ssr/tokens-BHiCElYD.mjs +0 -2
- package/.output/server/drizzle/0001_add_pi_agent.sql +0 -9
- package/.output/server/drizzle/0002_remove_teams.sql +0 -15
- package/.output/server/drizzle/0003_add_loop_tags.sql +0 -5
- package/.output/server/node_modules/tslib/modules/index.js +0 -70
- package/.output/server/node_modules/tslib/modules/package.json +0 -3
- package/.output/server/node_modules/tslib/package.json +0 -47
- package/.output/server/node_modules/tslib/tslib.js +0 -484
- package/.output/server/package.json +0 -9
- package/drizzle/0001_add_pi_agent.sql +0 -9
- package/drizzle/0002_remove_teams.sql +0 -15
- package/drizzle/0003_add_loop_tags.sql +0 -5
- package/scripts/prestart.mjs +0 -66
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { r as __exportAll } from "../../_runtime.mjs";
|
|
2
|
-
import { a as require_client, c as require_protocols, f as require_config, u as require_serde } from "./checksums+[...].mjs";
|
|
3
|
-
import { i as NodeHttpHandler, r as init_dist_es } from "./client-s3+[...].mjs";
|
|
4
|
-
import fs$1 from "node:fs/promises";
|
|
5
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.972.51/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js
|
|
6
|
-
var import_protocols = require_protocols();
|
|
7
|
-
var import_client = require_client();
|
|
8
|
-
init_dist_es();
|
|
9
|
-
var import_config = require_config();
|
|
10
|
-
var ECS_CONTAINER_HOST = "169.254.170.2";
|
|
11
|
-
var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
|
|
12
|
-
var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
|
|
13
|
-
var checkUrl = (url, logger) => {
|
|
14
|
-
if (url.protocol === "https:") return;
|
|
15
|
-
if (url.hostname === ECS_CONTAINER_HOST || url.hostname === EKS_CONTAINER_HOST_IPv4 || url.hostname === EKS_CONTAINER_HOST_IPv6) return;
|
|
16
|
-
if (url.hostname.includes("[")) {
|
|
17
|
-
if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") return;
|
|
18
|
-
} else {
|
|
19
|
-
if (url.hostname === "localhost") return;
|
|
20
|
-
const ipComponents = url.hostname.split(".");
|
|
21
|
-
const inRange = (component) => {
|
|
22
|
-
const num = parseInt(component, 10);
|
|
23
|
-
return 0 <= num && num <= 255;
|
|
24
|
-
};
|
|
25
|
-
if (ipComponents[0] === "127" && inRange(ipComponents[1]) && inRange(ipComponents[2]) && inRange(ipComponents[3]) && ipComponents.length === 4) return;
|
|
26
|
-
}
|
|
27
|
-
throw new import_config.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
28
|
-
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
29
|
-
- ECS container host 169.254.170.2
|
|
30
|
-
- EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger });
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.972.51/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js
|
|
34
|
-
var import_serde = require_serde();
|
|
35
|
-
function createGetRequest(url) {
|
|
36
|
-
return new import_protocols.HttpRequest({
|
|
37
|
-
protocol: url.protocol,
|
|
38
|
-
hostname: url.hostname,
|
|
39
|
-
port: Number(url.port),
|
|
40
|
-
path: url.pathname,
|
|
41
|
-
query: Array.from(url.searchParams.entries()).reduce((acc, [k, v]) => {
|
|
42
|
-
acc[k] = v;
|
|
43
|
-
return acc;
|
|
44
|
-
}, {}),
|
|
45
|
-
fragment: url.hash
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
async function getCredentials(response, logger) {
|
|
49
|
-
const str = await (0, import_serde.sdkStreamMixin)(response.body).transformToString();
|
|
50
|
-
if (response.statusCode === 200) {
|
|
51
|
-
const parsed = JSON.parse(str);
|
|
52
|
-
if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") throw new import_config.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger });
|
|
53
|
-
return {
|
|
54
|
-
accessKeyId: parsed.AccessKeyId,
|
|
55
|
-
secretAccessKey: parsed.SecretAccessKey,
|
|
56
|
-
sessionToken: parsed.Token,
|
|
57
|
-
expiration: (0, import_serde.parseRfc3339DateTime)(parsed.Expiration)
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
if (response.statusCode >= 400 && response.statusCode < 500) {
|
|
61
|
-
let parsedBody = {};
|
|
62
|
-
try {
|
|
63
|
-
parsedBody = JSON.parse(str);
|
|
64
|
-
} catch (e) {}
|
|
65
|
-
throw Object.assign(new import_config.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }), {
|
|
66
|
-
Code: parsedBody.Code,
|
|
67
|
-
Message: parsedBody.Message
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
throw new import_config.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger });
|
|
71
|
-
}
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.972.51/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js
|
|
74
|
-
var retryWrapper = (toRetry, maxRetries, delayMs) => {
|
|
75
|
-
return async () => {
|
|
76
|
-
for (let i = 0; i < maxRetries; ++i) try {
|
|
77
|
-
return await toRetry();
|
|
78
|
-
} catch (e) {
|
|
79
|
-
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
80
|
-
}
|
|
81
|
-
return await toRetry();
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.972.51/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js
|
|
86
|
-
var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
|
|
87
|
-
var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2";
|
|
88
|
-
var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
|
|
89
|
-
var AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE";
|
|
90
|
-
var AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
|
|
91
|
-
var fromHttp = (options = {}) => {
|
|
92
|
-
options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
|
|
93
|
-
let host;
|
|
94
|
-
const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
|
|
95
|
-
const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
|
|
96
|
-
const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
|
|
97
|
-
const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
|
|
98
|
-
const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn ? console.warn : options.logger.warn.bind(options.logger);
|
|
99
|
-
if (relative && full) {
|
|
100
|
-
warn("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
|
|
101
|
-
warn("awsContainerCredentialsFullUri will take precedence.");
|
|
102
|
-
}
|
|
103
|
-
if (token && tokenFile) {
|
|
104
|
-
warn("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.");
|
|
105
|
-
warn("awsContainerAuthorizationToken will take precedence.");
|
|
106
|
-
}
|
|
107
|
-
if (full) host = full;
|
|
108
|
-
else if (relative) host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`;
|
|
109
|
-
else throw new import_config.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
110
|
-
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
|
|
111
|
-
const url = new URL(host);
|
|
112
|
-
checkUrl(url, options.logger);
|
|
113
|
-
const requestHandler = NodeHttpHandler.create({ connectionTimeout: options.timeout ?? 1e3 });
|
|
114
|
-
const requestTimeout = options.timeout ?? 1e3;
|
|
115
|
-
const provider = retryWrapper(async () => {
|
|
116
|
-
const request = createGetRequest(url);
|
|
117
|
-
if (token) request.headers.Authorization = token;
|
|
118
|
-
else if (tokenFile) request.headers.Authorization = (await fs$1.readFile(tokenFile)).toString();
|
|
119
|
-
try {
|
|
120
|
-
return getCredentials((await requestHandler.handle(request, { requestTimeout })).response).then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_HTTP", "z"));
|
|
121
|
-
} catch (e) {
|
|
122
|
-
throw new import_config.CredentialsProviderError(String(e), { logger: options.logger });
|
|
123
|
-
}
|
|
124
|
-
}, options.maxRetries ?? 3, options.timeout ?? 1e3);
|
|
125
|
-
return async () => {
|
|
126
|
-
try {
|
|
127
|
-
return await provider();
|
|
128
|
-
} finally {
|
|
129
|
-
requestHandler.destroy?.();
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
//#endregion
|
|
134
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.972.51/node_modules/@aws-sdk/credential-provider-http/dist-es/index.js
|
|
135
|
-
var dist_es_exports = /* @__PURE__ */ __exportAll({ fromHttp: () => fromHttp });
|
|
136
|
-
//#endregion
|
|
137
|
-
export { dist_es_exports as t };
|
|
@@ -1,440 +0,0 @@
|
|
|
1
|
-
import { o as __toESM, r as __exportAll } from "../../_runtime.mjs";
|
|
2
|
-
import { a as require_client, c as require_protocols, f as require_config } from "./checksums+[...].mjs";
|
|
3
|
-
import { createHash, createPrivateKey, createPublicKey, sign } from "node:crypto";
|
|
4
|
-
import { promises } from "node:fs";
|
|
5
|
-
import { dirname, join } from "node:path";
|
|
6
|
-
import { homedir } from "node:os";
|
|
7
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js
|
|
8
|
-
var import_protocols = require_protocols();
|
|
9
|
-
var import_client = require_client();
|
|
10
|
-
var import_config = require_config();
|
|
11
|
-
var resolveCredentialSource = (credentialSource, profileName, logger) => {
|
|
12
|
-
const sourceProvidersMap = {
|
|
13
|
-
EcsContainer: async (options) => {
|
|
14
|
-
const { fromHttp } = await import("./credential-provider-http+[...].mjs").then((n) => n.t);
|
|
15
|
-
const { fromContainerMetadata } = await import("../@smithy/credential-provider-imds+[...].mjs").then((n) => n.t);
|
|
16
|
-
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
|
|
17
|
-
return async () => (0, import_config.chain)(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
|
|
18
|
-
},
|
|
19
|
-
Ec2InstanceMetadata: async (options) => {
|
|
20
|
-
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
|
|
21
|
-
const { fromInstanceMetadata } = await import("../@smithy/credential-provider-imds+[...].mjs").then((n) => n.t);
|
|
22
|
-
return async () => fromInstanceMetadata(options)().then(setNamedProvider);
|
|
23
|
-
},
|
|
24
|
-
Environment: async (options) => {
|
|
25
|
-
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
|
26
|
-
const { fromEnv } = await import("./client-s3+[...].mjs").then((n) => n.o);
|
|
27
|
-
return async () => fromEnv(options)().then(setNamedProvider);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
if (credentialSource in sourceProvidersMap) return sourceProvidersMap[credentialSource];
|
|
31
|
-
else throw new import_config.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });
|
|
32
|
-
};
|
|
33
|
-
var setNamedProvider = (creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p");
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js
|
|
36
|
-
var isAssumeRoleProfile = (arg, { profile = "default", logger } = {}) => {
|
|
37
|
-
return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, {
|
|
38
|
-
profile,
|
|
39
|
-
logger
|
|
40
|
-
}) || isCredentialSourceProfile(arg, {
|
|
41
|
-
profile,
|
|
42
|
-
logger
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
var isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {
|
|
46
|
-
const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
|
|
47
|
-
if (withSourceProfile) logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
|
|
48
|
-
return withSourceProfile;
|
|
49
|
-
};
|
|
50
|
-
var isCredentialSourceProfile = (arg, { profile, logger }) => {
|
|
51
|
-
const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
|
|
52
|
-
if (withProviderProfile) logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
|
|
53
|
-
return withProviderProfile;
|
|
54
|
-
};
|
|
55
|
-
var resolveAssumeRoleCredentials = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, resolveProfileData) => {
|
|
56
|
-
options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
|
|
57
|
-
const profileData = profiles[profileName];
|
|
58
|
-
const { source_profile, region } = profileData;
|
|
59
|
-
if (!options.roleAssumer) {
|
|
60
|
-
const { getDefaultRoleAssumer } = await import("../aws-sdk__nested-clients.mjs").then((n) => /* @__PURE__ */ __toESM(n.t()));
|
|
61
|
-
options.roleAssumer = getDefaultRoleAssumer({
|
|
62
|
-
...options.clientConfig,
|
|
63
|
-
credentialProviderLogger: options.logger,
|
|
64
|
-
parentClientConfig: {
|
|
65
|
-
...callerClientConfig,
|
|
66
|
-
...options?.parentClientConfig,
|
|
67
|
-
region: region ?? options?.parentClientConfig?.region ?? callerClientConfig?.region
|
|
68
|
-
}
|
|
69
|
-
}, options.clientPlugins);
|
|
70
|
-
}
|
|
71
|
-
if (source_profile && source_profile in visitedProfiles) throw new import_config.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${(0, import_config.getProfileName)(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger });
|
|
72
|
-
options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);
|
|
73
|
-
const sourceCredsProvider = source_profile ? resolveProfileData(source_profile, profiles, options, callerClientConfig, {
|
|
74
|
-
...visitedProfiles,
|
|
75
|
-
[source_profile]: true
|
|
76
|
-
}, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();
|
|
77
|
-
if (isCredentialSourceWithoutRoleArn(profileData)) return sourceCredsProvider.then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
|
|
78
|
-
else {
|
|
79
|
-
const params = {
|
|
80
|
-
RoleArn: profileData.role_arn,
|
|
81
|
-
RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,
|
|
82
|
-
ExternalId: profileData.external_id,
|
|
83
|
-
DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10)
|
|
84
|
-
};
|
|
85
|
-
const { mfa_serial } = profileData;
|
|
86
|
-
if (mfa_serial) {
|
|
87
|
-
if (!options.mfaCodeProvider) throw new import_config.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, {
|
|
88
|
-
logger: options.logger,
|
|
89
|
-
tryNextLink: false
|
|
90
|
-
});
|
|
91
|
-
params.SerialNumber = mfa_serial;
|
|
92
|
-
params.TokenCode = await options.mfaCodeProvider(mfa_serial);
|
|
93
|
-
}
|
|
94
|
-
const sourceCreds = await sourceCredsProvider;
|
|
95
|
-
return options.roleAssumer(sourceCreds, params).then((creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var isCredentialSourceWithoutRoleArn = (section) => {
|
|
99
|
-
return !section.role_arn && !!section.credential_source;
|
|
100
|
-
};
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-login@3.972.55/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js
|
|
103
|
-
var LoginCredentialsFetcher = class LoginCredentialsFetcher {
|
|
104
|
-
profileData;
|
|
105
|
-
init;
|
|
106
|
-
callerClientConfig;
|
|
107
|
-
static REFRESH_THRESHOLD = 300 * 1e3;
|
|
108
|
-
constructor(profileData, init, callerClientConfig) {
|
|
109
|
-
this.profileData = profileData;
|
|
110
|
-
this.init = init;
|
|
111
|
-
this.callerClientConfig = callerClientConfig;
|
|
112
|
-
}
|
|
113
|
-
async loadCredentials() {
|
|
114
|
-
const token = await this.loadToken();
|
|
115
|
-
if (!token) throw new import_config.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, {
|
|
116
|
-
tryNextLink: false,
|
|
117
|
-
logger: this.logger
|
|
118
|
-
});
|
|
119
|
-
const accessToken = token.accessToken;
|
|
120
|
-
const now = Date.now();
|
|
121
|
-
if (new Date(accessToken.expiresAt).getTime() - now <= LoginCredentialsFetcher.REFRESH_THRESHOLD) return this.refresh(token);
|
|
122
|
-
return {
|
|
123
|
-
accessKeyId: accessToken.accessKeyId,
|
|
124
|
-
secretAccessKey: accessToken.secretAccessKey,
|
|
125
|
-
sessionToken: accessToken.sessionToken,
|
|
126
|
-
accountId: accessToken.accountId,
|
|
127
|
-
expiration: new Date(accessToken.expiresAt)
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
get logger() {
|
|
131
|
-
return this.init?.logger;
|
|
132
|
-
}
|
|
133
|
-
get loginSession() {
|
|
134
|
-
return this.profileData.login_session;
|
|
135
|
-
}
|
|
136
|
-
async refresh(token) {
|
|
137
|
-
const { SigninClient, CreateOAuth2TokenCommand } = await import("../aws-sdk__nested-clients.mjs").then((n) => /* @__PURE__ */ __toESM(n.r()));
|
|
138
|
-
const { logger, userAgentAppId } = this.callerClientConfig ?? {};
|
|
139
|
-
const isH2 = (requestHandler) => {
|
|
140
|
-
return requestHandler?.metadata?.handlerProtocol === "h2";
|
|
141
|
-
};
|
|
142
|
-
const requestHandler = isH2(this.callerClientConfig?.requestHandler) ? void 0 : this.callerClientConfig?.requestHandler;
|
|
143
|
-
const client = new SigninClient({
|
|
144
|
-
credentials: {
|
|
145
|
-
accessKeyId: "",
|
|
146
|
-
secretAccessKey: ""
|
|
147
|
-
},
|
|
148
|
-
region: this.profileData.region ?? await this.callerClientConfig?.region?.() ?? process.env.AWS_REGION,
|
|
149
|
-
requestHandler,
|
|
150
|
-
logger,
|
|
151
|
-
userAgentAppId,
|
|
152
|
-
...this.init?.clientConfig
|
|
153
|
-
});
|
|
154
|
-
this.createDPoPInterceptor(client.middlewareStack);
|
|
155
|
-
const commandInput = { tokenInput: {
|
|
156
|
-
clientId: token.clientId,
|
|
157
|
-
refreshToken: token.refreshToken,
|
|
158
|
-
grantType: "refresh_token"
|
|
159
|
-
} };
|
|
160
|
-
try {
|
|
161
|
-
const response = await client.send(new CreateOAuth2TokenCommand(commandInput));
|
|
162
|
-
const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {};
|
|
163
|
-
const { refreshToken, expiresIn } = response.tokenOutput ?? {};
|
|
164
|
-
if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) throw new import_config.CredentialsProviderError("Token refresh response missing required fields", {
|
|
165
|
-
logger: this.logger,
|
|
166
|
-
tryNextLink: false
|
|
167
|
-
});
|
|
168
|
-
const expiresInMs = (expiresIn ?? 900) * 1e3;
|
|
169
|
-
const expiration = new Date(Date.now() + expiresInMs);
|
|
170
|
-
const updatedToken = {
|
|
171
|
-
...token,
|
|
172
|
-
accessToken: {
|
|
173
|
-
...token.accessToken,
|
|
174
|
-
accessKeyId,
|
|
175
|
-
secretAccessKey,
|
|
176
|
-
sessionToken,
|
|
177
|
-
expiresAt: expiration.toISOString()
|
|
178
|
-
},
|
|
179
|
-
refreshToken
|
|
180
|
-
};
|
|
181
|
-
await this.saveToken(updatedToken);
|
|
182
|
-
const newAccessToken = updatedToken.accessToken;
|
|
183
|
-
return {
|
|
184
|
-
accessKeyId: newAccessToken.accessKeyId,
|
|
185
|
-
secretAccessKey: newAccessToken.secretAccessKey,
|
|
186
|
-
sessionToken: newAccessToken.sessionToken,
|
|
187
|
-
accountId: newAccessToken.accountId,
|
|
188
|
-
expiration
|
|
189
|
-
};
|
|
190
|
-
} catch (error) {
|
|
191
|
-
if (error.name === "AccessDeniedException") {
|
|
192
|
-
const errorType = error.error;
|
|
193
|
-
let message;
|
|
194
|
-
switch (errorType) {
|
|
195
|
-
case "TOKEN_EXPIRED":
|
|
196
|
-
message = "Your session has expired. Please reauthenticate.";
|
|
197
|
-
break;
|
|
198
|
-
case "USER_CREDENTIALS_CHANGED":
|
|
199
|
-
message = "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";
|
|
200
|
-
break;
|
|
201
|
-
case "INSUFFICIENT_PERMISSIONS":
|
|
202
|
-
message = "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";
|
|
203
|
-
break;
|
|
204
|
-
default: message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \`aws login\``;
|
|
205
|
-
}
|
|
206
|
-
throw new import_config.CredentialsProviderError(message, {
|
|
207
|
-
logger: this.logger,
|
|
208
|
-
tryNextLink: false
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
throw new import_config.CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger });
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
async loadToken() {
|
|
215
|
-
const tokenFilePath = this.getTokenFilePath();
|
|
216
|
-
try {
|
|
217
|
-
let tokenData;
|
|
218
|
-
try {
|
|
219
|
-
tokenData = await (0, import_config.readFile)(tokenFilePath, { ignoreCache: this.init?.ignoreCache });
|
|
220
|
-
} catch {
|
|
221
|
-
tokenData = await promises.readFile(tokenFilePath, "utf8");
|
|
222
|
-
}
|
|
223
|
-
const token = JSON.parse(tokenData);
|
|
224
|
-
const missingFields = [
|
|
225
|
-
"accessToken",
|
|
226
|
-
"clientId",
|
|
227
|
-
"refreshToken",
|
|
228
|
-
"dpopKey"
|
|
229
|
-
].filter((k) => !token[k]);
|
|
230
|
-
if (!token.accessToken?.accountId) missingFields.push("accountId");
|
|
231
|
-
if (missingFields.length > 0) throw new import_config.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, {
|
|
232
|
-
logger: this.logger,
|
|
233
|
-
tryNextLink: false
|
|
234
|
-
});
|
|
235
|
-
return token;
|
|
236
|
-
} catch (error) {
|
|
237
|
-
throw new import_config.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, {
|
|
238
|
-
logger: this.logger,
|
|
239
|
-
tryNextLink: false
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
async saveToken(token) {
|
|
244
|
-
const tokenFilePath = this.getTokenFilePath();
|
|
245
|
-
const directory = dirname(tokenFilePath);
|
|
246
|
-
try {
|
|
247
|
-
await promises.mkdir(directory, { recursive: true });
|
|
248
|
-
} catch (error) {}
|
|
249
|
-
await promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
|
|
250
|
-
}
|
|
251
|
-
getTokenFilePath() {
|
|
252
|
-
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join(homedir(), ".aws", "login", "cache");
|
|
253
|
-
const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
|
|
254
|
-
return join(directory, `${createHash("sha256").update(loginSessionBytes).digest("hex")}.json`);
|
|
255
|
-
}
|
|
256
|
-
derToRawSignature(derSignature) {
|
|
257
|
-
let offset = 2;
|
|
258
|
-
if (derSignature[offset] !== 2) throw new Error("Invalid DER signature");
|
|
259
|
-
offset++;
|
|
260
|
-
const rLength = derSignature[offset++];
|
|
261
|
-
let r = derSignature.subarray(offset, offset + rLength);
|
|
262
|
-
offset += rLength;
|
|
263
|
-
if (derSignature[offset] !== 2) throw new Error("Invalid DER signature");
|
|
264
|
-
offset++;
|
|
265
|
-
const sLength = derSignature[offset++];
|
|
266
|
-
let s = derSignature.subarray(offset, offset + sLength);
|
|
267
|
-
r = r[0] === 0 ? r.subarray(1) : r;
|
|
268
|
-
s = s[0] === 0 ? s.subarray(1) : s;
|
|
269
|
-
const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]);
|
|
270
|
-
const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]);
|
|
271
|
-
return Buffer.concat([rPadded, sPadded]);
|
|
272
|
-
}
|
|
273
|
-
createDPoPInterceptor(middlewareStack) {
|
|
274
|
-
middlewareStack.add((next) => async (args) => {
|
|
275
|
-
if (import_protocols.HttpRequest.isInstance(args.request)) {
|
|
276
|
-
const request = args.request;
|
|
277
|
-
const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`;
|
|
278
|
-
const dpop = await this.generateDpop(request.method, actualEndpoint);
|
|
279
|
-
request.headers = {
|
|
280
|
-
...request.headers,
|
|
281
|
-
DPoP: dpop
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
return next(args);
|
|
285
|
-
}, {
|
|
286
|
-
step: "finalizeRequest",
|
|
287
|
-
name: "dpopInterceptor",
|
|
288
|
-
override: true
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
async generateDpop(method = "POST", endpoint) {
|
|
292
|
-
const token = await this.loadToken();
|
|
293
|
-
try {
|
|
294
|
-
const privateKey = createPrivateKey({
|
|
295
|
-
key: token.dpopKey,
|
|
296
|
-
format: "pem",
|
|
297
|
-
type: "sec1"
|
|
298
|
-
});
|
|
299
|
-
const publicDer = createPublicKey(privateKey).export({
|
|
300
|
-
format: "der",
|
|
301
|
-
type: "spki"
|
|
302
|
-
});
|
|
303
|
-
let pointStart = -1;
|
|
304
|
-
for (let i = 0; i < publicDer.length; i++) if (publicDer[i] === 4) {
|
|
305
|
-
pointStart = i;
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
const x = publicDer.slice(pointStart + 1, pointStart + 33);
|
|
309
|
-
const y = publicDer.slice(pointStart + 33, pointStart + 65);
|
|
310
|
-
const header = {
|
|
311
|
-
alg: "ES256",
|
|
312
|
-
typ: "dpop+jwt",
|
|
313
|
-
jwk: {
|
|
314
|
-
kty: "EC",
|
|
315
|
-
crv: "P-256",
|
|
316
|
-
x: x.toString("base64url"),
|
|
317
|
-
y: y.toString("base64url")
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
const payload = {
|
|
321
|
-
jti: crypto.randomUUID(),
|
|
322
|
-
htm: method,
|
|
323
|
-
htu: endpoint,
|
|
324
|
-
iat: Math.floor(Date.now() / 1e3)
|
|
325
|
-
};
|
|
326
|
-
const message = `${Buffer.from(JSON.stringify(header)).toString("base64url")}.${Buffer.from(JSON.stringify(payload)).toString("base64url")}`;
|
|
327
|
-
const asn1Signature = sign("sha256", Buffer.from(message), privateKey);
|
|
328
|
-
return `${message}.${this.derToRawSignature(asn1Signature).toString("base64url")}`;
|
|
329
|
-
} catch (error) {
|
|
330
|
-
throw new import_config.CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, {
|
|
331
|
-
logger: this.logger,
|
|
332
|
-
tryNextLink: false
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-login@3.972.55/node_modules/@aws-sdk/credential-provider-login/dist-es/fromLoginCredentials.js
|
|
339
|
-
var fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {
|
|
340
|
-
init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");
|
|
341
|
-
const profiles = await (0, import_config.parseKnownFiles)(init || {});
|
|
342
|
-
const profileName = (0, import_config.getProfileName)({ profile: init?.profile ?? callerClientConfig?.profile });
|
|
343
|
-
const profile = profiles[profileName];
|
|
344
|
-
if (!profile?.login_session) throw new import_config.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {
|
|
345
|
-
tryNextLink: true,
|
|
346
|
-
logger: init?.logger
|
|
347
|
-
});
|
|
348
|
-
return (0, import_client.setCredentialFeature)(await new LoginCredentialsFetcher(profile, init, callerClientConfig).loadCredentials(), "CREDENTIALS_LOGIN", "AD");
|
|
349
|
-
};
|
|
350
|
-
//#endregion
|
|
351
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveLoginCredentials.js
|
|
352
|
-
var isLoginProfile = (data) => {
|
|
353
|
-
return Boolean(data && data.login_session);
|
|
354
|
-
};
|
|
355
|
-
var resolveLoginCredentials = async (profileName, options, callerClientConfig) => {
|
|
356
|
-
return (0, import_client.setCredentialFeature)(await fromLoginCredentials({
|
|
357
|
-
...options,
|
|
358
|
-
profile: profileName
|
|
359
|
-
})({ callerClientConfig }), "CREDENTIALS_PROFILE_LOGIN", "AC");
|
|
360
|
-
};
|
|
361
|
-
//#endregion
|
|
362
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js
|
|
363
|
-
var isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string";
|
|
364
|
-
var resolveProcessCredentials = async (options, profile) => {
|
|
365
|
-
const { fromProcess } = await import("./credential-provider-process+[...].mjs").then((n) => n.t);
|
|
366
|
-
return (0, import_client.setCredentialFeature)(await fromProcess({
|
|
367
|
-
...options,
|
|
368
|
-
profile
|
|
369
|
-
})(), "CREDENTIALS_PROFILE_PROCESS", "v");
|
|
370
|
-
};
|
|
371
|
-
//#endregion
|
|
372
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js
|
|
373
|
-
var resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => {
|
|
374
|
-
const { fromSSO } = await import("./credential-provider-sso+[...].mjs").then((n) => n.t);
|
|
375
|
-
return fromSSO({
|
|
376
|
-
profile,
|
|
377
|
-
logger: options.logger,
|
|
378
|
-
parentClientConfig: options.parentClientConfig,
|
|
379
|
-
clientConfig: options.clientConfig
|
|
380
|
-
})({ callerClientConfig }).then((creds) => {
|
|
381
|
-
if (profileData.sso_session) return (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SSO", "r");
|
|
382
|
-
else return (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
|
|
383
|
-
});
|
|
384
|
-
};
|
|
385
|
-
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");
|
|
386
|
-
//#endregion
|
|
387
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js
|
|
388
|
-
var isStaticCredsProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1;
|
|
389
|
-
var resolveStaticCredentials = async (profile, options) => {
|
|
390
|
-
options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
|
|
391
|
-
return (0, import_client.setCredentialFeature)({
|
|
392
|
-
accessKeyId: profile.aws_access_key_id,
|
|
393
|
-
secretAccessKey: profile.aws_secret_access_key,
|
|
394
|
-
sessionToken: profile.aws_session_token,
|
|
395
|
-
...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope },
|
|
396
|
-
...profile.aws_account_id && { accountId: profile.aws_account_id }
|
|
397
|
-
}, "CREDENTIALS_PROFILE", "n");
|
|
398
|
-
};
|
|
399
|
-
//#endregion
|
|
400
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js
|
|
401
|
-
var isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
|
|
402
|
-
var resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => {
|
|
403
|
-
const { fromTokenFile } = await import("./credential-provider-web-identity+[...].mjs").then((n) => n.t);
|
|
404
|
-
return (0, import_client.setCredentialFeature)(await fromTokenFile({
|
|
405
|
-
webIdentityTokenFile: profile.web_identity_token_file,
|
|
406
|
-
roleArn: profile.role_arn,
|
|
407
|
-
roleSessionName: profile.role_session_name,
|
|
408
|
-
roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
|
|
409
|
-
logger: options.logger,
|
|
410
|
-
parentClientConfig: options.parentClientConfig
|
|
411
|
-
})({ callerClientConfig }), "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q");
|
|
412
|
-
};
|
|
413
|
-
//#endregion
|
|
414
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js
|
|
415
|
-
var resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
|
|
416
|
-
const data = profiles[profileName];
|
|
417
|
-
if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) return resolveStaticCredentials(data, options);
|
|
418
|
-
if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, {
|
|
419
|
-
profile: profileName,
|
|
420
|
-
logger: options.logger
|
|
421
|
-
})) return resolveAssumeRoleCredentials(profileName, profiles, options, callerClientConfig, visitedProfiles, resolveProfileData);
|
|
422
|
-
if (isStaticCredsProfile(data)) return resolveStaticCredentials(data, options);
|
|
423
|
-
if (isWebIdentityProfile(data)) return resolveWebIdentityCredentials(data, options, callerClientConfig);
|
|
424
|
-
if (isProcessProfile(data)) return resolveProcessCredentials(options, profileName);
|
|
425
|
-
if (isSsoProfile(data)) return await resolveSsoCredentials(profileName, data, options, callerClientConfig);
|
|
426
|
-
if (isLoginProfile(data)) return resolveLoginCredentials(profileName, options, callerClientConfig);
|
|
427
|
-
throw new import_config.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });
|
|
428
|
-
};
|
|
429
|
-
//#endregion
|
|
430
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js
|
|
431
|
-
var fromIni = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
432
|
-
init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
|
|
433
|
-
const profiles = await (0, import_config.parseKnownFiles)(init);
|
|
434
|
-
return resolveProfileData((0, import_config.getProfileName)({ profile: init.profile ?? callerClientConfig?.profile }), profiles, init, callerClientConfig);
|
|
435
|
-
};
|
|
436
|
-
//#endregion
|
|
437
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.972.56/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js
|
|
438
|
-
var dist_es_exports = /* @__PURE__ */ __exportAll({ fromIni: () => fromIni });
|
|
439
|
-
//#endregion
|
|
440
|
-
export { dist_es_exports as t };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { r as __exportAll } from "../../_runtime.mjs";
|
|
2
|
-
import { a as require_client, f as require_config } from "./checksums+[...].mjs";
|
|
3
|
-
import { exec } from "node:child_process";
|
|
4
|
-
import { promisify } from "node:util";
|
|
5
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.972.49/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js
|
|
6
|
-
var import_config = require_config();
|
|
7
|
-
var import_client = require_client();
|
|
8
|
-
var getValidatedProcessCredentials = (profileName, data, profiles) => {
|
|
9
|
-
if (data.Version !== 1) throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
|
|
10
|
-
if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) throw Error(`Profile ${profileName} credential_process returned invalid credentials.`);
|
|
11
|
-
if (data.Expiration) {
|
|
12
|
-
const currentTime = /* @__PURE__ */ new Date();
|
|
13
|
-
if (new Date(data.Expiration) < currentTime) throw Error(`Profile ${profileName} credential_process returned expired credentials.`);
|
|
14
|
-
}
|
|
15
|
-
let accountId = data.AccountId;
|
|
16
|
-
if (!accountId && profiles?.[profileName]?.aws_account_id) accountId = profiles[profileName].aws_account_id;
|
|
17
|
-
const credentials = {
|
|
18
|
-
accessKeyId: data.AccessKeyId,
|
|
19
|
-
secretAccessKey: data.SecretAccessKey,
|
|
20
|
-
...data.SessionToken && { sessionToken: data.SessionToken },
|
|
21
|
-
...data.Expiration && { expiration: new Date(data.Expiration) },
|
|
22
|
-
...data.CredentialScope && { credentialScope: data.CredentialScope },
|
|
23
|
-
...accountId && { accountId }
|
|
24
|
-
};
|
|
25
|
-
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_PROCESS", "w");
|
|
26
|
-
return credentials;
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.972.49/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
|
|
30
|
-
var resolveProcessCredentials = async (profileName, profiles, logger) => {
|
|
31
|
-
const profile = profiles[profileName];
|
|
32
|
-
if (profiles[profileName]) {
|
|
33
|
-
const credentialProcess = profile["credential_process"];
|
|
34
|
-
if (credentialProcess !== void 0) {
|
|
35
|
-
const execPromise = promisify(import_config.externalDataInterceptor?.getTokenRecord?.().exec ?? exec);
|
|
36
|
-
try {
|
|
37
|
-
const { stdout } = await execPromise(credentialProcess);
|
|
38
|
-
let data;
|
|
39
|
-
try {
|
|
40
|
-
data = JSON.parse(stdout.trim());
|
|
41
|
-
} catch {
|
|
42
|
-
throw Error(`Profile ${profileName} credential_process returned invalid JSON.`);
|
|
43
|
-
}
|
|
44
|
-
return getValidatedProcessCredentials(profileName, data, profiles);
|
|
45
|
-
} catch (error) {
|
|
46
|
-
throw new import_config.CredentialsProviderError(error.message, { logger });
|
|
47
|
-
}
|
|
48
|
-
} else throw new import_config.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger });
|
|
49
|
-
} else throw new import_config.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, { logger });
|
|
50
|
-
};
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.972.49/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js
|
|
53
|
-
var fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
54
|
-
init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
|
|
55
|
-
const profiles = await (0, import_config.parseKnownFiles)(init);
|
|
56
|
-
return resolveProcessCredentials((0, import_config.getProfileName)({ profile: init.profile ?? callerClientConfig?.profile }), profiles, init.logger);
|
|
57
|
-
};
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.972.49/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js
|
|
60
|
-
var dist_es_exports = /* @__PURE__ */ __exportAll({ fromProcess: () => fromProcess });
|
|
61
|
-
//#endregion
|
|
62
|
-
export { dist_es_exports as t };
|