aboutsummaryrefslogtreecommitdiff
path: root/crates/arti/src/cfg.rs
Commit message (Collapse)AuthorAgeFilesLines
* arti tests: Suppress a lint locallyIan Jackson2023-09-051-1/+2
| | | | | There's a complaint (seen in a CI build log) about over-eager iterator item cloning. This is a perf complaint and not very relevant in tests.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* arti::cfg tests: Use fold to make nightly clippy happierNick Mathewson2023-08-221-4/+5
|
* arti cfg tests: Add keystore to example config.Gabriela Moldovan2023-07-131-14/+2
| | | | Closes #939
* arti-client: Use the config struct from tor-keymgr.Gabriela Moldovan2023-07-131-1/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* arti: Add a `logging.time_granularity` option with 1s default.Nick Mathewson2023-07-061-0/+1
| | | | | | | This lets us provide less information in our logs: in particular, it lets us avoid logging with microsecond precision. Closes #551.
* arti cfg tests: Add declare_exceptions for storage.keystore_dir.Gabriela Moldovan2023-06-291-1/+22
| | | | | This moves `storage.keystore_dir` to a separate `declare_exceptions` block and explains why we have this exception.
* example-config: Temporarily remove keystore_dir example.Gabriela Moldovan2023-06-291-1/+1
| | | | | | Let's remove this until we figure out how the config should behave when the `keymgr` feature is disabled (should it accept or reject `keystore_dir = true`?)
* arti-client: Add keystore_dir to StorageConfig.Gabriela Moldovan2023-06-291-0/+1
|
* arti cfg tests: Suppress an undesriable clippy lintIan Jackson2023-06-281-0/+1
|
* arti cfg tests: declare_exceptions: Annotate the types for clarity (fmt)Ian Jackson2023-06-281-6/+4
|
* arti cfg tests: declare_exceptions: Annotate the types for clarityIan Jackson2023-06-281-1/+6
|
* arti cfg tests: Point the reader to the types used in declarationsIan Jackson2023-06-281-0/+12
|
* arti cfg tests: Move InCode into declare_config_exampleIan Jackson2023-06-281-19/+19
| | | | It's used for declarations only, and they should all be here.
* arti cfg tests: Make declare_exception take distinguished old/new typesIan Jackson2023-06-281-15/+27
| | | | | | As per discussion in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1320#note_2916689 and IRC followup.
* HS configuration: Add retry parameters to configurationIan Jackson2023-06-281-0/+2
| | | | | | | I think these should go in `[circuit_timing]`. That section already has some retry parameters, so is not strictly *timing*. This is not honoured yet.
* HS configuration: Add and honour `allow_onion_addrs` in configurationIan Jackson2023-06-281-0/+11
| | | | | | | We put this in `[address_filter]`. The interaction with the corresponding stream preference is a bit complicated. We must turn the stream pref into a `BoolOrAuto`.
* art cfg tests: Fix garbled doc wordinggabi-2502023-06-281-2/+2
|
* arti cfg tests: Fix doc commentgabi-2502023-06-281-1/+1
|
* arti cfg tests: Overhaul exception handling (fmt)Ian Jackson2023-06-281-36/+32
|
* arti cfg tests: Overhaul exception handlingIan Jackson2023-06-281-92/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was super confusing and fragile. Amongst the problems: * Information about exceptional config keys was spread across a number of places, manipulated in ad-hoc ways (conditional Vec appends, etc). * As a consequence, each exceptional table has confusing and unclear semantics. * It doesn't deal well with the way that cargo sometimes enables features for dependency crates even if arti itself wouldn't demand them; this can lead to sub-crates supporting config keys when the tests in arti don't expect them to, causing spurious test failures. Fix this: * Introduce a new, systematic, way of writing information about configuration keys that need some kind of special handling. * Use this new approach in *both* sets of "thorough" config tests. * Be more relaxed about deprecated keys. We don't want to tightly couple this to absence in the supported file, I think. * Understand more clearly the concept of keys of which we don't know, in the current build config, whether the code is expected to accept them. I have tested this locally with: for p in '-p arti' '--workspace'; do for f in '--no-default-features --features=tokio,native-tls' '--all-features' ''; do nailing-cargo test $p $f; done; done
* arti cfg tests: Remove a comment relating to work already doneIan Jackson2023-06-281-4/+0
| | | | | | We *do* have a thing that works like this. It's fragile and confusing and that's what I'm about to fix.
* arti cfg tests: Code motionIan Jackson2023-06-281-206/+214
| | | | | Bring the exciting tests together, and move some more normal tests out of the middle.
* Mark a builder as non-exhaustiveIan Jackson2023-06-281-0/+1
| | | | | | | If all the fields vanish, this generates a warning with cargo clippy --locked --offline --workspace --all-targets Fix that.
* RPC: Move the "listen" part of the RPC listener code to `arti`.Nick Mathewson2023-05-041-0/+44
| | | | | | | | | Now there's a module in `arti` that runs the loop for an RPC listener. The part of the old `listener` module that made the framed connections is now part of the `Session` object. There is now yet another a temporary location for the pipe; we should pick something better. At least now it's configurable.
* 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.
* arti: transports parsing: Record this as a ticketIan Jackson2022-11-301-4/+3
|
* arti, arti-client: Conditionalise various things on pt-clientIan Jackson2022-11-291-0/+1
|
* arti cfg tests: Add some more debug outputIan Jackson2022-11-291-0/+1
|
* bridge non-support: Test that we reject configsIan Jackson2022-11-211-4/+19
|
* bridge non-support: De-cfg the primary bridge config fieldsIan Jackson2022-11-211-3/+0
| | | | | | | | | | | | | | | | | | | | We now parse the `bridges.enabled` BoolOrAuto, and the `bridges.bridges` list. The `bridges.bridges` list is Vec<()> in the builder, and Vec<Void> in the built config. Ie, it is simply a count, and vanishes in the built config. But this count triggers us to try to call build(), to try to parse bridges, and to try to set and honour the enablement boolean. The result is that the type system now ensures that if bridges are disabled, but specified (either by listing them in the config, or writing `enabled=true`), we inevitably try to insist that we have a non-empty Vec<Void>, which is of course impossible. There will be a test case too for those who think this too abstract a way to guarantee this property :-).
* arti cfg test: Break out expect_err_contains functionIan Jackson2022-11-211-9/+15
| | | | | Maybe this will want to be in tor-error or something but put it here for now.
* bridge non-support: Disable the test for nowIan Jackson2022-11-211-0/+1
| | | | | | | | 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.
* Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-3/+3
| | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* pt config, arti cfg test: Expect bridges.transports to be missingIan Jackson2022-11-161-2/+9
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/823#note_2854365
* arti cfg test: Coalesce expect_missingIan Jackson2022-11-161-0/+22
| | | | | | If there are subkeys which are covered by also expected_missing superkeys, delete them, since we expect the superkey to be missing, so the subkey won't show up.
* arti cfg test: Document exhaustive_1 and comment exhaustiveIan Jackson2022-11-151-0/+39
|
* arti cfg test: Break out CONFIG_KEYS_EXPECT_NO_EXAMPLEIan Jackson2022-11-151-2/+9
| | | | Giving this a name will allow us to refer to it docs in a moment.
* arti cfg test: Drop a redundant allowIan Jackson2022-11-151-1/+0
| | | | | This allow is also present in the standard lint block at the start of the test inline module.
* Spelling fixes and normalizations on some high-level cratesNick Mathewson2022-11-071-3/+3
|
* Fix typosDimitris Apostolou2022-11-061-3/+3
|
* cfg tests: bridges: Document test case assumptionsIan Jackson2022-10-121-0/+19
|
* cfg tests: bridges: Remove now-redundant block { }Ian Jackson2022-10-121-13/+11
|
* cfg test: bridges: Test all three feature casesIan Jackson2022-10-121-4/+31
| | | | | | | | | | | | | This demonstrates that: * !bridge-client: uncommenting nondefault bridge config generates urecognized config key warnings (but the config is still accepted)( * bridge-client, !pt-client: uncommenting nondefault bridges generates error due to attempting to use a PT. If that's filtered out, everything is fine. * pt-client: Everything is good (as before).
* cfg tests: bridges: Prepare for more comprehensive testingIan Jackson2022-10-121-8/+20
| | | | | | | | | | | | | * Introduce filter_examples and resolve_examples helpers, which will become more complex in a moment. * Move the API test into a { } block to minimise subsequent diff. It's going to become conditional. * In subsequent comparisons, use the parsed version, since the API built one might not exist. No overall functional change.
* cfg tests: Make ExampleSectionLines::resolve fallibleIan Jackson2022-10-121-5/+5
|
* Fix comment typo.Nick Mathewson2022-10-121-1/+1
|
* bridges: Test configurationIan Jackson2022-10-121-0/+121
|
* pt and bridges: Parse configurationIan Jackson2022-10-121-3/+1
|