Commit Graph

451 Commits

Author SHA1 Message Date
Nick Mathewson e0aeda3071 Remove semver.md files now that 1.1.0 is released. 2022-11-30 17:10:29 -05:00
Nick Mathewson 38bef96b99 Bump the minor version of every crate.
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Nick Mathewson ed08cce1b5 Rename for_circuit_usage => as_relay_with_desc 2022-11-30 13:16:51 -05:00
Ian Jackson e4ac39e638 bridge config: Add a TODO about a redundant clone 2022-11-30 15:49:34 +00:00
Ian Jackson 429d2c7cb7 bridge config: Rename accessors
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858480
2022-11-30 15:49:34 +00:00
Ian Jackson 117bee5808 bridge config: Use unreachable, not None.expect
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858479
2022-11-30 15:49:34 +00:00
Ian Jackson 199a6e0754 Separate BridgeAddr and PtTargetAddr
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.
2022-11-30 15:49:34 +00:00
Nick Mathewson bdddb78828 Merge branch 'more-linkspec-tests' into 'main'
Add tests for a bunch of code in tor-linkspec

See merge request tpo/core/arti!867
2022-11-29 18:41:54 +00:00
Ian Jackson b36a23cfd3 Merge branch 'ptmgr-optional-dep' into 'main'
Support building without pluggable transports

Closes #649

See merge request tpo/core/arti!898
2022-11-29 18:26:30 +00:00
Ian Jackson 1bd606ab5c guardmgr: Conditionalise DisplayRule::Redacted
This is unused in bridgeless configs.  Fixes a compiler warning.
2022-11-29 16:32:14 +00:00
Nick Mathewson 6b12c5d1de guardmgr: remove todo about bridge::config::Inner members
We've revised this a few times; now it seems plausible.
2022-11-29 11:03:44 -05:00
Nick Mathewson 0c0f3d1faf guardmgr: Remove now-unneeded #[allow(unnecessary_wraps)] 2022-11-29 11:00:27 -05:00
Nick Mathewson 5d6044f3fc Rustdoc fix: escape []s. 2022-11-28 09:36:15 -05:00
Nick Mathewson 45c4beff7a Fix up compatibility issues between linkspec tests and other patches 2022-11-28 08:29:33 -05:00
Nick Mathewson cf9f29158f GuardMgr: Treat Guards as sensitive and Bridges as redacted.
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.
2022-11-28 08:01:53 -05:00
Nick Mathewson 29f903bdac Display guards in redacted form in guard status messages.
Closes #627, again.

Closes #648.
2022-11-28 08:01:53 -05:00
Nick Mathewson 8cf9e2a6a4 Merge branch 'chanmethod-non-exhaustive' into 'main'
Make ChannelMethod non-exhaustive

See merge request tpo/core/arti!891
2022-11-27 19:36:22 +00:00
Nick Mathewson 984bd6012a Merge branch 'reconfig-bridges-bad' into 'main'
Require state ownership when using bridges

Closes #612

See merge request tpo/core/arti!889
2022-11-27 19:30:00 +00:00
Ian Jackson 1a39a0c7e9 Make ChannelMethod non-exhaustive
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.
2022-11-24 17:17:36 +00:00
Ian Jackson 04082ab7a9 tor-guardmgr: rustfmt for recent changes
Left unsquashed for ease of review
2022-11-24 14:31:05 +00:00
Ian Jackson ecd0e121a8 tor-guardmgr: NoLock error: add TODO for trying to get lock
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856874
2022-11-24 14:31:05 +00:00
Ian Jackson 112e28d88e tor-config: Rename to ReconfigureError::UnsupportedSituation
From Unsupported.  Prompted by
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873
This was added in this MR.

Also add the missing semver note.
2022-11-24 14:31:03 +00:00
Ian Jackson fa918446ac tor-config: Rename to ConfigBuildError::NoCompileTimeSupport
From Unsupported.  Following one of the suggestions here
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873

This was added in 2c37116149 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.
2022-11-24 14:30:58 +00:00
Nick Mathewson ce0f8f41cb Merge branch 'bridge-config-arc' into 'main'
Make BridgeConfig be Arc, so no Arc<BridgeConfig>

Closes #635

See merge request tpo/core/arti!885
2022-11-23 17:52:26 +00:00
Ian Jackson fbd4b88044 Merge branch 'test-config' into 'main'
tor-guardmgr: Fix visibility of TestConfig with no features enabled

See merge request tpo/core/arti!875
2022-11-23 17:51:05 +00:00
Nick Mathewson e25ed00fd1 Merge branch 'remove_deadcode_allow' into 'main'
guardmgr: Remove a now-unneeded "allow(dead_code)"

See merge request tpo/core/arti!862
2022-11-23 17:45:26 +00:00
Ian Jackson ecaf8b23b8 tor-guardmgr: Refuse to configure bridges if we don't have the lock
Fixes #612
2022-11-23 13:03:14 +00:00
Ian Jackson c0b297c99c tor-guardmgr: make replace_bridge_config fallible
The error type needs to be convertible to GuardMgrError and also to
ReconfigureError.  Neither of those is right, so we need a new error
type.
2022-11-23 13:00:10 +00:00
Ian Jackson 8cddb0a06a tor-guardmgr: Replace a let _ignore with a typed version
`let _ignore =` isn't great because if the function called is
currently infallible, but becomes fallible, it suppresses the
detection of the error check.

A better pattern is to specify the type of the ignored value.

I'm about to do precisely this, here.

I did a git-grep and `let _ignore =` seems very common.  Let's not
deal with all those now.
2022-11-23 13:00:05 +00:00
Nick Mathewson c0aa10d409 CircMgr: retire all circuits if bridge configuration changes.
Closes #650.
2022-11-22 12:53:32 -05:00
Ian Jackson ee87097dc1 BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfig
BridgeConfig is itself an Arc now, so these are redundant.
2022-11-22 15:33:21 +00:00
Ian Jackson 3caf7aafc0 BridgeConfig: Make it be a newtype around Arc<Inner>
This leaves the external API of this type unchanged, but now it's much
smaller and quite cheap to clone.
2022-11-22 15:33:21 +00:00
Ian Jackson 5d8d3f79fa bridge config: Remove a done TODO
This was done by !874 and #604 closed accordingly.
2022-11-22 15:08:28 +00:00
Ian Jackson 8406474435 bridge config parsing tests: Show expected error message in asssrt 2022-11-22 14:59:25 +00:00
Ian Jackson 987f67d7f6 bridge config parsing: Parse transport as TransportId (fmt) 2022-11-22 14:59:25 +00:00
Ian Jackson e57d3061db bridge config parsing: Parse transport as TransportId
Fixes #653
2022-11-22 14:59:25 +00:00
Ian Jackson 6b2940bb7d bridge config parsing: Move unsupported block
This will make the next commit textually smaller.
2022-11-22 14:59:25 +00:00
Ian Jackson 17002c7462 bridge non-support: Add doc notes to GuardMgrConfig::bridges_enabled 2022-11-21 16:46:19 +00:00
Ian Jackson 939d11c034 bridge non-support: Provide a better BridgeConfigBuilder
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.
2022-11-21 16:46:19 +00:00
Ian Jackson c4a3b0b5c4 bridge config: Feature-gate the error variants
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.
2022-11-21 16:46:19 +00:00
Ian Jackson 5800b1cdc9 bridge config: Move error to its own file
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.
2022-11-21 16:46:19 +00:00
Ian Jackson f087c7121d bridge non-support: Move dummy bridge module into own file
A bit more stuff is going to appear here, so it's getting to be rather
much for an inline module.
2022-11-21 16:46:19 +00:00
Ian Jackson 2c37116149 tor-config: introduce ConfigBuildError::Unsupported
And use it in bridge configuration parsing.
2022-11-21 15:46:53 +00:00
Ian Jackson 681b4062ff bridge config builder: Introduce error constructor helpers (fmt noise) 2022-11-21 15:46:53 +00:00
Ian Jackson 85d7651827 bridge config builder: Introduce error constructor helpers
Prompted by
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=12d13428d8fcc68b7b0f231bac9fc130b3eeb18b#d53209cbcd12771c549f3a130379ecb65dd60145_100_193
2022-11-21 15:46:53 +00:00
Ian Jackson b0bd9b3fb3 bridge config builder: Document one id of each type restriction
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=620cc90f6dcdad20f49a001a9e04d191a323e904#d53209cbcd12771c549f3a130379ecb65dd60145_100_124
2022-11-21 14:58:24 +00:00
Ian Jackson 897d8a0ee3 bridge config builder: Document PT one address restriction
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=620cc90f6dcdad20f49a001a9e04d191a323e904#d53209cbcd12771c549f3a130379ecb65dd60145_100_121
2022-11-21 14:58:24 +00:00
Ian Jackson 9aa1c56fc9 BridgeConfigBuilder: Allow (de)ser to/from bridge lines
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.
2022-11-21 14:58:24 +00:00
Ian Jackson 345d8e130b BridgeConfigBuilder: Implement FromStr 2022-11-21 14:58:24 +00:00
Ian Jackson cd2070b3ba BridgeConfigBuilder: Introduce build() function
And test cases for it, and its errors.
2022-11-21 14:58:24 +00:00