summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-guardmgr: Make some vanguard test helpers public (fmt).Gabriela Moldovan2024-06-201-10/+5
|
* tor-guardmgr: Make some vanguard test helpers public.Gabriela Moldovan2024-06-201-50/+67
| | | | | | We will soon need these helpers outside of `tor-guardmgr` too. This commit is mainly code motion.
* tor-guardmgr: Add test for vanguards state file deserialization.Gabriela Moldovan2024-06-031-2/+104
| | | | This checks that we can read `vanguards.json` state files.
* tor-config: Apply deferred cargo fmt.Gabriela Moldovan2024-06-031-1/+1
|
* tor-config: Add macro for implementing NotAutoValue.Gabriela Moldovan2024-06-031-2/+2
|
* tor-config: Add NotAutoValue trait bound to ExplicitOrAuto inner type.Gabriela Moldovan2024-06-031-1/+3
| | | | | | | This is a safeguard to prevent users from using ExplicitOrAuto with types that serialize to the same value as ExplicitOrAuto::Auto. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2146#note_3030692
* tor-guardmgr: Replace From impl with VanguardConfig::mode accessor.Gabriela Moldovan2024-06-032-10/+11
|
* tor-guardmgr: Fix broken doc link.Gabriela Moldovan2024-06-031-1/+1
|
* tor-guardmgr: Use ExplicitOrAuto in the VanguardConfig (fmt).Gabriela Moldovan2024-06-031-2/+8
|
* tor-guardmgr: Use ExplicitOrAuto in the VanguardConfigGabriela Moldovan2024-06-032-7/+18
|
* tor-guardmgr: Unconditionally define VanguardConfig.Gabriela Moldovan2024-06-033-17/+17
| | | | | | | | | We want to export the `VanguardConfig` even if the `vanguards` feature is disabled (we will need to unconditionally include it in the arti config). Note that if `vanguards` are disabled, the `VanguardMode` from the `VanguardConfig` can only be `Dsiabled`.
* tor-guardmgr: Map NoSuitableRelay errors to ErrorKind::NoPath.Gabriela Moldovan2024-05-091-2/+1
|
* tor-guardmgr: Add an error variant for when the vanguard mode is unsuitable.Gabriela Moldovan2024-05-092-8/+25
|
* tor-guardmgr: Return a BootstrapRequired error if all the sets are empty (fmt).Gabriela Moldovan2024-05-091-1/+6
|
* tor-guardmgr: Return a BootstrapRequired error if all the sets are empty.Gabriela Moldovan2024-05-092-14/+27
| | | | | | | | | Previously, `select_vanguard` returned a `NoSuitableRelay` error if it was unable to select a relay to use as a vanguard. We now distunguish the "there are no suitable relays in the vanguard sets" (`NoSuitableRelays`) error case from the "our vanguard sets are empty" (`BootstrapRequired`) one.
* tor-guardmgr: Fix typo in documentation.Gabriela Moldovan2024-05-091-1/+1
|
* tor-guardmgr: Add a BootstrapRequired error for VanguardMgr.Gabriela Moldovan2024-05-091-0/+9
|
* tor-guardmgr: Move VanguardMgrError to a separate module.Gabriela Moldovan2024-05-092-40/+50
| | | | | This is about to grow another variant, so I'm moving it to a dedicated `err` module.
* tor-guardmgr: Remove a nonsensical TODO.Gabriela Moldovan2024-05-091-1/+0
| | | | | | The `match` below it is fine, there's no need to rewrite it. (I think this TODO is actually dupe of the the TODO above it).
* tor-guardmgr: Remove TODO about removing Vanguard abstraction.Gabriela Moldovan2024-05-091-3/+0
| | | | | I think it's alright to keep it: it gives us the flexibility to extend it later on, if needed.
* tor-guardmgr: Remove unnecessary clippy allow.Gabriela Moldovan2024-05-091-1/+0
|
* tor-guardmgr: Remove a TODO HS-VANGUARDS.Gabriela Moldovan2024-05-091-3/+0
| | | | | | This TODO doesn't really need to be implemented: we can test the `VanguardMgr` just the same without it (`GuardMgrInner` is similar, in that it doesn't mock the rng).
* tor-guardmgr: Remove dead_code allow.Gabriela Moldovan2024-05-091-1/+0
|
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Resolve some clippy warnings about empty rustdoc.Nick Mathewson2024-05-051-3/+1
| | | | | (In most cases, by writing the documentation; in tests, by permitting the documentation to be missing.)
* tor-guardmgr: Make remove_unlisted return the number of unlisted vanguards.Gabriela Moldovan2024-04-301-2/+4
| | | | For symmetry with remove_expired.
* tor-guardmgr: Make remove_expired return the number of expired vanguards.Gabriela Moldovan2024-04-302-20/+25
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2109#note_3024672
* tor-guardmgr: Prevent misleading logs when not rotating vanguards.Gabriela Moldovan2024-04-292-2/+15
| | | | | `rotate_expired()` now only logs that it is rotating the vanguards if some existing vanguards have actually expired.
* tor-guardmgr: Make a vanguard log message more accurate.Gabriela Moldovan2024-04-291-1/+1
| | | | | We flush every time the vanguards may have changed, but we don't know for sure if they did.
* tor-guardmgr: Add a TODO about using the vanguard consensus params.Gabriela Moldovan2024-04-291-0/+3
|
* tor-guardmgr: Make the VanguardMgr tests pass again.Gabriela Moldovan2024-04-291-14/+29
| | | | | The tests need to be updated now that the `VanguardMode` is read from the config rather than the consensus.
* tor-guardmgr: Temporarily reintroduce VanguardConfig.Gabriela Moldovan2024-04-291-35/+66
| | | | | | | | | | | | | | As discussed on #tor-dev, I'm reintroducing `VanguardConfig` for now. The `VanguardConfig` specifies what mode (full/lite/disabled) the `VanguardMgr` should run in. We currently don't have a separate modes for HS clients and HS services. We shouldn't actually *need* a `VanguardConfig` at all, so this is just a (hopefully!) short- or medium-term fix until we sort out #1382 (which might involve making breaking changes to our `reconfigure()` APIs). Closes #1272
* tor-guardmgr: Remove old TODO about making VanguardMode a VanguardParam.Gabriela Moldovan2024-04-291-3/+0
| | | | | | | | | `VanguardParams` already contains the `vanguards_enabled` and `vanguards_hs_service` `VanguardMode` params. We still intend to abolish `VanguardConfig` in favour of deriving the `VanguardMode` from the consensus params (#1382), but this is not the right place for such a TODO.
* tor-guardmgr: Remove unnecessary clippy allows.Gabriela Moldovan2024-04-293-6/+0
| | | | None of these should be unused anymore.
* tor-guardmgr: Remove unnecessary VanguardSetsTrackedMut contraption (fmt).Gabriela Moldovan2024-04-221-1/+2
|
* tor-guardmgr: Remove unnecessary VanguardSetsTrackedMut contraption.Gabriela Moldovan2024-04-222-177/+25
| | | | | | | | The VanguardMgr now unconditionally flushes the vanguard sets to disk each time there's a consensus change, and every time a vanguard expires. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2090#note_3021013
* tor-guardmgr: Remove pick_{l2,l3}_relay, add l2(), l3() accessors (fmt).Gabriela Moldovan2024-04-221-20/+19
|
* tor-guardmgr: Remove pick_{l2,l3}_relay, add l2(), l3() accessors.Gabriela Moldovan2024-04-222-27/+14
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2090#note_3021016
* tor-guardmgr: Make vanguard logs begin with an uppercase letter for consistency.Gabriela Moldovan2024-04-222-4/+4
| | | | | Our log messages begin with an uppercase letter in the rest of the code base.
* tor-guardmgr: Add logging around vanguard rotation.Gabriela Moldovan2024-04-222-3/+21
|
* tor-guardmgr: Add a TODO about rethinking vanguard flushing.Gabriela Moldovan2024-04-221-0/+14
|
* tor-guardmgr: Rename VanguardMgr::handle_netdir_update for clarity (fmt).Gabriela Moldovan2024-04-221-2/+1
|
* tor-guardmgr: Rename VanguardMgr::handle_netdir_update for clarity.Gabriela Moldovan2024-04-221-9/+6
|
* tor-guardmgr: Test that vanguards are written to persistent storage.Gabriela Moldovan2024-04-221-1/+137
|
* tor-guardmgr: Derive PartialEq for VanguardSets.Gabriela Moldovan2024-04-221-3/+3
| | | | This will be useful for testing.
* tor-guardmgr: Fix vanguard doc links.Gabriela Moldovan2024-04-221-4/+4
| | | | The referenced types are no longer available in `vanguards.rs`.
* tor-guardmgr: Select an L3 vanguard in a vanguard test.Gabriela Moldovan2024-04-221-4/+3
|
* tor-guardmgr: Allow running VanguardMgr in "service mode" in the tests.Gabriela Moldovan2024-04-221-7/+7
| | | | We will soon use this to test full vanguards.
* tor-guardmgr: Make VanguardSet private.Gabriela Moldovan2024-04-221-18/+10
| | | | | | This doesn't need to be `pub(super)` anymore, `VanguardMgr` now manipulates the `VanguardSets` exclusively through `VanguardSetsTrackedMut`.
* tor-guardmgr: Load the vanguards from disk on startup.Gabriela Moldovan2024-04-221-7/+26
| | | | | | The `VanguardMgr` reads the vanguards from the vanguards state file, whether full vanguards are enabled or not. It only persists the vanguard sets to storage if full vanguards are in use.