summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc
Commit message (Collapse)AuthorAgeFilesLines
* maint: bump minor versions of all published cratesSteven Engler2025-10-291-13/+13
| | | | | | | ```bash readarray -t publish < <(cargo metadata --format-version 1 | jq -r '.packages[] | select((.id | startswith("path+file:///")) and (.rust_version != null) and (.publish == null or .publish == true or .publish != [])) | .name') for package in "${publish[@]}"; do echo "$package:"; cargo set-version --bump minor -p "$package"; done ```
* tor-netdoc: impl ItemArgumentParseable for IgnoredIan Jackson2025-10-232-2/+11
| | | | Change our mind about the logic for encoding an Ignored.
* tor-netdoc: Abolish ArgumentNotPresent alias, completing the renameIan Jackson2025-10-233-9/+6
|
* tor-netdoc: Use NotPresent rather than Option<Ignored> to suppress fieldsIan Jackson2025-10-234-8/+8
|
* tor-netdoc: Add unit tests for NotPresent and Ignored objectsIan Jackson2025-10-231-1/+32
|
* tor-netdoc: Add unit tests for NotPresent itemsIan Jackson2025-10-233-2/+6
|
* tor-netcoc: Introduce NotPresent, for absent multiplicityIan Jackson2025-10-233-9/+88
| | | | | | | | | Currently this is mishandled: the current use sites (in rs/each_variety.rs) use Option<Ignored>, which would reject repeated items with that keyword, which is technically wrong. And encoing will become a problem. Vec<Ignored> would be wrong too. Instead, broaden NotPresent and give it multiplicity impls.
* tor-netdoc: Move parse2 impls on Ignored to types/misc.rsIan Jackson2025-10-232-23/+22
| | | | | | This seems to be where we're putting most of the parse2 impls on these types, now. That makes more sense as parse2 becomes more of a proper thing.
* tor-netdoc: Document new feature in semver.mdIan Jackson2025-10-221-0/+1
|
* tor-netdoc: NetdocParseableFields derive: support flatten (test)Ian Jackson2025-10-221-0/+11
|
* tor-netdoc: NetdocParseableFields derive: support flattenIan Jackson2025-10-221-2/+26
| | | | | | | | | This allows a NetdocParseableFields inside a NetdocParseableFields. The code is rather duplicative with the NetdocParseable implementation. This is due to limitations in derive-deftly; see https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/525 where I'm trying to start to address them.
* tor-netdoc: NetdocParseableFields derive: break out kw variableIan Jackson2025-10-221-1/+3
| | | | We're going to reuse this.
* tor-netdoc: Preamble: Fix garbled doc commentIan Jackson2025-10-221-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3378#note_3277957
* tor-netdoc: Preamble: rename relay_version field to server_versionIan Jackson2025-10-224-8/+9
| | | | This makes it match the protocol and the spec.
* tor-netdoc: Say Preamble doesn't contain vote-status, in summary.Ian Jackson2025-10-221-1/+1
|
* tor-netdoc: Explain that Preamble doesn't contain vote-status either.Ian Jackson2025-10-221-1/+1
|
* tor-netdoc: Document breaking changes in semver.mdIan Jackson2025-10-221-0/+2
|
* tor-netdoc: netstatus: Preamble: Name the protocols fields in docIan Jackson2025-10-221-0/+2
|
* tor-netdoc: netstatus: Preamble: rename shared rand fields to match docIan Jackson2025-10-223-18/+18
| | | | | We should use the same name everywhere, even if the name in the spec is clumsy (as it is here).
* tor-netdoc: Move ConsensusFlavor into Consensus structIan Jackson2025-10-223-14/+22
| | | | | | We're going to want to apply the parse2 derive to Preamble, but this field is anomalous. Rather than trying to make it regular, simply move it to the old-parser-specific Consensus struct.
* tor-netdoc: Declare intent not to apply parse2 to ConsensusIan Jackson2025-10-221-4/+1
| | | | | | | Consensus is not going to be easy to square with parse2 - especially, signature handling is very different between the two parsers. Instead, we'll have a new NetworkStatus type.
* tor-netdoc: Rename consensus Header to PreambleIan Jackson2025-10-224-40/+42
| | | | | There is no such thing as the "header" according to the spec. We mean the preamble.
* Merge branch 'p2-shared-rand-status' into 'main'Ian Jackson2025-10-225-17/+28
|\ | | | | | | | | impl ItemValueParseable for SharedRandStatus See merge request tpo/core/arti!3380
| * tor-netdoc: impl ItemValueParseable for SharedRandStatusIan Jackson2025-10-211-0/+1
| |
| * tor-netdoc: impl Display, FromStr, NormalItemArgument for SharedRandValIan Jackson2025-10-211-2/+18
| |
| * tor-netdoc: derive From<Vec<u8>> and v-v for B64Ian Jackson2025-10-211-7/+1
| | | | | | | | | | | | | | | | This may not be the best utility type to use for lots of the fixed-length byte strings, but we *are* using it a lot in the old and now the new parser. Implement From and Into.
| * tor-netdoc: Change type of timestamp in SharedRandStatus (fmt)Ian Jackson2025-10-211-2/+1
| |
| * tor-netdoc: Change type of timestamp in SharedRandStatusIan Jackson2025-10-214-7/+8
| |
* | Merge branch 'p2-misc-fixes' into 'main'opara2025-10-212-2/+7
|\ \ | | | | | | | | | | | | tor-netdoc: parse2: Minor fixes See merge request tpo/core/arti!3376
| * | tor-netdoc: Reference `build::ItemArgument` from `NoramlItemArgument` docIan Jackson2025-10-211-1/+2
| | | | | | | | | | | | | | | | | | Since 9ce85acb3ab0d1a0b1be6ef0f10707983f4362a3 tor-netdoc: replace impl_item_argument_as_display with NormalItemArgument this trait impl has implications for encoding as well as parsing.
| * | tor-netdoc: NetdocParseable derive: use more explicit syntaxIan Jackson2025-10-211-1/+1
| | | | | | | | | | | | In principle some other trait might be in scope.
| * | tor-netdoc: parse2: Don't declare internal error on subdoc intro itemsIan Jackson2025-10-211-0/+4
| |/ | | | | | | | | subdoc intro items aren't inherently incoherent, but implementing them is nontrivial. Let's reject them with a bespoke error instead.
* | Merge branch 'msrv-1-86-0' into 'main'David Goulet2025-10-211-1/+1
|\ \ | | | | | | | | | | | | Bump MSRV from 1.85.1 to 1.86 See merge request tpo/core/arti!3382
| * | Bump MSRV from 1.85.1 to 1.86Clara Engler2025-10-211-1/+1
| |/
* | Merge branch 'p2-blanket-arc' into 'main'David Goulet2025-10-212-7/+30
|\ \ | | | | | | | | | | | | tor-netdoc: blanket impl parse2 traits for Arc See merge request tpo/core/arti!3381
| * | tor-netdoc: blanket impl parse2 traits for ArcIan Jackson2025-10-212-7/+30
| |/ | | | | | | This replaces one ad-hoc impl and will avoid having to have any more.
* | tor-netdoc: Lifetime impls: reindentIan Jackson2025-10-211-37/+37
| |
* | tor-netdoc: derive NetdocParseableFields for LifetimeIan Jackson2025-10-211-0/+4
| |
* | tor-netdoc: parse2: Provide documentation for derived Accumulator typesIan Jackson2025-10-211-0/+3
| |
* | tor-netdoc: Lifetime: change type of fieldsIan Jackson2025-10-212-8/+8
| | | | | | | | These fields aren't public so this doesn't have semver impacts.
* | tor-netdoc: Lifetime: derive constructor and accessorsIan Jackson2025-10-211-20/+17
| | | | | | | | | | | | | | | | | | | | | | In a moment, we're going to want to transform the field arguments. That would leave us open to bugs like this: valid_after: valid_after.into(), fresh_until: fresh_until.into(), valid_until: valid_after.into(), We'll sort out the indentation later in this branch.
* | tor-netdoc: Lifetime: Move some documentation to fieldsIan Jackson2025-10-211-10/+10
| | | | | | | | | | This (briefly) regresses the documentation, but it's going to appear again when we derive the methods.
* | tor-netdoc: Lifetime: Construct Lifetime struct earlierIan Jackson2025-10-211-6/+10
|/
* tor-netdoc: Add a lot of spec cross-references and tidy docsIan Jackson2025-10-153-15/+101
| | | | | | | | | | | | | Add links to torspec, and other cross-references. Change heading fof `IgnoredPublicationTimeSp` to `publication` to match spec and distinguish it from the `published` item in netstatus docs. Align several descriptions with the wording from torspec. Remove a restatement of a fact from the spec, on the `valid_until` field in `Lifetime`.
* tor-netdoc: Typo fixes in docsIan Jackson2025-10-152-2/+2
|
* tor-netdoc: tests: Print out vote routerstatusIan Jackson2025-10-151-1/+2
| | | | | | | I have eyeballed the output and it seems to look right. Eventually we'll have encoing code and then we'll be able to check that things round-trip.
* tor-netdoc: tests: Move vote parsing test to netstatus.rsIan Jackson2025-10-152-12/+21
| | | | | This is a test of real document structs now, albeit that it still uses one of the types from `poc`.
* tor-netdoc: tests: Use real `RouterStatus` in `parse2::poc`Ian Jackson2025-10-152-9/+8
| | | | This now exercises all the new parsing code.
* tor-netdoc: impl parse2 for RouterStatus entryIan Jackson2025-10-152-1/+85
|
* tor-netdoc: Type for parsing `m` lines in votesIan Jackson2025-10-152-1/+39
|