feat(cli): fold bootstrap-infisical/clients/qa subcommands into mokosh-server (PMS-494) #369
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-494-fold-bootstrap-subcommands-into-server"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Re-home the three operator features that previously lived only in the
mokosh-bootstrap binary so they survive that binary's removal (PMS-493):
bootstrap-infisical (first-run Infisical setup), clients register (OAuth/OIDC
client registration), and qa-seed / qa-teardown (QA walkthrough dataset, PMS-331).
Decision: fold all three into the mokosh-server binary as subcommands. None are
obsolete - each is still wired to a just recipe or used as QA tooling - so dropping
was not an option, and a separate binary would just recreate what PMS-493 removes.
The logic moves into a new library module (src/cli.rs); main.rs inspects argv before
starting the HTTP server and runs the one-shot task instead when the first token is
bootstrap-infisical, clients, qa-seed, or qa-teardown. Each feature keeps its original
env-var contract and fail-closed guards verbatim: qa-* still refuse any tenant not marked
is_qa, the public/confidential client-type and auth-method validation is unchanged, and
the CLI path loads .env.infisical then .env so credentials never hit the command line.
provision-roles is intentionally untouched - it relocates into server startup under PMS-489.
The register-client, register-bunyip-client, register-lets-chat-client and
infisical-bootstrap recipes now invoke cargo run --bin mokosh-server instead of
--bin mokosh-bootstrap.
#PMS-494