Commit Graph

1427 Commits

Author SHA1 Message Date
Justus Winter
7397a8a440
Make sq pki link list fail if a designated cert has no link.
- Fixes #484.
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 #444.
2024-12-04 12:22:47 +01:00
Justus Winter
cc50bd36ac
Make the default third-party certification expiration configurable.
- Fixes #336.
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 #484.
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 #225.
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 #336.
2024-12-03 20:32:09 +01:00
Justus Winter
0d37335aad
Improve the --self-signer help texts and add to the template.
- Fixes 25e99e5afb.
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 #210.
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 #342.
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 #342.
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 #342.
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 #342.
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 #342.
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 #342.
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 #342.
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 #342.
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 #342.
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 #342.
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 #342.
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 #342.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
9b46f2e239
Add new macro wwrintln.
- Add a new macro `wwriteln`, which is like `writeln`, but wraps the
    output.

  - Rewrite `weprintln` to use it.

  - See #342.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
68e3ddf0b9
Generalize weprintln and iweprintln to write to any stream.
- `weprintln` and `iweprintln` unconditionally write to `stderr`.

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

  - Rename the functions to `wwriteln` and `iwwriteln` to reflect that
    the don't just write to `stderr` anymore, and are now closer to
    `writeln`.

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

  - See #342.
2024-12-03 18:59:35 +01:00
Neal H. Walfield
8902710333
Rename wprintln to weprintln.
- This change is in preparation for a `stdout` variant.

  - See #342.
2024-12-03 18:59:23 +01:00
Neal H. Walfield
fc617dee6b
Clean up sq key list's output. 2024-12-03 18:56:59 +01:00
Justus Winter
f6e7efa371
Implement sq config inspect network.
- Fixes #431.
2024-12-03 18:39:08 +01:00
Justus Winter
ac0044a677
Implement sq config inspect paths.
- Fixes #275.
2024-12-03 17:43:35 +01:00
Justus Winter
3bde91aeb4
Implement sq config inspect policy.
- Fixes #276.
2024-12-03 16:34:20 +01:00
Justus Winter
68522f7bf1
Make sq key list fail without key store, align error messages.
- Fixes #479.
2024-12-03 16:11:51 +01:00
Justus Winter
f0df37d13f
Align error messages when listing certs.
- Previously, `sq key list` showed a different error for a certificate
    in the certificate store from a certificate that is not in the
    certificate store.  Align these.

  - Fixes #462.
2024-12-03 15:06:27 +01:00
Justus Winter
32bdb2598d
Import the secret key so that the example has something to list.
- Otherwise, `--cert-domain=example.org` matches no key.
2024-12-03 14:54:39 +01:00
Neal H. Walfield
3263a5e2d5
Change sq inspect to show the cert associated with a recipient.
- When `sq inspect` displays a PKESK, it displays the recipient key
    ID.  For a user of `sq`, this information is nearly useless.  The
    recipient is normally a subkey, and `sq` doesn't support looking
    up certificates by subkey.

  - Extend `sq inpsect` to look up the recipient, and display
    information about the the associated certificate, if it is
    available.
2024-12-03 11:42:27 +01:00
Neal H. Walfield
a69b8f4921
policy: Update certificates. 2024-03-30 10:00:00 +01:00
Justus Winter
9085ef8638
Simplify code.
- The policy and time were only used to reason over subkeys.  Since
    we don't match on subkeys,  we no longer need the specialized
    functions.
2024-12-03 10:45:51 +01:00
Justus Winter
ee29f3c8f8
Remove unreachable code.
- We no longer resolve certs by subkey fingerprint.

  - Fixes 8c47caaee9.
2024-12-03 10:43:16 +01:00
Justus Winter
84928e39d0
Fix resolving --signer-self.
- Fixes 25e99e5afb.

  - Fixes #475.
2024-12-03 10:39:52 +01:00
Justus Winter
169da29c09
Improve formatting of message.
- We don't emit anything for a backend with devices, so it doesn't
    make sense to indent this more.
2024-12-03 09:53:43 +01:00