fix(membership): register directory route as /directory, not /api/directory
Caddy strips /api via `handle_path /api/*` before forwarding to membershipd, so the SPA's GET /api/directory arrives as GET /directory. The route was registered with the /api prefix, so the stripped request hit no route and returned 404 in production: the directory never resolved and uniweb fell back to short ids. Every other control-plane route is registered without the prefix; this aligns directory with them. The unit test passed despite the bug because it requested /api/directory, the same wrong path as the registration. Corrected the request paths to /directory so the test now exercises the real production path (verified: reverting the registration to /api/directory now makes TestDirectoryGolden fail with 404). Bump 0.15.0 -> 0.15.1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
name: unibus
|
||||
lang: go
|
||||
domain: infra
|
||||
version: 0.15.0
|
||||
version: 0.15.1
|
||||
description: "Bus de mensajería unificado sobre NATS+JetStream con cifrado E2E por room (megolm/olm reducido): service de membresía/claves, librería cliente y peers demo."
|
||||
tags: [service, messaging, nats, e2e]
|
||||
uses_functions:
|
||||
@@ -163,7 +163,10 @@ Para apuntar a un NATS externo en producción: `--nats-url nats://host:4222` en
|
||||
Cada frame del bus lleva el **endpoint id** del remitente
|
||||
(`base64url(sha256(signPub))`, sin padding — `frame.EndpointID`), no un nombre
|
||||
legible. Para que un cliente muestre nombres en vez de hashes, el control-plane
|
||||
expone `GET /api/directory`:
|
||||
expone la ruta del directorio. La SPA la llama como `GET /api/directory`, pero
|
||||
Caddy hace `handle_path /api/*` y **stripea `/api`** antes de reenviar a
|
||||
`membershipd`, así que el servidor la registra (como todas las rutas del
|
||||
control-plane) SIN el prefijo: `GET /directory`:
|
||||
|
||||
- **Auth:** el mismo middleware de firma que el resto del control-plane
|
||||
(cabeceras `X-Unibus-Pub/Ts/Nonce/Sig` sobre `CanonicalRequest`). NO es
|
||||
@@ -222,6 +225,7 @@ agent.<nombre>.{in,out} inbox/outbox de agente LLM (agent.scout.in)
|
||||
|
||||
## Capability growth log
|
||||
|
||||
- v0.15.1 (2026-06-14) — fix: la ruta del directorio se registraba con prefijo /api y Caddy lo stripeaba (404 en prod); corregida a /directory.
|
||||
- v0.15.0 (2026-06-14) — nombres legibles + provisioning de bots de un comando.
|
||||
(1) Nuevo `GET /api/directory` en el control-plane: cualquier usuario activo del
|
||||
bus (member o admin), autenticado con la misma firma Ed25519 que el resto de
|
||||
|
||||
Reference in New Issue
Block a user