dsh-workbench-vault 0.3.5 → 0.3.9
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/cordis.patch.yml +1 -1
- package/lib/client.js +1029 -338
- package/lib/domain/actions.js +21 -0
- package/lib/index.js +3 -2
- package/package.json +4 -4
package/lib/domain/actions.js
CHANGED
|
@@ -23,6 +23,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
api.action("vault.setup", {
|
|
26
|
+
agentLocked: true,
|
|
26
27
|
description: "首次初始化保险箱:设置口令与解锁模式 A/B/C,默认 A(每次启动锁定)。口令包裹会上云。",
|
|
27
28
|
input: {
|
|
28
29
|
type: "object",
|
|
@@ -41,6 +42,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
41
42
|
});
|
|
42
43
|
|
|
43
44
|
api.action("vault.unlock", {
|
|
45
|
+
agentLocked: true,
|
|
44
46
|
description: "用主口令解锁保险箱;连续 5 次失败锁定 5 分钟。",
|
|
45
47
|
input: {
|
|
46
48
|
type: "object",
|
|
@@ -55,6 +57,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
55
57
|
});
|
|
56
58
|
|
|
57
59
|
api.action("vault.lock", {
|
|
60
|
+
agentLocked: true,
|
|
58
61
|
description: "立即清除内存中的 DEK;插件后台可用它主动锁定。",
|
|
59
62
|
input: { type: "object", properties: {}, additionalProperties: false },
|
|
60
63
|
execute: (_args, ctx) => {
|
|
@@ -65,6 +68,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
65
68
|
});
|
|
66
69
|
|
|
67
70
|
api.action("vault.setUnlockMode", {
|
|
71
|
+
agentLocked: true,
|
|
68
72
|
description: "切换解锁模式:A 全锁 / B 自动解锁但查看需口令 / C 自动解锁且查看免口令。",
|
|
69
73
|
input: {
|
|
70
74
|
type: "object",
|
|
@@ -82,6 +86,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
82
86
|
});
|
|
83
87
|
|
|
84
88
|
api.action("vault.changePassphrase", {
|
|
89
|
+
agentLocked: true,
|
|
85
90
|
description: "修改主口令:只重包 DEK 并让 passphrase_rev 加一,不重新加密所有 secret。",
|
|
86
91
|
input: {
|
|
87
92
|
type: "object",
|
|
@@ -117,6 +122,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
117
122
|
});
|
|
118
123
|
|
|
119
124
|
api.action("vault.secretCreate", {
|
|
125
|
+
agentLocked: true,
|
|
120
126
|
description: "新增凭据;secret 只在内存加密后落库,审计中该字段显示为 ***。",
|
|
121
127
|
input: {
|
|
122
128
|
type: "object",
|
|
@@ -139,6 +145,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
139
145
|
});
|
|
140
146
|
|
|
141
147
|
api.action("vault.secretUpdate", {
|
|
148
|
+
agentLocked: true,
|
|
142
149
|
description: "更新名称/类型/备注或轮换明文;改名称或类型会重加密,改归属不会。",
|
|
143
150
|
input: {
|
|
144
151
|
type: "object",
|
|
@@ -161,6 +168,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
161
168
|
});
|
|
162
169
|
|
|
163
170
|
api.action("vault.secretDelete", {
|
|
171
|
+
agentLocked: true,
|
|
164
172
|
description: "软删除凭据;已绑定它的连接器会在下次运行时提示凭据失效。",
|
|
165
173
|
input: {
|
|
166
174
|
type: "object",
|
|
@@ -177,6 +185,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
177
185
|
registerSetActions({ api, sets, groups, vault, only, KINDS });
|
|
178
186
|
|
|
179
187
|
api.action("vault.secretReveal", {
|
|
188
|
+
agentLocked: true,
|
|
180
189
|
description: "在界面上显示一条凭据明文;B 模式必须再输口令,agent/plugin 一律拒绝。",
|
|
181
190
|
input: {
|
|
182
191
|
type: "object",
|
|
@@ -194,6 +203,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
194
203
|
});
|
|
195
204
|
|
|
196
205
|
api.action("vault.lease", {
|
|
206
|
+
agentLocked: true,
|
|
197
207
|
description: "后台插件租用凭据明文,ttl 30–300 秒;只允许 plugin origin,传 subject 时校验绑定。",
|
|
198
208
|
input: {
|
|
199
209
|
type: "object",
|
|
@@ -214,6 +224,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
214
224
|
});
|
|
215
225
|
|
|
216
226
|
api.action("vault.rotateDeviceKey", {
|
|
227
|
+
agentLocked: true,
|
|
217
228
|
description: "重写自动解锁的 device key 包裹;B/C 模式可用,需要主口令。",
|
|
218
229
|
input: {
|
|
219
230
|
type: "object",
|
|
@@ -241,6 +252,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
241
252
|
});
|
|
242
253
|
|
|
243
254
|
api.action("vault.groupCreate", {
|
|
255
|
+
agentLocked: true,
|
|
244
256
|
description: "新建凭据分组;组名唯一。",
|
|
245
257
|
input: {
|
|
246
258
|
type: "object",
|
|
@@ -259,6 +271,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
259
271
|
});
|
|
260
272
|
|
|
261
273
|
api.action("vault.groupUpdate", {
|
|
274
|
+
agentLocked: true,
|
|
262
275
|
description: "改名/描述/色标;不改动组内凭据的密文。",
|
|
263
276
|
input: {
|
|
264
277
|
type: "object",
|
|
@@ -278,6 +291,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
278
291
|
});
|
|
279
292
|
|
|
280
293
|
api.action("vault.groupDelete", {
|
|
294
|
+
agentLocked: true,
|
|
281
295
|
description: "软删除分组:组内凭据移到 moveTo,未指定则移出分组;组上的绑定一并软删。",
|
|
282
296
|
input: {
|
|
283
297
|
type: "object",
|
|
@@ -295,6 +309,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
295
309
|
});
|
|
296
310
|
|
|
297
311
|
api.action("vault.subjectRegister", {
|
|
312
|
+
agentLocked: true,
|
|
298
313
|
description: "业务插件注册自己的关联类型(幂等),供组详情页显示可读标题。",
|
|
299
314
|
input: {
|
|
300
315
|
type: "object",
|
|
@@ -313,6 +328,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
313
328
|
});
|
|
314
329
|
|
|
315
330
|
api.action("vault.bind", {
|
|
331
|
+
agentLocked: true,
|
|
316
332
|
description: "把业务对象关联到凭据分组(重复绑定幂等);vault 不校验对象是否存在。",
|
|
317
333
|
input: {
|
|
318
334
|
type: "object",
|
|
@@ -331,6 +347,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
331
347
|
});
|
|
332
348
|
|
|
333
349
|
api.action("vault.unbind", {
|
|
350
|
+
agentLocked: true,
|
|
334
351
|
description: "解除一个业务对象与分组的关联(软删)。",
|
|
335
352
|
input: {
|
|
336
353
|
type: "object",
|
|
@@ -381,6 +398,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
381
398
|
});
|
|
382
399
|
|
|
383
400
|
api.action("vault.subjectSecrets", {
|
|
401
|
+
agentLocked: true,
|
|
384
402
|
description: "后台插件只读:某个业务对象经分组可见的凭据清单(不含明文),拿到 id 后再 lease。",
|
|
385
403
|
input: {
|
|
386
404
|
type: "object",
|
|
@@ -395,6 +413,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
395
413
|
});
|
|
396
414
|
|
|
397
415
|
api.action("vault.bindingPurge", {
|
|
416
|
+
agentLocked: true,
|
|
398
417
|
description: "插件卸载/业务对象删除时清理自己的绑定引用(硬删)。",
|
|
399
418
|
input: {
|
|
400
419
|
type: "object",
|
|
@@ -428,6 +447,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
428
447
|
});
|
|
429
448
|
|
|
430
449
|
api.action("vault.dataTables", {
|
|
450
|
+
agentLocked: true,
|
|
431
451
|
description: "只读:数据页表清单。",
|
|
432
452
|
input: { type: "object", properties: {}, additionalProperties: false },
|
|
433
453
|
execute: (_args, ctx) => {
|
|
@@ -461,6 +481,7 @@ export function registerVaultActions(api, vault, groups) {
|
|
|
461
481
|
});
|
|
462
482
|
|
|
463
483
|
api.action("vault.dataQuery", {
|
|
484
|
+
agentLocked: true,
|
|
464
485
|
description: "只读:数据页查询;密文列一律掩码。",
|
|
465
486
|
input: {
|
|
466
487
|
type: "object",
|
package/lib/index.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* 0.3.1:凭据表单明文支持小眼睛临时显示;主口令/删除确认改用应用内弹层(桌面端不支持 window.prompt)。
|
|
6
6
|
* 0.3.3:备注两栏合并为单个「备注」(meta.note);新建分组改弹窗并可直接勾选集合。
|
|
7
7
|
* 0.3.4:集合选择改用共享 filter-checklist(关键字搜索 + 滚动分页),任务/站点/储物标签筛选同步复用。
|
|
8
|
+
* 0.3.6:口令输入框统一用共享的明文切换控件(lib/secret-field.cjs),初始化页主/确认口令、解锁页与口令弹层都能点小眼睛看明文,各自独立切换。
|
|
8
9
|
* 0.3.5:修复「保存凭据后列表不新增」——客户端 unwrap 对 ok:false 抛错、锁定态在凭据页提示并可内联解锁、写成功后无条件刷新列表。
|
|
9
10
|
*/
|
|
10
11
|
import { ensureSchema, bindClock } from "./db/db.js";
|
|
@@ -30,7 +31,7 @@ export function createDomain(host) {
|
|
|
30
31
|
id: "wb-addon-vault",
|
|
31
32
|
title: "凭据保险箱",
|
|
32
33
|
description: "集中保存密码、应用专用密码与 token;按分组授权给业务模块,加密落库、密文可同步。",
|
|
33
|
-
version: "0.3.
|
|
34
|
+
version: "0.3.9",
|
|
34
35
|
tables: [
|
|
35
36
|
"vault_header",
|
|
36
37
|
"vault_device",
|
|
@@ -143,7 +144,7 @@ export function createDomain(host) {
|
|
|
143
144
|
api.action("vault.actionSchema", {
|
|
144
145
|
description: "只读:本域 action 清单与输入 schema(插件自证,不读宿主统一接口)。",
|
|
145
146
|
input: { type: "object", properties: {}, additionalProperties: false },
|
|
146
|
-
execute: () => ({ shellVersion: api.shellVersion || "", domains: [{ id: "wb-addon-vault", version: (api.addon && api.addon.version) || "0.3.
|
|
147
|
+
execute: () => ({ shellVersion: api.shellVersion || "", domains: [{ id: "wb-addon-vault", version: (api.addon && api.addon.version) || "0.3.6" }], actions: schemas }),
|
|
147
148
|
});
|
|
148
149
|
void host;
|
|
149
150
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-workbench-vault",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "个人工作台凭据保险箱:加密保存密码与 token,agent 只见掩码",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"addon": {
|
|
17
17
|
"id": "wb-addon-vault",
|
|
18
18
|
"title": "凭据保险箱",
|
|
19
|
-
"version": "0.3.
|
|
20
|
-
"minShell": "0.
|
|
19
|
+
"version": "0.3.9",
|
|
20
|
+
"minShell": "0.8.0",
|
|
21
21
|
"tables": [
|
|
22
22
|
"vault_header",
|
|
23
23
|
"vault_device",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"dsh-workbench-host": "^0.
|
|
71
|
+
"dsh-workbench-host": "^0.8.1"
|
|
72
72
|
},
|
|
73
73
|
"dsh": {
|
|
74
74
|
"bundle": {
|