Commit Graph

5102 Commits

Author SHA1 Message Date
Ian Jackson 7688973fd4 arti cfg test: Break out expect_err_contains function
Maybe this will want to be in tor-error or something but put it here
for now.
2022-11-21 16:46:19 +00:00
Ian Jackson fa4f842340 bridge non-support: Disable the test for now
This test will start to fail if you compile without bridge support,
because we'll start rejecting the test configurations with bridges
specified.

We'll add a proper test for this later.
2022-11-21 16:46:19 +00:00
Ian Jackson 17ae757ffd Merge branch 'bridge-config-builder' into 'main'
Introduce BridgeConfigBuilder

Closes #604

See merge request tpo/core/arti!874
2022-11-21 16:24:26 +00:00
Ian Jackson a171f51c1a maint/matrix_test: Print what command we are running! 2022-11-21 15:47:08 +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 ac4869633a tor-config: ConfigBuildError::within: Introduce add_prefix 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 58710b9635 Make the bridge list in the builder be a list of BridgeConfigBuilder
By changing MultilineListBuilder.
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 91536da10a tor-basic-utils: Provide helper for serde flexible parsing 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
Ian Jackson 589f74a78f BridgeConfigBuilder: Introduce the struct with the dictionary repr
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)
2022-11-21 14:58:24 +00:00
Ian Jackson 2327c7657c tor-basic-utils: list_builder: Introduce DirectDefaultEmptyListBuilderAccessors
This trait can have this ludicrously long name because no-one needs to
import it.
2022-11-21 14:54:39 +00:00
Ian Jackson 88b60a1fa7 BridgeAddr rename: update tor_guardmgr::bridge::config
Here is where my motivation is and I'm working on this code now, so do
this renaming cleanup now.
2022-11-21 14:54:39 +00:00
Ian Jackson fec66077de BridgeAddr rename from PtTargetAddr: Update in tor-linkspec
And the error too.

We need this for the API for BridgeConfigBuilder, where the user can
specify any kind of target "address", even a hostname.

It's already non-conditional, it's just that the name is too limiting.

In this commit:
 * Change in tor-linkspec
 * Export transitional aliases
 * Add TODOs to remove the transitional aliases
2022-11-21 14:54:39 +00:00
Ian Jackson 224f4905e4 tor-linkspec: Provide deconstructors for PtTargetSettings and PtTarget 2022-11-21 14:54:39 +00:00
Ian Jackson 0b14b93f76 arti-client, tor-config: Remove stability warning from top-level docs
Ticket #285 is closed and most of this is stable now we think.

(There are still a couple of stability warnings for specific types in
tor-config, which aren't exposed at the arti-client level.)
2022-11-21 12:06:27 +00:00
Nick Mathewson 3520505a2c Merge branch 'cfg-allow' into 'main'
cfg compilation: Add two allows

See merge request tpo/core/arti!876
2022-11-18 19:29:45 +00:00
Ian Jackson 113341e397 cfg compilation: Add two allows 2022-11-18 18:50:00 +00:00
Ian Jackson 285a7988bb Merge branch 'fix_nightly_20221118' into 'main'
Fix warnings and breakage in nightly (2022-11-18 edition)

See merge request tpo/core/arti!872
2022-11-18 16:43:16 +00:00
Ian Jackson d6f567b8ef fixup! tor-guardmgr: Fix visibility of TestConfig with no features enabled 2022-11-18 16:40:28 +00:00
Ian Jackson 7ec52057dc tor-guardmgr: Fix visibility of TestConfig with no features enabled
Without this, tor-guardmgr tests don't build when run without the
crate's own testing feature enabled.
2022-11-18 16:30:46 +00:00
Nick Mathewson 122c796fac Merge branch 'fix_ownedchantarget_missing' into 'main'
Fix a missing import in tests.

See merge request tpo/core/arti!873
2022-11-18 16:07:33 +00:00
Nick Mathewson 483b857d78 Merge branch 'fix_nightly_version' into 'main'
gitlab-ci: Pin to nightly-2022-11-05

See merge request tpo/core/arti!871
2022-11-18 15:44:41 +00:00
Nick Mathewson de9f3177b0 Fix a missing import in tests.
I'm not sure why the CI didn't reject this the first time around.
2022-11-18 10:34:19 -05:00
Nick Mathewson 47041bd4ce Merge branch 'refactor_into_ownedchantarget' into 'main'
CircMgr: Refactor DirSpecificTarget constructor

See merge request tpo/core/arti!866
2022-11-18 15:21:46 +00:00
Nick Mathewson 829cb708e2 Fix a couple of rustdoc issues.
These slipped in while nightly was broken.
2022-11-18 10:19:54 -05:00
Nick Mathewson d51162e55b Fix a bunch of "needless borrow" warnings on nightly
It looks like, despite a few false starts, they've got this warning
right; there weren't any false positives.
2022-11-18 10:12:05 -05:00
Nick Mathewson e8701b1e9e gitlab-ci: Pin to nightly-2022-11-11
This is a workaround for #633.
2022-11-18 10:02:27 -05:00
Nick Mathewson ec148a63cb CircMgr: Refactor DirSpecificTarget constructor
This commit replaces the
`impl From<&T> for OwnedChanTarget where T:ChanTarget`
with a new `IntoOwnedChanTarget` trait. This lets us be explicit
that we're constructing an owned object, and not just converting
something.

No semver change needed, since these APIs haven't been released.

----------- (new description)
2022-11-18 09:55:46 -05:00
Nick Mathewson c666133be4 Merge branch 'mark-bridges-not-experimental' into 'main'
Mark bridge and PT-related APIs as non-experimental.

Closes #643

See merge request tpo/core/arti!865
2022-11-18 14:22:31 +00:00
Nick Mathewson 76e41b8bf6 circmgr: make some imports conditional
This resolves an "unused import" warning when bridges are not
enabled.
2022-11-18 08:53:47 -05:00
Nick Mathewson 2c366927cc arti-client: make bridge-client depend on dirmgr/bridge-client
This resolves some errors when building with `bridge-client` but not
with `--all-features`.
2022-11-18 08:53:47 -05:00
Nick Mathewson b0e337d22d arti: Mark bridge and pt support non-experimental, and on-by-default 2022-11-18 08:53:47 -05:00
Nick Mathewson 9229e1a59b arti: Split long lines in Cargo.toml
This will make the next commit easier to review.
2022-11-18 08:53:47 -05:00
Nick Mathewson f1f6005474 arti-client: Mark "bridge-client" and "pt-client" as non-experimental 2022-11-18 08:53:47 -05:00
Nick Mathewson 09591bcc5a arti-client: split long lines in Cargo.toml
Doing this separately to make the next commit easier to read.
2022-11-18 08:53:47 -05:00
Nick Mathewson 9f661e264f dirmgr: make "bridge-client" non-experimental. 2022-11-18 08:53:47 -05:00
Nick Mathewson 471cdc77f2 guardmgr: Make bridge-client and pt-client non-experimental 2022-11-18 08:53:47 -05:00
Nick Mathewson 1928fd0b72 circmgr: Make "specific-relay" non-experimental. 2022-11-18 08:53:47 -05:00
Nick Mathewson b5a9e0b475 chanmgr: Make "pt-client" non-experimental. 2022-11-18 08:53:47 -05:00
Nick Mathewson c441853cb8 Merge branch 'log_guard_status' into 'main'
GuardMgr: Log significant guard/bridge status changes at info/warn

Closes #627

See merge request tpo/core/arti!869
2022-11-18 13:51:42 +00:00
Ian Jackson c0fa78fd4d Merge branch 'display_chan_target' into 'main'
ChanTarget: Add a display function, with better output.

Closes #647

See merge request tpo/core/arti!868
2022-11-18 13:19:10 +00:00
Ian Jackson fc047b4b3c Merge branch 'inst_as_arg' into 'main'
GuardMgr: Resolve a `TODO pt-client` by having `update` take an `Instant`.

See merge request tpo/core/arti!863
2022-11-18 12:42:02 +00:00
Nick Mathewson 8dfbbca4e5 GuardMgr: Log when a guard status changes (significantly).
We previously had a trace message on _every_ change.  That's fine,
but we also want to log more important changes where the user
can see them.  Namely:

  * If we go from any other status to Reachable, we want to tell
    the user. (We don't want to spam them if it was already
    reachable.)
  * If we go from Untried or Reachable to Unreachable, we want to
    tell the user. (We don't tell them about changes from Retriable
    to Unreachable, since that just means that a retry attempt
    was not successful.)

Closes #627.
2022-11-17 12:32:57 -05:00
Nick Mathewson 6c5dd05698 GuardMgr: split Reachable::Unknown into Untried and Retriable
There are two cases here, and we will want to log them
differently.

(By removing the "Unknown" variant entirely, we ensure that we
didn't miss any code that formerly checked for Unknown.)
2022-11-17 12:21:06 -05:00