1343 Commits

Author SHA1 Message Date
Justus Winter
379248aa64
Make long help texts configurable for cert designators. 2024-12-11 17:56:28 +01:00
Justus Winter
3f81e65ecb
Deduplicate and rework the signature notation argument handling. 2024-12-11 17:56:28 +01:00
Justus Winter
830c49def0
Require explicit opt-out for encrypting without signing.
- Fixes .
2024-12-11 17:29:36 +01:00
Justus Winter
ebef0cf9ee
Use cert designators for sq cert list.
- This aligns it with `sq key list` and `sq pki link list`.

  - Fixes .
2024-12-11 16:24:43 +01:00
franzi
3d4554a5a4
Add examples for sq cert list
- List all bindings for User IDs containing a specific email address
- List all paths to a specific certificate
- See: 
2024-12-11 14:12:33 +01:00
franzi
03578878fe
Refactor files in /cli/cert to new example framework
- no content changes
- see: 
2024-12-11 14:12:24 +01:00
Malte Meiboom
898ccc753f
Modify examples
- Don't encourage unprotected keys
- sq key generate: Don't show '--without-password'
- sq key subkey add: Don't show '--without-password'
- See: 
2024-12-11 14:03:48 +01:00
Malte Meiboom
4158d4045b
Refactor files under .../cli/key to use example framework
- Just refactoring, no changes to content
2024-12-11 14:03:48 +01:00
Justus Winter
02f0dc44fa
Fix generation of user ID-less keys.
- Fixes .
2024-12-11 13:29:32 +01:00
Justus Winter
44d97fc920
Upgrade hickory-proto to avoid vulnerable idna 0.4.0.
- See https://rustsec.org/advisories/RUSTSEC-2024-0421
2024-12-11 12:44:49 +01:00
Justus Winter
01aa4dc06a
Gracefully handle missing ui section in config file.
- Fixes `sq config get` without the [ui] section in the config file,
    while making sure that `sq config get` reflects whether hints are
    displayed.

  - Fixes .
2024-12-09 15:21:35 +01:00
Justus Winter
3ab852aba2
Add sq encrypt --profile in preparation for RFC9580.
- Fixes .
2024-12-04 16:18:43 +01:00
Justus Winter
6cf2acc893
Add sq key generate --profile in preparation for RFC9580.
- See .
2024-12-04 16:17:28 +01:00
Justus Winter
ab01bd9557
Parse key.generate.cipher-suite case sensitively.
- This matches the parsing of the command line parameter.  Let's
    reduce variance.
2024-12-04 15:31:07 +01:00
Justus Winter
9e2af6a92f
Mention the configuration key in the augmented help texts. 2024-12-04 15:15:24 +01:00
Justus Winter
98203e6cd0
Make sq network dane generate require cert designators or --all.
- Fixes .
2024-12-04 14:39:20 +01:00
Justus Winter
7397a8a440
Make sq pki link list fail if a designated cert has no link.
- Fixes .
2024-12-04 14:04:22 +01:00
Justus Winter
5c2829fa7a
Refactor user ID matching when resolving certificates. 2024-12-04 14:04:22 +01:00
Justus Winter
148b647715
Generalize the filter for `Sq::resolve_certs_filter. 2024-12-04 13:40:01 +01:00
Justus Winter
660d1eb39d
Align sq sign --detached-file with sq verify --detached-file.
- `sq sign --signature-file` now takes a value specifying where the
    signature should be written to.  It conflicts with `--output`.
    This aligns `sq sign` with `sq verify`.

  - Fixes .
2024-12-04 12:22:47 +01:00
Justus Winter
cc50bd36ac
Make the default third-party certification expiration configurable.
- Fixes .
2024-12-04 11:55:18 +01:00
Justus Winter
2d17692dda
Introduce a specialization for third-party certifications. 2024-12-04 11:55:18 +01:00
Justus Winter
74edd46721
Make ExpirationArg configurable. 2024-12-04 11:55:18 +01:00
Justus Winter
c6eb28eb1b
Manually implement clap::Args for ExpirationArg. 2024-12-04 11:55:18 +01:00
Neal H. Walfield
f0e73deb7f
Add tests for sq pki link list.
- Add tests that check that `sq pki link list` returns an
    appropriate error code.

  - See .
2024-12-04 11:22:23 +01:00
Neal H. Walfield
0cc2aba0be
Add tests for sq key list.
- Add tests that check that `sq key list` returns an appropriate
    error code.
2024-12-04 11:22:20 +01:00
Neal H. Walfield
fde96e5790
Listing an empty certificate store should not be an error.
- `sq cert list` on an empty certificate store should not be an
    error.
2024-12-04 11:15:13 +01:00
Neal H. Walfield
500447b804
Fix hint. 2024-12-04 11:15:13 +01:00
Malte Meiboom
a7cbf56067
Hide --without-password from the sq key generate examples.
- The `sq key generate` examples shouldn't include
    `--without-password`, but it is needed for the automated tests.

  - Hide it.
2024-12-04 11:15:12 +01:00
Malte Meiboom
ae0609006c
Make it possible to hide parts of an example.
- Sometimes an example needs an argument to run in an automated way,
    but which the user shouldn't actually use, like
    `--without-password`.

  - Add a mechanism to hide specific arguments.
2024-12-04 11:15:12 +01:00
Justus Winter
f6b4b31976
Change the default third-party certification expiration to 10y.
- Fixes .
2024-12-03 20:44:50 +01:00
Justus Winter
1fcdd57d93
Implement sq pki vouch {add,authorize} --certifier-self.
- This selects the default certification key controlled by the
    `pki.vouch.certifier-self` setting.

  - See .
2024-12-03 20:32:09 +01:00
Justus Winter
0d37335aad
Improve the --self-signer help texts and add to the template.
- Fixes 25e99e5afb1e2f382e138a4502c9e00641dd903b.
2024-12-03 20:05:40 +01:00
Justus Winter
84a57d45d1
Add a pattern argument to sq pki link list.
- This harmonizes the interface with `sq cert list` and `sq key
    list`.

  - Fixes .
2024-12-03 19:21:19 +01:00
Justus Winter
888c82e4ec
Add missing conflict for sq key list. 2024-12-03 19:12:15 +01:00
Neal H. Walfield
0b11ee4ef9
Change sq config inspect network to use stdout.
- Change `sq config inspect network ` to use `stdout`, not `stderr`,
    for its main output.

  - See .
2024-12-03 19:03:11 +01:00
Neal H. Walfield
a47a130d42
Change sq config inspect paths to use stdout.
- Change `sq config inspect paths ` to use `stdout`, not `stderr`,
    for its main output.

  - See .
2024-12-03 18:59:38 +01:00
Neal H. Walfield
93217dcfd0
Change sq cert import and sq key import to use stdout.
- Change `sq cert import` and `sq key import` to use `stdout`, not
    `stderr`, for their main output.

  - See .
2024-12-03 18:59:38 +01:00
Neal H. Walfield
4b76ba2b81
Improve sq network wkd publish's output.
- Add a header to a list so that it doesn't run into the previous
    list.  Consider:

    ```
    $ sq network wkd publish --domain example.org  /tmp/example.org --cert 9889EAA8B493129489EF7D235CE7215F115DA8A6
    Note: Skipping the following certificates because they don't have a valid self-signed user ID in example.org:
     - 9889EAA8B493129489EF7D235CE7215F115DA8A6
     - F57D5B402CEA11F8F22228A64AC1A5F0C16EE42D
       - alice (UNAUTHENTICATED)
       - updated

    1 update applied.
    ```
2024-12-03 18:59:38 +01:00
Neal H. Walfield
a96a1ea538
Change sq network wkd publish to use stdout.
- Change `sq network wkd publish` to use `stdout`, not `stderr`, for
    its main output.

  - See .
2024-12-03 18:59:37 +01:00
Neal H. Walfield
de2d022007
Convert a hint to a warning. 2024-12-03 18:59:37 +01:00
Neal H. Walfield
eec362d75f
Change sq network keyserver publish to use stdout.
- Change `sq network keyserver publish` to use `stdout`, not
    `stderr`, for its main output.

  - See .
2024-12-03 18:59:37 +01:00
Neal H. Walfield
61e3b67505
Change sq pki link add, etc. to use stdout.
- Change `sq pki link add`, `sq pki link authorize`, `sq pki link
    retract` to use `stdout`, not `stderr`, for their main output.

  - See .
2024-12-03 18:59:37 +01:00
Neal H. Walfield
639503bf10
Generalize make_qprintln to write to a different stream.
- Add an optional parameter to `make_qprintln` to make it write to
    an alternate stream, e.g., `stdout`.

  - See .
2024-12-03 18:59:37 +01:00
Neal H. Walfield
acbc039031
Change sq pki link list to use stdout.
- Change `sq pki link list` to use `stdout`, not `stderr`, for its
    main output.

  - See .
2024-12-03 18:59:37 +01:00
Neal H. Walfield
3ac37dc386
Before printing a hint, flush stdout.
- Hints are printed to `stderr`.  If the output is going to `stdout`
    and `stdout` is a terminal, first flush `stdout` to reduce the
    chance of incorrectly interleaving output and hints.

  - Note: this is a precaution; I haven't observed this happen in
    practice.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
a2beb96123
Change sq cert list, sq pki authenticate, etc. to use stdout.
- Change `sq cert list`, `sq pki authenticate`, `sq pki lookup`, `sq
    pki identify`, and `sq pki path` to use `stdout`, not `stderr`, for
    their main output.

  - See .
2024-12-03 18:59:36 +01:00
Neal H. Walfield
8695928157
Generalize the authentication output routines to use any stream.
- `print_path_error`, `print_path_header`, `print_path`, and
    `ConciseHumanReadableOutputNetwork` unconditionally use `stderr`.

  - Change them to take an additional parameter, the stream
    to write to.

  - This change is in preparation for using these functions to write
    to `stdout`.

  - See .
2024-12-03 18:59:36 +01:00
Neal H. Walfield
1611150f5c
Change sq key approvals list to use stdout.
- `sq key approvals list`'s main output is the approvals listing.
    Write this to `stdout`, not `stderr`.

  - See .
2024-12-03 18:59:36 +01:00
Neal H. Walfield
9c15761f48
Change sq key list to use stdout.
- `sq key list`'s main output is the key listing.  Write this to
    `stdout`, not `stderr`.

  - See .
2024-12-03 18:59:36 +01:00