summaryrefslogtreecommitdiff
path: root/crates/tor-linkspec/src
Commit message (Collapse)AuthorAgeFilesLines
* RelayId: implement id_type and as_bytes in terms of RelayIdRefIan Jackson2023-04-271-8/+2
| | | | This eliminates some duplicated code.
* RelayIdRef: as_bytes: Doesn't borrow from selfIan Jackson2023-04-271-1/+1
| | | | | | | This borrows from the contained key, but not from self. This will allow us to implement RelayId::as_bytes in terms of RelayIdRef::as_bytes.
* RelayId: impl Display in terms of RelayIdRefIan Jackson2023-04-271-3/+9
| | | | This removes a duplicated copy of the format strings.
* linkspec: Add a missing ; in tests.Nick Mathewson2023-04-061-1/+1
|
* tor-linkspec: Add a constructor for UnparsedLinkSpecNick Mathewson2023-03-061-0/+10
|
* tor-linkspec: New UnparsedLinkspec type.Nick Mathewson2023-02-172-1/+81
| | | | | | | | | | Unlike linkspec, this doesn't validate the actual contents of the specifiers. We'll use this so we can handle the linkspec list for an introduction point in an HsDesc, and just pass it on when constructing our circuits. I haven't added any accessor or constructor functions, because I don't expect to need them.
* tor-linkspec: LinkSpec parsing: use read_nested_u8len (fmt)Ian Jackson2023-02-061-13/+15
|
* tor-linkspec: LinkSpec parsing: use read_nested_u8lenIan Jackson2023-02-061-21/+5
| | | | This eliminates hardcoded length values.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-277-0/+7
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Merge branch 'ya-lint' into 'main'eta2023-01-061-1/+4
|\ | | | | | | | | tor-linkspec: Fix an unused lint See merge request tpo/core/arti!935
| * tor-linkspec: Fix an unused lintIan Jackson2022-12-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise: cargo +stable clippy -p tor-proto --all-features --all-targets Produces: warning: unused import: `PtTargetAddr` --> crates/tor-linkspec/src/traits.rs:9:28 | 9 | use crate::{ChannelMethod, PtTargetAddr, RelayIdRef, RelayIdType, RelayIdTypeIter}; | ^^^^^^^^^^^^
* | test lint blocks: Add many many automaticallyIan Jackson2022-12-126-0/+48
|/ | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* bridge config: Rename accessorsIan Jackson2022-11-301-2/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858480
* BridgeAddr tests: dedupe slightlyIan Jackson2022-11-301-12/+11
|
* Separate BridgeAddr and PtTargetAddrIan Jackson2022-11-303-38/+212
| | | | | | | | | 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.
* Merge branch 'more-linkspec-tests' into 'main'Nick Mathewson2022-11-293-15/+159
|\ | | | | | | | | Add tests for a bunch of code in tor-linkspec See merge request tpo/core/arti!867
| * Fix up compatibility issues between linkspec tests and other patchesNick Mathewson2022-11-281-5/+5
| |
| * linkspec: Add some tests for ChannelMethodNick Mathewson2022-11-281-0/+84
| |
| * linkspec: Tests for PtTargetSettingsNick Mathewson2022-11-281-0/+46
| |
| * PtTransportName: Remove unused accessors.Nick Mathewson2022-11-281-13/+0
| |
| * linkspec: Add tests for has_any_identity.Nick Mathewson2022-11-281-0/+7
| |
| * linkspec: Add test for lookup on no-ids.Nick Mathewson2022-11-281-0/+1
| |
| * Add a test for ByRelayIds::remove_by_all_idsNick Mathewson2022-11-281-2/+21
| |
* | Remove deprecated aliases in tor-linkspec.Nick Mathewson2022-11-292-10/+2
| |
* | Add a default debug_redacted impl to save space.Nick Mathewson2022-11-281-4/+0
| |
* | linkspec: Give a Redacted form for chantarget.Nick Mathewson2022-11-284-6/+83
|/
* Make ChannelMethod non-exhaustiveIan Jackson2022-11-241-1/+1
| | | | | | | | | 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.
* tor-linkspec: Provide LoggedChanTarget type alias and utility methodIan Jackson2022-11-232-2/+13
| | | | | This makes it easy to talk about, and construct, a BoxSensitive<OwnedChanTarget>, which is what we'll use in errors.
* TransportId: Fix test case for no pt-targetIan Jackson2022-11-221-16/+19
| | | | | | | | | | | Fixes cargo +stable clippy --manifest-path=/home/ian/Rustup/Arti/arti/Cargo.toml --locked --target-dir=target --offline -p tor-linkspec --no-default-features --all-targets giving 446 | .method(ChannelMethod::Pluggable(PtTarget::new( | ^^^^^^^^^ variant or associated item not found in `transport::ChannelMethod`
* TransportId: Parse "bridge" as builtin transportIan Jackson2022-11-221-3/+8
| | | | | This will allow transport="bridge" in bridge configurations, etc. Doing it at this layer means it will be recognised everywhere.
* TransportId: Provide new_builtin and new_pluggableIan Jackson2022-11-221-0/+15
| | | | | I think normal Rustic practice is to provide a real constructor as well as just `Default`.
* TransportId: Provide name accessor and deconstructorIan Jackson2022-11-221-0/+26
| | | | | We are maintaining the notion that at some point this thing might grow additional variants.
* TransportId: Document and change string repr for builtinIan Jackson2022-11-221-6/+16
| | | | | | * Change the Display of builtin to "-" * Parse "" and "-" as builtin, as well as "<none>" * Document this
* TransportId: Add test case for builtin Display reprIan Jackson2022-11-221-0/+2
|
* BridgeAddr rename from PtTargetAddr: Update in tor-linkspecIan Jackson2022-11-212-29/+37
| | | | | | | | | | | | | | 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
* tor-linkspec: Provide deconstructors for PtTargetSettings and PtTargetIan Jackson2022-11-211-0/+10
|
* Fix a missing import in tests.Nick Mathewson2022-11-181-1/+1
| | | | I'm not sure why the CI didn't reject this the first time around.
* Merge branch 'refactor_into_ownedchantarget' into 'main'Nick Mathewson2022-11-183-9/+21
|\ | | | | | | | | CircMgr: Refactor DirSpecificTarget constructor See merge request tpo/core/arti!866
| * CircMgr: Refactor DirSpecificTarget constructorNick Mathewson2022-11-183-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | 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)
* | Remove impl Display for OwnedCircTargetNick Mathewson2022-11-171-7/+0
| | | | | | | | | | Nothing used this; if anything wants it, it would be better off calling `.display_chan_target()`.
* | ChanTarget: Add a display function, with better output.Nick Mathewson2022-11-172-13/+80
|/ | | | | | | | | | This change lets us display a ChanTarget's members without first cloning them into an OwnedChanTarget. It also resolves a reliability issue by outputting better info when talking about connections via pluggable transports. Closes #647
* Allow a subset-only ChanMethod match when looking up a BridgeConfigNick Mathewson2022-11-151-0/+15
| | | | | | | | | If we have a bridge guard that is using Direct connection and it knows multiple addresses, our code to match it with a BridgeConfig is wrong, because the BridgeConfig has only one address, and our code looks for an exact match. Fixes #642.
* Remove allow() for a false-positive warn on Rust 1.56.Nick Mathewson2022-11-101-3/+0
|
* linkspec: Rename "maybe rename this?" TODOs in favor of #623Nick Mathewson2022-11-072-5/+0
|
* PtTargetSettings: Enforce correctness at lower level.Nick Mathewson2022-11-071-19/+49
| | | | This resolves a number of TODOs.
* Remove a blank lineNick Mathewson2022-11-071-1/+0
|
* Downgrade TODO on chan_methodNick Mathewson2022-11-071-1/+1
| | | | | This is not something we need to solve for 1.1.0 (and it might not need to be solved ever).
* Remove TODO about third ChannelMethod variant.Nick Mathewson2022-11-071-2/+0
| | | | We didn't find a use for this.
* Remove TODO about inlining PtTargetSettings.Nick Mathewson2022-11-071-7/+0
| | | | | Since there are (or soon will be) parsing restrictions on this type, we don't want to inline it as a simple Vec.