summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr
Commit message (Collapse)AuthorAgeFilesLines
...
* keymgr: Add an `id` function to `Keystore`.Gabriela Moldovan2023-07-203-0/+13
| | | | | | This will enable the `KeyMgr` to look up `Keystore`s by ID (which is a requirement for disambiguating the semantics of `insert`, which currently tries to "guess" which keystore it should be using).
* keymgr: Iterate over all the stores, not just the secondary ones.Gabriela Moldovan2023-07-201-1/+7
|
* keymgr: Explicitly specify the default keystore for `KeyMgr`.Gabriela Moldovan2023-07-203-5/+13
|
* keymgr: Add a type alias for `Box<dyn Keystore>`.Gabriela Moldovan2023-07-201-2/+5
| | | | This makes the code slightly less verbose.
* keymgr-config: Make fields private, add function for checking if keystore is ↵Gabriela Moldovan2023-07-203-2/+20
| | | | | | | | | enabled. Hiding the underlying value of `enabled` enables us to give it a different `auto` value depending on whether the `keymgr` feature is enabled or not (it defaults to `true` if `keymgr` is enabled, and `false` otherwise).
* keymgr: Upgrade to latest itertools.Nick Mathewson2023-07-171-1/+1
| | | | (Everything else is already on 0.11.0.)
* tor-keymgr: Add ArtiNativeKeystoreConfig.Gabriela Moldovan2023-07-135-1/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-115-0/+5
|\ | | | | | | | | clippy: Allow some of our existing code patterns See merge request tpo/core/arti!1396
| * Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-105-0/+5
| |
* | keymgr: Add semver.md.Gabriela Moldovan2023-07-101-0/+2
| |
* | keymgr: Use Box<dyn EncodableKey> instead of Box<dyn Any>.Gabriela Moldovan2023-07-104-10/+20
|/ | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1337#note_2917701 This will make it harder to accidentally return the wrong value from `Keystore::get` (the returned value is now at least guaranteed to implement `EncodableKey`). Closes #937
* Remove explicit allows for missing_panics_docs.Nick Mathewson2023-07-061-1/+0
| | | | These are no longer needed.
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* keymgr: Explain why the TODO regarding EncodableKey can't be addressed.Gabriela Moldovan2023-07-051-1/+12
|
* keymgr: Fix broken doc link.Gabriela Moldovan2023-06-301-2/+2
|
* Bump patchlevel versions on crates with smaller changesNick Mathewson2023-06-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with the commands below. The following crates have had various changes, and should get a patchlevel bump. Since they are pre-1.0, we do not need to distinguish new APIs from other changes. ``` cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p safelog cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-circmgr cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p tor-linkspec cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-netdoc cargo set-version --bump patch -p tor-proto cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-socksproto ``` This crate has new features, but no new non-experimental Rust APIs. So even though it is post-1.0, it gets a patchlevel bump. ``` cargo set-version --bump patch -p arti ```
* Bump minor versions on crates with breaking changesNick Mathewson2023-06-301-1/+1
| | | | | | | | | | Done with: ``` cargo set-version --bump minor -p tor-hsclient cargo set-version --bump minor -p arti-rpcserver cargo set-version --bump minor -p tor-hscrypto cargo set-version --bump minor -p tor-cell ```
* Merge branch 'arti-path-bug' into 'main'gabi-2502023-06-301-9/+22
|\ | | | | | | | | keymgr: Allow periods in ArtiPath and ArtiPathComponent. See merge request tpo/core/arti!1358
| * keymgr: Update ArtiPath and ArtiPathComponent docs.Gabriela Moldovan2023-06-301-2/+2
| | | | | | | | | | The docs were lying, we actually support UTF-8 paths (though we might later decide to restrict the charset further).
| * keymgr: Allow periods in ArtiPath and ArtiPathComponent.Gabriela Moldovan2023-06-301-9/+22
| | | | | | | | | | | | | | The `ArtiPath` of a client auth key contains the `HsId` of the onion Since the `HsId` contains a `.onion` component, let's allow `.` for now. In the future, we may want to update the code (and keystore structure) to strip away the `.onion` part before building the `ArtiPath`.
* | Merge branch 'keymgr-docs' into 'main'Ian Jackson2023-06-302-3/+3
|\ \ | |/ |/| | | | | keymgr: Downgrade "TODO hs" to "TODO HSS" See merge request tpo/core/arti!1360
| * keymgr: Downgrade "TODO hs" to "TODO HSS"Gabriela Moldovan2023-06-302-3/+3
| | | | | | | | This TODO doesn't need to block the release.
* | Merge branch 'fixup-features' into 'main'Ian Jackson2023-06-301-1/+3
|\ \ | |/ |/| | | | | Run fixup-features on current `main` See merge request tpo/core/arti!1352
| * Resolve XXXs from fixup-features.Nick Mathewson2023-06-291-1/+0
| | | | | | | | | | Some of these seem spurious: it looks like fixup-features resolved an issue and then complained about it too. I'll investigate further.
| * Run "cargo sort".Nick Mathewson2023-06-291-1/+0
| |
| * Run "fixup-features".Nick Mathewson2023-06-291-0/+4
| |
* | keymgr: Rename KeyStore to Keystore globally.Gabriela Moldovan2023-06-298-35/+35
|/ | | | | We've been capitalizing the "s" in "KeyStore" inconsistently. This `s/KeyStore/Keystore/g` across the codebase.
* Merge branch 'exp' into 'main'Ian Jackson2023-06-291-1/+1
|\ | | | | | | | | tor-error: Make KeystoreFsPermissions experimental for now See merge request tpo/core/arti!1350
| * tor-keymgr: When keymgr enabled, enable tor-error's experimental tooIan Jackson2023-06-291-1/+1
| |
* | Merge branch 'validate-client-spec' into 'main'Ian Jackson2023-06-293-7/+144
|\ \ | | | | | | | | | | | | keymgr: Validate ArtiPaths, replace HsClientSpecifier with generic ArtiPathComponent See merge request tpo/core/arti!1262
| * | keymgr: Remove unstable ErrorKind, use internal! for ArtiPath errors.Gabriela Moldovan2023-06-291-21/+7
| | |
| * | keymgr: Validate the individual ArtiPahtComponents of ArtiPath.Gabriela Moldovan2023-06-291-37/+25
| | | | | | | | | | | | | | | This also implicitly forbids leading and trailing slashes in an `ArtiPath`.
| * | keymgr: Rephrase ArtiPath docs.Gabriela Moldovan2023-06-291-14/+5
| | | | | | | | | | | | This updates the docs with Diziet's suggested doc improvements.
| * | keymgr: Remove ArtiPath normalization, introduce additional restrictions.Gabriela Moldovan2023-06-292-45/+46
| | |
| * | keymgr: Document how ArtiPath validation is actually supposed to work.Gabriela Moldovan2023-06-291-7/+11
| | |
| * | keymgr: Move validation requirements to the ArtiPath docs.Gabriela Moldovan2023-06-291-12/+15
| | |
| * | keymgr: Make ArtiPath platform-independent by always using '/' as a separator.Gabriela Moldovan2023-06-291-10/+10
| | |
| * | keymgr: Add tests for ArtiPath validation.Gabriela Moldovan2023-06-291-0/+90
| | |
| * | keymgr: Validate ArtiPath and ArtiPathComponent.Gabriela Moldovan2023-06-291-12/+45
| | |
| * | keymgr: Derive Into for ArtiPath and ArtiPathComponent.Gabriela Moldovan2023-06-291-1/+3
| | |
| * | keymgr: Define an error type for bad `ArtiPathComponents`.Gabriela Moldovan2023-06-291-1/+18
| | |
| * | keymgr: Derive Display for ArtiPath and ArtiPathComponent.Gabriela Moldovan2023-06-291-3/+4
| | |
| * | keymgr: Define `ArtiPathComponent`.Gabriela Moldovan2023-06-292-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Merge branch 'keymgr' into 'main'Ian Jackson2023-06-292-5/+20
|\ \ \ | |/ / |/| | | | | | | | | | | | | | tor-keymgr: Adjust stability guarantees for release Closes #934 See merge request tpo/core/arti!1346
| * | tor-keymgr: Add missing footnoteIan Jackson2023-06-291-0/+5
| | |
| * | tor-keymgr: Replace whole-crate-is-unstable warningIan Jackson2023-06-291-3/+5
| | | | | | | | | | | | | | | arti-client is going to use this so it can't be whole-crate-unstable, but it can be rapidly-changing.
| * | tor-keymgr features: Document that "keymgr" is experimentalIan Jackson2023-06-291-0/+8
| | |
| * | tor-keymgr features: Make "keymgr" disabled by defaultIan Jackson2023-06-292-2/+2
| |/
* | keymgr: Fix dummy keymgr doc links.Gabriela Moldovan2023-06-291-3/+3
| | | | | | | | | | `Error` is private to `dummy.rs` so let's not mention it in the docs of the public items.
* | keymgr: Add missing dummy implementation for KeyType::arti_extension.Gabriela Moldovan2023-06-291-0/+9
|/ | | | | | | | This fixes a rustdoc warning when building with: ``` cargo doc --locked --offline -p arti --no-default-features --features=full,onion-service-client ```