mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 14:37:26 +00:00
fix(cli): vault names join with "--", not "/" — the server rejects slashes (#112)
#109 addressed vaults as <project>/<env> and shipped broken: every push failed with Vault name must be lowercase letters, numbers, and dashes. The vault-create endpoint slugifies through /^[a-z0-9][a-z0-9-]{0,62}$/ (apps/pwa/src/routes/credshare.mjs), so a "/" join is refused outright. Nothing in the CLI ever saw it, because the tests exercised vaultName and splitVaultName in isolation and never made a request — the one assumption that mattered, that the server takes an arbitrary vault name, was the one left unverified. Switches the separator to "--", which is inside the allowed character set and still splits unambiguously since neither half may contain one. A single dash would not: "a-b" + "c" and "a" + "b-c" would collide. Also validates the joined name against the server's own regex before the request, so a bad name fails locally with a useful message rather than a 422 after the .env has been read. The tests now assert the produced name matches that regex, so the separator cannot drift back out of the allowed set without failing. Verified end to end against app.logicsrc.com: push, then pull into a scratch file and diff — keys and values both round-trip losslessly. Then 49 repos pushed under the profullstack team; server reports 49 vaults, 169 secrets, 0 failures. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f41abbd712
commit
bb09c145cd
4 changed files with 86 additions and 27 deletions
|
|
@ -183,7 +183,9 @@ re-wraps (seals) it to the new member's public key. The private key lives only i
|
|||
logicsrc login
|
||||
|
||||
# Owner: create a team, push a local .env into an encrypted vault, invite people.
|
||||
# A vault is addressed as <project> <env>, stored as the vault name project/env.
|
||||
# A vault is addressed as <project> <env>, stored as the vault name
|
||||
# project--env (a double dash: the server slugs vault names through
|
||||
# /^[a-z0-9][a-z0-9-]{0,62}$/, so a "/" would be rejected).
|
||||
logicsrc teams create acme --name "Acme Inc"
|
||||
logicsrc teams push acme web prod --env .env # encrypt + upload
|
||||
logicsrc teams invite acme teammate@example.com # emails an accept link
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue