aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-linkspec/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'remove-lint' into 'main'Jim Newsome2026-07-153-6/+1
|\ | | | | | | | | | | | | Removed unnecessary lint Closes #2556 See merge request tpo/core/arti!4210
| * Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-4/+0
| |
| * add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
| |
| * Removed unnecessary lintpryty262026-07-152-2/+1
| | | | | | | | Removed unnecessary lint
* | Merge branch 'da-relayid' into 'main'Ian Jackson2026-07-151-145/+119
|\ \ | | | | | | | | | | | | tor-linkspec: Use deftly to reduce copypasta in RelayId and RelayIdRef See merge request tpo/core/arti!4196
| * | tor-linkspec: RelayIdType: Clarify display vs display_idIan Jackson2026-07-151-4/+4
| | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4196#note_3433090
| * | tor-linkspec: Un-explode and tidy some derive listsIan Jackson2026-07-011-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | rustfmt likes this IMO-awful layout for derives. We can force it to let us manually break the line, if we use //, and then it stays put. No functional change.
| * | tor-linkspec: Sort out indentation in new macro templateIan Jackson2026-07-011-111/+111
| | | | | | | | | | | | Pure whitespace change. Review with, eg, git diff -w.
| * | tor-linkspec: PartialEq: use deftly, not an ad-hoc macro_rulesIan Jackson2026-07-011-10/+2
| | | | | | | | | | | | This gets rid of the matcher, and the need to invoke it.
| * | tor-linkspec: PartialEq: change variable namesIan Jackson2026-07-011-6/+6
| | | | | | | | | | | | | | | | | | | | | Change $var to $vname, and $type to $IDENTITY. These are the names used in the deftly template. This will make the next commit almost a no-op.
| * | tor-linkspec: PartialEq: simplify PartialEq<FooIdentity> for RelayIdIan Jackson2026-07-011-1/+1
| | | | | | | | | | | | | | | We can just refer to the PartialEq<FooIdentity> for RelayIdRef, which is macro-generated just above, replacing this copy-pasted matches.
| * | tor-linkspec: Use deftly for RelayIdId and RelayIdRef implsIan Jackson2026-07-011-44/+26
| | | | | | | | | | | | | | | | | | | | | This removes quite a lot of in-detail copy-paste. The lone `}` is being moved, bringing the code we're changing within the scope of the template.
| * | tor-linkspec: Minimal deftly for RelayIdId and RelayIdRefIan Jackson2026-07-011-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Derive the two types. We end up moving the display strings from direct attributes directed to derive_more, to deftly attributes. Indentation is rather odd now: we ought to indent the macro body. We'll sort that out at the end. No functional change.
| * | tor-linkspec: Move PartialEq implsIan Jackson2026-07-011-19/+19
| |/ | | | | | | | | | | | | Pure code motion. We want to move this to where a bigger macro is going to be, so that it can be part of it. Code motion only, review with --color-moved.
* / multiple crates: Fix clippy warningshjrgrn2026-07-101-1/+1
|/
* hscrypto, linkspec, llcrypto: Use new redaction helpersNick Mathewson2026-06-101-2/+5
| | | | This eliminates some string slicing.
* everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-091-0/+1
| | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-0910-0/+10
| | | | | | | | | | | | 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.
* linkspec: Add serde(default) to fields in RelayIds.Nick Mathewson2026-04-281-2/+6
| | | | | | | | With this change, we will accept serialized RelayId representations that omit one or more keys. This will eventually allow us to omit absent keys when we serialize these. This is the first stage of #2477.
* linkspec: Rename all_addrs_allowed_for_extend()David Goulet2026-04-091-2/+2
| | | | | | Also set a better error message when validating channel target. Signed-off-by: David Goulet <[email protected]>
* linkspec: Rename has_all_public_addresses()David Goulet2026-03-301-2/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* linkspec: Rename has_all_reachable_addresses()David Goulet2026-03-301-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* linkspec: Rename has_all_valid_port() to has_all_nonzero_port()David Goulet2026-03-301-2/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* linkspec: Move has_all_valid_port() and has_all_reachable_addresses() into ↵David Goulet2026-03-302-35/+38
| | | | | | ChanTarget Signed-off-by: David Goulet <[email protected]>
* linkspec: Add OwnedChanTarget address validation helpersDavid Goulet2026-03-301-1/+34
| | | | | | | | | | | The has_all_reachable_addresses() should be used to validate the channel target of a request to open a relay channel. The function looks for non routable addresses or, most importantly, private addresses. The other function is to validate that all socket addresses have a non zero port. Signed-off-by: David Goulet <[email protected]>
* Fix typosTobias Stoeckmann2026-03-241-1/+1
| | | | Typos found with codespell
* tor-chanmgr: add base64ct dependency and docsNihal2026-03-181-1/+1
|
* linkspec: Implement a RelayIdsBuilder::from_relay_ids()David Goulet2026-03-031-0/+18
| | | | | | | | | This is used when we build an OwnedChanTarget using the builder. Instead of going identities by identities at the callsite, we can use this helper to get us a RelayIds builder and set it in the OwnedChanTargetBuilder. Signed-off-by: David Goulet <[email protected]>
* proto: Implement Display for PeerAddrDavid Goulet2026-03-031-0/+10
| | | | | | This required to implement Display for PtTarget. Signed-off-by: David Goulet <[email protected]>
* linkspec: Add missing feature gateDavid Goulet2026-02-191-0/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* proto: Enforce that channel method as unique SocketAddrDavid Goulet2026-02-121-0/+20
| | | | | | | | | | | | | During the channel handshake, we require the peer IP address for the canonicity check which requires the exact peer IP we are connected to. This commit adds a function that enforces this requirement on a ChannelMethod so anything else results in an error. It is to basically have stronger guarantee on the channel method we use in the handshake. Signed-off-by: David Goulet <[email protected]>
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* linkspec: Remove comment about expense of cloning protocols.Nick Mathewson2025-12-031-2/+0
|
* linkspec: allow unstable_name_collisions lint for exactly_one()Gabriela Moldovan2025-12-011-0/+5
| | | | This silences a new warning on nightly.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0610-10/+10
| | | | Run maint/add_warning
* tor-linkspec: Change HasAddrs::addrs to return an Iterator (fmt)Ian Jackson2025-10-061-1/+3
|
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-064-23/+36
| | | | | | | | This will let us model the actual structure of routerstatus entries in netdocs more closely. They don't have the addresses in a single list. When this code was written this would have been much more awkward, but now we have RPITIT.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* circmgr: Don't count channel negotiation towards circuit built time.Nick Mathewson2025-08-071-0/+5
| | | | | | | | | | This is important, since some circuits require us to negotiate a new channel, and some don't: by adding this variability, we can easily learn a timeout based on pre-existing channels to our guards, but then later time out if it takes a while to open a TLS connection. This is a possible solution to part of #2079, a bug where we "learn" a circuit timeout that is too low for us to satisfy.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-074-6/+9
| | | | | | | | | | | | | | 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.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-linkspec,tor-basic-utils: remove deprecated `empty_iterator()` methodSteven Engler2025-05-141-3/+1
| | | | | | This method has always been deprecated, so it's not a big deal to remove. It can be replaced with the corresponding iterators's `Default` implementation.
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* linkspec: Fix nightly warning about elided lifetimeNick Mathewson2024-10-221-1/+1
| | | | | | This warning shows up when running `cargo +nightly doc`. Apparently nightly doesn't like it when we have elided a lifetime that has a perfectly good name.
* Some HasMemoryCost impls in tor-linkspecIan Jackson2024-10-021-2/+8
|
* tor-chanmgr: don't allow pending channels with no relay idsSteven Engler2024-10-011-1/+1
|
* Merge branch 'orport' into 'main'opara2024-09-303-13/+479
|\ | | | | | | | | tor-chanmgr: support multiple channels for a relay ID See merge request tpo/core/arti!2442
| * tor-linkspec: add `ListByRelayIds`Steven Engler2024-09-232-13/+472
| | | | | | | | Like `ByRelayIds`, but allows multiple items per relay ID.