summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* KeySpecifier d-a macro: Use doc-hidden re-exportsIan Jackson2024-01-041-1/+1
|
* KeySpecifier: Make KeySpecifierPattern a traitIan Jackson2024-01-041-1/+1
| | | | | | So now .arti_pattern() is a trait method. arti#1151 item 3.
* KeySpecifier d-a macro: Move to its own moduleIan Jackson2024-01-041-0/+3
| | | | This is going to expand and gain private helper methods.
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathError (fmt)Ian Jackson2023-12-071-3/+3
|
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathErrorIan Jackson2023-12-071-1/+1
| | | | | The previous name was ambiguous, and confusable with KeyPathError (of which it is, basically, a variant).
* tor-keymgr: Move ArtiPath etc. into new moduleIan Jackson2023-12-071-2/+4
| | | | Minimal changes to still compile and pass tests.
* tor-keymgr: provide KeySpecifierComponentViaDisplayFromStr and use itIan Jackson2023-12-071-1/+1
| | | | Now the only manual impl is TimePeriod, which is indeed special.
* tor-keymgr: Abolish the KeyDenotator trait in favour of KeyPathComponent (fmt).Gabriela Moldovan2023-12-051-3/+3
|
* tor-keymgr: Abolish the KeyDenotator trait in favour of KeyPathComponent.Gabriela Moldovan2023-12-051-1/+1
|
* tor-hsservice: Test the TryFrom<&KeyPath> KeySpecifier impl.Gabriela Moldovan2023-12-051-2/+2
|
* tor-keymgr: Add a module for test utilities.Gabriela Moldovan2023-12-051-0/+2
|
* tor-keymgr: Make DefaultKeySpecifier generate a key info extractor as well.Gabriela Moldovan2023-12-051-1/+1
|
* tor-keymgr: Introduce a KeySpecifierComponent trait.Gabriela Moldovan2023-12-051-1/+1
| | | | | | | | | Now the fields of a `DefaultKeySpecifier` no longer have to implement `Display` (they need to implement `KeySpecifierComponent`). See https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1733#note_2966400 Closes #1127
* tor-keymgr: Add a way of registering key info extractors using inventory.Gabriela Moldovan2023-12-051-1/+1
|
* tor-keymgr: Add types for extracting info out of a KeyPath.Gabriela Moldovan2023-12-051-2/+3
|
* tor-keymgr: Change KeyDenotator error type to KeyPathError.Gabriela Moldovan2023-12-051-1/+1
| | | | | This is a separate class of errors that deserves its own error type. We will soon use `KeyPathError` in other contexts as well.
* Merge branch 'keymgr-derive-builder' into 'main'gabi-2502023-11-281-1/+4
|\ | | | | | | | | | | | | tor-keymgr: Derive Builder for KeyMgr. Closes #1114 See merge request tpo/core/arti!1760
| * tor-keymgr: Derive Builder for KeyMgr.Gabriela Moldovan2023-11-271-1/+4
| | | | | | | | | | | | | | `KeyMgr` is soon going to have more fields, so now is a good time to derive `Builder` for it. Closes #1114
* | tor-keymgr: Move ArtiPathError, KeystoreCorruptionError to err.rs.Gabriela Moldovan2023-11-211-3/+3
|/ | | | | | KeystoreCorruptionError is about to become a variant of the top-level keymgr Error enum (which doesn't exist yet but will be introduced in a future commit).
* tor-keymgr: Rewrite define_key_specifier using derive-adhoc.Gabriela Moldovan2023-11-201-0/+3
| | | | | | | | For the most part, this is just code movement. The implementation was copied over to `define_derive_adhoc` from `define_key_specifier`, with some minor adjustments that were needed to make it compile. Closes #1093
* tor-keymgr: Add missing backticks (fmt).Gabriela Moldovan2023-11-131-2/+1
|
* tor-keymgr: Abolish KeyPathPatternSet.Gabriela Moldovan2023-11-131-1/+1
| | | | | | We don't really need it. Closes #1066
* tor-keymgr: Add an error type for keystore corruption (fmt).Gabriela Moldovan2023-11-021-2/+2
|
* tor-keymgr: Add an error type for keystore corruption.Gabriela Moldovan2023-11-021-0/+1
|
* tor-keymgr: Add a constant for the denotator separator.Gabriela Moldovan2023-11-021-1/+1
|
* tor-keymgr: Move the KeyDenotator trait to tor-keymgr.Gabriela Moldovan2023-10-301-2/+2
| | | | | The trait is no longer sealed because users should be allowed to define their own key denotators.
* tor-keymgr: Rename KeyPathError to ArtiPathUnavailableError (fmt).Gabriela Moldovan2023-10-191-2/+2
|
* tor-keymgr: Rename KeyPathError to ArtiPathUnavailableError.Gabriela Moldovan2023-10-191-1/+1
|
* tor-keymgr: Add KeyMgr::list_matching for retrieving keys that match a given ↵Gabriela Moldovan2023-10-191-1/+1
| | | | pattern.
* tor-keymgr: Give KeyType an Unknown variant.Gabriela Moldovan2023-10-191-3/+3
|
* tor-keymgr: Add matching functionality and types for representing patterns.Gabriela Moldovan2023-10-191-1/+2
|
* tor-keymgr: Add ArtiPathError, KeyPathError (fmt).Gabriela Moldovan2023-10-191-1/+3
|
* tor-keymgr: Add ArtiPathError, KeyPathError.Gabriela Moldovan2023-10-191-1/+1
|
* tor-keymgr: Add an enum for representing an ArtiPath or a CTorPath.Gabriela Moldovan2023-10-191-1/+1
| | | | | | This will enable the future `KeyMgr::list_matching()` API to return a list that contains results from (potentially) multiple different keystore backends.
* tor-keymgr: Factor the generate() function into a separate trait.Gabriela Moldovan2023-10-091-1/+1
| | | | | | `EncodableKey` is a trait for encoding keypairs and public keys. Keygen only makes sense for key_pairs_ (it doesn't make sense for public keys), so it makes sense to move `generate()` out of `EncodableKey`,
* tor-keymgr: Make EncodableKey support public keys too.Gabriela Moldovan2023-09-251-1/+1
| | | | | | | | | Previously, `EncodableKey::to_keypair_data` could only be used for encoding private keys (its return type was `KeypairData`). Now `EncodableKey::to_keypair_data` can return public key data (`KeyData`) too. Note: `to_keypair_data()` will be renamed in a future commit.
* tor-keymgr: Re-export ssh-key.Gabriela Moldovan2023-08-161-1/+2
| | | | | | | | | | The `KeypairData` type from [ssh-key] at some point leaked into the keymgr API (via the `EncodableKey` trait). Instead of re-exporting just `KeypairData`, let's re-export the entire `ssh_key` crate (`EncodableKey` implementors would need additional types from `ssh_key` to construct a `KeypairData` object anyway). [ssh-key]: https://crates.io/crates/ssh-key
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* keymgr: Replace EncodableKey::to_bytes() with SSH-specific function.Gabriela Moldovan2023-08-021-1/+1
| | | | | | | | | | | The `EncodableKey::to_bytes` function didn't make much sense, because not all keys have a canonical byte representation. This commit replaces `EncodableKey::to_bytes` with `EncodableKey::as_ssh_keypair_data`. In the future, `EncodableKey` will grow functions for encoding keys in other storage formats too. Closes #965
* keymgr: Add function for generating EncodableKeys.Gabriela Moldovan2023-07-241-1/+1
|
* keymgr: Use KeystoreId instead of a static string.Gabriela Moldovan2023-07-211-2/+2
|
* keymgr: Add a newtype for keystore identifiers.Gabriela Moldovan2023-07-211-0/+22
|
* keymgr: Remove unused KeystoreSelector::All variant.Gabriela Moldovan2023-07-211-2/+0
| | | | | | This also removes the corresponding `KeyMgrError::UnsupportedKeystoreSelector` error, because it's not needed anymore.
* keymgr: Add type for specifying which keystore to access.Gabriela Moldovan2023-07-201-0/+13
|
* tor-keymgr: Add ArtiNativeKeystoreConfig.Gabriela Moldovan2023-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the keystore config consisted of a single field in `StorageConfig`, which encoded 2 bits of information: whether the keystore is enabled, and its root directory: ``` [storage] # use this path, fail if compiled out # keystore = "/path/to/arti/keystore" # # use default path, fail if compiled out # keystore = true # # disable # keystore = false ``` This commit adds `ArtiNativeKeystoreConfig`, which will replace the multi-purpose `keystore` field. The new config will look like this: ``` #[storage.keystore] # Whether the keystore is enabled. # # If the `keymgr` feature is enabled and this option is: # * set to false, we will ignore the configured keystore path. # * set to "auto", the configured keystore, or the default keystore, if the # keystore path is not specified, will be used # * set to true, the configured keystore, or the default keystore, if the # keystore path is not specified, will be used # # If the `keymgr` feature is disabled and this option is: # * set to false, we will ignore the configured keystore path. # * set to "auto", we will ignore the configured keystore path. # # Setting this option to true when the `keymgr` feature is disabled is a # configuration error. #enabled = "auto" # The root directory of the arti keystore #path = "${ARTI_LOCAL_DATA}/keystore" ``` While `ArtiNativeKeystoreConfig` currently only has 2 fields, `enabled` and `path`, future versions of the keystore might require additional config options.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* keymgr: Downgrade "TODO hs" to "TODO HSS"Gabriela Moldovan2023-06-301-0/+3
| | | | This TODO doesn't need to block the release.
* keymgr: Rename KeyStore to Keystore globally.Gabriela Moldovan2023-06-291-2/+2
| | | | | We've been capitalizing the "s" in "KeyStore" inconsistently. This `s/KeyStore/Keystore/g` across the codebase.
* keymgr: Define `ArtiPathComponent`.Gabriela Moldovan2023-06-291-1/+1
| | | | | | | | | | An `ArtiPathComponent` is a substring of an `ArtiPath`. An `ArtiPathComponent` will be validated according to the same rules as `ArtiPath`. In the future we can replace `HsClientSpecifier` with `ArtiPathComponent` (they both serve the same purpose except `ArtiPathComponent` is more generic).