Commit Graph
6 Commits
Author SHA1 Message Date
mrcharles 24a57c1dff Add keyproxy CLI with serve and get commands
Wire the config loader, backends, and HTTP server into an executable.
`serve` runs the resolve hop until SIGINT/SIGTERM (graceful shutdown);
`get` resolves one ref to stdout as a bare value with no trailing
newline for $(...) exec-style plumbing. Exit codes: 0 ok, 1 usage or
config error, 2 resolution failure.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
2026-08-28 22:30:50 -05:00
mrcharles 82861b6d23 Add localhost resolve HTTP hop with bearer auth and redaction
Implement `keyproxy serve`: POST /v1/resolve (constant-time bearer-token
auth, 4 KiB body cap, mpk- ref validation before any echo) and
GET /healthz. The token is resolved once at startup from the file
backend. Panics are recovered with the panic value discarded and detail
suppressed; auth failures log the remote address only; every log line
naming a ref masks it as <ref>=***. Failures respond with fixed reason
enums (404/400/405/413/500/501/502) that cannot embed material.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
2026-08-28 22:30:50 -05:00
mrcharles 7bec2a1905 Add config loader with strict stdlib-only TOML subset parser
Parse keyproxy.toml (listen address, [auth] token_ref, and the mpk-<name>
ref map) using a deliberate TOML subset implemented with the standard
library only. The surface is strict: unknown keys, malformed refs, and
backend-specific misconfigurations (e.g. env refs setting key, file refs
missing key) fail loudly at startup. The bearer-token ref must resolve
through the file backend. Parse errors carry line numbers, never line
contents.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
2026-08-28 22:30:50 -05:00
mrcharles b43bc55963 Add backend resolver interface with file and env backends plus phase-3 stubs
Introduce the single Backend interface every credential source implements.
v0 ships two working backends: file (0600 KEY=VALUE env files, parsed in
pure Go, never sourced; looser permission masks refused before read) and
env (process-environment indirection). Bitwarden Secrets Manager and
HashiCorp Vault ship as explicit not-implemented stubs behind the same
interface so the phase-3 connectors are drop-ins. All failures are typed
ResolveErrors carrying only the ref, backend, and a fixed reason enum —
never material.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
2026-08-28 22:30:50 -05:00
mrcharles 325a36cc35 docs: upgrade README to the docs standard
Purpose kept; adds dated status line, scope/non-goals (no admin UI,
memory-only), today-vs-planned table, and navigable links into the
ukrrs/MOPAC design docs.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
2026-08-28 21:11:09 -05:00
mrcharles 6c88e65957 Seed: keyproxy spec posture (placeholders, vault-authoritative, AGPLv3) 2026-08-28 19:14:41 -05:00