@warlock.js/devtools 5.56.0 → 5.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +3 -0
- package/cjs/{auth-DzU0gHDG.cjs → auth-DV2GA1A9.cjs} +33 -403
- package/cjs/auth-DV2GA1A9.cjs.map +1 -0
- package/cjs/{boot-BQi0Etor.cjs → boot-CyeHPFtk.cjs} +14 -12
- package/cjs/boot-CyeHPFtk.cjs.map +1 -0
- package/cjs/{capture-CqIiaznN.cjs → capture-DcyBhdqw.cjs} +3 -3
- package/cjs/{capture-CqIiaznN.cjs.map → capture-DcyBhdqw.cjs.map} +1 -1
- package/cjs/{cascade-store-pHjKeSFm.cjs → cascade-store-DEGxAFDI.cjs} +141 -4
- package/cjs/cascade-store-DEGxAFDI.cjs.map +1 -0
- package/cjs/{contracts-CVmplkNb.cjs → contracts-CDuY-ahl.cjs} +6 -2
- package/cjs/{contracts-CVmplkNb.cjs.map → contracts-CDuY-ahl.cjs.map} +1 -1
- package/cjs/{errors-CyZp5yS-.cjs → errors-DEqdWaqm.cjs} +3 -1
- package/cjs/{errors-CyZp5yS-.cjs.map → errors-DEqdWaqm.cjs.map} +1 -1
- package/cjs/helpers-7k_Q-abk.cjs +436 -0
- package/cjs/helpers-7k_Q-abk.cjs.map +1 -0
- package/cjs/{histogram-BaI-PnCv.cjs → histogram-BRV5eHcp.cjs} +2 -2
- package/cjs/{histogram-BaI-PnCv.cjs.map → histogram-BRV5eHcp.cjs.map} +1 -1
- package/cjs/{http-CabcUwBx.cjs → http-XNLYU2vS.cjs} +517 -28
- package/cjs/http-XNLYU2vS.cjs.map +1 -0
- package/cjs/index.cjs +2 -1
- package/cjs/{insights-BKtqxdnP.cjs → insights-BBZnUpWO.cjs} +4 -3
- package/cjs/{insights-BKtqxdnP.cjs.map → insights-BBZnUpWO.cjs.map} +1 -1
- package/cjs/{migrations-w7GMsrQw.cjs → migrations-DTTzCNpR.cjs} +38 -3
- package/cjs/migrations-DTTzCNpR.cjs.map +1 -0
- package/cjs/{options-CWqFC5__.cjs → options-CHhmQJic.cjs} +16 -4
- package/cjs/options-CHhmQJic.cjs.map +1 -0
- package/cjs/{panels-B0dAfGbJ.cjs → panels-CHd20RK5.cjs} +97 -10
- package/cjs/panels-CHd20RK5.cjs.map +1 -0
- package/cjs/production/index.cjs +4 -4
- package/cjs/{server-B6xdeKS8.cjs → server-C8JfggQU.cjs} +5 -4
- package/cjs/server-C8JfggQU.cjs.map +1 -0
- package/cjs/{src-Ce-3Lniv.cjs → src-DjOUdhKc.cjs} +96 -10
- package/cjs/src-DjOUdhKc.cjs.map +1 -0
- package/cjs/{store-aq207T8v.cjs → store-C06KO_A1.cjs} +2 -2
- package/cjs/{stream-route-BGJa-zQu.cjs → stream-route-D4k-sJvW.cjs} +70 -9
- package/cjs/stream-route-D4k-sJvW.cjs.map +1 -0
- package/esm/devtools-connector.d.mts.map +1 -1
- package/esm/devtools-connector.mjs +10 -3
- package/esm/devtools-connector.mjs.map +1 -1
- package/esm/index.d.mts +4 -3
- package/esm/index.mjs +2 -1
- package/esm/panel-errors.mjs +33 -0
- package/esm/panel-errors.mjs.map +1 -0
- package/esm/panel-tokens.d.mts +13 -0
- package/esm/panel-tokens.d.mts.map +1 -0
- package/esm/panel-tokens.mjs +45 -0
- package/esm/panel-tokens.mjs.map +1 -0
- package/esm/panels.mjs +96 -9
- package/esm/panels.mjs.map +1 -1
- package/esm/production/auth/service.mjs +4 -2
- package/esm/production/auth/service.mjs.map +1 -1
- package/esm/production/boot.mjs +4 -2
- package/esm/production/boot.mjs.map +1 -1
- package/esm/production/contracts.d.mts +68 -2
- package/esm/production/contracts.d.mts.map +1 -1
- package/esm/production/contracts.mjs +5 -1
- package/esm/production/contracts.mjs.map +1 -1
- package/esm/production/errors.mjs +2 -0
- package/esm/production/errors.mjs.map +1 -1
- package/esm/production/http/access.mjs +6 -2
- package/esm/production/http/access.mjs.map +1 -1
- package/esm/production/http/constants.mjs +7 -1
- package/esm/production/http/constants.mjs.map +1 -1
- package/esm/production/http/context.mjs.map +1 -1
- package/esm/production/http/cookie.mjs +23 -2
- package/esm/production/http/cookie.mjs.map +1 -1
- package/esm/production/http/mount.mjs +25 -3
- package/esm/production/http/mount.mjs.map +1 -1
- package/esm/production/http/share-session.mjs +114 -0
- package/esm/production/http/share-session.mjs.map +1 -0
- package/esm/production/http/share.mjs +339 -0
- package/esm/production/http/share.mjs.map +1 -0
- package/esm/production/index.d.mts +2 -2
- package/esm/production/insights/writer.mjs +2 -1
- package/esm/production/insights/writer.mjs.map +1 -1
- package/esm/production/options.d.mts +5 -0
- package/esm/production/options.d.mts.map +1 -1
- package/esm/production/options.mjs +14 -2
- package/esm/production/options.mjs.map +1 -1
- package/esm/production/store/cascade-store.mjs +49 -2
- package/esm/production/store/cascade-store.mjs.map +1 -1
- package/esm/production/store/mapping.mjs +29 -1
- package/esm/production/store/mapping.mjs.map +1 -1
- package/esm/production/store/memory-store.mjs +62 -0
- package/esm/production/store/memory-store.mjs.map +1 -1
- package/esm/production/store/migrations.d.mts +2 -1
- package/esm/production/store/migrations.d.mts.map +1 -1
- package/esm/production/store/migrations.mjs +5 -2
- package/esm/production/store/migrations.mjs.map +1 -1
- package/esm/production/store/models/index.mjs +3 -1
- package/esm/production/store/models/share.migration.mjs +27 -0
- package/esm/production/store/models/share.migration.mjs.map +1 -0
- package/esm/production/store/models/share.model.mjs +13 -0
- package/esm/production/store/models/share.model.mjs.map +1 -0
- package/esm/server/panel-files.mjs +35 -0
- package/esm/server/panel-files.mjs.map +1 -0
- package/esm/server/panel-routes.mjs +27 -7
- package/esm/server/panel-routes.mjs.map +1 -1
- package/esm/server/session-routes.mjs +2 -1
- package/esm/server/session-routes.mjs.map +1 -1
- package/esm/types.d.mts +87 -4
- package/esm/types.d.mts.map +1 -1
- package/llms-full.txt +41 -4
- package/package.json +8 -8
- package/skills/SKILL.md +41 -4
- package/ui/dashboard/assets/app.css +1 -1
- package/ui/dashboard/assets/app.js +16 -16
- package/ui/dashboard/build-info.json +10 -10
- package/ui/dashboard/index.html +1 -0
- package/ui/panels/processes.js +12 -3
- package/cjs/auth-DzU0gHDG.cjs.map +0 -1
- package/cjs/boot-BQi0Etor.cjs.map +0 -1
- package/cjs/cascade-store-pHjKeSFm.cjs.map +0 -1
- package/cjs/http-CabcUwBx.cjs.map +0 -1
- package/cjs/migrations-w7GMsrQw.cjs.map +0 -1
- package/cjs/options-CWqFC5__.cjs.map +0 -1
- package/cjs/panels-B0dAfGbJ.cjs.map +0 -1
- package/cjs/server-B6xdeKS8.cjs.map +0 -1
- package/cjs/src-Ce-3Lniv.cjs.map +0 -1
- package/cjs/stream-route-BGJa-zQu.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,37 @@ All notable changes to `@warlock.js/devtools` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
6
|
|
|
7
|
+
## 5.58.0 - 2026-11-18
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Read-only share links in the production monitor (`production.share.enabled`): an admin creates an expiring, revocable link to a shareable panel (the Grimoire product map) under Admin, Share links, with a label. The token stays in the URL fragment and is stored hashed; the link opens only that panel's shared view. Needs the new `devtools_shares` table from `devtoolsMigrations`.
|
|
12
|
+
- Panels can serve a folder of images (`files`), declare a shared view (`share`), and receive captured error counts (`errors`). View contexts gain `file()`, `shared` and `share`, and panel requests carry `shared` when they come through a share link.
|
|
13
|
+
- A panel view's `asset()` and `file()` return absolute URLs, so a view can `import()` another of its modules.
|
|
14
|
+
|
|
15
|
+
## 5.57.0 - 2026-11-18
|
|
16
|
+
|
|
17
|
+
### Upgrading
|
|
18
|
+
|
|
19
|
+
- The dashboard has a new palette and layout. A package panel whose stylesheet used CSS variables the dashboard never defined (anything outside `DEVTOOLS_PANEL_TOKENS`) should switch to the listed tokens; see "Styling a panel" in the docs.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- The `panels` option accepts `[specifier, options]` entries. The options object is passed to the panel factory next to `root` and `mode`, for example `panels: [["@warlock.js/grimoire/devtools", { ttlMs: 60_000 }]]`. An invalid entry is reported with what to change and skipped; the other panels still load.
|
|
24
|
+
- `DEVTOOLS_PANEL_TOKENS`: the CSS variables a package panel stylesheet may use. Every one is defined in the light and the dark theme, and a spec checks the definitions, their WCAG AA contrast and the built-in panel views.
|
|
25
|
+
- A command palette (Ctrl/Cmd+K, or the search button in the top bar) jumps to any tab, the account page or an admin page.
|
|
26
|
+
- A theme toggle (system, light, dark) in the top bar, saved in the browser.
|
|
27
|
+
- Package panels show a "Loading <title>…" state while their view loads, so a slow panel is never a blank area.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- The dashboard has a new look: a left sidebar with grouped, icon-labelled tabs (Monitor, Application, AI, Packages), a slim top bar, and a slide-over menu on narrow screens. Light and dark themes use a tinted palette with one brand colour, and every text colour meets WCAG AA contrast on both themes.
|
|
32
|
+
- Every built-in tab opens with a description and its actions, a row of summary figures, and a filter bar with result counts and a Clear filters action. Requests gains a status-class filter, Queries a Slow / N+1 / Errors filter, Errors a Source filter, and Logs a message search and a level control.
|
|
33
|
+
- Status codes, methods and log levels are colour-coded pills, durations show a bar sized against the rest of the list, table headers stay in view while scrolling, and rows open their detail with the keyboard as well as the mouse. Tables scroll inside their card on narrow screens.
|
|
34
|
+
- Detail views are split into titled sections with key/value grids and code blocks with copy buttons. The request detail has a Close button and a waterfall legend.
|
|
35
|
+
- Badges gain `success`, `warning`, `info`, `brand` and `neutral` tones, buttons gain `brand` and `soft`, and empty states show an icon and what to do next.
|
|
36
|
+
- Sign-in, account and admin screens use the new look.
|
|
37
|
+
|
|
7
38
|
## 5.56.0 - 2026-11-17
|
|
8
39
|
|
|
9
40
|
### Upgrading
|
package/README.md
CHANGED
|
@@ -35,6 +35,9 @@ warlock dev
|
|
|
35
35
|
Without `production.enabled`, nothing is mounted and nothing is captured. The app refuses to start when the monitor
|
|
36
36
|
is enabled but misconfigured. Full guide: https://warlock.js.org/v/latest/devtools/production/
|
|
37
37
|
|
|
38
|
+
Optional: set `production.share.enabled` to let an admin give a read-only, expiring, revocable link to a panel that
|
|
39
|
+
declares a shared view (such as the Grimoire product map). The token is stored hashed; see the production guide.
|
|
40
|
+
|
|
38
41
|
## Safe by construction
|
|
39
42
|
|
|
40
43
|
- In development it answers loopback clients only. Anything else gets a 404, and `X-Forwarded-For` cannot unlock it.
|
|
@@ -1,381 +1,9 @@
|
|
|
1
|
-
const require_contracts = require("./contracts-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_contracts = require("./contracts-CDuY-ahl.cjs");
|
|
2
|
+
const require_errors = require("./errors-DEqdWaqm.cjs");
|
|
3
3
|
const require_ip = require("./ip-DbNhPOzi.cjs");
|
|
4
|
+
const require_helpers = require("./helpers-7k_Q-abk.cjs");
|
|
4
5
|
let node_crypto = require("node:crypto");
|
|
5
6
|
|
|
6
|
-
//#region ../../packages/devtools/src/production/auth/common-passwords.ts
|
|
7
|
-
/**
|
|
8
|
-
* Passwords the monitor refuses (compared lower-cased). Short entries are
|
|
9
|
-
* left out: the length rule already refuses them.
|
|
10
|
-
*/
|
|
11
|
-
const COMMON_PASSWORDS = /* @__PURE__ */ new Set([
|
|
12
|
-
"password",
|
|
13
|
-
"password1",
|
|
14
|
-
"password12",
|
|
15
|
-
"password123",
|
|
16
|
-
"password1234",
|
|
17
|
-
"passw0rd",
|
|
18
|
-
"p@ssw0rd",
|
|
19
|
-
"p@ssword",
|
|
20
|
-
"password!",
|
|
21
|
-
"password1!",
|
|
22
|
-
"password2",
|
|
23
|
-
"password3",
|
|
24
|
-
"password01",
|
|
25
|
-
"password11",
|
|
26
|
-
"password99",
|
|
27
|
-
"pa55word",
|
|
28
|
-
"pa$$word",
|
|
29
|
-
"12345678",
|
|
30
|
-
"123456789",
|
|
31
|
-
"1234567890",
|
|
32
|
-
"12345678910",
|
|
33
|
-
"123123123",
|
|
34
|
-
"1234qwer",
|
|
35
|
-
"1q2w3e4r",
|
|
36
|
-
"1q2w3e4r5t",
|
|
37
|
-
"1q2w3e4r5t6y",
|
|
38
|
-
"1qaz2wsx",
|
|
39
|
-
"1qaz2wsx3edc",
|
|
40
|
-
"1qazxsw2",
|
|
41
|
-
"qwertyui",
|
|
42
|
-
"qwertyuiop",
|
|
43
|
-
"qwerty123",
|
|
44
|
-
"qwerty1234",
|
|
45
|
-
"qwerty12",
|
|
46
|
-
"qwertyuio",
|
|
47
|
-
"qwerty123456",
|
|
48
|
-
"qwerty12345",
|
|
49
|
-
"asdfghjk",
|
|
50
|
-
"asdfghjkl",
|
|
51
|
-
"asdfgh123",
|
|
52
|
-
"zxcvbnm1",
|
|
53
|
-
"zxcvbnmasd",
|
|
54
|
-
"zxcvbnm123",
|
|
55
|
-
"abcd1234",
|
|
56
|
-
"abcd12345",
|
|
57
|
-
"abc12345",
|
|
58
|
-
"abc123456",
|
|
59
|
-
"abcdefgh",
|
|
60
|
-
"abcdefg1",
|
|
61
|
-
"abcdefgh1",
|
|
62
|
-
"abcdefghi",
|
|
63
|
-
"iloveyou",
|
|
64
|
-
"iloveyou1",
|
|
65
|
-
"iloveyou2",
|
|
66
|
-
"iloveyou123",
|
|
67
|
-
"letmein1",
|
|
68
|
-
"letmein123",
|
|
69
|
-
"letmein12",
|
|
70
|
-
"welcome1",
|
|
71
|
-
"welcome12",
|
|
72
|
-
"welcome123",
|
|
73
|
-
"welcome01",
|
|
74
|
-
"welcome2",
|
|
75
|
-
"monkey123",
|
|
76
|
-
"monkey12",
|
|
77
|
-
"dragon123",
|
|
78
|
-
"dragon12",
|
|
79
|
-
"master123",
|
|
80
|
-
"master12",
|
|
81
|
-
"shadow123",
|
|
82
|
-
"shadow12",
|
|
83
|
-
"sunshine",
|
|
84
|
-
"sunshine1",
|
|
85
|
-
"sunshine123",
|
|
86
|
-
"princess",
|
|
87
|
-
"princess1",
|
|
88
|
-
"princess123",
|
|
89
|
-
"football",
|
|
90
|
-
"football1",
|
|
91
|
-
"football123",
|
|
92
|
-
"baseball",
|
|
93
|
-
"baseball1",
|
|
94
|
-
"baseball123",
|
|
95
|
-
"basketball",
|
|
96
|
-
"soccer123",
|
|
97
|
-
"hockey123",
|
|
98
|
-
"superman",
|
|
99
|
-
"superman1",
|
|
100
|
-
"superman123",
|
|
101
|
-
"batman123",
|
|
102
|
-
"batman12",
|
|
103
|
-
"spiderman",
|
|
104
|
-
"spiderman1",
|
|
105
|
-
"trustno1",
|
|
106
|
-
"trustno123",
|
|
107
|
-
"trustnoone",
|
|
108
|
-
"whatever",
|
|
109
|
-
"whatever1",
|
|
110
|
-
"whatever123",
|
|
111
|
-
"freedom1",
|
|
112
|
-
"freedom123",
|
|
113
|
-
"starwars",
|
|
114
|
-
"starwars1",
|
|
115
|
-
"starwars123",
|
|
116
|
-
"pokemon1",
|
|
117
|
-
"pokemon123",
|
|
118
|
-
"charlie1",
|
|
119
|
-
"charlie123",
|
|
120
|
-
"michael1",
|
|
121
|
-
"michael123",
|
|
122
|
-
"jessica1",
|
|
123
|
-
"jessica123",
|
|
124
|
-
"jennifer",
|
|
125
|
-
"jennifer1",
|
|
126
|
-
"daniel123",
|
|
127
|
-
"daniel12",
|
|
128
|
-
"thomas123",
|
|
129
|
-
"hunter123",
|
|
130
|
-
"hunter12",
|
|
131
|
-
"hunter2hunter2",
|
|
132
|
-
"hello123",
|
|
133
|
-
"hello1234",
|
|
134
|
-
"hello12345",
|
|
135
|
-
"helloworld",
|
|
136
|
-
"helloworld1",
|
|
137
|
-
"hello@123",
|
|
138
|
-
"admin123",
|
|
139
|
-
"admin1234",
|
|
140
|
-
"admin12345",
|
|
141
|
-
"admin@123",
|
|
142
|
-
"admin@1234",
|
|
143
|
-
"administrator",
|
|
144
|
-
"administrator1",
|
|
145
|
-
"adminadmin",
|
|
146
|
-
"adminadmin1",
|
|
147
|
-
"admin2020",
|
|
148
|
-
"admin2021",
|
|
149
|
-
"admin2022",
|
|
150
|
-
"admin2023",
|
|
151
|
-
"admin2024",
|
|
152
|
-
"admin2025",
|
|
153
|
-
"admin2026",
|
|
154
|
-
"root1234",
|
|
155
|
-
"root12345",
|
|
156
|
-
"toor1234",
|
|
157
|
-
"test1234",
|
|
158
|
-
"test12345",
|
|
159
|
-
"test123456",
|
|
160
|
-
"testtest",
|
|
161
|
-
"testing123",
|
|
162
|
-
"testing1",
|
|
163
|
-
"guest123",
|
|
164
|
-
"guest1234",
|
|
165
|
-
"changeme",
|
|
166
|
-
"changeme1",
|
|
167
|
-
"changeme123",
|
|
168
|
-
"change123",
|
|
169
|
-
"default1",
|
|
170
|
-
"default123",
|
|
171
|
-
"secret123",
|
|
172
|
-
"secret1234",
|
|
173
|
-
"secretpassword",
|
|
174
|
-
"mypassword",
|
|
175
|
-
"mypassword1",
|
|
176
|
-
"mypassword123",
|
|
177
|
-
"mypass123",
|
|
178
|
-
"mysecret1",
|
|
179
|
-
"login123",
|
|
180
|
-
"login1234",
|
|
181
|
-
"access123",
|
|
182
|
-
"access14",
|
|
183
|
-
"qazwsxedc",
|
|
184
|
-
"qazwsx123",
|
|
185
|
-
"qazxswedc",
|
|
186
|
-
"qweasdzxc",
|
|
187
|
-
"qweasd123",
|
|
188
|
-
"qweqweqwe",
|
|
189
|
-
"asdasdasd",
|
|
190
|
-
"asdasd123",
|
|
191
|
-
"zaq12wsx",
|
|
192
|
-
"zaq1zaq1",
|
|
193
|
-
"zaq1xsw2",
|
|
194
|
-
"aaaaaaaa",
|
|
195
|
-
"aaaaaaa1",
|
|
196
|
-
"11111111",
|
|
197
|
-
"111111111",
|
|
198
|
-
"1111111111",
|
|
199
|
-
"00000000",
|
|
200
|
-
"000000000",
|
|
201
|
-
"0000000000",
|
|
202
|
-
"12341234",
|
|
203
|
-
"12121212",
|
|
204
|
-
"11223344",
|
|
205
|
-
"1122334455",
|
|
206
|
-
"123321123",
|
|
207
|
-
"12344321",
|
|
208
|
-
"123456789a",
|
|
209
|
-
"123456abc",
|
|
210
|
-
"1234567a",
|
|
211
|
-
"1234abcd",
|
|
212
|
-
"987654321",
|
|
213
|
-
"9876543210",
|
|
214
|
-
"98765432",
|
|
215
|
-
"88888888",
|
|
216
|
-
"66666666",
|
|
217
|
-
"55555555",
|
|
218
|
-
"77777777",
|
|
219
|
-
"99999999",
|
|
220
|
-
"22222222",
|
|
221
|
-
"33333333",
|
|
222
|
-
"44444444",
|
|
223
|
-
"pass1234",
|
|
224
|
-
"pass12345",
|
|
225
|
-
"pass123456",
|
|
226
|
-
"passpass",
|
|
227
|
-
"passpass1",
|
|
228
|
-
"pass@123",
|
|
229
|
-
"pass@1234",
|
|
230
|
-
"mustang1",
|
|
231
|
-
"mustang123",
|
|
232
|
-
"ranger123",
|
|
233
|
-
"harley123",
|
|
234
|
-
"ferrari1",
|
|
235
|
-
"porsche1",
|
|
236
|
-
"computer",
|
|
237
|
-
"computer1",
|
|
238
|
-
"computer123",
|
|
239
|
-
"internet",
|
|
240
|
-
"internet1",
|
|
241
|
-
"internet123",
|
|
242
|
-
"windows1",
|
|
243
|
-
"windows123",
|
|
244
|
-
"microsoft",
|
|
245
|
-
"linux123",
|
|
246
|
-
"ubuntu123",
|
|
247
|
-
"google123",
|
|
248
|
-
"google12",
|
|
249
|
-
"facebook",
|
|
250
|
-
"facebook1",
|
|
251
|
-
"facebook123",
|
|
252
|
-
"twitter1",
|
|
253
|
-
"youtube1",
|
|
254
|
-
"instagram",
|
|
255
|
-
"samsung1",
|
|
256
|
-
"samsung123",
|
|
257
|
-
"iphone123",
|
|
258
|
-
"android1",
|
|
259
|
-
"android123",
|
|
260
|
-
"liverpool",
|
|
261
|
-
"liverpool1",
|
|
262
|
-
"manchester",
|
|
263
|
-
"chelsea1",
|
|
264
|
-
"arsenal1",
|
|
265
|
-
"barcelona",
|
|
266
|
-
"realmadrid1",
|
|
267
|
-
"cheese123",
|
|
268
|
-
"chocolate",
|
|
269
|
-
"chocolate1",
|
|
270
|
-
"cookie123",
|
|
271
|
-
"banana123",
|
|
272
|
-
"butterfly",
|
|
273
|
-
"butterfly1",
|
|
274
|
-
"flower123",
|
|
275
|
-
"rainbow1",
|
|
276
|
-
"rainbow123",
|
|
277
|
-
"summer123",
|
|
278
|
-
"summer2024",
|
|
279
|
-
"summer2025",
|
|
280
|
-
"winter123",
|
|
281
|
-
"winter2024",
|
|
282
|
-
"winter2025",
|
|
283
|
-
"spring123",
|
|
284
|
-
"autumn123",
|
|
285
|
-
"january1",
|
|
286
|
-
"february1",
|
|
287
|
-
"december1",
|
|
288
|
-
"qwerty@123",
|
|
289
|
-
"abc@12345",
|
|
290
|
-
"p@55w0rd",
|
|
291
|
-
"p@$$w0rd",
|
|
292
|
-
"passw0rd1",
|
|
293
|
-
"passw0rd!",
|
|
294
|
-
"warlock123",
|
|
295
|
-
"warlock1",
|
|
296
|
-
"devtools",
|
|
297
|
-
"devtools1",
|
|
298
|
-
"devtools123",
|
|
299
|
-
"monitor123",
|
|
300
|
-
"monitor1",
|
|
301
|
-
"dashboard",
|
|
302
|
-
"dashboard1",
|
|
303
|
-
"dashboard123"
|
|
304
|
-
]);
|
|
305
|
-
|
|
306
|
-
//#endregion
|
|
307
|
-
//#region ../../packages/devtools/src/production/auth/helpers.ts
|
|
308
|
-
const MIN_PASSWORD_LENGTH = 8;
|
|
309
|
-
const MAX_PASSWORD_BYTES = 72;
|
|
310
|
-
/** The alphabet of recovery codes and references: no 0, 1, 8, 9, I, L, O. */
|
|
311
|
-
const CODE_ALPHABET = "ABCDEFGHJKMNPQRSTUVWXYZ23456789";
|
|
312
|
-
/** Letters and digits that cannot be mistaken for each other. */
|
|
313
|
-
const TEMPORARY_ALPHABET = "ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789";
|
|
314
|
-
/**
|
|
315
|
-
* The password rules: at least 8 characters, at most 72 bytes (UTF-8), not in
|
|
316
|
-
* the built-in common list (compared lower-cased), not equal to the email
|
|
317
|
-
* (lower-cased). Returns the failing rule's error code, or `null`.
|
|
318
|
-
*/
|
|
319
|
-
function checkPasswordPolicy(password, email) {
|
|
320
|
-
if (typeof password !== "string" || [...password].length < MIN_PASSWORD_LENGTH) return "auth.password-too-short";
|
|
321
|
-
if (Buffer.byteLength(password, "utf8") > MAX_PASSWORD_BYTES) return "auth.password-too-long";
|
|
322
|
-
const lower = password.toLowerCase();
|
|
323
|
-
if (COMMON_PASSWORDS.has(lower)) return "auth.password-common";
|
|
324
|
-
if (email !== null && lower === email.trim().toLowerCase()) return "auth.password-same-as-email";
|
|
325
|
-
return null;
|
|
326
|
-
}
|
|
327
|
-
/** 32 random bytes, base64url (43 characters): session, CSRF and invite tokens. */
|
|
328
|
-
function generateToken() {
|
|
329
|
-
return (0, node_crypto.randomBytes)(32).toString("base64url");
|
|
330
|
-
}
|
|
331
|
-
/** SHA-256 hex of a token: what the store keeps. */
|
|
332
|
-
function hashToken(token) {
|
|
333
|
-
return (0, node_crypto.createHash)("sha256").update(token).digest("hex");
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* A random temporary password for `warlock devtools:reset-admin`: 20
|
|
337
|
-
* characters from an unambiguous alphabet, passes `checkPasswordPolicy`.
|
|
338
|
-
*/
|
|
339
|
-
function generateTemporaryPassword() {
|
|
340
|
-
for (;;) {
|
|
341
|
-
let password = "";
|
|
342
|
-
for (let index = 0; index < 20; index++) password += TEMPORARY_ALPHABET[(0, node_crypto.randomInt)(54)];
|
|
343
|
-
if (checkPasswordPolicy(password, null) === null) return password;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
/** Compares two strings in constant time (both are hashed first, so lengths do not leak). */
|
|
347
|
-
function safeEqual(a, b) {
|
|
348
|
-
const left = (0, node_crypto.createHash)("sha256").update(String(a)).digest();
|
|
349
|
-
const right = (0, node_crypto.createHash)("sha256").update(String(b)).digest();
|
|
350
|
-
return (0, node_crypto.timingSafeEqual)(left, right);
|
|
351
|
-
}
|
|
352
|
-
/** Emails are compared trimmed and lower-cased. */
|
|
353
|
-
function normalizeEmail(email) {
|
|
354
|
-
return typeof email === "string" ? email.trim().toLowerCase() : "";
|
|
355
|
-
}
|
|
356
|
-
/** A deliberately plain shape check; the invite flow is the real proof of ownership. */
|
|
357
|
-
function isPlausibleEmail(email) {
|
|
358
|
-
return email.length <= 254 && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
359
|
-
}
|
|
360
|
-
/** One recovery code, `xxxxx-xxxxx` from the unambiguous alphabet. */
|
|
361
|
-
function generateRecoveryCode() {
|
|
362
|
-
let code = "";
|
|
363
|
-
for (let index = 0; index < 10; index++) {
|
|
364
|
-
if (index === 5) code += "-";
|
|
365
|
-
code += CODE_ALPHABET[(0, node_crypto.randomInt)(31)];
|
|
366
|
-
}
|
|
367
|
-
return code;
|
|
368
|
-
}
|
|
369
|
-
/** The form a recovery code is hashed in: upper case, letters and digits only. */
|
|
370
|
-
function normalizeRecoveryCode(code) {
|
|
371
|
-
return String(code).toUpperCase().replace(/[^A-Z0-9]/g, "");
|
|
372
|
-
}
|
|
373
|
-
/** SHA-256 hex of a normalized recovery code. */
|
|
374
|
-
function hashRecoveryCode(code) {
|
|
375
|
-
return hashToken(normalizeRecoveryCode(code));
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
//#endregion
|
|
379
7
|
//#region ../../packages/devtools/src/production/auth/service.ts
|
|
380
8
|
const MINUTE = 6e4;
|
|
381
9
|
const HOUR = 60 * MINUTE;
|
|
@@ -440,7 +68,7 @@ function createDevtoolsAuth(deps) {
|
|
|
440
68
|
const hashPassword = (password) => withSlot(() => crypto.hashPassword(password));
|
|
441
69
|
const passwordInput = (value) => typeof value === "string" ? value.slice(0, MAX_PASSWORD_INPUT) : "";
|
|
442
70
|
function requirePolicy(password, email) {
|
|
443
|
-
const problem = checkPasswordPolicy(password, email);
|
|
71
|
+
const problem = require_helpers.checkPasswordPolicy(password, email);
|
|
444
72
|
if (problem !== null) fail(problem);
|
|
445
73
|
}
|
|
446
74
|
const csrfToken = (session) => Buffer.from(crypto.hmac(`devtools-csrf:${session.id}:${session.csrfSecret}`)).toString("base64url");
|
|
@@ -658,11 +286,11 @@ function createDevtoolsAuth(deps) {
|
|
|
658
286
|
}));
|
|
659
287
|
}
|
|
660
288
|
async function createSession(account, stage, meta) {
|
|
661
|
-
const token = generateToken();
|
|
289
|
+
const token = require_helpers.generateToken();
|
|
662
290
|
const at = now();
|
|
663
291
|
const lifetime = stage === "active" ? options.session.maxHours * HOUR : options.session.pendingMinutes * MINUTE;
|
|
664
292
|
const session = await store.sessions.create({
|
|
665
|
-
tokenHash: hashToken(token),
|
|
293
|
+
tokenHash: require_helpers.hashToken(token),
|
|
666
294
|
accountId: account.id,
|
|
667
295
|
stage,
|
|
668
296
|
csrfSecret: (0, node_crypto.randomBytes)(32).toString("base64url"),
|
|
@@ -714,10 +342,10 @@ function createDevtoolsAuth(deps) {
|
|
|
714
342
|
if (auth.stage !== "active" || auth.account.role !== "admin") fail("role.forbidden");
|
|
715
343
|
}
|
|
716
344
|
function newRecoveryCodes() {
|
|
717
|
-
const codes = Array.from({ length: RECOVERY_CODE_COUNT }, () => generateRecoveryCode());
|
|
345
|
+
const codes = Array.from({ length: RECOVERY_CODE_COUNT }, () => require_helpers.generateRecoveryCode());
|
|
718
346
|
return {
|
|
719
347
|
codes,
|
|
720
|
-
hashes: codes.map(hashRecoveryCode)
|
|
348
|
+
hashes: codes.map(require_helpers.hashRecoveryCode)
|
|
721
349
|
};
|
|
722
350
|
}
|
|
723
351
|
/** The step a TOTP code matches for this account, or `null` (also `null` when the step was already used). */
|
|
@@ -737,12 +365,12 @@ function createDevtoolsAuth(deps) {
|
|
|
737
365
|
}
|
|
738
366
|
async function ensureFirstAdmin() {
|
|
739
367
|
const admin = options.admin;
|
|
740
|
-
const email = normalizeEmail(admin.email);
|
|
368
|
+
const email = require_helpers.normalizeEmail(admin.email);
|
|
741
369
|
const existing = email ? await store.accounts.findByEmail(email) : null;
|
|
742
370
|
if (existing && existing.role === "admin") {
|
|
743
371
|
if (existing.passwordSource === "env" && admin.password !== null) {
|
|
744
372
|
if (!await withSlot(() => verifyPassword(admin.password, existing.passwordHash))) {
|
|
745
|
-
if (checkPasswordPolicy(admin.password, email) !== null) throw new require_errors.DevtoolsProductionConfigError("DT004");
|
|
373
|
+
if (require_helpers.checkPasswordPolicy(admin.password, email) !== null) throw new require_errors.DevtoolsProductionConfigError("DT004");
|
|
746
374
|
const hash = await hashPassword(admin.password);
|
|
747
375
|
const updated = await casAccount(existing, (fresh) => fresh.passwordSource === "env" ? {
|
|
748
376
|
passwordHash: hash,
|
|
@@ -764,7 +392,7 @@ function createDevtoolsAuth(deps) {
|
|
|
764
392
|
if (existing || !email || admin.password === null && admin.setupToken === null) throw new require_errors.DevtoolsProductionConfigError("DT003");
|
|
765
393
|
let record;
|
|
766
394
|
if (admin.password !== null) {
|
|
767
|
-
if (checkPasswordPolicy(admin.password, email) !== null) throw new require_errors.DevtoolsProductionConfigError("DT004");
|
|
395
|
+
if (require_helpers.checkPasswordPolicy(admin.password, email) !== null) throw new require_errors.DevtoolsProductionConfigError("DT004");
|
|
768
396
|
record = {
|
|
769
397
|
email,
|
|
770
398
|
role: "admin",
|
|
@@ -806,7 +434,7 @@ function createDevtoolsAuth(deps) {
|
|
|
806
434
|
}
|
|
807
435
|
}
|
|
808
436
|
async function login(input, meta) {
|
|
809
|
-
const email = normalizeEmail(input?.email);
|
|
437
|
+
const email = require_helpers.normalizeEmail(input?.email);
|
|
810
438
|
const password = passwordInput(input?.password);
|
|
811
439
|
const account = email ? await store.accounts.findByEmail(email) : null;
|
|
812
440
|
const blockedReason = await blockedBy(account, meta.ip);
|
|
@@ -842,10 +470,10 @@ function createDevtoolsAuth(deps) {
|
|
|
842
470
|
}
|
|
843
471
|
async function setup(input, meta) {
|
|
844
472
|
const configured = options.admin.setupToken;
|
|
845
|
-
const adminEmail = normalizeEmail(options.admin.email);
|
|
473
|
+
const adminEmail = require_helpers.normalizeEmail(options.admin.email);
|
|
846
474
|
const account = adminEmail ? await store.accounts.findByEmail(adminEmail) : null;
|
|
847
475
|
const blocked = await isBlocked(null, meta.ip);
|
|
848
|
-
const tokenMatches = safeEqual(hashToken(typeof input?.token === "string" ? input.token : ""), hashToken(configured ?? ""));
|
|
476
|
+
const tokenMatches = require_helpers.safeEqual(require_helpers.hashToken(typeof input?.token === "string" ? input.token : ""), require_helpers.hashToken(configured ?? ""));
|
|
849
477
|
const usable = configured !== null && tokenMatches && account !== null && account.passwordSource === "setup";
|
|
850
478
|
if (blocked) return failLogin("login.blocked", "auth.invalid-setup-token", {
|
|
851
479
|
email: adminEmail || null,
|
|
@@ -878,7 +506,7 @@ function createDevtoolsAuth(deps) {
|
|
|
878
506
|
}
|
|
879
507
|
async function findOpenInvite(token) {
|
|
880
508
|
if (typeof token !== "string" || token === "" || token.length > 200) fail("invite.invalid");
|
|
881
|
-
const invite = await store.invites.findByTokenHash(hashToken(token));
|
|
509
|
+
const invite = await store.invites.findByTokenHash(require_helpers.hashToken(token));
|
|
882
510
|
if (!invite || invite.usedAt !== null || invite.expiresAt <= now()) fail("invite.invalid");
|
|
883
511
|
return invite;
|
|
884
512
|
}
|
|
@@ -926,7 +554,7 @@ function createDevtoolsAuth(deps) {
|
|
|
926
554
|
}
|
|
927
555
|
async function authenticate(token) {
|
|
928
556
|
if (typeof token !== "string" || token === "" || token.length > 200) return null;
|
|
929
|
-
const session = await store.sessions.findByTokenHash(hashToken(token));
|
|
557
|
+
const session = await store.sessions.findByTokenHash(require_helpers.hashToken(token));
|
|
930
558
|
if (!session) return null;
|
|
931
559
|
const at = now();
|
|
932
560
|
if (at >= session.expiresAt || at - session.lastSeenAt > options.session.idleMinutes * MINUTE) {
|
|
@@ -951,7 +579,7 @@ function createDevtoolsAuth(deps) {
|
|
|
951
579
|
}
|
|
952
580
|
function verifyCsrf(auth, header) {
|
|
953
581
|
if (typeof header !== "string" || header === "") return false;
|
|
954
|
-
return safeEqual(header, csrfToken(auth.session));
|
|
582
|
+
return require_helpers.safeEqual(header, csrfToken(auth.session));
|
|
955
583
|
}
|
|
956
584
|
function sessionView(auth) {
|
|
957
585
|
if (!auth) return {
|
|
@@ -962,7 +590,8 @@ function createDevtoolsAuth(deps) {
|
|
|
962
590
|
csrf: null,
|
|
963
591
|
expiresAt: null,
|
|
964
592
|
instance: null,
|
|
965
|
-
methods: null
|
|
593
|
+
methods: null,
|
|
594
|
+
share: null
|
|
966
595
|
};
|
|
967
596
|
return {
|
|
968
597
|
mode: "production",
|
|
@@ -975,7 +604,8 @@ function createDevtoolsAuth(deps) {
|
|
|
975
604
|
methods: {
|
|
976
605
|
totp: true,
|
|
977
606
|
passkeys: passkeys !== null
|
|
978
|
-
}
|
|
607
|
+
},
|
|
608
|
+
share: { enabled: options.share.enabled }
|
|
979
609
|
};
|
|
980
610
|
}
|
|
981
611
|
async function logout(auth, meta) {
|
|
@@ -1179,12 +809,12 @@ function createDevtoolsAuth(deps) {
|
|
|
1179
809
|
});
|
|
1180
810
|
return moveTo(auth, consumed, "active", meta);
|
|
1181
811
|
}
|
|
1182
|
-
const given = hashRecoveryCode(input.recoveryCode);
|
|
812
|
+
const given = require_helpers.hashRecoveryCode(input.recoveryCode);
|
|
1183
813
|
let left = 0;
|
|
1184
814
|
const used = await casAccount(auth.account, (account) => {
|
|
1185
815
|
let found = -1;
|
|
1186
816
|
account.recoveryCodes.forEach((stored, index) => {
|
|
1187
|
-
if (safeEqual(stored, given) && normalizeRecoveryCode(input.recoveryCode).length === 10) found = index;
|
|
817
|
+
if (require_helpers.safeEqual(stored, given) && require_helpers.normalizeRecoveryCode(input.recoveryCode).length === 10) found = index;
|
|
1188
818
|
});
|
|
1189
819
|
if (found === -1) return null;
|
|
1190
820
|
const remaining = account.recoveryCodes.filter((_, index) => index !== found);
|
|
@@ -1373,13 +1003,13 @@ function createDevtoolsAuth(deps) {
|
|
|
1373
1003
|
}
|
|
1374
1004
|
async function createInvite(auth, input, meta) {
|
|
1375
1005
|
requireAdmin(auth);
|
|
1376
|
-
const email = normalizeEmail(input?.email);
|
|
1377
|
-
if (!isPlausibleEmail(email) || input.role !== "admin" && input.role !== "viewer") fail("input.invalid");
|
|
1006
|
+
const email = require_helpers.normalizeEmail(input?.email);
|
|
1007
|
+
if (!require_helpers.isPlausibleEmail(email) || input.role !== "admin" && input.role !== "viewer") fail("input.invalid");
|
|
1378
1008
|
if (await store.accounts.findByEmail(email)) fail("invite.email-taken");
|
|
1379
|
-
const token = generateToken();
|
|
1009
|
+
const token = require_helpers.generateToken();
|
|
1380
1010
|
const at = now();
|
|
1381
1011
|
const invite = await store.invites.create({
|
|
1382
|
-
tokenHash: hashToken(token),
|
|
1012
|
+
tokenHash: require_helpers.hashToken(token),
|
|
1383
1013
|
email,
|
|
1384
1014
|
role: input.role,
|
|
1385
1015
|
createdBy: auth.account.id,
|
|
@@ -1485,7 +1115,7 @@ function createDevtoolsAuth(deps) {
|
|
|
1485
1115
|
const state = await store.state.read();
|
|
1486
1116
|
if (await store.state.update(state.version, {
|
|
1487
1117
|
disabled: true,
|
|
1488
|
-
disabledPathHash: hashToken(options.path),
|
|
1118
|
+
disabledPathHash: require_helpers.hashToken(options.path),
|
|
1489
1119
|
disabledAt: now(),
|
|
1490
1120
|
disabledBy: auth.account.id
|
|
1491
1121
|
})) {
|
|
@@ -1645,11 +1275,11 @@ async function loadDevtoolsPasskeys() {
|
|
|
1645
1275
|
}
|
|
1646
1276
|
|
|
1647
1277
|
//#endregion
|
|
1648
|
-
exports.checkPasswordPolicy = checkPasswordPolicy;
|
|
1278
|
+
exports.checkPasswordPolicy = require_helpers.checkPasswordPolicy;
|
|
1649
1279
|
exports.createDevtoolsAuth = createDevtoolsAuth;
|
|
1650
1280
|
exports.defaultDevtoolsCrypto = defaultDevtoolsCrypto;
|
|
1651
|
-
exports.generateTemporaryPassword = generateTemporaryPassword;
|
|
1652
|
-
exports.generateToken = generateToken;
|
|
1653
|
-
exports.hashToken = hashToken;
|
|
1281
|
+
exports.generateTemporaryPassword = require_helpers.generateTemporaryPassword;
|
|
1282
|
+
exports.generateToken = require_helpers.generateToken;
|
|
1283
|
+
exports.hashToken = require_helpers.hashToken;
|
|
1654
1284
|
exports.loadDevtoolsPasskeys = loadDevtoolsPasskeys;
|
|
1655
|
-
//# sourceMappingURL=auth-
|
|
1285
|
+
//# sourceMappingURL=auth-DV2GA1A9.cjs.map
|