summaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix typosDimitris Apostolou2024-01-082-3/+3
|
* Merge branch 'keyspec' into 'main'Ian Jackson2024-01-084-348/+751
|\ | | | | | | | | | | | | KeySpecifier improvements Closes #1126, #1147, and #1151 See merge request tpo/core/arti!1851
| * tor-keymgr: KeySpecifierPattern: fix grammarIan Jackson2024-01-081-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1851#note_2981473
| * tor-keymgr: KeySpecifierPattern: fix docsIan Jackson2024-01-081-3/+3
| | | | | | | | | | | | | | Swap the docs for new_any and arti_pattern to the right methods! As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1851#note_2981475
| * tor-keymgr: Fix typosgabi-2502024-01-082-4/+4
| |
| * KeyPathInfo: Add role fieldIan Jackson2024-01-042-2/+27
| | | | | | | | This *is* the spec name.
| * KeySpecifier d-a macro: Populate extra_infoIan Jackson2024-01-042-2/+20
| | | | | | | | Finishes arti#1151 item 10.
| * KeySpecifier d-a macro: Use dyn for describingIan Jackson2024-01-042-24/+75
| | | | | | | | This also passes the information we'll need to populate extra_info.
| * KeySpecifier d-a macro: Add a test for describingIan Jackson2024-01-041-0/+16
| |
| * KeySpecifier d-a macro: Mnaully wrap two long linesIan Jackson2024-01-041-2/+6
| |
| * KeySpecifier d-a macro: Use doc-hidden re-exportsIan Jackson2024-01-042-9/+7
| |
| * KeySpecifier d-a macro: Name result by whole pathIan Jackson2024-01-041-2/+2
| | | | | | | | This will make the macro work if call sites rebind Result.
| * KeySpecifier d-a macro: Use derive-adhoc's pasting featureIan Jackson2024-01-041-6/+4
| | | | | | | | | | The KeyInfoExtractor impl is still misindented but we'll change that when we replace it.
| * KeySpecifier d-a macro: Use dyn for parsingIan Jackson2024-01-041-91/+181
| | | | | | | | | | | | | | | | | | | | | | Now the only place that knows how to do all this is the one place in the macro. The indentation is -4 compared to previously, because we're going to remove the wrapping with paste::paste! later. It's convenient to do this reindent now, while we're rewriting it. arti#1151 item 5.
| * KeyPathError::PatternNotMatched: Remove pattern from errorIan Jackson2024-01-042-3/+3
| | | | | | | | | | | | | | | | | | This can only happen if we tried to parse an ArtiPath as the wrong kind of KeySpecifier, which shouldn't happen very often. If it does, the pattern isn't that interesting. Which is just as well, since we're about to make it a bit harder to obtain it in the place where this error is going to be constructed.
| * KeySpecifier d-a macro: Do not produce fn new()Ian Jackson2024-01-041-15/+1
| | | | | | | | | | | | Where we wanted this, use derive_more::Constructor isntead. arti#1151 item 6.
| * KeySpecifier d-a macro: Say what we produce, in the docsIan Jackson2024-01-041-1/+17
| |
| * KeySpecifier: Make KeySpecifierPattern a traitIan Jackson2024-01-043-11/+21
| | | | | | | | | | | | So now .arti_pattern() is a trait method. arti#1151 item 3.
| * KeySpecifier d-a macro: Abolish prefix fnsIan Jackson2024-01-042-55/+0
| | | | | | | | | | | | | | | | arti_prefix is no longer used. Abolish prefix too. arti#1151 item 7. Closes #1147.
| * KeySpecifier d-a macro: Introduce SomeSpecifierPattern and use dynIan Jackson2024-01-042-40/+72
| | | | | | | | | | | | | | | | This is a better API. The implementation has less monomorphisation. arti#1151 item 2 and the patterns part of 4. Closes #1126.
| * KeySpecifier d-a macro: Use dyn for arti_pathIan Jackson2024-01-041-11/+153
| | | | | | | | | | | | | | | | | | This reduces monomorphisation. arti#1151 item 4. The commentary reflects a decision not to do arti#1151 item 9 (using fmt signature for to_component) at this time.
| * KeySpecifier tests: add a TimePeriod testIan Jackson2024-01-041-2/+36
| |
| * KeySpecifierComponent: Add .fmt_pretty() methodIan Jackson2024-01-041-1/+21
| | | | | | | | | | | | | | Part of arti#1151 item 10. Discussion in https://gitlab.torproject.org/tpo/core/arti/-/issues/1151#note_2977278
| * KeySpecifier d-a macro: Move to its own moduleIan Jackson2024-01-043-318/+336
| | | | | | | | This is going to expand and gain private helper methods.
| * KeySpecifier d-a macro: insist on structsIan Jackson2024-01-031-1/+1
| | | | | | | | | | We don't handle enums and we don't want to try. Put this here as documentation of this intent.
| * KeySpecifier d-a macro: rename from KeySpecifierDefaultIan Jackson2024-01-032-11/+11
| | | | | | | | arti#1151 item 1.
* | Remove an unneeded allowIan Jackson2024-01-021-2/+0
|/ | | | Now d-a #27 is fixed, we don't need this.
* rustdoc: linkify a url properlyIan Jackson2024-01-021-2/+2
|
* clippy: An an allow for fallible ed25519 conversionIan Jackson2024-01-021-0/+5
| | | | | I'm not sure about this. Leaving it this way seems the most conservative choice for now.
* 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-141-2/+2
| | | | | | | | | 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).