summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc
Commit message (Collapse)AuthorAgeFilesLines
...
* | | tor-netdoc: Test for IPv6-mapped IPv4 addressIan Jackson2026-04-201-0/+1
| | |
* | | tor-netdoc: Test for `::` host addressIan Jackson2026-04-201-0/+1
| | |
* | | tor-netdoc: Make Nickname have its own parsing error typeIan Jackson2026-04-206-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | This will let us use it in more places, more sensibly. Sadly it means a lot of syntactic vinegar at many of the call sites in the old parser, which has very janky ideas about how errors should work.
* | | tor-netdoc: semver.md for InternetHost and HostnameIan Jackson2026-04-201-0/+1
| | |
* | | tor-netdoc: Tests for InternetHost and HostnameIan Jackson2026-04-201-0/+65
| | |
* | | tor-netdoc: Introduce InternetHost newtypeIan Jackson2026-04-202-1/+52
| | | | | | | | | | | | Tests will come in a moment.
* | | tor-netdoc: Introduce Hostname newtypeIan Jackson2026-04-203-0/+82
| | | | | | | | | | | | Tests will come in a moment.
* | | Merge branch 'p2-misc-exactly-1' into 'main'Clara Engler2026-04-202-3/+6
|\ \ \ | |_|/ |/| | | | | | | | tor-netdoc: derives: Three small improvements See merge request tpo/core/arti!3887
| * | tor-netdoc: derives: Expect an intro itemIan Jackson2026-04-141-0/+1
| | | | | | | | | | | | | | | | | | This can't trigger, but when messing about with some new features, I messed up and got a syntax error here. Let's try this feature out, here.
| * | tor-netdoc: derives: Reformat a long lineIan Jackson2026-04-141-2/+4
| | | | | | | | | | | | No functional change.
| * | tor-netdoc: derives: Remove an otiose testIan Jackson2026-04-141-1/+1
| |/ | | | | | | T_SIGNATURES is false, just above.
* | Merge branch 'parse2-fix-eh' into 'main'Ian Jackson2026-04-141-1/+1
|\ \ | | | | | | | | | | | | tor-netdoc: parse2: Fix error for invalid item argument See merge request tpo/core/arti!3879
| * | tor-netdoc: parse2: Fix error for invalid item argumentIan Jackson2026-04-141-1/+1
| |/ | | | | | | When we can't parse a NormalItemArgument, that's Invalid, not Missing.
* | tor-netdoc: impl NormalItemArgument for B16 and B16UIan Jackson2026-04-141-0/+3
| | | | | | | | | | I also searched this file for FromStr impls and these types were the only ones that ought to be NormalItemArgument but weren't.
* | tor-netdoc: Fix a slip in a doc commentIan Jackson2026-04-141-1/+1
| |
* | tor-netdoc: Explain why the macro doesn't use hex::encodeIan Jackson2026-04-141-0/+2
| |
* | tor-netdoc: Fix slip in semver.mdIan Jackson2026-04-141-1/+1
| |
* | tor-netdoc: Use Transparent and derive Hash for RsaIdentity wrappersIan Jackson2026-04-142-8/+9
| |
* | tor-netdoc: Use Transparent for SystemTime wrappersIan Jackson2026-04-142-4/+5
| |
* | tor-netdoc: Use Transparent for Curve25519PublicIan Jackson2026-04-142-1/+3
| |
* | tor-netdoc: types/misc.rs: Have Transparent do From and IntoIan Jackson2026-04-141-7/+19
| | | | | | | | | | Unfortunately one derive can't invoke another, so we must open-code them, just like the other traits.
* | tor-netdoc: types/misc.rs: Break out Transparent derive module/macroIan Jackson2026-04-141-31/+83
| | | | | | | | | | | | | | Nothing derives just Transparent yet. Mostly code motion, with some additional furniture and docs. Review with git show --color-moved.
* | tor-netdoc: types/misc.rs: Prepare message for Transparent deriveIan Jackson2026-04-141-2/+2
| | | | | | | | | | | | This error message is going to be used by both Transparent and BytesTransparent. Put it in the code that is going to be part of Transparent, and remove the macro name from it.
* | tor-netdoc: types/misc.rs: Remove a stray comma in a docIan Jackson2026-04-141-1/+1
| |
* | tor-netdoc: types/misc.rs: Use fmt and Display aliasesIan Jackson2026-04-141-12/+12
| | | | | | | | This reduces clutter some more.
* | tor-netdoc: types/misc.rs: Use FromStr aliasIan Jackson2026-04-141-16/+18
| | | | | | | | | | | | This is in the use's at the top of the file. If we `use super::*` (like we do in the newer modules): the code can get a lot more readable.
* | tor-netdoc: Provide B16U for printing hex uppercaseIan Jackson2026-04-142-3/+32
| | | | | | | | | | | | | | Test the parsing and printing success cases. Given that the parsing implementation is just a wrapper around B16's, we don't need explicit tests for that.
* | tor-netdoc: Make B16 pub and improve its APIIan Jackson2026-04-142-15/+8
| | | | | | | | | | Make this a public BytesTransparent newtype like B64, implementing all the same traits etc.
* | tor-netdoc: impl Display for B16, as lowercaseIan Jackson2026-04-141-1/+16
| | | | | | | | | | | | | | | | On reflection, and looking at the test cases, I think the name `B16` should refer to the lowercase version. I'll introduce a type for uppercase in a moment. Test the display implementation.
* | tor-netdoc: Clean up base16 testIan Jackson2026-04-141-4/+11
| | | | | | | | | | | | | | Replace the open-coded .parse() calls with a closure. This will let us test round trips, other types, etc., for each pairs of test values.
* | tor-netdoc: Adjust API of B64Ian Jackson2026-04-142-2/+5
| | | | | | | | | | | | | | | | Firstly, make its field pub. Secondly, make the into_array method crate-private. It has a crate-specific (albeit public) error type, The same basic effect can be achieved with methods from std on arrays and slices.
* | tor-netdoc: Use BytesTransparent for FixedB64, and make it pubIan Jackson2026-04-142-9/+5
| | | | | | | | | | | | Make this type public. The new macro call means this type now implements many more traits.
* | tor-netdoc: impl many more traits for B64, by improving Bytes TransparentIan Jackson2026-04-142-1/+49
| | | | | | | | | | I think these are all the traits that a parsing/printing newtype adapter ought to implement.
* | tor-netdoc: types/misc.rs: Introduce BytesTransparent macro (finish macro)Ian Jackson2026-04-141-10/+14
| | | | | | | | | | | | | | Actually make the macro be a proper d-d macro. Replace uses of .0 with $fname, B64 with $ftype, etc. No functional change in this commit.
* | tor-netdoc: types/misc.rs: Introduce BytesTransparent macro (code motion)Ian Jackson2026-04-141-18/+50
| | | | | | | | | | | | | | | | | | | | | | Break various open-coded impls on B64 into this macro. That will let us reuse this code for other types, making all these bytes wrappers similar to each other. In this commit, we just move the code. The macro is wrong because it ought to refer to $ttype and so on. Review with git show --color-moved. No functional change in this commit.
* | tor-netdoc: Move a Hash deriveIan Jackson2026-04-141-2/+2
| | | | | | | | | | This is slightly more logical and will make the next commit slightly easier to read.
* | tor-netdoc: Move some imports to the top of types/misc.rsIan Jackson2026-04-141-3/+3
|/ | | | This will reduce some duplication and simplify some macrology.
* Merge branch 'contact-info' into 'main'Clara Engler2026-04-133-3/+100
|\ | | | | | | | | tor-netdoc: ContactInfo See merge request tpo/core/arti!3866
| * tor-netdoc: ContactInfo: Fix unused attributeIan Jackson2026-04-091-3/+1
| |
| * tor-netdoc: ContactInfo: Add some roundtrip testsIan Jackson2026-04-081-0/+30
| |
| * tor-netdoc: ContactInfo: Use FromStr impl for netdoc item parsingIan Jackson2026-04-081-5/+15
| |
| * tor-netdoc: ContactInfo: derive Display tooIan Jackson2026-04-081-1/+1
| |
| * tor-netdoc: ContactInfo: Impose a syntax restrictionIan Jackson2026-04-081-2/+41
| | | | | | | | | | | | | | Otherwise you might, for example, receive a String from a config file, JSON API submission, RPC call, or whatever, containing a newline, and then encode it into a netdoc giving a syntax error or, worse, smuggling additional items into the document!
| * tor-netdoc: ContactInfo: semver entryIan Jackson2026-04-081-0/+1
| |
| * tor-netdoc: ContactInfo: derive ItemValueEncodableIan Jackson2026-04-081-0/+1
| |
| * tor-netdoc: ContactInfo: Use d_d_adhoc technique to de-cfgIan Jackson2026-04-081-1/+3
| | | | | | | | Otherwise the cfg_attr for the field would need to name both features.
| * tor-netdoc: ContactInfo: Improve doc with an xref and item nameIan Jackson2026-04-081-1/+5
| |
| * tor-netdoc: Add ContactInfoClara Engler2026-04-082-1/+13
| |
* | Merge branch 'netdoc-test-fix' into 'main'Clara Engler2026-04-0849-2668/+2825
|\ \ | | | | | | | | | | | | Fix the testdata2 situation See merge request tpo/core/arti!3861
| * | tor-netdoc: Add manual happy families microdesc testClara Engler2026-04-081-0/+35
| | | | | | | | | | | | | | | | | | | | | This commit adds a manual test case for happy families in microdesc with parse2. Manual in the sense that we hardcode a microdescriptor taken from the wild here, as testdata2 does not contain them at the current moment, which is unfortunate but reported.