@desplega.ai/agent-swarm 1.152.2 → 1.154.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/README.md +2 -2
- package/dist/{acp-adapter-pfeje2v5.js → acp-adapter-eb2aj8xy.js} +4 -4
- package/dist/{actions-0sttc7f5.js → actions-kpnwp1kz.js} +31 -27
- package/dist/{anthropic-messages-2y8nktar.js → anthropic-messages-9vqsbznt.js} +112 -84
- package/dist/{app-p8teva95.js → app-zk1apkf6.js} +10 -7
- package/dist/{assistant-r45jnsrt.js → assistant-kwq4y50q.js} +32 -28
- package/dist/{azure-openai-responses-f38x2avq.js → azure-openai-responses-04qwdwfq.js} +27 -13
- package/dist/{boot-reembed-je26h5y7.js → boot-reembed-22hd3jjn.js} +9 -7
- package/dist/{boot-reembed-1qmybsd4.js → boot-reembed-qe168424.js} +10 -8
- package/dist/{boot-scrub-logs-gte3h1mm.js → boot-scrub-logs-pkdpsrjd.js} +7 -5
- package/dist/{claude-adapter-csc1mzka.js → claude-adapter-3fx90nww.js} +18 -16
- package/dist/{claude-managed-adapter-dsmkcrjy.js → claude-managed-adapter-ea2aga6w.js} +3 -3
- package/dist/{claude-sdk-session-fcd6f078.js → claude-sdk-session-z7fahf1k.js} +18 -16
- package/dist/{cli-r2fpe7cx.js → cli-00w2c66p.js} +61 -55
- package/dist/{cli-wbyk465z.js → cli-09y3tjxz.js} +1 -1
- package/dist/{cli-ht5rs63n.js → cli-0e31nm4n.js} +16 -7
- package/dist/cli-0x5qzvkg.js +4279 -0
- package/dist/{cli-d3p82erb.js → cli-18amys3y.js} +9 -9
- package/dist/{cli-4ahpr4sw.js → cli-1jpjafw4.js} +5 -5
- package/dist/{cli-jbmc0r7r.js → cli-243tzws8.js} +1 -1
- package/dist/{cli-ch38q5z4.js → cli-24k806sc.js} +6789 -2542
- package/dist/cli-3bkz2p7j.js +2828 -0
- package/dist/cli-3er6gcsn.js +1849 -0
- package/dist/cli-4k7jazkq.js +3339 -0
- package/dist/{cli-c4eeb5q2.js → cli-5b6b62tz.js} +1 -1
- package/dist/{cli-qd65dvr6.js → cli-5vs0nh43.js} +65 -44
- package/dist/{cli-z3wkng35.js → cli-6r3cgpk2.js} +224 -156
- package/dist/{cli-pgj4a5fb.js → cli-71cj99hx.js} +4 -3
- package/dist/cli-8sea27q4.js +14075 -0
- package/dist/{cli-jvy9qgjs.js → cli-913yakhv.js} +22 -7
- package/dist/{cli-pf9q3696.js → cli-927erqqt.js} +5 -2
- package/dist/cli-95jnpnqg.js +230 -0
- package/dist/{cli-wpv5rgg2.js → cli-abp3g4ax.js} +15 -2
- package/dist/{cli-ckz5t2hb.js → cli-acy6bfhr.js} +10 -7
- package/dist/{cli-4yc5d8fk.js → cli-avkd6mqv.js} +50 -0
- package/dist/{cli-8wrympd7.js → cli-bzr0ftht.js} +26 -7
- package/dist/{cli-qn042eh7.js → cli-c1v10xb2.js} +194 -1913
- package/dist/cli-cgj4hc12.js +18902 -0
- package/dist/{cli-2nnd56zt.js → cli-e0pg4zeh.js} +3 -2
- package/dist/{cli-r84ctdxn.js → cli-e31ehqwy.js} +2 -2
- package/dist/{cli-gphgnvpf.js → cli-e3229na9.js} +3 -3
- package/dist/{cli-gpqcs935.js → cli-e3cyf59d.js} +2 -2
- package/dist/{cli-s25avqg9.js → cli-e781c6f9.js} +1 -0
- package/dist/{cli-s2qjdd6z.js → cli-eetrvv91.js} +1 -1
- package/dist/{cli-j4nv2wqy.js → cli-fdzg6jhf.js} +10 -4
- package/dist/{cli-fm4ytsdk.js → cli-g2h29qar.js} +2 -2
- package/dist/{cli-zvgj5zg8.js → cli-ge67p080.js} +302 -3497
- package/dist/cli-h38x0qhg.js +6912 -0
- package/dist/{cli-9xvdm3bx.js → cli-h60qfasa.js} +742 -278
- package/dist/{cli-jew3jda5.js → cli-hws0vn86.js} +2 -2
- package/dist/{cli-j8dggbcr.js → cli-k0g1sjzm.js} +23 -31
- package/dist/{cli-xw7vak96.js → cli-kp3qs53m.js} +5 -5
- package/dist/{cli-rgvp6r2x.js → cli-mcnhgnn1.js} +193 -4
- package/dist/{cli-zvkq5csn.js → cli-myaxtgh8.js} +7 -6
- package/dist/{cli-56h18ng2.js → cli-n62atwh9.js} +1 -1
- package/dist/cli-n7h1kqpf.js +29 -0
- package/dist/{cli-fmy65jdn.js → cli-pf1v8xhb.js} +7 -5
- package/dist/{cli-xy1cchaf.js → cli-q85qhckh.js} +238 -11
- package/dist/{cli-3bpzj8me.js → cli-r1d3dzt6.js} +2 -2
- package/dist/{pi-mono-adapter-jcqt71cg.js → cli-rxkqvngf.js} +67343 -101083
- package/dist/{cli-kj76p1ez.js → cli-scwq51gn.js} +13 -7
- package/dist/{cli-b9dd0h3k.js → cli-stwsmd6k.js} +3 -2
- package/dist/{cli-c2mk1kgf.js → cli-v4en75c5.js} +8 -1
- package/dist/{cli-z61ykvam.js → cli-wg04s9kr.js} +4 -3
- package/dist/cli-yn0a417a.js +4069 -0
- package/dist/{cli-zfzznn7c.js → cli-ytxs7mn1.js} +26 -2
- package/dist/{cli-4j8k1m4w.js → cli-zt1227k1.js} +1162 -192
- package/dist/cli.js +28 -35
- package/dist/{codex-adapter-fxmpsabw.js → codex-adapter-ttdm995v.js} +12 -11
- package/dist/{codex-hook-8jexc34x.js → codex-hook-8gx7bcz0.js} +3 -3
- package/dist/{codex-session-runner-rr1e47ea.js → codex-session-runner-3v8nh4c8.js} +12 -11
- package/dist/{commands-0f5rxz51.js → commands-1cxwbhhq.js} +7 -5
- package/dist/{db-r3jxf3wy.js → db-y9zwsr79.js} +25 -5
- package/dist/{dispatcher-06vph6q4.js → dispatcher-9m9zss36.js} +30 -26
- package/dist/dsh-adapter-gsb2qqf9.js +19 -0
- package/dist/{e2b-413b8t4v.js → e2b-93x1k0j5.js} +6 -7
- package/dist/{google-generative-ai-ndjmj5fa.js → google-generative-ai-gwwrnzqn.js} +33 -73
- package/dist/{google-vertex-fr665tqs.js → google-vertex-5wfawpwz.js} +38 -68
- package/dist/{handlers-0hgtc910.js → handlers-36fm1bwn.js} +33 -29
- package/dist/{hook-9kvrv1er.js → hook-pntw4r8h.js} +12 -10
- package/dist/{hook-fbfhkat3.js → hook-vwq8y26p.js} +13 -11
- package/dist/{http-xbyx8k5j.js → http-20jesakk.js} +357 -261
- package/dist/{index-jsw3aynb.js → index-6artrehg.js} +30 -26
- package/dist/{cli-pdz9qde4.js → index-9ch1n761.js} +10 -11
- package/dist/{index-rnyahfn5.js → index-9n5z2492.js} +30 -26
- package/dist/{index-66xz5e9j.js → index-h5gs261z.js} +521 -9
- package/dist/{index-tfsdxyv6.js → index-j5wrf1yw.js} +40 -25
- package/dist/{index-2sp0384z.js → index-kkeftv5h.js} +738 -21
- package/dist/{index-sgk50mbg.js → index-m2xqpz5r.js} +31 -27
- package/dist/{index-gpfn1741.js → index-m9ks8a7t.js} +9 -7
- package/dist/index-w097eg0x.js +5 -0
- package/dist/jiti-loader-b4837mtm.js +34 -0
- package/dist/jiti-static-loader-q2g5ds0y.js +31267 -0
- package/dist/{keepalive-s3xpr7sw.js → keepalive-pwxvxd2c.js} +9 -7
- package/dist/{lead-rq4n5r16.js → lead-m789wqa3.js} +46 -41
- package/dist/{maintenance-f0atj1ab.js → maintenance-bvg6w7e2.js} +10 -8
- package/dist/{mistral-conversations-qhr84ph3.js → mistral-conversations-zx0kn554.js} +24 -18
- package/dist/{node-x1g4v0pq.js → node-5qtycf6a.js} +16 -11
- package/dist/{oauth-refresh-sweep-q0t3bxre.js → oauth-refresh-sweep-6v4bd737.js} +8 -6
- package/dist/{onboard-br5j1kch.js → onboard-snckpcj1.js} +115 -35
- package/dist/{openai-codex-responses-wy6a43wd.js → openai-codex-responses-4vjqzvjp.js} +33 -27
- package/dist/{openai-completions-32rdwmze.js → openai-completions-pxsmym7g.js} +52 -64
- package/dist/{openai-responses-6xwf7bzg.js → openai-responses-tmn0rqp0.js} +23 -24
- package/dist/{opencode-adapter-28axqa09.js → opencode-adapter-qbmv4tpy.js} +6 -6
- package/dist/{otel-impl-vdqge2nt.js → otel-impl-e0ytens5.js} +4 -4
- package/dist/{pi-messages-b1mbr6gp.js → pi-messages-txpjj39q.js} +3 -3
- package/dist/pi-mono-adapter-c4ggemhz.js +1316 -0
- package/dist/{pricing-refresh-hb3691fd.js → pricing-refresh-52g2ywrw.js} +9 -7
- package/dist/{rbac-roles-t78xt39b.js → rbac-roles-5455kfdn.js} +8 -6
- package/dist/{rbac-roles-jh280k9g.js → rbac-roles-hbf0xa52.js} +9 -7
- package/dist/{render-v2-7p8r2ymg.js → render-v2-npm8xdzh.js} +16 -9
- package/dist/{seed-pricing-hf889enh.js → seed-pricing-650wbr1n.js} +8 -6
- package/dist/{setup-w6mb03jv.js → setup-k1mew5rf.js} +4 -5
- package/dist/virtual-modules-2q5b2pk4.js +54 -0
- package/dist/{work-objects-nt8gy1kj.js → work-objects-2ea3kvwg.js} +33 -29
- package/dist/{worker-dwy617t0.js → worker-ec6hvc4m.js} +46 -41
- package/openapi.json +109 -16
- package/package.json +7 -6
- package/plugin/opencode-plugins/lib/memory-raters.ts +7 -0
- package/src/be/automation-preflight.ts +6 -4
- package/src/be/db/agents.ts +75 -2
- package/src/be/db/tasks/read.ts +2 -0
- package/src/be/db/tasks/write.ts +7 -1
- package/src/be/db.ts +140 -18
- package/src/be/extensions/db.ts +35 -4
- package/src/be/memory/raters/llm.ts +2 -6
- package/src/be/memory/raters/noop.ts +2 -3
- package/src/be/memory/raters/registry.ts +4 -10
- package/src/be/migrations/157_defer_provenance_and_marker.sql +27 -0
- package/src/be/models-catalog.ts +2 -0
- package/src/be/modelsdev-cache.json +213 -0
- package/src/be/rbac-audit.ts +2 -0
- package/src/be/seed/agent-fs-provision.ts +23 -0
- package/src/be/seed-pricing.ts +3 -1
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/commands/onboard/compose-generator.ts +16 -1
- package/src/commands/onboard/env-generator.ts +14 -1
- package/src/commands/onboard/manifest.ts +1 -0
- package/src/commands/onboard/steps/integration-slack.tsx +56 -16
- package/src/commands/onboard/steps/review.tsx +5 -0
- package/src/commands/onboard/types.ts +6 -0
- package/src/commands/onboard.tsx +5 -1
- package/src/commands/provider-credentials.ts +14 -2
- package/src/commands/runner.ts +18 -2
- package/src/extensions/identity.ts +15 -7
- package/src/extensions/lifecycle.ts +15 -21
- package/src/hooks/codex-hook.ts +7 -1
- package/src/http/agents.ts +12 -4
- package/src/http/config.ts +1 -1
- package/src/http/core.ts +5 -3
- package/src/http/extensions.ts +108 -34
- package/src/http/poll.ts +7 -0
- package/src/http/schedules.ts +10 -0
- package/src/http/script-runs.ts +35 -26
- package/src/http/status.ts +24 -11
- package/src/http/tasks.ts +6 -1
- package/src/prompts/base-prompt.ts +15 -7
- package/src/prompts/memories.ts +5 -7
- package/src/prompts/session-templates.ts +3 -2
- package/src/prompts/steering-delivery.ts +2 -0
- package/src/providers/claude-managed-models.ts +8 -0
- package/src/providers/codex-adapter.ts +3 -6
- package/src/providers/codex-models.ts +15 -1
- package/src/providers/dsh-adapter.ts +248 -0
- package/src/providers/index.ts +5 -1
- package/src/providers/modelsdev-reasoning.json +50 -0
- package/src/providers/pi-mono-extension.ts +2 -5
- package/src/rbac/legacy-policy.ts +15 -1
- package/src/rbac/types.ts +2 -0
- package/src/server.ts +7 -1
- package/src/slack/ack.ts +43 -8
- package/src/slack/app.ts +32 -10
- package/src/slack/config.ts +29 -0
- package/src/slack/handlers.ts +7 -1
- package/src/slack/render-v2.ts +186 -17
- package/src/slack/responses.ts +1 -3
- package/src/slack/task-output.ts +66 -8
- package/src/slack/thread-buffer.ts +27 -3
- package/src/telemetry.ts +2 -3
- package/src/tests/agent-fs-provision-seeder.test.ts +56 -2
- package/src/tests/agents-harness-provider.test.ts +19 -0
- package/src/tests/agents-list-model-display.test.ts +60 -1
- package/src/tests/base-prompt.test.ts +25 -0
- package/src/tests/claude-managed-adapter.test.ts +6 -0
- package/src/tests/codex-gpt6-release.test.ts +97 -0
- package/src/tests/codex-steering-hook.test.ts +2 -2
- package/src/tests/config-api-only-keys.test.ts +9 -0
- package/src/tests/context-window.test.ts +1 -0
- package/src/tests/db-task-read-contract.test.ts +9 -0
- package/src/tests/db-task-write-contract.test.ts +9 -0
- package/src/tests/defer-task.test.ts +115 -16
- package/src/tests/dsh-adapter.test.ts +276 -0
- package/src/tests/e2e-nightly-report.test.ts +3 -3
- package/src/tests/e2e-redact.test.ts +2 -0
- package/src/tests/env-flag.test.ts +6 -0
- package/src/tests/extension-agent-visibility.test.ts +474 -0
- package/src/tests/extensions-db.test.ts +41 -0
- package/src/tests/extensions-http.test.ts +148 -4
- package/src/tests/extensions-lifecycle.test.ts +21 -1
- package/src/tests/extensions-mcp-tools.test.ts +9 -5
- package/src/tests/fetch-resolved-env.test.ts +43 -0
- package/src/tests/internal-ai/complete-structured.test.ts +32 -9
- package/src/tests/internal-ai/credentials.test.ts +4 -4
- package/src/tests/internal-ai/models.test.ts +20 -0
- package/src/tests/memory-rate-tool.test.ts +7 -10
- package/src/tests/memory-rater-defaults.test.ts +23 -0
- package/src/tests/memory-rater-e2e.test.ts +2 -3
- package/src/tests/migration-046-budgets.test.ts +2 -0
- package/src/tests/model-control.test.ts +2 -2
- package/src/tests/onboard-compose.test.ts +14 -0
- package/src/tests/onboard-env.test.ts +17 -0
- package/src/tests/onboard-manifest.test.ts +12 -0
- package/src/tests/opus-5-5-registry.test.ts +48 -0
- package/src/tests/pricing-refresh.test.ts +1 -1
- package/src/tests/pricing-routes.test.ts +15 -3
- package/src/tests/provider-registration.test.ts +5 -2
- package/src/tests/rbac-admission-e2e.test.ts +54 -0
- package/src/tests/rbac-e2e-helpers.ts +2 -0
- package/src/tests/rbac-engine.test.ts +32 -0
- package/src/tests/rbac-wire-e2e.test.ts +33 -0
- package/src/tests/reasoning-effort.test.ts +8 -0
- package/src/tests/reload-config.test.ts +33 -0
- package/src/tests/script-connections.test.ts +3 -0
- package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
- package/src/tests/slack-config.test.ts +136 -0
- package/src/tests/slack-mode-lifecycle.test.ts +69 -0
- package/src/tests/slack-render-v2.test.ts +446 -16
- package/src/tests/slack-steering.test.ts +69 -1
- package/src/tests/slack-task-output.test.ts +33 -12
- package/src/tests/status.test.ts +22 -2
- package/src/tests/steering-core.test.ts +35 -0
- package/src/tests/steering-delivery.test.ts +39 -0
- package/src/tests/steering-transport.test.ts +2 -2
- package/src/tests/task-tool-preload-mcp.test.ts +3 -1
- package/src/tests/telemetry-init.test.ts +18 -0
- package/src/tests/workflow-live-recovery.test.ts +126 -0
- package/src/tests/workflow-llm.test.ts +3 -3
- package/src/tools/defer-task.ts +64 -26
- package/src/tools/extension-common.ts +4 -0
- package/src/tools/extension-install.ts +1 -1
- package/src/tools/extension-list.ts +4 -3
- package/src/tools/join-swarm.ts +1 -1
- package/src/tools/schedules/create-schedule.ts +11 -1
- package/src/tools/schedules/patch-schedule.ts +5 -0
- package/src/tools/schedules/update-schedule.ts +5 -0
- package/src/tools/send-task.ts +6 -0
- package/src/tools/utils.ts +1 -1
- package/src/types.ts +30 -8
- package/src/utils/context-window.ts +1 -0
- package/src/utils/credentials.ts +8 -0
- package/src/utils/internal-ai/complete-structured.ts +8 -0
- package/src/utils/internal-ai/models.ts +5 -5
- package/src/utils/memory-raters.ts +3 -0
- package/src/workflows/engine.ts +28 -0
- package/src/workflows/recovery.ts +7 -4
- package/templates/schedules/daily-status-report/content.md +25 -12
- package/templates/schedules/daily-workflow-health-audit/content.md +1 -1
- package/templates/skills/swarm-extensions/content.md +9 -5
- package/dist/cli-4wppfkcm.js +0 -16384
- package/dist/cli-55qrx3q8.js +0 -6041
- package/dist/cli-cg4vnyh4.js +0 -305
- package/dist/cli-jyetr64j.js +0 -52
- package/dist/cli-pp9ax9pa.js +0 -520
- package/dist/cli-qa66qaf0.js +0 -6076
- package/dist/cli-qghpvca2.js +0 -590
- package/dist/cli-rembwgt8.js +0 -861
- package/dist/cli-tcvj7j2r.js +0 -1971
- package/dist/cli-vfcth11k.js +0 -36
- package/dist/cli-w1d1bgkk.js +0 -1422
- package/dist/cli-y6x0gqtg.js +0 -5977
- package/dist/es5-tj3tn4jj.js +0 -844
- package/dist/index-1kq5hw2p.js +0 -467
- package/dist/index-1p8wdstt.js +0 -7
- package/dist/index-8fdjzb2f.js +0 -100
- package/dist/index-bxmwzbgw.js +0 -365
- package/dist/index-nzerxd5z.js +0 -7
- package/dist/index-pyymnzat.js +0 -1168
- package/dist/index-qv6atbab.js +0 -619
- package/dist/index-rja32qa7.js +0 -801
- package/dist/index-tzg5srfp.js +0 -211
- package/dist/index-vhncw983.js +0 -90
- package/dist/index-xk036zsk.js +0 -859
- package/dist/index-zyazbzcb.js +0 -6
- package/dist/{claude-managed-setup-48dwg9bv.js → claude-managed-setup-f5pmsyrp.js} +3 -3
package/dist/index-1kq5hw2p.js
DELETED
|
@@ -1,467 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
require_client
|
|
3
|
-
} from "./cli-tcvj7j2r.js";
|
|
4
|
-
import {
|
|
5
|
-
require_config,
|
|
6
|
-
require_protocols
|
|
7
|
-
} from "./cli-qa66qaf0.js";
|
|
8
|
-
import {
|
|
9
|
-
__commonJS,
|
|
10
|
-
__esm,
|
|
11
|
-
__require,
|
|
12
|
-
__toESM
|
|
13
|
-
} from "./cli-bc05qbss.js";
|
|
14
|
-
|
|
15
|
-
// node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js
|
|
16
|
-
var require_dist_cjs = __commonJS(function(exports) {
|
|
17
|
-
var client = require_client();
|
|
18
|
-
var config = require_config();
|
|
19
|
-
var protocols = require_protocols();
|
|
20
|
-
var node_crypto = __require("node:crypto");
|
|
21
|
-
var node_fs = __require("node:fs");
|
|
22
|
-
var node_os = __require("node:os");
|
|
23
|
-
var node_path = __require("node:path");
|
|
24
|
-
|
|
25
|
-
class LoginCredentialsFetcher {
|
|
26
|
-
profileData;
|
|
27
|
-
init;
|
|
28
|
-
callerClientConfig;
|
|
29
|
-
static REFRESH_THRESHOLD = 5 * 60 * 1000;
|
|
30
|
-
constructor(profileData, init, callerClientConfig) {
|
|
31
|
-
this.profileData = profileData;
|
|
32
|
-
this.init = init;
|
|
33
|
-
this.callerClientConfig = callerClientConfig;
|
|
34
|
-
}
|
|
35
|
-
async loadCredentials() {
|
|
36
|
-
const token = await this.loadToken();
|
|
37
|
-
if (!token) {
|
|
38
|
-
throw new config.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger });
|
|
39
|
-
}
|
|
40
|
-
const accessToken = token.accessToken;
|
|
41
|
-
const now = Date.now();
|
|
42
|
-
const expiryTime = new Date(accessToken.expiresAt).getTime();
|
|
43
|
-
const timeUntilExpiry = expiryTime - now;
|
|
44
|
-
if (timeUntilExpiry <= LoginCredentialsFetcher.REFRESH_THRESHOLD) {
|
|
45
|
-
return this.refresh(token);
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
accessKeyId: accessToken.accessKeyId,
|
|
49
|
-
secretAccessKey: accessToken.secretAccessKey,
|
|
50
|
-
sessionToken: accessToken.sessionToken,
|
|
51
|
-
accountId: accessToken.accountId,
|
|
52
|
-
expiration: new Date(accessToken.expiresAt)
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
get logger() {
|
|
56
|
-
return this.init?.logger;
|
|
57
|
-
}
|
|
58
|
-
get loginSession() {
|
|
59
|
-
return this.profileData.login_session;
|
|
60
|
-
}
|
|
61
|
-
async refresh(token) {
|
|
62
|
-
const { SigninClient, CreateOAuth2TokenCommand } = await import("./index-qv6atbab.js");
|
|
63
|
-
const { logger, userAgentAppId } = this.callerClientConfig ?? {};
|
|
64
|
-
const isH2 = (requestHandler2) => {
|
|
65
|
-
return requestHandler2?.metadata?.handlerProtocol === "h2";
|
|
66
|
-
};
|
|
67
|
-
const requestHandler = isH2(this.callerClientConfig?.requestHandler) ? undefined : this.callerClientConfig?.requestHandler;
|
|
68
|
-
const region = this.profileData.region ?? await this.callerClientConfig?.region?.() ?? process.env.AWS_REGION;
|
|
69
|
-
const client2 = new SigninClient({
|
|
70
|
-
credentials: {
|
|
71
|
-
accessKeyId: "",
|
|
72
|
-
secretAccessKey: ""
|
|
73
|
-
},
|
|
74
|
-
region,
|
|
75
|
-
requestHandler,
|
|
76
|
-
logger,
|
|
77
|
-
userAgentAppId,
|
|
78
|
-
...this.init?.clientConfig
|
|
79
|
-
});
|
|
80
|
-
this.createDPoPInterceptor(client2.middlewareStack);
|
|
81
|
-
const commandInput = {
|
|
82
|
-
tokenInput: {
|
|
83
|
-
clientId: token.clientId,
|
|
84
|
-
refreshToken: token.refreshToken,
|
|
85
|
-
grantType: "refresh_token"
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
try {
|
|
89
|
-
const response = await client2.send(new CreateOAuth2TokenCommand(commandInput));
|
|
90
|
-
const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {};
|
|
91
|
-
const { refreshToken, expiresIn } = response.tokenOutput ?? {};
|
|
92
|
-
if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) {
|
|
93
|
-
throw new config.CredentialsProviderError("Token refresh response missing required fields", {
|
|
94
|
-
logger: this.logger,
|
|
95
|
-
tryNextLink: false
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const expiresInMs = (expiresIn ?? 900) * 1000;
|
|
99
|
-
const expiration = new Date(Date.now() + expiresInMs);
|
|
100
|
-
const updatedToken = {
|
|
101
|
-
...token,
|
|
102
|
-
accessToken: {
|
|
103
|
-
...token.accessToken,
|
|
104
|
-
accessKeyId,
|
|
105
|
-
secretAccessKey,
|
|
106
|
-
sessionToken,
|
|
107
|
-
expiresAt: expiration.toISOString()
|
|
108
|
-
},
|
|
109
|
-
refreshToken
|
|
110
|
-
};
|
|
111
|
-
await this.saveToken(updatedToken);
|
|
112
|
-
const newAccessToken = updatedToken.accessToken;
|
|
113
|
-
return {
|
|
114
|
-
accessKeyId: newAccessToken.accessKeyId,
|
|
115
|
-
secretAccessKey: newAccessToken.secretAccessKey,
|
|
116
|
-
sessionToken: newAccessToken.sessionToken,
|
|
117
|
-
accountId: newAccessToken.accountId,
|
|
118
|
-
expiration
|
|
119
|
-
};
|
|
120
|
-
} catch (error) {
|
|
121
|
-
if (error.name === "AccessDeniedException") {
|
|
122
|
-
const errorType = error.error;
|
|
123
|
-
let message;
|
|
124
|
-
switch (errorType) {
|
|
125
|
-
case "TOKEN_EXPIRED":
|
|
126
|
-
message = "Your session has expired. Please reauthenticate.";
|
|
127
|
-
break;
|
|
128
|
-
case "USER_CREDENTIALS_CHANGED":
|
|
129
|
-
message = "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";
|
|
130
|
-
break;
|
|
131
|
-
case "INSUFFICIENT_PERMISSIONS":
|
|
132
|
-
message = "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";
|
|
133
|
-
break;
|
|
134
|
-
default:
|
|
135
|
-
message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \`aws login\``;
|
|
136
|
-
}
|
|
137
|
-
throw new config.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false });
|
|
138
|
-
}
|
|
139
|
-
throw new config.CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger });
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
async loadToken() {
|
|
143
|
-
const tokenFilePath = this.getTokenFilePath();
|
|
144
|
-
try {
|
|
145
|
-
let tokenData;
|
|
146
|
-
try {
|
|
147
|
-
tokenData = await config.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache });
|
|
148
|
-
} catch {
|
|
149
|
-
tokenData = await node_fs.promises.readFile(tokenFilePath, "utf8");
|
|
150
|
-
}
|
|
151
|
-
const token = JSON.parse(tokenData);
|
|
152
|
-
const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k) => !token[k]);
|
|
153
|
-
if (!token.accessToken?.accountId) {
|
|
154
|
-
missingFields.push("accountId");
|
|
155
|
-
}
|
|
156
|
-
if (missingFields.length > 0) {
|
|
157
|
-
throw new config.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, {
|
|
158
|
-
logger: this.logger,
|
|
159
|
-
tryNextLink: false
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
return token;
|
|
163
|
-
} catch (error) {
|
|
164
|
-
throw new config.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, {
|
|
165
|
-
logger: this.logger,
|
|
166
|
-
tryNextLink: false
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
async saveToken(token) {
|
|
171
|
-
const tokenFilePath = this.getTokenFilePath();
|
|
172
|
-
const directory = node_path.dirname(tokenFilePath);
|
|
173
|
-
try {
|
|
174
|
-
await node_fs.promises.mkdir(directory, { recursive: true });
|
|
175
|
-
} catch (error) {}
|
|
176
|
-
await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
|
|
177
|
-
}
|
|
178
|
-
getTokenFilePath() {
|
|
179
|
-
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), ".aws", "login", "cache");
|
|
180
|
-
const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
|
|
181
|
-
const loginSessionSha256 = node_crypto.createHash("sha256").update(loginSessionBytes).digest("hex");
|
|
182
|
-
return node_path.join(directory, `${loginSessionSha256}.json`);
|
|
183
|
-
}
|
|
184
|
-
derToRawSignature(derSignature) {
|
|
185
|
-
let offset = 2;
|
|
186
|
-
if (derSignature[offset] !== 2) {
|
|
187
|
-
throw new Error("Invalid DER signature");
|
|
188
|
-
}
|
|
189
|
-
offset++;
|
|
190
|
-
const rLength = derSignature[offset++];
|
|
191
|
-
let r = derSignature.subarray(offset, offset + rLength);
|
|
192
|
-
offset += rLength;
|
|
193
|
-
if (derSignature[offset] !== 2) {
|
|
194
|
-
throw new Error("Invalid DER signature");
|
|
195
|
-
}
|
|
196
|
-
offset++;
|
|
197
|
-
const sLength = derSignature[offset++];
|
|
198
|
-
let s = derSignature.subarray(offset, offset + sLength);
|
|
199
|
-
r = r[0] === 0 ? r.subarray(1) : r;
|
|
200
|
-
s = s[0] === 0 ? s.subarray(1) : s;
|
|
201
|
-
const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]);
|
|
202
|
-
const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]);
|
|
203
|
-
return Buffer.concat([rPadded, sPadded]);
|
|
204
|
-
}
|
|
205
|
-
createDPoPInterceptor(middlewareStack) {
|
|
206
|
-
middlewareStack.add((next) => async (args) => {
|
|
207
|
-
if (protocols.HttpRequest.isInstance(args.request)) {
|
|
208
|
-
const request = args.request;
|
|
209
|
-
const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`;
|
|
210
|
-
const dpop = await this.generateDpop(request.method, actualEndpoint);
|
|
211
|
-
request.headers = {
|
|
212
|
-
...request.headers,
|
|
213
|
-
DPoP: dpop
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
return next(args);
|
|
217
|
-
}, {
|
|
218
|
-
step: "finalizeRequest",
|
|
219
|
-
name: "dpopInterceptor",
|
|
220
|
-
override: true
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
async generateDpop(method = "POST", endpoint) {
|
|
224
|
-
const token = await this.loadToken();
|
|
225
|
-
try {
|
|
226
|
-
const privateKey = node_crypto.createPrivateKey({
|
|
227
|
-
key: token.dpopKey,
|
|
228
|
-
format: "pem",
|
|
229
|
-
type: "sec1"
|
|
230
|
-
});
|
|
231
|
-
const publicKey = node_crypto.createPublicKey(privateKey);
|
|
232
|
-
const publicDer = publicKey.export({ format: "der", type: "spki" });
|
|
233
|
-
let pointStart = -1;
|
|
234
|
-
for (let i = 0;i < publicDer.length; i++) {
|
|
235
|
-
if (publicDer[i] === 4) {
|
|
236
|
-
pointStart = i;
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
const x = publicDer.slice(pointStart + 1, pointStart + 33);
|
|
241
|
-
const y = publicDer.slice(pointStart + 33, pointStart + 65);
|
|
242
|
-
const header = {
|
|
243
|
-
alg: "ES256",
|
|
244
|
-
typ: "dpop+jwt",
|
|
245
|
-
jwk: {
|
|
246
|
-
kty: "EC",
|
|
247
|
-
crv: "P-256",
|
|
248
|
-
x: x.toString("base64url"),
|
|
249
|
-
y: y.toString("base64url")
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
const payload = {
|
|
253
|
-
jti: crypto.randomUUID(),
|
|
254
|
-
htm: method,
|
|
255
|
-
htu: endpoint,
|
|
256
|
-
iat: Math.floor(Date.now() / 1000)
|
|
257
|
-
};
|
|
258
|
-
const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url");
|
|
259
|
-
const payloadB64 = Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
260
|
-
const message = `${headerB64}.${payloadB64}`;
|
|
261
|
-
const asn1Signature = node_crypto.sign("sha256", Buffer.from(message), privateKey);
|
|
262
|
-
const rawSignature = this.derToRawSignature(asn1Signature);
|
|
263
|
-
const signatureB64 = rawSignature.toString("base64url");
|
|
264
|
-
return `${message}.${signatureB64}`;
|
|
265
|
-
} catch (error) {
|
|
266
|
-
throw new config.CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, { logger: this.logger, tryNextLink: false });
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
var fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {
|
|
271
|
-
init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");
|
|
272
|
-
const profiles = await config.parseKnownFiles(init || {});
|
|
273
|
-
const profileName = config.getProfileName({
|
|
274
|
-
profile: init?.profile ?? callerClientConfig?.profile
|
|
275
|
-
});
|
|
276
|
-
const profile = profiles[profileName];
|
|
277
|
-
if (!profile?.login_session) {
|
|
278
|
-
throw new config.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {
|
|
279
|
-
tryNextLink: true,
|
|
280
|
-
logger: init?.logger
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig);
|
|
284
|
-
const credentials = await fetcher.loadCredentials();
|
|
285
|
-
return client.setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD");
|
|
286
|
-
};
|
|
287
|
-
exports.fromLoginCredentials = fromLoginCredentials;
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
// node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js
|
|
291
|
-
var config, client, credentialProviderLogin, resolveCredentialSource = (credentialSource, profileName, logger) => {
|
|
292
|
-
const sourceProvidersMap = {
|
|
293
|
-
EcsContainer: async (options) => {
|
|
294
|
-
const { fromHttp } = await import("./index-tzg5srfp.js");
|
|
295
|
-
const { fromContainerMetadata } = await import("./index-bxmwzbgw.js");
|
|
296
|
-
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
|
|
297
|
-
return async () => config.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
|
|
298
|
-
},
|
|
299
|
-
Ec2InstanceMetadata: async (options) => {
|
|
300
|
-
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
|
|
301
|
-
const { fromInstanceMetadata } = await import("./index-bxmwzbgw.js");
|
|
302
|
-
return async () => fromInstanceMetadata(options)().then(setNamedProvider);
|
|
303
|
-
},
|
|
304
|
-
Environment: async (options) => {
|
|
305
|
-
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
|
306
|
-
const { fromEnv } = await import("./index-nzerxd5z.js");
|
|
307
|
-
return async () => fromEnv(options)().then(setNamedProvider);
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
if (credentialSource in sourceProvidersMap) {
|
|
311
|
-
return sourceProvidersMap[credentialSource];
|
|
312
|
-
} else {
|
|
313
|
-
throw new config.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });
|
|
314
|
-
}
|
|
315
|
-
}, setNamedProvider = (creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"), isAssumeRoleProfile = (arg, { profile = "default", logger } = {}) => {
|
|
316
|
-
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, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger }));
|
|
317
|
-
}, isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {
|
|
318
|
-
const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
|
|
319
|
-
if (withSourceProfile) {
|
|
320
|
-
logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
|
|
321
|
-
}
|
|
322
|
-
return withSourceProfile;
|
|
323
|
-
}, isCredentialSourceProfile = (arg, { profile, logger }) => {
|
|
324
|
-
const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
|
|
325
|
-
if (withProviderProfile) {
|
|
326
|
-
logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
|
|
327
|
-
}
|
|
328
|
-
return withProviderProfile;
|
|
329
|
-
}, resolveAssumeRoleCredentials = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, resolveProfileData) => {
|
|
330
|
-
options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
|
|
331
|
-
const profileData = profiles[profileName];
|
|
332
|
-
const { source_profile, region } = profileData;
|
|
333
|
-
if (!options.roleAssumer) {
|
|
334
|
-
const { getDefaultRoleAssumer } = await import("./index-pyymnzat.js");
|
|
335
|
-
options.roleAssumer = getDefaultRoleAssumer({
|
|
336
|
-
...options.clientConfig,
|
|
337
|
-
credentialProviderLogger: options.logger,
|
|
338
|
-
parentClientConfig: {
|
|
339
|
-
...callerClientConfig,
|
|
340
|
-
...options?.parentClientConfig,
|
|
341
|
-
region: region ?? options?.parentClientConfig?.region ?? callerClientConfig?.region
|
|
342
|
-
}
|
|
343
|
-
}, options.clientPlugins);
|
|
344
|
-
}
|
|
345
|
-
if (source_profile && source_profile in visitedProfiles) {
|
|
346
|
-
throw new config.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${config.getProfileName(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger });
|
|
347
|
-
}
|
|
348
|
-
options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);
|
|
349
|
-
const sourceCredsProvider = source_profile ? resolveProfileData(source_profile, profiles, options, callerClientConfig, {
|
|
350
|
-
...visitedProfiles,
|
|
351
|
-
[source_profile]: true
|
|
352
|
-
}, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();
|
|
353
|
-
if (isCredentialSourceWithoutRoleArn(profileData)) {
|
|
354
|
-
return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
|
|
355
|
-
} else {
|
|
356
|
-
const params = {
|
|
357
|
-
RoleArn: profileData.role_arn,
|
|
358
|
-
RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,
|
|
359
|
-
ExternalId: profileData.external_id,
|
|
360
|
-
DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10)
|
|
361
|
-
};
|
|
362
|
-
const { mfa_serial } = profileData;
|
|
363
|
-
if (mfa_serial) {
|
|
364
|
-
if (!options.mfaCodeProvider) {
|
|
365
|
-
throw new config.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });
|
|
366
|
-
}
|
|
367
|
-
params.SerialNumber = mfa_serial;
|
|
368
|
-
params.TokenCode = await options.mfaCodeProvider(mfa_serial);
|
|
369
|
-
}
|
|
370
|
-
const sourceCreds = await sourceCredsProvider;
|
|
371
|
-
return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
|
|
372
|
-
}
|
|
373
|
-
}, isCredentialSourceWithoutRoleArn = (section) => {
|
|
374
|
-
return !section.role_arn && !!section.credential_source;
|
|
375
|
-
}, isLoginProfile = (data) => {
|
|
376
|
-
return Boolean(data && data.login_session);
|
|
377
|
-
}, resolveLoginCredentials = async (profileName, options, callerClientConfig) => {
|
|
378
|
-
const credentials = await credentialProviderLogin.fromLoginCredentials({
|
|
379
|
-
...options,
|
|
380
|
-
profile: profileName
|
|
381
|
-
})({ callerClientConfig });
|
|
382
|
-
return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE_LOGIN", "AC");
|
|
383
|
-
}, isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string", resolveProcessCredentials = async (options, profile) => import("./index-vhncw983.js").then(({ fromProcess }) => fromProcess({
|
|
384
|
-
...options,
|
|
385
|
-
profile
|
|
386
|
-
})().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))), resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => {
|
|
387
|
-
const { fromSSO } = await import("./index-xk036zsk.js");
|
|
388
|
-
return fromSSO({
|
|
389
|
-
profile,
|
|
390
|
-
logger: options.logger,
|
|
391
|
-
parentClientConfig: options.parentClientConfig,
|
|
392
|
-
clientConfig: options.clientConfig
|
|
393
|
-
})({
|
|
394
|
-
callerClientConfig
|
|
395
|
-
}).then((creds) => {
|
|
396
|
-
if (profileData.sso_session) {
|
|
397
|
-
return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r");
|
|
398
|
-
} else {
|
|
399
|
-
return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
}, 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"), 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, resolveStaticCredentials = async (profile, options) => {
|
|
403
|
-
options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
|
|
404
|
-
const credentials = {
|
|
405
|
-
accessKeyId: profile.aws_access_key_id,
|
|
406
|
-
secretAccessKey: profile.aws_secret_access_key,
|
|
407
|
-
sessionToken: profile.aws_session_token,
|
|
408
|
-
...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope },
|
|
409
|
-
...profile.aws_account_id && { accountId: profile.aws_account_id }
|
|
410
|
-
};
|
|
411
|
-
return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n");
|
|
412
|
-
}, 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, resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => import("./index-8fdjzb2f.js").then((m)=>__toESM(m.default,1)).then(({ fromTokenFile }) => fromTokenFile({
|
|
413
|
-
webIdentityTokenFile: profile.web_identity_token_file,
|
|
414
|
-
roleArn: profile.role_arn,
|
|
415
|
-
roleSessionName: profile.role_session_name,
|
|
416
|
-
roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
|
|
417
|
-
logger: options.logger,
|
|
418
|
-
parentClientConfig: options.parentClientConfig
|
|
419
|
-
})({
|
|
420
|
-
callerClientConfig
|
|
421
|
-
}).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))), resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
|
|
422
|
-
const data = profiles[profileName];
|
|
423
|
-
if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
|
|
424
|
-
return resolveStaticCredentials(data, options);
|
|
425
|
-
}
|
|
426
|
-
if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {
|
|
427
|
-
return resolveAssumeRoleCredentials(profileName, profiles, options, callerClientConfig, visitedProfiles, resolveProfileData);
|
|
428
|
-
}
|
|
429
|
-
if (isStaticCredsProfile(data)) {
|
|
430
|
-
return resolveStaticCredentials(data, options);
|
|
431
|
-
}
|
|
432
|
-
if (isWebIdentityProfile(data)) {
|
|
433
|
-
return resolveWebIdentityCredentials(data, options, callerClientConfig);
|
|
434
|
-
}
|
|
435
|
-
if (isProcessProfile(data)) {
|
|
436
|
-
return resolveProcessCredentials(options, profileName);
|
|
437
|
-
}
|
|
438
|
-
if (isSsoProfile(data)) {
|
|
439
|
-
return await resolveSsoCredentials(profileName, data, options, callerClientConfig);
|
|
440
|
-
}
|
|
441
|
-
if (isLoginProfile(data)) {
|
|
442
|
-
return resolveLoginCredentials(profileName, options, callerClientConfig);
|
|
443
|
-
}
|
|
444
|
-
throw new config.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });
|
|
445
|
-
}, fromIni = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
446
|
-
init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
|
|
447
|
-
const profiles = await config.parseKnownFiles(init);
|
|
448
|
-
return resolveProfileData(config.getProfileName({
|
|
449
|
-
profile: init.profile ?? callerClientConfig?.profile
|
|
450
|
-
}), profiles, init, callerClientConfig);
|
|
451
|
-
}, $fromIni;
|
|
452
|
-
var init_dist_cjs = __esm(() => {
|
|
453
|
-
config = require_config();
|
|
454
|
-
client = require_client();
|
|
455
|
-
credentialProviderLogin = require_dist_cjs();
|
|
456
|
-
$fromIni = fromIni;
|
|
457
|
-
});
|
|
458
|
-
init_dist_cjs();
|
|
459
|
-
|
|
460
|
-
export {
|
|
461
|
-
$fromIni as fromIni
|
|
462
|
-
};
|
|
463
|
-
export default {
|
|
464
|
-
get fromIni() {
|
|
465
|
-
return $fromIni;
|
|
466
|
-
}
|
|
467
|
-
};
|
package/dist/index-1p8wdstt.js
DELETED
package/dist/index-8fdjzb2f.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
require_client
|
|
3
|
-
} from "./cli-tcvj7j2r.js";
|
|
4
|
-
import {
|
|
5
|
-
require_config
|
|
6
|
-
} from "./cli-qa66qaf0.js";
|
|
7
|
-
import {
|
|
8
|
-
__commonJS,
|
|
9
|
-
__require
|
|
10
|
-
} from "./cli-bc05qbss.js";
|
|
11
|
-
|
|
12
|
-
// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js
|
|
13
|
-
var require_fromWebToken = __commonJS(function(exports) {
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.fromWebToken = undefined;
|
|
16
|
-
var fromWebToken = (init) => async (awsIdentityProperties) => {
|
|
17
|
-
init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
|
|
18
|
-
const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
|
|
19
|
-
let { roleAssumerWithWebIdentity } = init;
|
|
20
|
-
if (!roleAssumerWithWebIdentity) {
|
|
21
|
-
const { getDefaultRoleAssumerWithWebIdentity } = await import("./index-pyymnzat.js");
|
|
22
|
-
roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
|
|
23
|
-
...init.clientConfig,
|
|
24
|
-
credentialProviderLogger: init.logger,
|
|
25
|
-
parentClientConfig: {
|
|
26
|
-
...awsIdentityProperties?.callerClientConfig,
|
|
27
|
-
...init.parentClientConfig
|
|
28
|
-
}
|
|
29
|
-
}, init.clientPlugins);
|
|
30
|
-
}
|
|
31
|
-
return roleAssumerWithWebIdentity({
|
|
32
|
-
RoleArn: roleArn,
|
|
33
|
-
RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
|
|
34
|
-
WebIdentityToken: webIdentityToken,
|
|
35
|
-
ProviderId: providerId,
|
|
36
|
-
PolicyArns: policyArns,
|
|
37
|
-
Policy: policy,
|
|
38
|
-
DurationSeconds: durationSeconds
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
exports.fromWebToken = fromWebToken;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js
|
|
45
|
-
var require_fromTokenFile = __commonJS(function(exports) {
|
|
46
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.fromTokenFile = undefined;
|
|
48
|
-
var client_1 = require_client();
|
|
49
|
-
var config_1 = require_config();
|
|
50
|
-
var node_fs_1 = __require("node:fs");
|
|
51
|
-
var fromWebToken_1 = require_fromWebToken();
|
|
52
|
-
var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
|
|
53
|
-
var ENV_ROLE_ARN = "AWS_ROLE_ARN";
|
|
54
|
-
var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
|
|
55
|
-
var fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
|
|
56
|
-
init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
|
|
57
|
-
const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
|
|
58
|
-
const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
|
|
59
|
-
const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
|
|
60
|
-
if (!webIdentityTokenFile || !roleArn) {
|
|
61
|
-
throw new config_1.CredentialsProviderError("Web identity configuration not specified", {
|
|
62
|
-
logger: init.logger
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
const credentials = await (0, fromWebToken_1.fromWebToken)({
|
|
66
|
-
...init,
|
|
67
|
-
webIdentityToken: config_1.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? (0, node_fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }),
|
|
68
|
-
roleArn,
|
|
69
|
-
roleSessionName
|
|
70
|
-
})(awsIdentityProperties);
|
|
71
|
-
if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
|
|
72
|
-
(0, client_1.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
|
|
73
|
-
}
|
|
74
|
-
return credentials;
|
|
75
|
-
};
|
|
76
|
-
exports.fromTokenFile = fromTokenFile;
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js
|
|
80
|
-
var require_dist_cjs = __commonJS(function(exports) {
|
|
81
|
-
var fromTokenFile = require_fromTokenFile();
|
|
82
|
-
var fromWebToken = require_fromWebToken();
|
|
83
|
-
Object.prototype.hasOwnProperty.call(fromTokenFile, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
value: fromTokenFile["__proto__"]
|
|
86
|
-
});
|
|
87
|
-
Object.keys(fromTokenFile).forEach(function(k) {
|
|
88
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
89
|
-
exports[k] = fromTokenFile[k];
|
|
90
|
-
});
|
|
91
|
-
Object.prototype.hasOwnProperty.call(fromWebToken, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
value: fromWebToken["__proto__"]
|
|
94
|
-
});
|
|
95
|
-
Object.keys(fromWebToken).forEach(function(k) {
|
|
96
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
97
|
-
exports[k] = fromWebToken[k];
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
export default require_dist_cjs();
|