aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/key_specifier.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-keymgr: KeySpecifierComponent::to_component: rename from as_componentIan Jackson2023-12-071-7/+7
| | | | | | Normally as_... is a cheap and non-consuming (reference to reference) conversion. to_ is better here since we don't consume, but we do allocate.
* tor-keymgr: Make KeySpecifierComponent::as_component fallible (fmt)Ian Jackson2023-12-071-3/+8
|
* tor-keymgr: Make KeySpecifierComponent::as_component fallibleIan Jackson2023-12-071-28/+35
| | | | | | | | | | This allows a principled implentation via Display. The alternative would be to have runtime panics whenever someone uses KeySpecifierComponentViaDisplayFromStr but the Display impl can produce wrong syntax (that doesn't fit in an ArtiPathComponent). Bug seems like the right error since implemnting KeySpecifierComponent implies that every value is representable in an ArtiPathComponent.
* tor-keymgr: Introduce InvalidKeyPathComponentValue errors (fmt)Ian Jackson2023-12-071-2/+1
|
* tor-keymgr: Introduce InvalidKeyPathComponentValue errorsIan Jackson2023-12-071-8/+60
| | | | | | | | This is a variant in KeyPathError, which contains the actual wrong value, and the key name. But it is also a unit struct to return from the trait impl. This replaces ArtiPathError::InvalidDenotator.
* tor-keymgr: Have KeySpecifierComponent::from_component take a refIan Jackson2023-12-071-6/+6
| | | | | Call sites are shortly going to need the component on the error path, so this function ought probably not to consume it.
* tor-keymgr: KeySpecifierDefault: role: allow runtime valueIan Jackson2023-12-071-15/+72
| | | | Make it possible for the role to be a field.
* tor-keymgr: KeySpecifierDefault: Use meta as strIan Jackson2023-12-071-3/+6
| | | | This saves on some stringify! and improves error checking.
* tor-keymgr: KeySpecifierDefault: fixed_path_component featureIan Jackson2023-12-071-0/+29
|
* tor-keymgr: KeySpecifierDefault: recast field loopIan Jackson2023-12-071-1/+2
| | | | | We're going to do another per-field thing that doesn't want this condition.
* tor-keymgr: KeySpecifierDefault: ctor_path featureIan Jackson2023-12-071-8/+47
|
* tor-keymgr: KeySpecifierDefault: Document attributes more formallyIan Jackson2023-12-071-1/+20
| | | | | | The `summary` attribute refers to a field in KeyPathInfo but this field isn't public. We can refer to builder, but there should be getters or something.
* tor-keymgr: KeySpecifierDefault: Move dead code allowIan Jackson2023-12-071-5/+1
|
* tor-keymgr: KeyPathInfo: Provide builder() methodIan Jackson2023-12-071-4/+11
| | | | Otherwise the KeyPathInfo rustdocs don't have a method for making one.
* tor-keymgr: Replace assert_key_specifier_rountrip macro with function (fmt)Ian Jackson2023-12-071-14/+5
| | | | Formatting churn at call sites.
* tor-keymgr: Replace assert_key_specifier_rountrip macro with functionIan Jackson2023-12-071-21/+11
| | | | The new function checks both directions. The (misspelled) macro didn't.
* tor-keymgr: provide KeySpecifierComponentViaDisplayFromStr and use itIan Jackson2023-12-071-25/+21
| | | | Now the only manual impl is TimePeriod, which is indeed special.
* ArtiPaths: derive FromStr for ArtiPath ArtiPathComponent HsNickname (fmt)Ian Jackson2023-12-071-2/+14
| | | | Mandatory horrible formatting.
* ArtiPaths: derive FromStr for ArtiPath ArtiPathComponent HsNicknameIan Jackson2023-12-071-0/+2
|
* tor-keymgr: Fix some docs warningsIan Jackson2023-12-061-2/+2
| | | | | Fixes cargo doc --locked --workspace --all-features --document-private-items
* tor-keymgr: Update wording in TODO.Gabriela Moldovan2023-12-051-1/+1
|
* tor-keymgr: Mention KeyMgr::describe in the KeyInfoExtractor docs.Gabriela Moldovan2023-12-051-0/+3
|
* tor-keymgr: Remove outdated references to KeyDenotator.Gabriela Moldovan2023-12-051-6/+6
|
* tor-keymgr: Explain when KeySpecifierComponent should be implemented.Gabriela Moldovan2023-12-051-0/+6
|
* tor-keymgr: Abolish the KeyDenotator trait in favour of KeyPathComponent (fmt).Gabriela Moldovan2023-12-051-4/+10
|
* tor-keymgr: Abolish the KeyDenotator trait in favour of KeyPathComponent.Gabriela Moldovan2023-12-051-65/+24
|
* tor-keymgr: Use Bug instead of KeyPathInfoBuild.Gabriela Moldovan2023-12-051-6/+5
|
* tor-keymgr: Describe the key, not the specifier in the test key summaries.Gabriela Moldovan2023-12-051-5/+5
|
* tor-keymgr: Add some helpers to KeyPathInfoBuilder.Gabriela Moldovan2023-12-051-1/+84
|
* tor-keymgr: Use a BTreeMap for the extra_info.Gabriela Moldovan2023-12-051-2/+2
| | | | We probably want these values to be in the same order each time.
* tor-keymgr: Add TODO about allowing users to specify the spec_name.Gabriela Moldovan2023-12-051-2/+1
| | | | This also removes a TODO that doesn't make sense anymore.
* tor-keymgr: Update summary docs based on review.Gabriela Moldovan2023-12-051-1/+3
|
* tor-keymgr: s/register_key_validator/register_key_info_extractorGabriela Moldovan2023-12-051-1/+1
|
* tor-keymgr: Test the derived TryFrom<&KeyPath> key specifier impl.Gabriela Moldovan2023-12-051-9/+19
|
* tor-keymgr: Make DefaultKeySpecifier generate a key info extractor as well.Gabriela Moldovan2023-12-051-0/+116
|
* tor-keymgr: Use KeySpecifierComponent instead of Display.Gabriela Moldovan2023-12-051-1/+14
|
* tor-keymgr: Add more variants to KeyPathError.Gabriela Moldovan2023-12-051-0/+13
| | | | We will need them soon.
* tor-keymgr: Make all arguments of arti_pattern optional.Gabriela Moldovan2023-12-051-8/+12
| | | | | We're going to need this soon (to match all hidden service keys, regardless of nickname, for example).
* tor-keymgr: Introduce a KeySpecifierComponent trait.Gabriela Moldovan2023-12-051-0/+15
| | | | | | | | | 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 function for describing a KeyPath.Gabriela Moldovan2023-12-051-0/+7
|
* tor-keymgr: Add a way of registering key info extractors using inventory.Gabriela Moldovan2023-12-051-0/+8
|
* tor-keymgr: Add types for extracting info out of a KeyPath.Gabriela Moldovan2023-12-051-0/+25
|
* tor-keymgr: Change KeyDenotator error type to KeyPathError.Gabriela Moldovan2023-12-051-6/+15
| | | | | This is a separate class of errors that deserves its own error type. We will soon use `KeyPathError` in other contexts as well.
* tor-keymgr: Move ArtiPathError, KeystoreCorruptionError to err.rs.Gabriela Moldovan2023-11-211-50/+1
| | | | | | 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: Update ArtiPath docs.Gabriela Moldovan2023-11-201-5/+9
|
* tor-keymgr: Remove now-outdated TODO HSSs.Gabriela Moldovan2023-11-201-6/+0
|
* tor-keymgr: Support encoding more than one denotator in an ArtiPath.Gabriela Moldovan2023-11-201-3/+74
| | | | Closes arti#1112
* tor-keymgr: Add TODO about possibly abolishing arti_pattern.Gabriela Moldovan2023-11-201-0/+3
|
* tor-keymgr: Make the arti_path_prefix() helper private.Gabriela Moldovan2023-11-201-1/+1
|
* tor-keymgr: Abolish the `role()` public key specifier function.Gabriela Moldovan2023-11-201-9/+0
| | | | We don't use this anymore.