aboutsummaryrefslogtreecommitdiff
path: root/crates/arti/src/subcommands/keys.rs
Commit message (Collapse)AuthorAgeFilesLines
* arti: subcommands: keys: Fix clippy::for-kv-maphjrgrn2026-07-131-2/+2
|
* multiple crates: Fix clippy warningshjrgrn2026-07-101-2/+2
|
* arti: subcommands: keys: Fix compact outputhjrgrn2026-06-221-1/+1
|
* arti: Sort the arti keys list outputGabriela Moldovan2026-06-171-0/+5
| | | | | This will make the output deterministic and enable us to write some `trycmd` tests in the form of markdown output snippets.
* arti: Don't mention entry validity in the help messageGabriela Moldovan2026-06-171-1/+1
| | | | | | This actually applies to unrecognized entries too, and besides, most users aren't going to think in terms of "valid" vs "invalid" entries, so it's best to omit this qualifier.
* arti: subcommands: keys: Rework output of keys listhjrgrn2026-06-171-79/+110
|
* client: Factor out the "running a client" code into an inner typestateNick Mathewson2026-05-261-1/+1
| | | | | | We'll use this to distinguish "not running" from "running", in order to make it easier to be sure that non-bootstrapping clients will definitely not try to connect to the network.
* keymgr: Remove RawKeystoreEntryGabriela Moldovan2026-05-181-13/+11
| | | | | | | | | | | | I think this adds unnecessary indirection, and it's a bit confusing to have two separate keystore entry types (we have `KeystoreEntry` too). This type exists just to server as a wrapper over the `RawEntryId` of an unrecognized keystore entry, and the `KeystoreId` of the keystore it was found in. This commit folds `RawKeystoreEntry` into `UnrecognizedEntry`, which was previously a thin wrapper over `RawKeystoreEntry`.
* Make all TorClient constructors wrap the TorClient in an Arc.Nick Mathewson2026-05-131-1/+2
| | | | | | This is part of rationalizing the structure of TorClient so we can refactor startup logic, and so that RPC code can reason about object identity. See #2469.
* keymgr: Move Unrecognized errors out of KeyPathErrorGabriela Moldovan2026-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | Out of all the variants in `KeyPathError`, `Unrecognized` is the odd one out, because unlike the others, which are mainly just lower level parsing errors, `Unrecognized` is a higher level error constructed in `KeyMgr::describe()`. `KeyMgr::describe()` now returns an `Option`, because * the failure to describe a user provided `KeyPath` may or may not be an error * previously, `describe()` would only ever return `Ok` or `Err(KeyPathError::Unrecognized)`, which essentially a binary result. Also, `describe()` would never return any of the other `KeyPathError` kinds, which further suggests `Unrecognized` doesn't belong there The `Unrecognized` variant still exists, but is now part of `KeystoreCorruptionError`, (returned from `KeyMgr::validate_entry_integrity()`).
* arti: Remove no-longer needed helper functionGabriela Moldovan2026-01-061-23/+18
| | | | This folds `display_arti_entry()` into `display_entry()`.
* arti: Remove special handling for C Tor keys (fmt)Gabriela Moldovan2026-01-061-4/+1
|
* arti: Remove special handling for C Tor keysGabriela Moldovan2026-01-061-40/+2
| | | | | | | | | | This is no longer needed now that `KeyMgr::describe()` works on `CTorPath`s. Removing this special handling has the added bonus that the keymgr CLI output is now uniform for all keystores (before this change, `keys list` used a slightly different output format for displaying C Tor entries). The corresponding tests will be updated in a future commit.
* Merge branch 'torclient-keymgr-accessor' into 'main'wesleyac2025-12-031-12/+10
|\ | | | | | | | | Add `KeyMgr` accessor to `TorClient` See merge request tpo/core/arti!3442
| * arti: keys: use `TorClient::keymgr` instead of `InertTorClient::keymgr` in ↵hjrgrn2025-11-051-12/+10
| | | | | | | | | | | | `run_check_integrity` This change simplifies the signature of `run_check_integrity`.
* | arti: Add missing subcommand docsGabriela Moldovan2025-12-011-0/+1
|/
* arti: keys: Simplify `run_check_integrity`hjrgrn2025-10-081-9/+7
|
* arti: keys: Improve readability of `print_check_integrity_incipit`hjrgrn2025-10-081-11/+7
|
* arti: keys: Fix typo in `run_check_integrity`hjrgrn2025-10-081-1/+1
|
* arti: keys: Rename `invalid_entry` to `expired_entry` in `run_check_integrity`hjrgrn2025-10-081-3/+3
|
* arti: keys: Add warning for unexpected invalid keystore entryhjrgrn2025-10-081-14/+16
|
* arti: keys: Improve readability of `run_check_integrity`hjrgrn2025-10-081-5/+4
|
* arti: keys: Add comment explaining why `services` cannot be droppedhjrgrn2025-10-081-0/+2
|
* arti: keys: Add comment explaining difference between `affected_keystores` ↵hjrgrn2025-10-081-0/+5
| | | | and `keystores`
* arti: keys: Refactor `get_expired_keys`hjrgrn2025-10-081-9/+6
| | | | The function now returns `Result<Vec<InvalidKeystoreEntry<'a>>>`
* arti: keys: Add integrity check for empty expired_entrieshjrgrn2025-10-081-0/+14
| | | | | | | Add a check in `run_check_integrity` to verify that the `expired_entries` collection is empty after processing all registered keystores. This should always be true, as all expired entries are expected to be removed during iteration. If not, it indicates a bug.
* arti: keys: Introduce InvalidKeystoreEntry and InvalidKeystoreEntries structshjrgrn2025-10-081-33/+74
| | | | | Replace raw tuples with named structs to reduce type complexity and improve code clarity and maintainability.
* arti: keys: Remove `filter` in favor of `retain` in `run_check_integrity`hjrgrn2025-10-081-11/+9
|
* arti: keys: Add comment explaining expired entry handling in ↵hjrgrn2025-10-081-0/+2
| | | | `run_check_integrity`
* arti: keys: Improve `run_check_integrity` functionhjrgrn2025-10-081-11/+23
| | | | | | - Fix bug where expired keys from one keystore were incorrectly associated with all keystores - Remove unnecessary clone
* arti: keys: Adapt `maybe_remove_invalid_entries` to updated ↵hjrgrn2025-10-081-14/+19
| | | | `run_check_integrity`
* arti: keys: Refactor function `display_invalid_keystore_entries`hjrgrn2025-10-081-32/+40
| | | | | | - Add `display_invalid_keystore_entries` helper function `print_check_integrity_incipit` - Add `display_invalid_keystore_entries` comment
* arti: keys: Implement `display_invalid_keystore_entries`hjrgrn2025-10-081-2/+39
| | | | | | Add initial functional implementation of `display_invalid_keystore_entries`, which processes a list of invalid keystore entries grouped by `KeystoreId` and displays them with associated error messages.
* arti: keys: Refactor `display_invalid_keystore_entries`hjrgrn2025-10-081-35/+38
| | | | | | | | | | Create the skeletal version of the new `display_invalid_keystore_entries` function and adapt `run_check_integrity` to use it. The function now takes a slice of pairs, each containing a `KeystoreId` and a vector of invalid keystore entries along with their error messages, and processes all entries internally by iterating over each keystore, instead of being called once per keystore.
* arti: keys: Refactor run_check_integrity to use keystores with IDshjrgrn2025-10-081-28/+37
| | | | | | | | | Previously, the function worked with a flat `Vec<KeystoreEntryResult<KeystoreEntry>>`. Now, it uses a structured `Vec<(KeystoreId, Vec<KeystoreEntryResult<KeystoreEntry>>)>`, grouping entries by keystore. This makes it easier to track which keystore each entry belongs to, and prepares the code for upcoming improvements.
* arti: keys: Add `keys check-integrity` CLI toolhjrgrn2025-09-041-17/+220
|
* arti: keys: Fix `display_keystore_entries` outputhjrgrn2025-08-091-0/+1
|
* arti: keys: Improve CLI output by distinguishing KeyPath variantshjrgrn2025-08-061-17/+64
| | | | | * Update `display_entry` function to handle different `KeyPath` variants * Add functions `display_arti_entry` and `display_ctor_entry`
* arti: keys: Add arti keys-rawhjrgrn2025-07-141-37/+31
| | | | | | | | | | | | | | | | | | | * CLI: Add `keys-raw` and subcommand `remove-by-path` * arti: Add `arti::subcommand::raw` for the CLI `keys-raw` * tor-keymgr: Add `ArtiNativeKeystoreError::UnexpectedRawEntry`, `ArtiEphemeralKeystoreError::NotSupported` * tor-keymgr: Add `tor-keymgr::raw` module * tor-keymgr: Add `Keystore::remove_unchecked` * tor-keymgr: Change `Keystore::list` to return `KeystoreEntry` * tor-keymgr: Add field `KeystoreEntry::raw_id` * doc: Update keys.md * doc: Add raw.md * tor-keymgr: BREAKING: `UnrecognizedEntryError::new` associated function is now only accessible within the crate `tor-keymgr` * tor-keymgr: BREAKING: `UnrecognizedEntryId` is renamed to `UnrecognizedEntry` * tor-keymgr: BREAKING: `KeyMgr::list()` and `Keystore::list()` now return `Result<Vec<KeystoreEntryResult<KeystoreEntry>>>`
* arti: keys: Fix arti keys help messagehjrgrn2025-06-231-2/+2
|
* arti: Add keys list and keys list-keystoreshjrgrn2025-06-121-0/+180