feat(membershipd): add 'user add/list/revoke' local admin CLI
Local administration surface for the user allowlist, dispatched before the server flag set parses os.Args. It opens the SQLite store directly with no network or auth: running on the bus host is trusted by design, which is how the first admin is seeded (breaking the chicken-egg of needing an admin to add an admin). Validates that sign-pub is a 32-byte Ed25519 key in hex and tolerates the sign-pub positional appearing before or after --db. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,16 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Subcommand dispatch: `membershipd user ...` is the local administration CLI
|
||||
// (seed/list/revoke bus users) and must be handled before the server flag set
|
||||
// parses os.Args. Running the CLI on the bus host is trusted by design (whoever
|
||||
// has a shell there already controls the service), which is how the first admin
|
||||
// is seeded without a chicken-egg auth problem.
|
||||
if len(os.Args) > 1 && os.Args[1] == "user" {
|
||||
runUserCLI(os.Args[2:])
|
||||
return
|
||||
}
|
||||
|
||||
var (
|
||||
bind = flag.String("bind", "127.0.0.1", "network interface to bind the HTTP API and the embedded NATS to; use 0.0.0.0 to accept LAN/remote peers")
|
||||
natsURL = flag.String("nats-url", "", "external NATS url; empty starts an embedded server")
|
||||
|
||||
Reference in New Issue
Block a user