@feng0531/dsh-vcs 0.9.5 → 0.10.2

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/index.mjs CHANGED
@@ -798,9 +798,15 @@ export function apply(ctx) {
798
798
  // Older hosts expose explicit owner registration.
799
799
  connection.register(ctx,RPC_CHANNEL,host.handle);
800
800
  }else{
801
- // The new carrier admits a Peer before dispatch. VCS is local-owner only.
802
- connection.rpc.handle(RPC_CHANNEL,(endpoint,payload,signal,peer)=>
803
- peer?.principal?.kind==='owner'?host.handle(endpoint,payload,signal):failure('vcs/forbidden','VCS requires the local owner.'));
801
+ const handle=(endpoint,payload,signal,peer)=>
802
+ peer?.principal?.kind==='owner'?host.handle(endpoint,payload,signal):failure('vcs/forbidden','VCS requires the local owner.');
803
+ if(typeof connection.authorizeIndex==='function' && typeof connection.register==='function'){
804
+ // Pre-split authentication hosts can resolve webServer from Connection's
805
+ // scope during rpc.handle(). Pass the VCS scope, which injects webServer.
806
+ connection.register(ctx,RPC_CHANNEL,handle);
807
+ }else{
808
+ connection.rpc.handle(RPC_CHANNEL,handle);
809
+ }
804
810
  }
805
811
  registerAssets(ctx);
806
812
  registerDirectAssets(ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-vcs",
3
- "version": "0.9.5",
3
+ "version": "0.10.2",
4
4
  "private": false,
5
5
  "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
6
6
  "type": "module",