summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr/src/bridge
Commit message (Collapse)AuthorAgeFilesLines
* tor-guardmgr: Port to web_time_compat.Nick Mathewson2026-03-261-3/+3
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-062-6/+4
| | | | | | | | 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.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-072-58/+76
| | | | | | | | | | | | | | 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.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* tor-guardmgr: bridges: getter for BridgeConfigBuilder.transportIan Jackson2023-07-201-0/+8
| | | | | BridgeConfigBuilder is Serialize so this isn't making any new API promises. Ideally we'd have getters like this everywhere.
* Bridges: deduplicate addresses.Nick Mathewson2023-07-131-0/+2
| | | | | Currently we list an address for a bridge twice if it is listed both in the bridge line and the bridge descriptor. That can't be right.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Additional documentation around bridges/PT configurationNick Mathewson2023-07-031-0/+11
| | | | | | | This tries to flesh out some of the details for users who may be new to bridges and PTs. Closes #706.
* guardmgr: suppress a clippy-nightly warning.Nick Mathewson2023-05-181-0/+1
| | | | | I don't love this change, but apparently we are trying for "consistency".
* Use bool::then_some() as appropriateNick Mathewson2023-04-111-1/+1
| | | | | | Now that we require a version of Rust that allows `b.then_some(v)`, clippy complains about our use of `b.then(|| v)`.
* guardmgr: update feature behavior wrt testing and pts.Nick Mathewson2023-04-061-2/+2
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Rename for_circuit_usage => as_relay_with_descNick Mathewson2022-11-301-1/+1
|
* bridge config: Add a TODO about a redundant cloneIan Jackson2022-11-301-0/+3
|
* bridge config: Rename accessorsIan Jackson2022-11-301-2/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858480
* bridge config: Use unreachable, not None.expectIan Jackson2022-11-301-2/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858479
* Separate BridgeAddr and PtTargetAddrIan Jackson2022-11-301-22/+30
| | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/issues/668#note_2858220 This commit is difficult to split up. The innards of BridgeAddr and PtTargetAddr are still a bit entangled.
* Merge branch 'more-linkspec-tests' into 'main'Nick Mathewson2022-11-291-1/+1
|\ | | | | | | | | Add tests for a bunch of code in tor-linkspec See merge request tpo/core/arti!867
| * Fix up compatibility issues between linkspec tests and other patchesNick Mathewson2022-11-281-1/+1
| |
* | guardmgr: remove todo about bridge::config::Inner membersNick Mathewson2022-11-291-4/+0
| | | | | | | | We've revised this a few times; now it seems plausible.
* | GuardMgr: Treat Guards as sensitive and Bridges as redacted.Nick Mathewson2022-11-281-0/+2
|/ | | | | This machinery is a bit inelegant, but it is all confined to be within the GuardMgr crate, so IMO it should be fine for now.
* Merge branch 'chanmethod-non-exhaustive' into 'main'Nick Mathewson2022-11-272-1/+27
|\ | | | | | | | | Make ChannelMethod non-exhaustive See merge request tpo/core/arti!891
| * Make ChannelMethod non-exhaustiveIan Jackson2022-11-242-1/+27
| | | | | | | | | | | | | | | | | | Enums with variants conditional on cargo features must be non-exhaustive, because cargo features are supposed to be additive, meaning that enabling a feature (which might happen due to some random distant thing) ought not to break things using that enum. There were surprisingly few places to fix this.
* | Merge branch 'reconfig-bridges-bad' into 'main'Nick Mathewson2022-11-271-4/+5
|\ \ | |/ |/| | | | | | | | | Require state ownership when using bridges Closes #612 See merge request tpo/core/arti!889
| * tor-guardmgr: rustfmt for recent changesIan Jackson2022-11-241-4/+5
| | | | | | | | Left unsquashed for ease of review
| * tor-config: Rename to ConfigBuildError::NoCompileTimeSupportIan Jackson2022-11-241-1/+1
| | | | | | | | | | | | | | | | | | From Unsupported. Following one of the suggestions here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873 This was added in 2c3711614908d0c9cf1663b20b67a3fc233301f4 which was not yet in a release so this isn't a semver break. I have added the semver note that was omitted in that MR.
* | BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfigIan Jackson2022-11-221-5/+2
| | | | | | | | BridgeConfig is itself an Arc now, so these are redundant.
* | BridgeConfig: Make it be a newtype around Arc<Inner>Ian Jackson2022-11-221-21/+40
| | | | | | | | | | This leaves the external API of this type unchanged, but now it's much smaller and quite cheap to clone.
* | bridge config: Remove a done TODOIan Jackson2022-11-221-1/+0
|/ | | | This was done by !874 and #604 closed accordingly.
* bridge config parsing tests: Show expected error message in asssrtIan Jackson2022-11-221-2/+3
|
* bridge config parsing: Parse transport as TransportId (fmt)Ian Jackson2022-11-221-17/+15
|
* bridge config parsing: Parse transport as TransportIdIan Jackson2022-11-221-11/+23
| | | | Fixes #653
* bridge config parsing: Move unsupported blockIan Jackson2022-11-221-7/+7
| | | | This will make the next commit textually smaller.
* bridge non-support: Provide a better BridgeConfigBuilderIan Jackson2022-11-211-0/+5
| | | | | This type now does all the things people expect of it: you can (try to) deserialize it, parse it from a string, and call build on it.
* bridge config: Feature-gate the error variantsIan Jackson2022-11-211-0/+9
| | | | | | | This leaves this enum empty of actual errors, when bridge-client is disabled. We're going to add the not supported variant in a moment.
* bridge config: Move error to its own fileIan Jackson2022-11-212-104/+112
| | | | | | | | The dummy module is going to need an error type just like this but with only the disabled variant. To avoid that dummy enum getting out of step with the nontrivial one, we're going to make them the same. So as a first step, break this out into its own file.
* tor-config: introduce ConfigBuildError::UnsupportedIan Jackson2022-11-211-1/+1
| | | | And use it in bridge configuration parsing.
* bridge config builder: Introduce error constructor helpers (fmt noise)Ian Jackson2022-11-211-12/+12
|
* bridge config builder: Introduce error constructor helpersIan Jackson2022-11-211-40/+47
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=12d13428d8fcc68b7b0f231bac9fc130b3eeb18b#d53209cbcd12771c549f3a130379ecb65dd60145_100_193
* bridge config builder: Document one id of each type restrictionIan Jackson2022-11-211-0/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=620cc90f6dcdad20f49a001a9e04d191a323e904#d53209cbcd12771c549f3a130379ecb65dd60145_100_124
* bridge config builder: Document PT one address restrictionIan Jackson2022-11-211-0/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=620cc90f6dcdad20f49a001a9e04d191a323e904#d53209cbcd12771c549f3a130379ecb65dd60145_100_121
* BridgeConfigBuilder: Allow (de)ser to/from bridge linesIan Jackson2022-11-211-2/+39
| | | | | | That the *de*serialisation works as expected will be tested properly in just a moment, because when we plumb this all the way through, it will be what parses the bridge lines in the example config file.
* BridgeConfigBuilder: Implement FromStrIan Jackson2022-11-211-1/+46
|
* BridgeConfigBuilder: Introduce build() functionIan Jackson2022-11-211-8/+255
| | | | And test cases for it, and its errors.
* BridgeConfigBuilder: Introduce the struct with the dictionary reprIan Jackson2022-11-211-5/+122
| | | | | | | | | | | This struct is going to be the principal "dictionary-style" serde representation for a bridge, and the builder, making this all in keeping with our usual approach. In this commit: * Introduce the struct (defining the serialisation) * Provide the setters (defining the Rust API) * Add success test cases (not all of the data in which is used yet)
* BridgeAddr rename: update tor_guardmgr::bridge::configIan Jackson2022-11-211-5/+5
| | | | | Here is where my motivation is and I'm working on this code now, so do this renaming cleanup now.
* Allow a subset-only ChanMethod match when looking up a BridgeConfigNick Mathewson2022-11-151-1/+5
| | | | | | | | | If we have a bridge guard that is using Direct connection and it knows multiple addresses, our code to match it with a BridgeConfig is wrong, because the BridgeConfig has only one address, and our code looks for an exact match. Fixes #642.