summaryrefslogtreecommitdiff
path: root/crates/tor-linkspec/src
Commit message (Collapse)AuthorAgeFilesLines
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* linkspec: cleanup usage; change std::fmt to fmt.Nick Mathewson2023-06-121-6/+6
|
* RelayId: Display the ID type on redacted identities.Nick Mathewson2023-06-092-4/+3
| | | | | Formerly we would display just the first characters of the identity, without telling you what kind of ID it was.
* linkspec: implement Display/Redacted on RelayIdsNick Mathewson2023-06-091-0/+22
|
* linkspec: Implement HasRelayIds::display_relay_ids().Nick Mathewson2023-06-091-6/+49
|
* linkspec::verbatim: wrapper to give a CircTarget a new set of LinkSpecsNick Mathewson2023-05-112-0/+111
|
* Add linkspec::decode to convert linkspecs to an OwnedChanTargetNick Mathewson2023-05-112-0/+186
| | | | | | | Relays and onion service services/clients will both need this. I'm marking this experimental for now; we should stabilize it before we release onion services.
* Change CircTarget::linkspecs() to return an encoded list.Nick Mathewson2023-05-102-4/+15
| | | | | | | | If we didn't do this, we would need to transfrom `EncodedLinkSpec`s into a `LinkSpec::Unrecognized`, which is not semantically right. What's more, every user of this API wants to consume encoded link specifiers, so encoding them early saves a little effort.
* linkspec: Make LinkSpecType public.Nick Mathewson2023-05-102-31/+39
| | | | | This lets us check the type of an `EncodedLinkSpec` as well, and lets us remove an interface that took a raw u8.
* linkspec: define conversion functions for EncodedLinkSpecNick Mathewson2023-05-101-48/+79
| | | | | | This commit adds functions to convert between LinkSpec and EncodedLinkSpec, and refactors their read/write implementations a bit to avoid code duplication.
* Rename UnparsedLinkSpec => EncodedLinkSpecNick Mathewson2023-05-102-13/+13
|
* test_linkspecs: tidy order of linkspecsNick Mathewson2023-05-101-11/+11
| | | | This is pure code movement.
* Move responsibility for linkspec sorting to CircTarget.Nick Mathewson2023-05-101-2/+13
| | | | | | This change is necessary so that we can build Extend2 messages that have their LinkSpecs appear in a verbatim order as provided in an INTRODUCE2 message or in a HS descriptor.
* 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
|