Repository navigation
Milestone 1, slice 5: output - #15
Merged
Merged
Conversation
Owner
Author
|
The PR description describes the rounds of review that I did by looking at all of the permutations of output and the code. |
Owner
Author
|
I also did a quick scan of all of the files in the PR in the GitHub "Files changed" tab. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Milestone 1, slice 5: output
This slice gives vcrd's output its three formats and its verbosity levels, makes masking visible value by value, and adds the levels of
--unsafe.textbecomes the default. A first draft (cf54833) was reviewed and revised in four rounds, one commit each, listed below.Example of what a reader sees
textat the default level, for a credential that carries its own key and names no issuer:Changes
Formats.
--format text(the default, whether or not stdout is a terminal) prints labeled sections of tables.plainprints onename: valueline per item, orname: column=value …for a table row.jsonprints the complete result as before.textandplaindraw on the same sections (vcrd-cli/src/text.rs), so the two always show the same information.textandplain, every control character and every character that reorders bidirectional text is printed as an escape such as\u{001b}, so a credential's content can't act on the terminal or fake a line of output.text. The header'skidbreaks before its#. Other values stay on one line, so they can be copied and searched for.NO_COLORholds trivially.Verbosity.
--verbosity0–3 chooses how muchtextandplainshow; JSON is always complete.The status is always the first line of
textandplain.Masking,
--unsafe, and visibility.--unsafehas three levels:--unsafe,--unsafe=1or--unsafe 1) shows claims;jwk's private members.visibilityofnon_sensitive,maskedorrevealed: in JSON on each entry ofcredential.claims,credential.metadataandformat.header, and as a Visibility column intextandplain.revealslists each revealed value with its path, the key the path is relative to, andvisibility: revealed.--unsafewrites a warning to stderr, and repeats it in the result:warningsin JSON, a Warnings table or line intextandplain.The header.
format.headerlists every member of the JOSE header as values, as the claims are listed.Keys.
key_provenance.jwkandcredential_key.jwkhold each key as a JWK (JSON Web Key): the public members its RFC 7638 thumbprint covers. They come from a new core type,PublicJwk.credential_key_mismatchis now{carried_key: {location, thumbprint}, key: {source, method, thumbprint}};weak_keynames its key the same way and addscriterion: small_order.Exit codes. No output setting changes the exit code.
--verbosity 0 --unsafeis accepted and prints nothing, where the draft treated it as a caller error.Blocks.
{phase: parse, reason: impossible}in JSON, withoutmissing: document, and reads "parse failed" intextandplain.missing: key_materialand reads "inspect: no key to verify with; looked in: issuer identifier".Other.
Cargo.lockupdate, needed the code owner's review or the bypass.deny.toml. Thesyn@2exception now names only curve25519-dalek-derive, since PR Bump the cargo group with 3 updates #14 removed zerocopy.The review rounds
f794a82warnings;--unsafe 2; prose wrappingf610f23treatment, the masked header valuevisibilityeverywhere; the header as a list of values;revealsentries renamed tovisibilitybc070668a2ed28jwkbeside each thumbprint; key findings name their keys' sources; the carried key at level 104f5528kidbroken at#Two notes moved to later work:
kidthat is adid:keyURL as a carried key, when the issuer gives none, is recorded in milestone 2's scope beside the embedded-key opt-in.Dependencies
vcrd-cliaddstabled0.22 withstdonly. It doesn't use the derive macro, since the columns change with the verbosity level, and leaves out color (ansi),macrosandassert.Cargo.lockgains six entries. Five are built:tabled,papergrid,bytecount,fnvandunicode-width, all MIT or Apache-2.0.testing_tableis listed but never built.cargo-denypasses.Tests
vcrd-cli/tests/redaction.rs, with the newfixtures/canary.jwt):--unsafelevels, exactly the right canaries are printed, none reaches stderr, the warning is on both streams exactly when asked for, and the status is the first line.reveals,--verbosity 0with--unsafe, and the warning after a caller error.vcrd-cli/tests/exit_codes.rs): the example, every fixture and an unparseable stdin input, each at every format, verbosity level and--unsafelevel. That's 720 runs in about 2 seconds, each required to give the input's one exit code, equal to the envelope'sexit_code.vcrd-cli/tests/output.rs): 14 cases compared with files invcrd-cli/tests/expected/, with an ignored test that regenerates them.plainquoting, the--unsafespace form, and the thumbprints fromPublicJwk.--format json, sincetextis the default.Documents
docs/output.md: the formats, the verbosity table,--unsafe, values and their visibility,format.header, blocks in the reader's terms, keys and thumbprints, andtextandplainexamples. Its nine examples match the binary.tabled;warnings;--unsafelevels, JSON always complete, and no output setting changing the exit code;kiditem.Checks
make ci-okandmake test-powersetpass locally.🤖 Generated with Claude Code using Opus 5.5 - Extra effort