summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-keymgr: Remove unnecessary impls for KeystoreCorruptionError.Gabriela Moldovan2023-11-291-9/+1
| | | | | | | These impl only exist because they were needed back when we didn't have the `tor_keymgr::Error` enum and all errors _had_ to implement `KeystoreError`. They are not used or required anymore, so let's remove them.
* tor-keymgr: Fix some broken docs linksIan Jackson2023-11-281-3/+3
|
* tor-keymgr: Remove a TODO that is no longer relevant.Gabriela Moldovan2023-11-211-3/+0
| | | | | | `KeystoreCorruptionError` is now part of `tor_keymgr::Error` and no longer implements `KeystoreError` (the `KeystoreError` trait is now only for keystore-specific errors).
* tor-keymgr: Remove unnecessary trait function.Gabriela Moldovan2023-11-211-7/+0
| | | | We don't use this anymore.
* tor-keymgr: Add a top-level error type (fmt).Gabriela Moldovan2023-11-211-1/+4
|
* tor-keymgr: Add a top-level error type.Gabriela Moldovan2023-11-211-21/+27
| | | | | | | | | | | | | Previously, the `tor_keymgr::Error` type was `Box<dyn KeystoreError>`. This forced us to impl `KeystoreError` for any error returned by the keymgr (including those that were not coming from a `Keystore` impl). Now, `tor_keymgr::Error` is an non-exhaustive enum and the `Box<dyn KeystoreError>` opaque error type is only returned from `Keystore` impls The reason we're keeping the `dyn KeystoreError` error type is because it enables `Keystore` implementors to use their own error types. Without it, they would have to choose from our (closed) set of error variants, which may not be suitable for their keystore. See #901.
* tor-keymgr: Move ArtiPathError, KeystoreCorruptionError to err.rs.Gabriela Moldovan2023-11-211-1/+49
| | | | | | 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).
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* keymgr: Add a convenience function for boxing keystore errors.Gabriela Moldovan2023-07-201-0/+7
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* 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: Remove outdated TODOs regarding error handling.Gabriela Moldovan2023-06-281-2/+0
| | | | These were tackled in #901.
* keymgr: Add regression test for tor_keymgr::Error recursion bug.Gabriela Moldovan2023-06-271-0/+39
|
* keymgr: Fix infinite recursion in Error impl.Gabriela Moldovan2023-06-271-2/+1
| | | | | The `source` impl `tor_keymgr::Error` was just calling itself recursively.
* keymgr: Document why we need the StdError impl for tor_keymgr::Error.Gabriela Moldovan2023-06-261-0/+5
|
* keymgr: Remove AsRef<dyn StdError> trait bound and unneeded impls.Gabriela Moldovan2023-06-261-1/+1
| | | | | | We don't really need the `AsRef<dyn StdError>` impls if we make `StdError` a supertrait of `KeystoreError` (and remove the `AsRef<dyn StdError>` trait bound).
* keymgr: Replace Error with Box<dyn KeystoreError>.Gabriela Moldovan2023-06-261-142/+4
| | | | Part of #901
* keymgr: Implement KeystoreError for Bug.Gabriela Moldovan2023-06-261-0/+2
| | | | | | | This also implements `AsRef<StdError>` for `Bug` to satisfy the `KeystoreError: AsRef<dyn StdError>` trait bound. Part of #901
* keymgr: Create a KeyStoreError trait for keystore errors.Gabriela Moldovan2023-06-261-0/+33
| | | | | | The new `BoxedError` type will replace `tor_keymgr::Error`. Part of #901
* keymgr: Move dummy implementation to tor-keymgr.Gabriela Moldovan2023-06-221-5/+25
|
* keymgr: Remove Error::NotFound, update KeyMgr, KeyStore APIs.Gabriela Moldovan2023-06-211-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the `NotFound` `tor_keymgr::Error` variant. Since `KeyMgr` and `KeyStore` users will need to be able to distinguish between "not found" errors and other I/O errors, this also changes the return types of the `get()` and `remove()` functions of `KeyStore` and `KeyMgr`, which now return `Ok(None)` instead of `Error::NotFound`. This makes the `KeyStore` API consistent with `KeyMgr::get`, which already has a return type of `Result<Option<K>>` (rather than `Result<K>`). This also prepares us for #901, which will make key store errors opaque. Without this change: * we'd have to create a `struct NotFoundError;` error type. Its `HasKind` impl would need to return a new `ErrorKind::KeyStoreErrorNotFound` `ErrorKind` variant * callers would have to match the `error_kind()` of the error to figure out whether the key simply can't be found (`ErrorKind::KeyStoreErrorNotFound`), or if something went wrong (any other `ErrorKind`). Given the above, I think `Result<Option<()>>` makes for a more ergonomic API. Part of #901
* keymgr: Update function names and docs to reflect reality.Gabriela Moldovan2023-06-201-2/+2
| | | | | | The functions that handle OpenSSH-formatted keys now no longer read or write from disk. This commit updates their names and doc strings to stop suggesting they do.
* keymgr: Create a temporary error type for the key types we don't support yet.Gabriela Moldovan2023-06-201-0/+5
|
* keymgr: Create a separate error source for key corruption errors.Gabriela Moldovan2023-06-201-29/+32
|
* keymgr: Fix broken docs.Gabriela Moldovan2023-06-201-1/+1
|
* keymgr: Add an error variant for fs_mistrust errors.Gabriela Moldovan2023-06-201-0/+13
| | | | | This will be useful later, when `KeyMgr` will start validating permissions and paths.
* keymgr: Add a FsErrorSource to Error::Fs.Gabriela Moldovan2023-06-201-1/+21
| | | | | | In the future, the potential causes of an `Error::Filesystem` error will include permission errors as well as other errors (not just `io::Error`s).
* keymgr: Add TODO regarding some error refactorings.Gabriela Moldovan2023-06-151-0/+14
|
* keymgr: Add ArtiNativeKeyStore implementation skeleton.Gabriela Moldovan2023-06-151-0/+74
This adds implementation stubs for `ArtiNativeKeyStore`, and introduces the traits needed to make the `KeyStore` APIs work.