Skip to content

Document the listing and export flags - #29

Merged
wayneeseguin merged 2 commits into
ls-escaped-pathsfrom
document-listing-flags
Jul 29, 2026
Merged

Document the listing and export flags#29
wayneeseguin merged 2 commits into
ls-escaped-pathsfrom
document-listing-flags

Conversation

@wayneeseguin

Copy link
Copy Markdown
Contributor

Documentation only. Stacked on #28 — it builds on the ### ls section that
PR adds, so review that one first; GitHub will retarget this to develop once
#28 merges.

Why

ls, tree, and paths all take flags the command reference never mentioned,
and one of them decides whether a secret is listed at all. A secret whose newest
version has been deleted or destroyed does not appear in a default listing —
not even when an older version of it is still perfectly readable — and nothing
in the README said so. The behaviour is defensible for a listing of what you can
read, and -q is right there, but a reader had no way to learn either fact.

export's two flags were undocumented in the same way, and they change which
secrets come out, not just how many versions of each.

Verified, not inferred

Every claim was measured against a live Vault 1.13.2 first. Fixture on the v2
secret/ mount: alive (one live version), gone (v1 live, v2 deleted),
dead (its only version deleted), blown (its only version destroyed).

$ safe paths secret/d          $ safe paths -q secret/d
secret/d/alive                 secret/d/alive
                               secret/d/blown
                               secret/d/dead
                               secret/d/gone

tree and ls agree with paths on the same fixture, both with and without
-q.

$ safe export secret/d
{"secret/d/alive":{"a":"1"}}

$ safe export -a secret/d
... "secret/d/gone":{"versions":[{"value":{"a":"1"}},{"destroyed":true}]} ...

$ safe export -a -d secret/d
... "secret/d/gone":{"versions":[{"value":{"a":"1"}},{"deleted":true,"value":{"a":"2"}}]},
    "secret/d/dead":{"versions":[{"deleted":true,"value":{"a":"1"}}]},
    "secret/d/blown":{"versions":[{"destroyed":true}]} ...

$ safe export -d secret/d
{"secret/d/alive":{"a":"1"},"secret/d/blown":{},"secret/d/dead":{"a":"1"},"secret/d/gone":{"a":"2"}}

Which is where the wording comes from: -a keeps any secret with at least one
readable version and pads the rest as placeholders so the surrounding version
numbers stay right; -d recovers the deleted values and pulls in secrets a
plain export skips entirely; a destroyed version stays a placeholder either way.

Not changed

The listing behaviour itself. Hiding a secret you cannot read is a reasonable
default for a listing, -q covers the other case, and unlike a backup it loses
nothing. This PR makes it discoverable rather than quietly true.

The three listing commands took flags the reference never mentioned,
including the one that governs whether a secret appears at all: a
secret whose newest version has been deleted is left out unless -q is
given, even when an older version of it is still readable.
Both flags change which secrets come out, not only how many versions
of each, and neither was described in the reference.
@wayneeseguin
wayneeseguin merged commit b772708 into ls-escaped-paths Jul 29, 2026
@wayneeseguin
wayneeseguin deleted the document-listing-flags branch July 29, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant