Commit Graph

1384 Commits

Author SHA1 Message Date
franzi
b5b211fb9b
Refactor files in /cli to new example framework.
- no content changes
2024-12-14 12:29:49 +01:00
Justus Winter
69e21afd60
Remove the unstable CLI warning. 2024-12-14 12:21:04 +01:00
Neal H. Walfield
68e355690b
Don't make impossible recommendations.
- Only recommend that they user try `--add-userid` if the command
    actually supports it.
2024-12-14 00:00:47 +01:00
Neal H. Walfield
201ce8f874
Remove useless code.
- There is no need for `--all` to require itself.  Drop it.
2024-12-14 00:00:47 +01:00
Neal H. Walfield
9b434cd888
Disable the --name and --add-name arguments.
- Disable the `--name` argument from `sq key approvals list`, `sq
    key approvals update`, `sq key userid revoke` and `sq pki path`,
    and disable the `--add-name` argument from `sq key userid
    revoke`.

  - These arguments are of uncertain value.  Disable them until there
    is clear demand.

  - Fixes #487.
2024-12-14 00:00:46 +01:00
Neal H. Walfield
8ccb13db20
Rename --userid-or-add to --add-userid, etc.
- Rename `--userid-or-add`, `--email-or-add`, and `--name-or-add`
    respectively to `--add-userid`, `--add-email`, and `--add-name`.

  - These names more closely match their new semantics: they don't
    first try and match a self-signed user ID, but just use a user ID
    consisting of the argument's value.
2024-12-14 00:00:46 +01:00
Neal H. Walfield
c0ef0f5dbd
Extend and adjust the set of user ID designators.
- Rename the `Exact` designator semantics to `By`.  By default, the
    `By` arguments are called `--userid`, `--userid-by-email`, and
    `--userid-by-name`.

  - Add a new set of designators called `Exact` for the arguments
    `--userid`, `--email`, and `--name`.  The semantics of `Exact`
    are: the value must match a self-signed user ID, however, the
    returned user ID is just the value, not the matching self-signed
    user ID.  That is, if there is a self-signed user ID `Alice
    <alice@example.org>`, `--email alice@example.org` matches and
    returns the user ID `<alice@example.org>`, and `--name Alice`
    returns the user ID `Alice`.

  - Change the semantics of `Add` user ID designators (by default,
    `--userid-or-add`, `--email-or-add`, and `--name-or-add`) so that
    they just return a user ID with just the specified value.  That is
    `--email alice@example.org` returns the user ID
    `<alice@example.org>`.

  - The following commands use user ID designators and their semantics
    are unchanged:

    - `sq key approvals list`: Unchanged.
    - `sq key approvals update`: Unchanged.
    - `sq pki authenticate`: Unchanged.
    - `sq pki lookup`: Unchanged.
    - `sq pki path`: Unchanged.

  - The following commands use user ID designators and their semantics
    changed as follows:

    - `sq pki link add`: `--email-or-add` had the old `Add` semantics
      and now has the new `Add` semantics.

    - `sq pki link authorize`: `--email-or-add` had the old `Add`
      semantics and now has the new `Add` semantics.

    - `sq pki link retract`: `--email` had the old `Add` semantics and
      now has the new `Add` semantics.

    - `sq key userid revoke`: `--email-or-add` had the old `Add` semantics and
      now has the new `Add` semantics.

    - `sq key vouch add`: `--email-or-add` had the old `Add` semantics and
      now has the new `Add` semantics.

    - `sq key vouch authorize --email-or-add` had the old `Add`
      semantics and now has the new `Add` semantics.
2024-12-13 22:53:00 +01:00
Neal H. Walfield
f9d1112735
Refactor the user ID designators.
- Don't parameterize over the arguments (e.g., `--email`) and their
    semantics.  Just parameterize over the semantics.  For a given set
    of semantics, enable all arguments (i.e., a user id, an email, and
    a name variant).

  - This commit does not change any arguments or their semantics.
2024-12-13 18:18:00 +01:00
Justus Winter
4b755cf2a2
Update all dependencies. 2024-12-13 17:01:38 +01:00
Justus Winter
c60a2d33fb
Fix test.
- Give Sequoia a little space to backdate the signatures.  Note:
    It will not backdate them past the key creation time.
2024-12-13 17:01:38 +01:00
Justus Winter
0cebcf5ea9
Trim unused features on sequoia-cert-store. 2024-12-13 16:48:18 +01:00
Justus Winter
50e941164c
Update sequoia-net and reqwest. 2024-12-13 16:47:32 +01:00
Justus Winter
e08b254d15
Add argument sq network search --iterations.
- Fixes #478.
2024-12-13 16:38:36 +01:00
Justus Winter
c9d7eb8878
Add argument sq network search --use-dane.
- See #478.
2024-12-13 16:38:36 +01:00
Justus Winter
964f9dd51f
Add argument sq network search --use-wkd.
- See #478.
2024-12-13 16:38:36 +01:00
Neal H. Walfield
1a8dd3e467
Better handle user ID's matched by --all.
- Change `sq pki link add`, `sq pki link authorize`, `sq pki link
    retract`, `sq pki vouch add`, and `sq pki vouch authorize` to
    better handle unusable user IDs matched by `--all`.  Specifically,
    if the user explicitly designates a user ID and we can't use it,
    then fail loudly, but if a user ID is selected by `--all` and it
    not usable, only emit a warning.
2024-12-13 14:31:31 +01:00
Neal H. Walfield
1dfaaeb644
Make --all conflict with other user ID designators.
- Make the `--all` user ID designator conflict with other user
    ID designators.
2024-12-13 14:31:31 +01:00
Neal H. Walfield
d830691779
Fix test for sq pki link retract.
- Fix the user ID designator test for `sq pki link retract`.  It
    didn't actually test `sq pki link retract`.
2024-12-13 14:31:31 +01:00
Justus Winter
09882042b1
Make sq cert list display certificates without user IDs.
- If a cert has been explicitly given via the cert designators, we
    want to display it even if it has no bindings.

  - Fixes #501.
2024-12-12 16:51:05 +01:00
Justus Winter
f292912564
Prepare for userid-less certificates in common::pki::authenticate. 2024-12-12 16:38:08 +01:00
Justus Winter
519f580119
Split OutputFormat::add_paths into two functions. 2024-12-12 15:45:01 +01:00
Justus Winter
82f3f292c2
Fix listing certificates without authenticated bindings.
- Fixes ebef0cf9ee.

  - See #501.
2024-12-12 14:12:24 +01:00
Justus Winter
f7eade37c8
Apply the input lints to all certs.
- Fixes ebef0cf9ee.

  - See #501.
2024-12-12 14:12:22 +01:00
Justus Winter
ca3b953bd3
Only show hints about an empty cert store if it is indeed empty.
- Fixes ebef0cf9ee.

  - See #501.
2024-12-12 14:12:16 +01:00
Justus Winter
4df20e9b9a
Change sq config inspect policy to explain the policy.
- Emitting the machine-readable policy configuration is not very
    helpful.  Instead, explain the effective policy, and how to change
    it.  This aligns the subcommand with the other `sq config inspect`
    subcommands.

  - Fixes #490.
2024-12-12 12:26:53 +01:00
Justus Winter
8d7155de32
Fix warnings about elided lifetimes that have a name. 2024-12-12 12:26:50 +01:00
Neal H. Walfield
5079c8ee66
Add tests for sq key approvals update.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:05 +01:00
Neal H. Walfield
29329e5dec
tests: Improve sq key approvals update help functions.
- Adjust the API for `Sq::key_approvals_update` and add
    `Sq::try_key_approvals_update`.
2024-12-12 10:47:04 +01:00
Neal H. Walfield
e227aecbc2
Add tests for sq key approvals list.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:04 +01:00
Neal H. Walfield
52fdea48e2
Add tests for sq key userid revoke.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:04 +01:00
Neal H. Walfield
9564c5cf99
Add tests for sq pki lookup.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:04 +01:00
Neal H. Walfield
551084b560
Add tests for sq pki authenticate.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:04 +01:00
Neal H. Walfield
4e5dcba9b1
Add tests for sq pki vouch {add,authorize}.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:04 +01:00
Neal H. Walfield
aa031eaf7c
tests: Rename Sq::pki_vouch_authorize_p.
- Rename `Sq::pki_vouch_authorize_p` to
    `Sq::try_pki_vouch_authorize`.
2024-12-12 10:47:03 +01:00
Neal H. Walfield
5c11414386
tests: Simplify Sq::try_pki_vouch_add and Sq::pki_vouch_authorize_p.
- Remove the `success` parameter from `Sq::try_pki_vouch_add` and
    `Sq::pki_vouch_authorize_p` and just propagate any error to the
    caller.  This is more consistent with the rest of the functions.
2024-12-12 10:47:03 +01:00
Neal H. Walfield
a979d343a2
Add tests for sq pki link retract.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:03 +01:00
Neal H. Walfield
2dac8e6253
Add tests for sq pki link authorize.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:03 +01:00
Neal H. Walfield
69d85bf3d4
Add tests for sq pki link add.
- Test that the user ID designators behave correctly.
2024-12-12 10:47:03 +01:00
Neal H. Walfield
448f83811a
Simplify comments. 2024-12-12 10:19:33 +01:00
Justus Winter
9b00fa43da
Lint CLI help texts. 2024-12-11 17:56:28 +01:00
Justus Winter
edc803eb21
Align CLI help texts with our UI guidelines.
- See #488.
2024-12-11 17:56:28 +01:00
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 #459.
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 #446.
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: #451
2024-12-11 14:12:33 +01:00
franzi
03578878fe
Refactor files in /cli/cert to new example framework
- no content changes
- see: #451
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: #451
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 #491.
2024-12-11 13:29:32 +01:00