| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
This updates some outdated references from back when `derive-deftly` was
called `derive-adhoc`.
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3891#note_3395849
|
| |
|
|
| |
This updates a doc and the corresponding test.
|
| |
|
|
| |
This also makes the macro `beta_deftly`.
|
| |
|
|
|
|
| |
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).
|
| |
|
|
| |
This attribute is called `keypair_specifier`, not `key_specifier`.
|
| | |
|
| |
|
|
| |
This was replaced by the new `CertSpecifier` d-d macro.
|
| |
|
|
|
| |
This will replace the `has_certificate()` attr from the
`KeySpecifier` d-d macro.
|
| |
|
|
| |
This will soon be used for parsing the denotators of cert paths too.
|
| |
|
|
|
|
|
| |
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)
|
| |
|
|
| |
Closes #2360
|
| |
|
|
| |
Fixes a clippy warning.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Previously, the `arti_path` was needed to build the various `ArtiPath`
errors, but that's no longer the case.
|
| |
|
|
|
| |
The `ArtiPath` is included in the `KeyPathError::Arti` outer error type,
so there is no need to include it in `ArtiPathError` too.
|
| |
|
|
|
| |
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.
|
| |
|
|
| |
This never returns any other type of error.
|
| |
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
This enables us to implement `KeyMgr::describe()`, which relies on the
ability to extract the key specifier of the key from its `KeyPath`.
|
| |
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
This breaks up a long statement to improve readability.
|
| |
|
|
|
| |
This is a follow-up to !2393, which added support for the
`key_specifier` top-level attribute.
|
| | |
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2393#note_3073480
|
| |
|
|
|
|
|
| |
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 `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
|
| |
|
|
|
|
| |
* Bump in Cargo.toml
* Deal with `${Xmeta as ...}` incompatible change, by
always specifying an `as`, and changing `as tokens`.
|
| |
|
|
| |
This had somehow got duplicated; remove the one in derive.rs.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
| |
All `KeyPathError` variants now include the `ArtiPath` that caused the
error.
Part of #1115
|
| | |
|
| |
|
|
| |
Part of #1115
|
| |
|
|
|
|
| |
The offending `ArtiPath` should be included in the error.
Part of #1115
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
This trait extracts a `KeyPathInfo`, not a `KeyInfo`.
Part of #1115
|
| |
|
|
|
|
|
| |
The role is a slug, and slugs are not allowed to contain uppercase
characters.
Closes #1195
|
| |
|
|
|
|
| |
`ArtiPathComponent`s are really just `Slugs`.
Part of #1193, #1092
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|