aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-keymgr/src/key_specifier
Commit message (Collapse)AuthorAgeFilesLines
* keymgr: Remove outdated references to derive-adhocGabriela Moldovan2026-04-161-3/+3
| | | | | This updates some outdated references from back when `derive-deftly` was called `derive-adhoc`.
* keymgr: Use CAPS for metasyntactic variables in macroGabriela Moldovan2026-04-161-6/+6
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3891#note_3395849
* keymgr: Don't require ctor_path attr to be quotedGabriela Moldovan2026-04-161-1/+1
| | | | This updates a doc and the corresponding test.
* keymgr: Make KeySpecifier take an unquoted keypair_specifierGabriela Moldovan2026-04-161-2/+2
| | | | This also makes the macro `beta_deftly`.
* keymgr: Require keypair_specifier to be a typeGabriela Moldovan2026-04-161-1/+1
| | | | | | I want to make all uses of `keypair_specifier` unquoted, so this can't be a `token_stream` (and in fact, `keypair_specifier` was always meant to be a type).
* keymgr: Update outdated KeySpecifier docGabriela Moldovan2026-04-161-1/+1
| | | | This attribute is called `keypair_specifier`, not `key_specifier`.
* keymgr: Reexport the d-d helpersGabriela Moldovan2026-03-121-0/+5
|
* keymgr: Remove old has_certificate() optionGabriela Moldovan2026-03-121-52/+0
| | | | This was replaced by the new `CertSpecifier` d-d macro.
* keymgr: Add a new experimental CertSpecifier macroGabriela Moldovan2026-03-121-0/+303
| | | | | This will replace the `has_certificate()` attr from the `KeySpecifier` d-d macro.
* keymgr: Move extract() out of parse_arti_path()Gabriela Moldovan2026-03-121-41/+41
| | | | This will soon be used for parsing the denotators of cert paths too.
* keymgr: Abolish KeyCertificateSpecifier::signing_key_specifier()Gabriela Moldovan2026-03-121-21/+2
| | | | | | | We need to be able to parse KeyPaths into KeyCertificateSpecifier, and we can't do that if the signing key is part of the cert specifier (because the signing key doesn't get encoded in the key path, unlike the subject key, which does)
* keymgr: Extend d-d helper to derive KeyCertificateSpecifiersGabriela Moldovan2026-02-171-0/+71
| | | | Closes #2360
* keymgr: Remove redundant field name in struct initGabriela Moldovan2026-01-061-1/+1
| | | | Fixes a clippy warning.
* keymgr: Use d-d to generate CTorPath<->KeySpecifier conversionsGabriela Moldovan2026-01-061-26/+54
|
* keymgr: Resolve a handful of clippy warnings (fmt)Gabriela Moldovan2026-01-061-2/+1
|
* keymgr: Resolve a handful of clippy warningsGabriela Moldovan2026-01-061-3/+3
|
* keymgr: Push error handling into the from_ctor_path() functionsGabriela Moldovan2026-01-061-14/+7
|
* keymgr: Replace placeholder errors with CTorPathErrorGabriela Moldovan2026-01-061-9/+10
|
* keymgr: Remove unused argument in helper function (fmt)Gabriela Moldovan2026-01-061-6/+1
|
* keymgr: Remove unused argument in helper functionGabriela Moldovan2026-01-061-3/+1
| | | | | Previously, the `arti_path` was needed to build the various `ArtiPath` errors, but that's no longer the case.
* keymgr: Remove redundant ArtiPath from error contextGabriela Moldovan2026-01-061-7/+3
| | | | | The `ArtiPath` is included in the `KeyPathError::Arti` outer error type, so there is no need to include it in `ArtiPathError` too.
* keymgr: Split out ArtiPathError from KeyPathErrorGabriela Moldovan2026-01-061-9/+9
| | | | | This makes the error handling around `KeyPath`s a bit more sensible, IMO, and it will make it easier to extend it for `CTorPath` errors.
* keymgr: Make describe_via_components() return BugGabriela Moldovan2026-01-061-1/+1
| | | | This never returns any other type of error.
* keymgr: Fix clippy warning when KeySpecifier is used in tor-keymgrGabriela Moldovan2026-01-061-0/+1
| | | | | | | | | If you try to use this macro within `tor-keymgr` (as we do in the tests), clippy complains about the unreachable catch-all branch for `KeyPath`s (we can't get rid of the catch-all, because outside of `tor-keymgr` KeyPath` is non-exhaustive; but we should probably just go ahead and make `KeyPath` exhaustive at this point, because it's very unlikely it will ever grow new variants).
* keymgr: Specify ctor conversion functions as moduleGabriela Moldovan2026-01-061-9/+13
| | | | | | | This is similar to `#[serde(with = "...")]`, and feels a bit nicer than having to specify two separate functions for the conversions (because with two separate functions, you *can* technically only specify one of them, which shouldn't be allowed).
* keymgr: Extend KeySpecifier macro to support CTorPath conversionsGabriela Moldovan2026-01-061-2/+22
| | | | | This enables us to implement `KeyMgr::describe()`, which relies on the ability to extract the key specifier of the key from its `KeyPath`.
* keymgr: Make parse_key_path() only parse ArtiPathsGabriela Moldovan2026-01-061-18/+23
| | | | | | Unlike `ArtiPath`s, C Tor paths don't need to be parsed, because we have a predefined list of allowed C Tor paths (`CTorPath` is an enum with variants for each supported key type).
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | 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: Reformat a long line for readability.Gabriela Moldovan2024-10-151-1/+3
| | | | This breaks up a long statement to improve readability.
* tor-keymgr: Add missing docs for keypair_specifier.Gabriela Moldovan2024-10-151-0/+12
| | | | | This is a follow-up to !2393, which added support for the `key_specifier` top-level attribute.
* arti-client, tor-keymgr: Remove a couple of now-addressed TODOs.Gabriela Moldovan2024-10-081-5/+0
|
* tor-keymgr: Set KeySpecifier deftly exported struct non_exhaustiveDavid Goulet2024-09-181-0/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* rename get_keypair_specifier() to keypair_specifier()Adam Joseph F0B74D717CDE8412A3E0D4D5F29AC8080DA8E1E02024-09-091-1/+1
| | | | https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2393#note_3073480
* tor_keymgr: add get_keypair_specifier() to KeySpecifier, and derive itAdam Joseph F0B74D717CDE8412A3E0D4D5F29AC8080DA8E1E02024-09-091-0/+8
| | | | | | | This commit adds a new method `get_keypair_specifier()` to `KeySpecifier`. This method is used to indicate when one KeySpecifier (e.g. `KP_hs_id`) is the public part of another keypair (e.g. `KS_hs_id`). It will return the containing keypair in this case, and `None` otherwise.
* 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
* Update to derive-deftly 0.12.1Ian Jackson2024-06-171-1/+1
| | | | | | * Bump in Cargo.toml * Deal with `${Xmeta as ...}` incompatible change, by always specifying an `as`, and changing `as tokens`.
* Delete duplicate KeySpecifierComponentPrettyHelperIan Jackson2024-04-251-9/+0
| | | | This had somehow got duplicated; remove the one in derive.rs.
* Switch to derive-deftlyIan Jackson2024-04-031-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* fix: fix typosDimitris Apostolou2024-03-091-2/+2
|
* tor-keymgr: Include the ArtiPath in PatternNotMatched.Gabriela Moldovan2024-02-191-2/+2
| | | | | | | All `KeyPathError` variants now include the `ArtiPath` that caused the error. Part of #1115
* tor-keymgr: Include ArtiPath in InvalidArtiPath (fmt).Gabriela Moldovan2024-02-191-3/+13
|
* tor-keymgr: Include ArtiPath in InvalidArtiPath.Gabriela Moldovan2024-02-191-1/+2
| | | | Part of #1115
* tor-keymgr: Include the ArtiPath in InvalidKeyPathComponentValue.Gabriela Moldovan2024-02-191-4/+6
| | | | | | The offending `ArtiPath` should be included in the error. Part of #1115
* tor-keymgr: Rename {to,from}_component to {to,from}_slug.Gabriela Moldovan2024-02-191-3/+3
| | | | | | | | | 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-keymgr: Rename KeyInfoExtractor to KeyPathInfoExtractor.Gabriela Moldovan2024-02-051-3/+3
| | | | | | This trait extracts a `KeyPathInfo`, not a `KeyInfo`. Part of #1115
* tor-keymgr: Lowercase the role when building the ArtiPath.Gabriela Moldovan2024-01-311-9/+2
| | | | | | | The role is a slug, and slugs are not allowed to contain uppercase characters. Closes #1195
* tor-keymgr: Abolish ArtiPathComponent.Gabriela Moldovan2024-01-311-5/+5
| | | | | | `ArtiPathComponent`s are really just `Slugs`. Part of #1193, #1092
* tor-keymgr: Turn some TODOs into #1195.Gabriela Moldovan2024-01-101-1/+1
|
* tor-keymgr: Turn some TODO HSS into #858Gabriela Moldovan2024-01-101-2/+2
|
* tor-keymgr: Fully qualify KeySpecifierPattern in KeySpecifier macro.Gabriela Moldovan2024-01-101-1/+2
| | | | | | If you derive `KeySpecifier` and forget to import `KeySpecifierPattern` you get a confusing error. It's better to let the macro import (or fully qualify) the necessary types from tor-keymgr.