Commit Graph

381 Commits

Author SHA1 Message Date
Nick Mathewson 957eb929a0 Remove now-redundant Send+Sync constraints alongside NetDirProvider 2022-06-07 11:44:51 -04:00
Ian Jackson 4f42101554 lints: Add let_unit_value allow to all crates
From running add_warning, with manual picking of the right
hunks/lines.
2022-05-31 15:23:52 +01:00
Ian Jackson ba0843da4a lints: Add lint block delimiters to every crate
This was the result of:
  maint/add_warning crates/*/src/{lib,main}.rs
and then manually curating the results.
2022-05-31 13:00:31 +01:00
Orhun Parmaksız bfd41ddb5f
Lexically sort Cargo.toml dependencies
Utilize cargo-sort: https://github.com/DevinR528/cargo-sort

Signed-off-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2022-05-28 20:05:51 +03:00
Nick Mathewson 4326aa1de9 Regenerate version bump from previous commit.
This commit was made by reverting the previous commit, then
re-running the script I used to generate it.  In theory there should
be no semantic changes: only changes due to improved formatting from
cargo edit.
2022-05-27 10:18:52 -04:00
Nick Mathewson b232365a75 Semantic version changes for Arti 0.4.0 release
I followed the following procedure to make these changes:

* I used maint/changed_crates to find out which crates had changed
  since 0.3.0.
* I used grep and maint/list_crates to sort those crates in
  topological (dependency) order.
* I looked through semver_status to find which crates were listed as
  having semver-relevant changes (new APIs and breaking changes).
* I scanned through the git logs of the crates with no
  semver-relevant changes listed to confirm that, indeed, they had
  no changes.  For those crates, I incremented their patch-level
  version _without_ changing the version that other crates depend on.
* I scanned through the git logs of the crates with no
  semver-relevant changes listed to confirm that, indeed, they had
  no obvious breaking changes.
* I treated all crates that depend on `arti` and/or `arti-client` as
  having breaking changes.
* I identified crates that depend on crates that have changed, even
  if they have not changed themselves, and identified them as having
  a non-breaking change.
* For all of the crates, I used `cargo set-version -p $CRATE --bump
  $STATUS` (where `STATUS` is `patch` or `minor`) to update the
  versions, and the depended-upon versions.
2022-05-27 09:01:20 -04:00
Ian Jackson 4bf87d61ca Merge branch 'config-split' into 'main'
Break TorClientConfig out of ArtiConfig and warn on unknown config keys

Closes #459 and #417

See merge request tpo/core/arti!529
2022-05-26 10:40:43 +00:00
Nick Mathewson 92f0f97fe8 Merge branch 'isolation-example' into 'main'
add example for Isolation

Closes #414

See merge request tpo/core/arti!524
2022-05-24 19:34:14 +00:00
Ian Jackson 9e526aad7c Split TorClientConfig out of ArtiConfig, and Resolvable trait
This gets rid of `#[serde(flatten)]` which prevents serde_ignored (and
other kinds of introspection) from working properly.

The price is now that the toplevel has to deal with two configuration
objects.

The Resolvable trait is overkill right now, but is going to do More
Things in a moment.  In particular, we need the impl on tuples, so
that the whole config can be processed in one go.
2022-05-24 20:14:57 +01:00
trinity-1686a 78b815e0d3 mention isolation is an advanced topic and most usage don't require implementing the trait 2022-05-24 18:25:32 +02:00
Nick Mathewson 25c64db575 Apply fs-mistrust to logfile directories. 2022-05-24 10:54:02 -04:00
Nick Mathewson b1fc4bd03b Make fs-mistrust configurable from the top level.
This change requires a little refactoring of TorClientBuilder: now,
instead of enabling or disabling mistrust, it enables or disables
the decision to _override_ the mistrust in the config.
2022-05-24 10:54:02 -04:00
Nick Mathewson 95200383b5 fs-mistrust: make Mistrust have a corresponding Builder type.
This is an approximately minimal revision to get Builder in place;
subsequent commits will clean up the API.
2022-05-24 10:54:02 -04:00
trinity-1686a b279b09b0c add example for Isolation 2022-05-23 22:40:08 +02:00
Nick Mathewson 546ae3000e Resolve the new `derive_partial_eq_without_eq` lint.
It's a little overzealous sometimes, but it's mostly to the good.
2022-05-23 12:55:37 -04:00
michael mccune 0d8f520faf add unit tests for arti_client::StreamPrefs
this change adds unit tests for the public methods of StreamPrefs. although
these are mostly "setter" style functions, the tests confirm the basic
expectations and operation.
2022-05-23 10:55:17 -04:00
Nick Mathewson 934de16098 Merge branch 'arti-config-2' into 'main'
Abolish arti-config, replacing with tombstone crate

See merge request tpo/core/arti!508
2022-05-13 12:30:24 +00:00
Ian Jackson cdde87846c arti-config: Move default config file test to arti-client
That's where this definitions is now.  This test ought to have been
moved in
  Move default_config_file() into arti-client
2022-05-13 12:41:27 +01:00
Ian Jackson be5bc04c02 impl_standard_builder: Have it generate FooConfig::builder
This deletes many handcoded impls.  It also generates lots of impls
that we previously didn't have.
2022-05-12 18:50:26 +01:00
eta 2255778afa Merge branch 'builder-default-bis' into 'main'
impl_standard_builder followup

See merge request tpo/core/arti!505
2022-05-12 15:57:56 +00:00
Ian Jackson c1c6f2b376 Rename impl_standard_builder from impl_default_via_builder
I have Plans for this macro.  In particular:

 * I have a wip branch which tests that the Builder can be
   deserialised from an empty config (ie, that config reading
   of a config with a blank section for this item works).

 * I think we should autogenerate $Config::builder(),
   and promote that, rather than $ConfigBuilder::default().
   This macro could do that.
2022-05-12 15:59:13 +01:00
Ian Jackson 400266b2c5 config: Move macro calls to next to the struct
This macro is kind of derive-y.  Also it has a test in it, and failing
to call it could allow bugs to exist, as well as missing bits of API.
Putting it next to the structs makes it easy to see that it's actually
been called.
2022-05-12 15:58:38 +01:00
Nick Mathewson 2a5ee2c8c9 Merge branch 'ticket_412_467' into 'main'
Teach DirMgr to use slightly untimely directories

Closes #467 and #412

See merge request tpo/core/arti!500
2022-05-12 14:42:51 +00:00
eta 7207b17567 Merge branch 'builder-default' into 'main'
Provide and use macro for impl Derive via Builder

See merge request tpo/core/arti!499
2022-05-12 12:52:37 +00:00
Ian Jackson 04b8729d6b Add correct serde(default) attrs for humantime_serde::option
Discovered by a test case in my local tree.  The test case was
macro-generated by an extension of impl_standard_builder (which
macro istself currently awaiting review, arti!499)

Have also sent an MR to update the upstream docs
  https://github.com/jean-airoldie/humantime-serde/pull/8
2022-05-12 11:34:53 +01:00
Ian Jackson 3420fe735d Define and use impl_default_via_builder 2022-05-11 18:27:15 +01:00
Nick Mathewson 7dec007d63 Add DirSkewTolerance section to DirMgr configuration.
This new section describes how much variance we accept when it comes
to expired and not-yet-valid directory documents.  (Currently, the
only ones where this matters for are consensus documents and
authority certificates.)  A document that is invalid by no more than
these tolerances is not _live_, but it can still be used.

These tolerances serve two purposes:

 * First, they allow clients to run with a little more clock skew
   than they would tolerate otherwise.
 * Second, they allow clients to survive the situation where the
   authorities are unable to reach a consensus for a day or two.

Compare with Tor's REASONABLY_LIVE_TIME and NETWORKSTATUS_ALLOW_SKEW
constants; also compare with proposal 212.

Closes #412.
2022-05-11 12:11:17 -04:00
Ian Jackson 8fe62da871 Move default_config_file() into arti-client
This will let other embedders use it.
2022-05-11 15:53:03 +01:00
Nick Mathewson 4262e9d0ec Merge branch 'use-fs-mistrust' 2022-05-09 15:27:25 -04:00
Nick Mathewson 8a62f9ce52 Remove "Mistrust" from the public API of arti-client.
I'm doing this per discussion, so that we can have it be part of the
TorConfig later on, and not break stuff as we change the Mistrust
API to have a builder.

This change, unfortunately, results in a little more internal
complexity and duplicated code in arti and arti-client.  I've marked
those points with TODOs.
2022-05-09 14:40:29 -04:00
Nick Mathewson b0f39abe32 arti: use fs-mistrust to validate configuration file locations. 2022-05-09 14:40:29 -04:00
Nick Mathewson 2938268f34 arti-client: Configure and use fs-mistrust.
This is derived from the environment, not the configuration file: We
might not want to trust the configuration file until we've decided
whether we like its permissions.
2022-05-09 14:40:29 -04:00
Ian Jackson cc99efb72a NetParams: Document its role as a validated config parameter 2022-05-09 15:35:50 +01:00
Nick Mathewson 7b93091f57 Bump the version of every* crate to 0.3.0
* Except for safelog and fs-mistrust, which are new.
2022-05-06 10:03:15 -04:00
Nick Mathewson 89b38b16c7 Change safelog version to 0.1.0.
(This is okay because we haven't published it yet, or any crate that
uses it.)
2022-05-06 09:59:13 -04:00
Nick Mathewson 9447e69355 Update README.md files (automated). 2022-05-06 09:51:11 -04:00
Nick Mathewson 013bb26040 Merge branch 'derive-builder-fork' into 'main'
Switch to derive_builder_arti_fork

Closes #446

See merge request tpo/core/arti!490
2022-05-06 13:07:51 +00:00
Ian Jackson 030289481f Switch to derive_builder_arti_fork
For reference, the git source for this crate (and the others in its
workspace) currently lives in my personal github account (ijackson).
If this fork turns out to be long-lived and gains features and/or
users, it would be good to move it to a gitlab somewhere.

I have granted Nick crate ownership on the crates.io system.
2022-05-06 13:36:40 +01:00
Nick Mathewson 4679023c39 Apply `sensitive` in some info-level log messages.
This specifically applies the `sensitive` wrapper in the places
where we're logging target addresses at level "info" or higher.
2022-05-06 07:36:50 -04:00
Ian Jackson d47e94b459 config derive attrs: Make builders serde, and validated structs not
* Builders additionally derive: Debug, Serialize, Deserialize.

 * Validated structs no longer derive: Serialize, Deserialize
   and all related attributes deleted.

 * As a consequence, all the `#[serde(deny_unknown_fields)]`
   are gone.  That means that right now unknown fields are totally
   ignored.  This is good for compatibility but poor for useability.
   Doing something better here is arti#417, in progress.

 * As a consequence, delete tor_dirmgr::retry::default_parallelism.
   (The default value was already duplicated into a builder attr.)
2022-05-05 10:35:52 +01:00
Ian Jackson 4ad4cae418 FallbackDir: Use VecBuilder for orports
And drop the ad-hoc orport() method.  This brings FallbackDir's
orports field in line with our list builder API.

The general semver note in "configuation" seems to cover most of this.
2022-05-04 17:18:55 +01:00
Ian Jackson 4bca912715 Change builder list API
The new API is (roughly) as discussed in
  https://gitlab.torproject.org/tpo/core/arti/-/issues/451

This is quite a large commit and it is not convenient to split it up.
It contains the following changes:

 * Redo the list builder and accessor macros implemnetation,
   including docs and tests.

 * Change uses of define_list_config_builder.  In each case:
   - Move the docs about the default value to the containing field.
   - Remove the other docs (which were just recapitulations, and
     are now not needed since the ListBuilder is no longer public).
   - Rewmove or replace `pub` in the define_list_builder_helper call,
     so that the builder is no longer public.
   - Change the main macro call site to use define_list_builder_helper.
   - Add a call to define_list_builder_accessors.

 * Make the module `list_builder` pub so that we have somewhere to
   put the overview documentation.

 * Consequential changes:
   - Change `outer.inner().replace(X)` to `outer.set_inner(X)`
   - Consequential changes to imports (`use` statements).
2022-05-04 13:50:10 +01:00
Ian Jackson ed970310e2 CfgPath: Overhaul API
Document that this can contain either a string for expansion, or a
literal PathBuf not for expansion.

Rename the `from_path` method to `new_literal`: a very important
difference is whether it gets expanded - less important than the Rust
type.  Also, now it takes `Into<PathBuf>`, which avoids a needless
clone.

(We don't change the API in `arti-client` because
`&tempfile::Tempdir()` doesn't implement `Into<PathBuf>`, so
`arti-client` has to have some new `as_ref` calls.)

Provide accessors `as_unexpanded_str` and `as_literal_path`.  The
deserialisation already makes this part of the stable API,l so not
pvoding accessors seems just obstructive.  They are useful for tests,
too.

Add tests for the new entrypoints, and for deserialisation of both
variants from TOML (via config, or directly) and JSON.
2022-05-03 17:42:14 +01:00
eta 6f787e1e77 Merge branch 'derive-builder-git-fixup' into 'main'
derive_builder: Use git dep everywhere, rather than cargo patch

See merge request tpo/core/arti!477
2022-04-27 14:31:08 +00:00
Ian Jackson a97ad69855 derive_builder: Use git dep everywhere, rather than cargo patch
The `[patch]` approach causes the tree not to build when used as a
dependency, unless the `[patch]` is replicated into the depending
project.

Instead, replace our `derive_builer =` dependencies with a reference
to a specific git commit:

  perl -i~ -pe 'next unless m/^derive_builder/; s#"(0\.11\.2)"#{ version = "$1", git = "https://github.com/ijackson/rust-derive-builder", rev = "ba0c1a5311bd9f93ddf5f5b8ec2a5f6f03b22fbe" }#' crates/*/Cargo.toml

Note that the commitid has changed.  This is because derive_builder is
in fact a workspace of 4 crates.  3 of them are of interest to arti
itself (the 4th exists only for testing).  So the same "add git
revision" treatment had to be done to the `derive_builder` and
`derive_builder_macro` crates.  Each dependency edge involves a new
commit in the derive_builder workspace, since we can't create a git
commit containing its own commitid.  (We want to use commits, rather
than a branch, so that what we are depending on is actually properly
defined, and not subject to the whims of my personal github
namespace.)

There are no actual code changes in derive_builder.
2022-04-27 14:57:59 +01:00
Samanta Navarro 1d62d92fb9 Fix spacing 2022-04-27 13:52:43 +01:00
Samanta Navarro c53818d496 Fix grammar and typos 2022-04-27 13:52:13 +01:00
eta 8509dbc920 Merge branch 'upgrade_dependencies' into 'main'
Upgrade various dependencies, now that we are MSRV 1.56

Closes #313 and #334

See merge request tpo/core/arti!476
2022-04-27 12:27:28 +00:00
Nick Mathewson 5484bcc21f Merge branch 'download-schedule' into 'main'
DownloadSchedule: Introduce Builder

See merge request tpo/core/arti!473
2022-04-26 18:47:08 +00:00
Nick Mathewson 5586f0d039 Upgrade to Postage 0.5.0 2022-04-26 12:16:22 -04:00
Ian Jackson 20d61dd4d4 DirMgrConfig: Rename two fields that contained a _config
This entire struct is config.  This is otiose.
2022-04-26 15:29:33 +01:00
Ian Jackson eb35555330 DownloadSchudule: Have NetworkConfig contain Builders
Use sub_builder.  We must do something special for defaults.

This involves moving the actual default values for retry_bootstrap and
retry_microdescs into config.rs, since they need to access the fields
of the un-built version of the structure.  (An alternative would be to
generate "weak setters" which do not override previous settings, but
derive_builder does not offer to generate them and that seems
overkill.)
2022-04-26 15:16:32 +01:00
Ian Jackson f4a1e34bee DownloadSchedule: Abolish new() method
Instead, everyone should use DownloadScheduleBuilder.

The new() method would in any case be useless in a moment, since we're
going to embed DownloadScheduleBuilder in the NetworkConfig, not
DownloadSchedule.

The call sites in the tests are all about to change again.
2022-04-26 15:16:32 +01:00
Nick Mathewson c1ea419477 Merge branch 'main' into 'msrv_1_56'
# Conflicts:
#   crates/tor-config/Cargo.toml
#   crates/tor-dirmgr/src/state.rs
#   doc/semver_status.md
2022-04-26 12:45:16 +00:00
Ian Jackson 1f215da1a3 Rename ThingListBuilder::replace (from set)
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798024
2022-04-25 18:15:25 +01:00
Nick Mathewson 2f6bc6bdc4 squash! Bump every crate's edition to 2021.
Remove all `use` statements for `TryFrom` and `TryInto`.  These are
now redundant in Rust 2021.
2022-04-25 13:06:26 -04:00
Nick Mathewson b60b0a266a Bump every crate's edition to 2021.
This is an automated change made with a perl one-liner and verified
with grep -L and grep -l.

Some warnings are introduced with this change; they will be removed
in subsequent commits.

See arti#208 for older discussion on this issue.
2022-04-25 13:05:31 -04:00
Nick Mathewson ca05b0904c Add 'rust-version = "1.56"' to every Cargo.toml file.
This change was made automatically with a perl one-liner, and
confirmed with `grep -L`.

The `rust-version` field itself was introduced in 1.56.0.
2022-04-25 13:04:31 -04:00
Nick Mathewson 0069fd2206 Reformat all not-yet-reformatted Cargo.toml files.
There are no semantic changes here; only formatting.  This is in
preparation for other changes (wrt MSRV and edition)
2022-04-25 13:04:31 -04:00
Ian Jackson 4ad9e5e4b0 Introduce AuthorityListBuilder in NetworkConfigBuilder
NetworkConfigBuilder needs to not contain any validated structs, so
that its serde does not expose the validated details.

AuthorityListBuilder is what ought to go here - and it contains
Vec<AuthorityBuilder>, not Vec<Authority>.  As a consequence, many
places now deal with AuthorityBuilder, rather than Authority.
2022-04-25 12:54:51 +01:00
Ian Jackson 89824fc7ea arti-client: TorClientConfig: derive TorClientConfigBuilder
Replace handwritten builder struct, accessors, and builder function.
2022-04-22 17:48:03 +01:00
Ian Jackson 962b6c32e1 fallback list: Introduce and use FallbackListBuilder
Now the network fallbacks configuration wants to Deserialize
a Vec<FallbackDirBuilder>, rather than validated Vec<FallbackDir>.

Methods on FallbackListBuilder are as per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
mutatis mutandi for the fact that this struct has only fallbacks in it.
2022-04-22 17:48:03 +01:00
Ian Jackson 6da7a2e3e2 Use git source for derive_builder for now, for sub_builder feature
This commitid is the current head of my MR branch
  https://github.com/colin-kiegel/rust-derive-builder/pull/253
  https://github.com/ijackson/rust-derive-builder/tree/field-builder
Using the commitid prevents surprises if that branch is updated.

We will require this newer version of derive_builder.  The version
will need to be bumped again later, assuming the upstream MR is merged
and upstream do a release containing the needed changes.

We will need the new version of not only `derive_builder_core` (the
main macro implementation) but also`derive_builder` for a new error
type.
2022-04-21 14:07:28 +01:00
Nick Mathewson 11a9091602 arti-client: Report clock skew when it is noteworthy
(Also, blame clock skew when it is an explanation of why we cannot
finish a connection.)
2022-04-12 08:03:49 -04:00
Nick Mathewson 5b2fc118df Bump all arti*, tor* crates to 0.2.0
Not all of these strictly need to be bumped to 0.2.0; many could go
to 0.1.1 instead.  But since everything at the tor-rtcompat and
higher layers has had breaking API changes, it seems not so useful
to distinguish.  (It seems unlikely that anybody at this stage is
depending on e.g. tor-protover but not arti-client.)
2022-04-01 09:15:18 -04:00
Nick Mathewson 1feb7eecac Reformat several Cargo.toml files with 100-char-wide lines. 2022-03-30 10:41:40 -04:00
Nick Mathewson 9da43189f3 Turn FallbackList into a real type, and store one in GuardMgr.
The guard manager is responsible for handing out the first hops of
tor circuits, keeping track of their successes and failures, and
remembering their states.  Given that, it makes sense to store this
information here.  It is not yet used; I'll be fixing that in
upcoming commits.

Arguably, this information no longer belongs in the directory
manager: I've added a todo about moving it.

This commit will break compilation on its own in a couple of places;
subsequent commits will fix it up.
2022-03-30 10:39:06 -04:00
eta 5d27710ef1 Merge branch 'disallowed_lint' into 'main'
Remove allow(clippy::disallowed_methods) lint flag.

See merge request tpo/core/arti!437
2022-03-30 14:02:13 +00:00
eta ac64bdea27 Make daemon tasks self-contained; introduce NetDirProvider
The various background daemon tasks that `arti-client` used to spawn are
now handled inside their respective crates instead, with functions
provided to spawn them that return `TaskHandle`s.

This required introducing a new trait, `NetDirProvider`, which steals
some functionality from the `DirProvider` trait to enable `tor-circmgr`
to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it
can't depend on `DirProvider` directly).

While we're at it, we also make some of the tasks wait for events from
the `NetDirProvider` instead of sleeping, slightly increasing
efficiency.
2022-03-30 14:26:43 +01:00
Nick Mathewson 537ff61ece Fix a let_and_return lint violation that had somehow slipped in. 2022-03-30 08:57:14 -04:00
Nick Mathewson 700e491813 Remove allow(clippy::disallowed_methods) lint. 2022-03-30 08:55:58 -04:00
eta fd081742fa Merge branch 'no-system-time' into 'main'
Don't use SystemTime::now()

Closes #306

See merge request tpo/core/arti!365
2022-03-30 12:44:25 +00:00
Nick Mathewson 6d7dcdc621 Update README.md files using readmes script 2022-03-29 13:30:17 -04:00
Nick Mathewson 9177411951 Merge branch 'isolation-followup' into 'main'
implement IsolationHelper for StreamIsolation

See merge request tpo/core/arti!434
2022-03-28 12:29:25 +00:00
trinity-1686a 219ad39eca remove usage of 'token' where it's no longer a token 2022-03-27 13:49:08 +02:00
Ian Jackson 6e07ab1668 Merge branch 'main' into 'main'
Fixed typo on arti-client README.md

See merge request tpo/core/arti!432
2022-03-25 16:01:45 +00:00
Ian Jackson 565a3d1d01 Merge branch 'dir-filter' into 'main'
arti-client, dirmgr: Initial DirFilter code

See merge request tpo/core/arti!431
2022-03-25 15:59:54 +00:00
Ian Jackson 678504d9f9 Abolish filter::DynFilter in favour of transparent DirFilter
There are two reasons why the DynFilter newtype might be needed:

1. To impl Default.  But we don't need it to impl Default since we can
have an accessor which does the defaulting.

2. To hide the API.  But this is usrely an unstable API.

Just writing Arc<dyn> gets rid of a lot of unnecessary boilerplate and
conversion code.
2022-03-25 13:08:56 +00:00
Ian Jackson 0846ebd6d1 Make DirFilter be Debug + Send + Sync
Abolish the handwritten Debug impl for DynFilter, which is no longer
needed.
2022-03-25 13:08:33 +00:00
eta 30e77785a0 Merge branch 'task-scheduler-2' into 'main'
Implement a periodic task scheduler, and a basic dormant mode

See merge request tpo/core/arti!429
2022-03-25 11:09:24 +00:00
solanav d90d1c00a7 Fixed typo on arti-client README.md 2022-03-24 21:50:27 +01:00
trinity-1686a d2edf25733 move StreamIsolation to isolation module 2022-03-24 21:12:46 +01:00
trinity-1686a de5f517da6 rename *_isolation_group to *_isolation 2022-03-24 18:56:22 +01:00
Nick Mathewson 123cd2223b Expose DirFilter from arti-client.
This will make it possible to implement a directory-munging
mechanism in arti-testing for #397.
2022-03-24 12:10:46 -04:00
Nick Mathewson c0399fc6c1 dirmgr: Initial DirFilter code.
This code sits behind a feature flag, and can be used to modify
directories before storing them.  This is part of the implementation
for #397.
2022-03-24 12:10:46 -04:00
Nick Mathewson 4354415999 Reformat {arti-client,tor-dirmgr}/Cargo.toml 2022-03-24 12:10:35 -04:00
eta 1ca79ff988 Implement a periodic task scheduler, and a basic dormant mode
This is a revised version of !397; it implements a scheduling system for
periodic tasks that can be externally controlled, and then uses the
external control aspect to implement a basic dormant mode (#90).

More technically, the scheduling system consists of a `Stream` that
periodic tasks are expected to embed in a `while` loop or similar, a
way for tasks themselves to choose how long to wait until the stream
next yields a result, and a handle to control this outside of the task.
2022-03-23 13:43:48 +00:00
Ian Jackson 1c213d4d89 Move SystemConfig to arti::cfg
Fixes #314, #418.
2022-03-21 15:54:11 +00:00
Nick Mathewson 85a20ae4ec Alternative API for set_isolation_group().
Instead of requiring a `Box<dyn Isolation>`, it now takes either a
`Box<dyn Isolation>`, or an arbitrary `T` that implements
`Isolation`.

This API still allows the user to pass in a `Box<dyn Isolation>` if
that's what they have, but it doesn't require them to Box the
isolation on their own.

Part of #414.
2022-03-17 09:07:08 -04:00
Nick Mathewson 2818a3cb35 Merge branch 'test-isolation' into 'main'
new api for isolation

See merge request tpo/core/arti!377
2022-03-17 12:46:13 +00:00
Ian Jackson 40bede587c Merge branch 'config-partials-transparent' into 'main'
Absolish builders for CircMgrConfig and DirMgrConfig

See merge request tpo/core/arti!417
2022-03-17 12:30:46 +00:00
trinity-1686a 575792b583 replace TODOs with documentation 2022-03-16 20:33:36 +01:00
Ian Jackson a020f82de2 DirMgrConfig: abolish builder; make it transparent and exhaustive
See rationale in the comment.
2022-03-16 19:31:10 +00:00
Ian Jackson 8bde40fdd3 Make CircMgrConfig transparent (and make it a trait)
See commentary for the rationale.
2022-03-16 19:30:59 +00:00
Ian Jackson 8d54c0f073 Change type of TorClientConfig::override_net_params
Now we use NetParams.  That implies making its constructor public,
which I think it fine.

This is related to #413 but is far from completing that ticket.
2022-03-16 19:30:59 +00:00
Ian Jackson d0c71b3872 Actually honour preemptive circuits configuration
This handwritten conversion function omitted a field.  There was
nothing to spot this mistake.

IMO this shows why these particular types ought not to use builders,
but instead, should cause API breaks when things change.

Adding this line here to explicitly fix the bug, although we are about
to abolish this function completely almost right away.
2022-03-16 19:22:13 +00:00
trinity-1686a 7c606048f2 accept boxed isolation in StreamPref::set_isolation_group 2022-03-16 19:24:23 +01:00
trinity-1686a 0b7c71a888 add tests on Isolation and fix conditional compilation issues
it seems I added conditional compilation without noticing it??
and there was some errors when choosing a prefered runtime depending on
feature flags
2022-03-16 19:24:23 +01:00
trinity-1686a 59bef598a3 replace IsolationMap with new Isolation trait 2022-03-16 19:24:23 +01:00
trinity-1686a cb00ac677b replace Arc with Box and use dyn-clone
this also removes JoinResult
2022-03-16 19:24:23 +01:00