feat(shipote): audit log persistente + HTTP gateway (fase S)

- Daemon escribe append-only a $XDG_STATE_HOME/shipote/audit.log además
  del tracing. Single-line: ts=<ms> uid=<peer> action=<verb> <detail>.
  Rotación simple a .log.1 al pasar 1 MiB.
- shipote-gateway: TCP listener 127.0.0.1:7378 default. POST /rpc traduce
  JSON ↔ postcard contra daemon socket. GET / health text. HTTP parser
  ad-hoc (~70 LOC), sin dep de hyper/axum. Sin auth — bind a localhost
  + SHIPOTE_TRUST_ANYONE=1 en prod.

E2E: curl --noproxy '*' POST /rpc → "Pong", Health JSON, Capabilities
JSON. Audit log persiste mutaciones con uid del peer.

85 tests pasan (features nuevos son binarios, no library mods).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
sergio
2026-05-11 17:16:11 +00:00
parent d962fe4601
commit 6596c81271
6 changed files with 252 additions and 0 deletions
Generated
+12
View File
@@ -9661,6 +9661,18 @@ dependencies = [
"toml 0.8.23",
]
[[package]]
name = "shipote-gateway"
version = "0.1.0"
dependencies = [
"anyhow",
"serde_json",
"shipote-protocol",
"tokio",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "shipote-protocol"
version = "0.1.0"