@dsh-plus/access-gate 0.3.25 → 0.3.27

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/lib/client.js CHANGED
@@ -160,7 +160,7 @@ window.__ModuleLoader__.load({
160
160
  unsaved: "未保存",
161
161
  loading: "加载中…",
162
162
  unavailable: "配置服务不可用。",
163
- readOnly: "当前部署无 settings provider,配置为只读;请编辑 settings.yaml。",
163
+ readOnly: "当前部署无 settings provider,配置为只读;请在 profile 的 cordis.patch.yml 行级配置。",
164
164
  invalidNumber: "请输入正整数。",
165
165
  collapse: "收起",
166
166
  expand: "展开",
@@ -177,7 +177,7 @@ window.__ModuleLoader__.load({
177
177
  unsaved: "Unsaved",
178
178
  loading: "Loading…",
179
179
  unavailable: "Settings service unavailable.",
180
- readOnly: "No settings provider in this deployment; config is read-only. Edit settings.yaml.",
180
+ readOnly: "No settings provider in this deployment; config is read-only. Configure it at the profile row in cordis.patch.yml.",
181
181
  invalidNumber: "Enter a positive integer.",
182
182
  collapse: "Collapse",
183
183
  expand: "Expand",
@@ -384,7 +384,7 @@ ${extra}
384
384
  //#region src/ns.ts
385
385
  /**
386
386
  * settings 命名空间字面量(纯常量,零依赖,浏览器半可安全引入)。
387
- * 服务端直接以字面量注册(0.1.2-alpha.2 起 dsh-settings 对命名空间做编译期
387
+ * 服务端直接以字面量注册(dsh-settings 对命名空间做编译期
388
388
  * 语法校验,见 config.ts);浏览器半把它作为配置卡片的注册键
389
389
  * (插件页配置卡片挂在 row/bundle config 槽位上,与命名空间解耦,
390
390
  * 见 shared/config-slots),
@@ -399,7 +399,7 @@ ${extra}
399
399
  * plugins.bundle.config,view 分发 summary/page)。
400
400
  * 外壳与基础控件走 @dsh-plus/shared/client 套件(CardChrome/TextField/CheckRow),
401
401
  * 本文件保留业务字段(白名单 textarea/诊断面板)与保存逻辑。
402
- * 配置读写经共享层 ctx.remote.settings 直连(0.1.7 起 settingsScope 已由
402
+ * 配置读写经共享层 ctx.remote.settings 直连(settingsScope 已由
403
403
  * configForms 取代):value 为 schema 解析后的视图,保存经 settings.update 深合并。
404
404
  * 卡片顶部「当前页面诊断」读 /dsh-plus/gate/status(本页放行原因/客户端 IP/
405
405
  * 官方 cookie 状态)。
package/lib/index.d.ts CHANGED
@@ -13,7 +13,7 @@ declare const Config: z<Schemastery.ObjectS<NoInfer<{
13
13
  trustForwardedFor: z<boolean, boolean, "volatile-defined">;
14
14
  autoLoginTrustedIps: z<boolean, boolean, "volatile-defined">;
15
15
  }>>, "plain">;
16
- /** 活动字段形态(0.1.7 loader 解析产物:volatile 字段为活动引用)。 */
16
+ /** 活动字段形态(loader 解析产物:volatile 字段为活动引用)。 */
17
17
  type AccessGateConfigFields = Schemastery.TypeT<typeof Config>;
18
18
  /** 平面配置形态(服务与判定面的消费形态,由活动引用解包得到)。 */
19
19
  type AccessGateConfig = UnwrapVolatile<AccessGateConfigFields>;
@@ -26,7 +26,7 @@ declare module '@deepseek-ai/cordis' {
26
26
  accessGate: AccessGateService;
27
27
  }
28
28
  }
29
- /** 围栏服务:持有当前配置读取器(0.1.7 起为 volatile 活动引用的平面解包,读即最新)。 */
29
+ /** 围栏服务:持有当前配置读取器(volatile 活动引用的平面解包,读即最新)。 */
30
30
  declare class AccessGateService extends Service {
31
31
  private current;
32
32
  /** 官方 browser-auth 签名密钥(惰性读取缓存;读取失败 = null,autoLogin fail-safe 降级)。 */
package/lib/index.js CHANGED
@@ -8,7 +8,7 @@ import { join } from "node:path";
8
8
  //#region src/config.ts
9
9
  /**
10
10
  * 配置单一事实源:cordis 行级 Config(组合默认值,dev/prod patch 层可覆盖)
11
- * 与 settings namespace(用户层,经 dsh-settings-file 持久化到 $DSH_HOME/settings.yaml)
11
+ * 与 settings namespace(用户层=profile 行级覆盖层 cordis.patch.yml,热生效)
12
12
  * 共用同一 schemastery schema(notify-email 同款约定)。
13
13
  *
14
14
  * 与官方认证合并后:访问凭据唯一化为官方 browser-auth cookie(dsh-auth-*,
@@ -34,8 +34,8 @@ const Config = z.object({
34
34
  * 浏览器落罐,后续 /api、WS 的官方 requestRejection() 自然通过,
35
35
  * 用户全程无感、免启动 token。
36
36
  *
37
- * 契约(对 dsh 0.1.2-alpha.2 / 0.1.3-alpha.2 官方 client-connection
38
- * browser-auth 逐行核实,见 docs/README.md「信任模型」):
37
+ * 契约(对官方 client-connection browser-auth 逐行核实,见 docs/README.md
38
+ * 「信任模型」;0.2.1-alpha.1 复核不变):
39
39
  * - 签名密钥持久化于 $DSH_HOME/.credentials.yaml
40
40
  * (records → client-connection/browser-session → payload.secret,
41
41
  * base64url 无填充 32B;跨重启不变);
@@ -745,7 +745,7 @@ function assertGateStructure(server) {
745
745
  //#region src/index.ts
746
746
  const name = "dsh-plus-access-gate";
747
747
  const inject = ["webServer", "connection"];
748
- /** 围栏服务:持有当前配置读取器(0.1.7 起为 volatile 活动引用的平面解包,读即最新)。 */
748
+ /** 围栏服务:持有当前配置读取器(volatile 活动引用的平面解包,读即最新)。 */
749
749
  var AccessGateService = class extends Service {
750
750
  current;
751
751
  /** 官方 browser-auth 签名密钥(惰性读取缓存;读取失败 = null,autoLogin fail-safe 降级)。 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plus/access-gate",
3
- "version": "0.3.25",
3
+ "version": "0.3.27",
4
4
  "description": "dsh-plus service+ui plugin: dsh web 全量访问围栏——与官方 browser-auth 合并:官方 cookie 为唯一凭据,可选 IP 附加围栏,未认证导航渲染 token 输入页(PWA 可恢复),loopback 管理通道",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -31,7 +31,7 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@dsh-plus/shared": "0.1.35"
34
+ "@dsh-plus/shared": "0.1.37"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/cordis": "^4.0.5-alpha.1",
@@ -3,7 +3,7 @@
3
3
  * plugins.bundle.config,view 分发 summary/page)。
4
4
  * 外壳与基础控件走 @dsh-plus/shared/client 套件(CardChrome/TextField/CheckRow),
5
5
  * 本文件保留业务字段(白名单 textarea/诊断面板)与保存逻辑。
6
- * 配置读写经共享层 ctx.remote.settings 直连(0.1.7 起 settingsScope 已由
6
+ * 配置读写经共享层 ctx.remote.settings 直连(settingsScope 已由
7
7
  * configForms 取代):value 为 schema 解析后的视图,保存经 settings.update 深合并。
8
8
  * 卡片顶部「当前页面诊断」读 /dsh-plus/gate/status(本页放行原因/客户端 IP/
9
9
  * 官方 cookie 状态)。
@@ -7,8 +7,8 @@
7
7
  *
8
8
  * 类型说明:浏览器半只用到 slots/locale/remote 的很窄一面,
9
9
  * scope 与基础控件走 @dsh-plus/shared/client 套件(收编自本插件原实现)。
10
- * 配置读写经 ctx.remote.settings 直连(0.1.2-alpha.1 起 connection.api.settings
11
- * 已移除;0.1.7 起 settingsScope 服务亦删除——configForms 取代,自始直连)。
10
+ * 配置读写经 ctx.remote.settings 直连(connection.api.settings
11
+ * 已移除; settingsScope 服务亦删除——configForms 取代,自始直连)。
12
12
  * 卡片 key/rowId 约定见 @dsh-plus/shared/client/config-slots。
13
13
  * @module @dsh-plus/access-gate/client
14
14
  */
package/src/config.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 配置单一事实源:cordis 行级 Config(组合默认值,dev/prod patch 层可覆盖)
3
- * 与 settings namespace(用户层,经 dsh-settings-file 持久化到 $DSH_HOME/settings.yaml)
3
+ * 与 settings namespace(用户层=profile 行级覆盖层 cordis.patch.yml,热生效)
4
4
  * 共用同一 schemastery schema(notify-email 同款约定)。
5
5
  *
6
6
  * 与官方认证合并后:访问凭据唯一化为官方 browser-auth cookie(dsh-auth-*,
@@ -15,10 +15,10 @@ import type { UnwrapVolatile } from '@dsh-plus/shared'
15
15
 
16
16
  import { SETTINGS_NS as NS_LITERAL } from './ns.ts'
17
17
 
18
- /** settings 命名空间(字面量即合法命名空间,0.1.2-alpha.2 起编译期校验;webui 配置卡片与插件运行期读取同一份)。 */
18
+ /** settings 命名空间(字面量即合法命名空间,编译期校验;webui 配置卡片与插件运行期读取同一份)。 */
19
19
  export const SETTINGS_NS = NS_LITERAL
20
20
 
21
- // 0.1.7:全部字段 `.volatile()`——loader 解析为活动引用(用户层 override 并入
21
+ // 全部字段 `.volatile()`——loader 解析为活动引用(用户层 override 并入
22
22
  // 行级 config,GUI 写入原位提交热生效),同时使本条目进入 settings describe
23
23
  // 视图(配置卡片可读写);缺 volatile 标记的条目会被 describe 跳过。
24
24
  export const Config = z.object({
@@ -50,7 +50,7 @@ export const Config = z.object({
50
50
  .volatile(),
51
51
  })
52
52
 
53
- /** 活动字段形态(0.1.7 loader 解析产物:volatile 字段为活动引用)。 */
53
+ /** 活动字段形态(loader 解析产物:volatile 字段为活动引用)。 */
54
54
  export type AccessGateConfigFields = Schemastery.TypeT<typeof Config>
55
55
  /** 平面配置形态(服务与判定面的消费形态,由活动引用解包得到)。 */
56
56
  export type AccessGateConfig = UnwrapVolatile<AccessGateConfigFields>
package/src/cookie.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  * 浏览器落罐,后续 /api、WS 的官方 requestRejection() 自然通过,
7
7
  * 用户全程无感、免启动 token。
8
8
  *
9
- * 契约(对 dsh 0.1.2-alpha.2 / 0.1.3-alpha.2 官方 client-connection
10
- * browser-auth 逐行核实,见 docs/README.md「信任模型」):
9
+ * 契约(对官方 client-connection browser-auth 逐行核实,见 docs/README.md
10
+ * 「信任模型」;0.2.1-alpha.1 复核不变):
11
11
  * - 签名密钥持久化于 $DSH_HOME/.credentials.yaml
12
12
  * (records → client-connection/browser-session → payload.secret,
13
13
  * base64url 无填充 32B;跨重启不变);
package/src/index.ts CHANGED
@@ -56,7 +56,7 @@ declare module '@deepseek-ai/cordis' {
56
56
  }
57
57
  }
58
58
 
59
- /** 围栏服务:持有当前配置读取器(0.1.7 起为 volatile 活动引用的平面解包,读即最新)。 */
59
+ /** 围栏服务:持有当前配置读取器(volatile 活动引用的平面解包,读即最新)。 */
60
60
  export class AccessGateService extends Service {
61
61
  private current: () => AccessGateConfig
62
62
  /** 官方 browser-auth 签名密钥(惰性读取缓存;读取失败 = null,autoLogin fail-safe 降级)。 */
@@ -64,7 +64,7 @@ export class AccessGateService extends Service {
64
64
 
65
65
  constructor(ctx: Context, config: AccessGateConfig | AccessGateConfigFields) {
66
66
  super(ctx, 'accessGate')
67
- // 0.1.7 替代 0.1.6 installSection/setSource:loader 解析层已把用户层
67
+ // 替代已删除的 installSection/setSource:loader 解析层已把用户层
68
68
  // override 并入行级 config 并以活动引用原位提交,current() 现取即热。
69
69
  this.current = () => unwrapVolatile(config)
70
70
  const logger = ctx.logger('access-gate')
package/src/ns.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * settings 命名空间字面量(纯常量,零依赖,浏览器半可安全引入)。
3
- * 服务端直接以字面量注册(0.1.2-alpha.2 起 dsh-settings 对命名空间做编译期
3
+ * 服务端直接以字面量注册(dsh-settings 对命名空间做编译期
4
4
  * 语法校验,见 config.ts);浏览器半把它作为配置卡片的注册键
5
5
  * (插件页配置卡片挂在 row/bundle config 槽位上,与命名空间解耦,
6
6
  * 见 shared/config-slots),