aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-keymgr
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-keymgr: Wrap a long doc comment line.Gabriela Moldovan2023-12-141-3/+3
|
* tor-keymgr: Update docs referencing outdated SSH algo names.Gabriela Moldovan2023-12-142-3/+3
|
* tor-keymgr: Remove the TODOs about adding a protocol name registry.Gabriela Moldovan2023-12-141-68/+3
| | | | Diziet addressed these in #1049
* tor-keymgr: Use spec.torproject.org for the SSH algo name domain.Gabriela Moldovan2023-12-145-15/+15
| | | | | | | | | Note: any existing x25519 or expanded ed25519 keys you might have in the keystore will become invalid (your keystore will appear corrupt, so you will need to manually delete them if you want to continue using the onion service they were originally generated for). Part of #1108
* arti-client: use sub_builder for ArtiNativeKeystoreConfigNick Mathewson2023-12-131-0/+2
| | | | | | | | | The sub_builder pattern changes `StorageConfigBuilder` so that instead of holding an `Option<ArtiNativeKeystoreConfig>`, it holds an `ArtiNativeKeystoreConfigBuilder`. This makes it a little more ergonomic to use from Rust, and lets us use defaults for the builder fields so that we can make them optional in our configuration.
* tor-keymgr: ArtiPath[Component]: Manually reformat derive listsIan Jackson2023-12-071-32/+8
|
* tor-keymgr: ArtiPath: impl serdeIan Jackson2023-12-071-0/+3
|
* tor-keymgr: ArtiPathComponent: Use unqualified namesIan Jackson2023-12-071-3/+3
| | | | This makes this like the list for ArtiPath.
* tor-keymgr: ArtiPath[Component]: Don't DerefMutIan Jackson2023-12-071-3/+1
| | | | That would allow construction of invalid paths.
* tor-keymgr: ArtiPath[Component]: Add some more test aspectsIan Jackson2023-12-071-1/+10
| | | | | | | | | Test that the FromStr and TryFrom impls give the same answers as new(). These tests dodn't even compile before Properly validate in FromStr because the derive-more generated version has a wrong error type.
* tor-keymgr: ArtiPath[Component]: Properly validate in FromStrIan Jackson2023-12-071-2/+11
| | | | | | | As pointed out in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1796#note_2974513 derive-more just parses like the inner type, so an unvalidated String. That is wrong.
* tor-keymgr: ArtiPath[Component]: Use d-a to generate various methodsIan Jackson2023-12-071-30/+36
| | | | Now ArtiPath too is TryFrom<String> and AsRef<str>.
* tor-keymgr: ArtiPath: Introduce validate_strIan Jackson2023-12-071-3/+8
| | | | This makes it more like ArtiPathComponent and will allow more unification
* tor-keymgr: ArtiPath tests: Add a test for a multi-component pathIan Jackson2023-12-071-2/+6
|
* tor-keymgr: ArtiPath tests: separate path from component testsIan Jackson2023-12-071-2/+4
| | | | | | Rename VALID_ARTI_PATH_COMPONENTS from _PATHS. These are tested for validity as components. I want to add a test for a multi-component path, so make a place to put it.
* tor-keymgr: ArtiPath::new: Rename a confusing variableIan Jackson2023-12-071-2/+2
| | | | Rebinding inner locally like this confused me.
* tor-keymgr: ArtiPathSyntaxError: impl EqIan Jackson2023-12-071-1/+1
|
* tor-keymgr: arti_path tests: Add two TODOsIan Jackson2023-12-071-0/+3
| | | | These don't seem critical to me.
* tor-keymgr: path errors: Add some xrefsIan Jackson2023-12-072-1/+9
|
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathError (fmt)Ian Jackson2023-12-072-11/+43
|
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathErrorIan Jackson2023-12-075-38/+37
| | | | | The previous name was ambiguous, and confusable with KeyPathError (of which it is, basically, a variant).
* tor-keymgr: Abolish unneeded StdResult alias in arti_pathIan Jackson2023-12-071-6/+4
|
* tor-keymgr: Move ArtiPath etc. into new module (docs links)Ian Jackson2023-12-071-2/+6
| | | | Fix docs link breakage.
* tor-keymgr: Move ArtiPath etc. into new moduleIan Jackson2023-12-073-191/+200
| | | | Minimal changes to still compile and pass tests.
* 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-072-14/+67
| | | | | | | | 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: Make two errors not be CopyIan Jackson2023-12-071-1/+1
| | | | | | This is a hostage to fortune. (In a previous version of !1796 I wanted to make it untrue.)
* 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-072-32/+42
| | | | The new function checks both directions. The (misspelled) macro didn't.
* tor-keymgr: provide KeySpecifierComponentViaDisplayFromStr and use itIan Jackson2023-12-072-26/+22
| | | | 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-062-5/+6
| | | | | Fixes cargo doc --locked --workspace --all-features --document-private-items
* tor-keymgr: Update wording in TODO.Gabriela Moldovan2023-12-051-1/+1
|
* tor-keymgr: Call inventory::collect in the dummy keymgr too.Gabriela Moldovan2023-12-051-0/+2
| | | | | Not calling it results in an error (it instantiates the plugin registry for our type).
* 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
|