You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(gateway): separate admin sock from bootstrap sock with ACL guarantee (#389)
Phase 3's admin facet was reachable through `bootstrap.getAdmin()`,
which collapsed registration authority (anyone with the bootstrap
sock) and admin authority onto a single capability path. Any local
user daemon that connects to the bootstrap sock to call `register`
could call `getAdmin` on the same exo and reach the administrator
facet.
Split the two authorities onto separate socks:
- `bootstrap.sock` (existing) carries the `GatewayBootstrap` exo
only. Its `getAdmin` method is removed; the `GatewayAdmin`
typedef no longer flows through the bootstrap module's import
graph.
- `admin.sock` (new) is a sibling sock, distinct file path,
mode 0600. Deployment is responsible for placing it under a
parent directory mode 0700 so only the administrator OS
account can `connect(2)`. The listener for both socks lands in
a follow-on PR; the path resolver and the surface contract
land here.
Surface changes:
- `src/sock-paths.js`: factor the resolution rules into a shared
helper; export `resolveAdminSocketPath` alongside
`resolveBootstrapSocketPath`. `ADMIN_SOCKET_BASENAME` is the
`admin.sock` constant; `ENDO_GATEWAY_ADMIN_SOCK` is the
operator override for the admin sock (mirroring the existing
`ENDO_GATEWAY_BOOTSTRAP_SOCK`).
- `src/bootstrap.js`: drop `getAdmin` from `GatewayBootstrap`'s
interface, exo body, deps, typedef, and the GatewayAdmin
`@import`. The bootstrap module no longer references the admin
module.
- `index.js`: wire the admin facet directly from `makeGateway`
against the bootstrap's in-process backplane (or an empty
backplane when `sockBootstrap` is off). The `gateway.getAdmin`
in-process accessor is preserved; the previous "admin requires
sockBootstrap" cross-toggle dependency is removed.
- `src/config.js`: drop the `adminDaemon depends on sockBootstrap`
validator. The two features have independent toggles; a
deployment may serve admin reads without exposing the
registration channel and vice versa.
- `src/admin.js`: docstring reflects the new architecture
(admin sock, not bootstrap sock; independent toggles).
Tests:
- `test/sock-paths.test.js`: admin sock system / user / darwin
resolutions; `ENDO_GATEWAY_ADMIN_SOCK` override; regression-
evidence saboteur verifying the admin resolver does **not**
pick up the bootstrap-override env var; cross-source invariant
that bootstrap and admin paths are always distinct files; the
two basenames are distinct constants.
- `test/admin.test.js`: `bootstrap.getAdmin` is replaced with a
`__getMethodNames__` enumeration that pins the absence of the
method; the prior cross-toggle "throws when sockBootstrap is
disabled" test is rewritten to verify the admin facet works
standalone and reports an empty registration view; the
"reachable only via gateway.getAdmin and bootstrap.getAdmin"
contract becomes "reachable only via gateway.getAdmin", with
zero admin-shaped methods on the bootstrap.
- `test/config.test.js`: the rejection test for
`adminDaemon=true` + `sockBootstrap=false` is rewritten to
verify the combination is now accepted; the merged config
reflects the requested toggles.
Linux/Mac scope (per #388): the new admin sock paths use the same
platform-bound resolution as the bootstrap sock (Linux primary,
macOS secondary, no Windows-flavored paths).
0 commit comments