aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/arti_path.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-2/+0
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* keymgr: Do not elide leading empty denotator groupsGabriela Moldovan2026-03-051-2/+5
| | | | Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3754#note_3361904
* keymgr: Replace literal value with constantGabriela Moldovan2026-03-051-1/+1
|
* keymgr: Add test for paths with empty denotator groups (fmt)Gabriela Moldovan2026-03-051-1/+4
|
* keymgr: Add test for paths with empty denotator groupsGabriela Moldovan2026-03-051-0/+12
|
* keymgr: Add more tests for cert ArtiPath construction (fmt)Gabriela Moldovan2026-03-051-8/+8
|
* keymgr: Add more tests for cert ArtiPath constructionGabriela Moldovan2026-03-051-2/+17
| | | | | This commit is intentionally misindented to make reviewing the diff a bit easier.
* keymgr: Update cert ArtiPath building to use denotator groupsGabriela Moldovan2026-03-051-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | In a certificate's `ArtiPath`, the `ArtiPath` of the subject key is now separated from the certificate denotators by `@`. This will enable us to derive the subject key `ArtiPath` from the `ArtiPath` of its certificate. In practice, this change is a no-op for the relay implementation, because none of our certificates have certificate denotators. For instance, the `ArtiPath` of the for the `KP_relaysign_ed` certificate (`KP_relaysign_ed` signed with `KS_relayid_ed`) is of the form `relay/relaysign_ed+<valid_until>` (the only denotators here are the denotators of the subject key). It's important to note that the certifying key is not encoded in the `ArtiPath` of the certificate. The implication is that if we'll ever need to have multiple certs for the same subject key, signed with different with different certifying keys, those certificates will be distinguished by their certificate denotator group. So if we ever need a second certificate for `KP_relaysign_ed`, certified with something other than `KP_relaysign_ed`, it will need to be of the form `relay/relaysign_ed+<valid_until>@<CERT_DENOS>`, where `<CERT_DENOS>` is a list of `+`-separated certificate denotators. Closes #2377
* keymgr: Support having multiple denotator groups within an ArtiPathGabriela Moldovan2026-03-051-3/+13
| | | | | | This will enable us to parse certificate paths that consist of the `ArtiPath` of the subject key, followed by the denotator group of the certificate.
* keymgr: Move denotator group validation to a separate functionGabriela Moldovan2026-03-051-3/+10
|
* keymgr: Update ArtiPath docs with the new denotator rulesGabriela Moldovan2026-03-051-3/+21
| | | | | | | This introduces the concept of a "denotator group", and new syntax for separating denotator groups within an ArtiPath. The implementation will follow in a separate commit.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-keymgr: Resolve TODOs from key_specifier::testshjrgrn2025-03-141-0/+173
|
* tor-keymgr: Remove no-longer-needed explicit link targets.Gabriela Moldovan2024-12-041-2/+2
| | | | | These aren't needed anymore now that `KeySpecifierComponent` is in scope.
* tor-keymgr: Add helper for building certificate ArtiPaths.Gabriela Moldovan2024-12-041-1/+114
| | | | This will be used for looking up certificates in the keystore.
* tor-keymgr: Rename KeyPathRange to ArtiPathRange (fmt).Gabriela Moldovan2024-10-081-1/+1
|
* tor-keymgr: Rename KeyPathRange to ArtiPathRange.Gabriela Moldovan2024-10-081-5/+5
| | | | | This is only used for representing portions of `ArtiPath`s, so let's rename it accordingly.
* Change deftly syntax to post 0.12.1 versionIan Jackson2024-06-171-1/+1
| | | | | | | | | | | * Change `pub` to `export` * Change the `=` in define to `:` * Change `pub_template_semver_check` to `template_export_semver_check` Right now, 0.12.1 supports both syntaxes. I have verified this branch also compiles with https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402 ee171ffaf56d7dcb7d75584054921153fe19b222
* Switch to derive-deftlyIan Jackson2024-04-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the combination of a number of separate commits, many of which were generated by seddery, and then rebased and squashed. Cargo.toml perl -i~ -pe 's{^derive-adhoc}{derive-deftly = "0.10"}' crates/*/Cargo.toml (not regenerated during rebase) update Cargo.lock `cargo fetch` without --locked (regenerated during rebase) seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{^use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bdefine_derive_adhoc\b}{define_derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bAdhoc\b}{Deftly}g if m{derive}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[derive_adhoc\b}{#[derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc\b}{derive_deftly_adhoc} if m{use.*deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc!}{derive_deftly_adhoc!}' (not regenerated during rebase) Manually add `#[derive_deftly_adhoc]` where needed. seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[adhoc\b}{#[deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc_template}{derive_deftly_template}' (not regenerated during rebase) Manually fix up an import Manually update some builder attrs Manually fix up tor_rtmock::time_core This was missed in my seddery, due to me rebasing the branch and not redoing the seddery.
* tor-keymgr: Remove vestigial comment.Gabriela Moldovan2024-02-191-2/+0
| | | | This removes a remnant of a now-gone TODO.
* tor-keymgr: Rename {to,from}_component to {to,from}_slug.Gabriela Moldovan2024-02-191-1/+1
| | | | | | | | | Originally, these functions converted to and from `ArtiPathComponent`. In !1931, we replaced `ArtiPathComponent` with `Slug` without renaming the conversion functions. Since we're converting to and from `Slug` now, I think it makes sense to rename them too. Part of #1115
* tor-persist: Make all Slugs non-empty.Gabriela Moldovan2024-01-311-1/+0
| | | | | | | | This also removes a TODO regarding adding a `Nickname` type for representing `HsClientSpecifier` and `HsNickname` (we don't need it if `Slug`s are non-empty). Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1931#note_2990227
* tor-keymgr: Allow empty denotators in ArtiPath.Gabriela Moldovan2024-01-311-3/+1
|
* tor-keymgr: Add a TODO about removing ValidatedString.Gabriela Moldovan2024-01-311-0/+2
|
* tor-keymgr: Abolish ArtiPathComponent.Gabriela Moldovan2024-01-311-57/+7
| | | | | | `ArtiPathComponent`s are really just `Slugs`. Part of #1193, #1092
* tor-keymgr: Make ArtiPathComponent a Slug internally (fmt).Gabriela Moldovan2024-01-311-2/+8
|
* tor-keymgr: Make ArtiPathComponent a Slug internally.Gabriela Moldovan2024-01-311-29/+40
| | | | | | | | | | | | | This will make it easier to replace `ArtiPathComponent` with `Slug` later down the line. Note this changes the syntax rules of `ArtiPathComponent`: * previously `ArtiPathComponent`s could be unicode strings, (now they are lowercase ASCII alphanumerics, plus `-`, `_`) * previously `ArtiPathComponent`s couldn't start with `-` or `_`, but now they can Part of #1193, #1092
* 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]: 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::new: Rename a confusing variableIan Jackson2023-12-071-2/+2
| | | | Rebinding inner locally like this confused me.
* tor-keymgr: ArtiPathSyntaxError: rename from ArtiPathErrorIan Jackson2023-12-071-12/+12
| | | | | 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-071-0/+192
Minimal changes to still compile and pass tests.