summaryrefslogtreecommitdiff
path: root/crates/tor-linkspec
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'factory_redux' into 'main'Nick Mathewson2022-10-131-0/+33
|\ | | | | | | | | chanmgr: Build and use chanmgr factory APIs See merge request tpo/core/arti!769
| * Add several accessors to ChannelMethod.Nick Mathewson2022-10-121-0/+33
| | | | | | | | | | | | * Get `TransportId` * Get the target address (of any type) * Ask, "is this a direct connection"?
* | cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | | | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* | Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-55/+1
|/ | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Fix a warning that I reintroduced.Nick Mathewson2022-10-111-0/+1
| | | | | It looks like this got fixed, but my branch for !759 reintroduced it by refactoring.
* Change multiplicity of ChannelMethod and addressesNick Mathewson2022-10-114-34/+35
| | | | | | | Now each `ChanTarget` has at most one `ChannelMethod`, and only `Direct` `ChannelMethods` can have multiple addresses. Closes #600.
* Allow two useless pattern matches that are going to be not uselessIan Jackson2022-10-111-0/+1
|
* Clarify limits on socket address from ChannelMethodNick Mathewson2022-10-061-2/+8
|
* Move two users of HasAddrs to HasChannelMethodsNick Mathewson2022-10-061-2/+4
| | | | All the other users of HasAddrs are correct.
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-061-56/+21
| | | | These are now builders.
* ChannelMethod: Add method to access the (optional) SocketAddrNick Mathewson2022-10-061-0/+18
|
* Add builders for OwnedChanTarget/OwnedCircTargetNick Mathewson2022-10-063-13/+63
| | | | | This will become the preferred way to make one of these objects, and insulate us against future API changes.
* Begin revising HasAddr and its relationship to ChanTargetNick Mathewson2022-10-064-15/+62
| | | | | | | | | | | | | | | | | | | HasAddr used to mean "Here are addresses that I have, at which I can be contacted." But "Where (and how) can I be contacted?" is now a question for HasChannelMethod to answer. (We still need to have "HasAddr", though, so we can answer things like "what country is this relay in" and "are these relays in the same /8?") So this commit introduces: * A new trait for adding an implementation of HasChannelMethod in terms of HasAddr. * A requirement on ChanTarget that it needs to implement HasChannelMethod. There is some temporary breakage here, marked with "TODO pt-client", that I'll fix later in this branch.
* tor-linkspec: ByRelayIds<> type to hold a set of HasRelayIdsNick Mathewson2022-10-045-1/+68
| | | | | This is based on the type generated with n_key_set, with a couple of extra methods to take advantage of RelayId and RelayIdRef.
* Merge branch 'bridge-parse' into 'main'Ian Jackson2022-10-032-10/+83
|\ | | | | | | | | Parse (and format) bridge lines See merge request tpo/core/arti!745
| * pt: transport ID error: Fix style to remove full stopIan Jackson2022-10-031-1/+1
| |
| * pt: Check PT key=value syntaxIan Jackson2022-10-031-2/+27
| | | | | | | | | | This is not perfect but it at least ensures that our own parsing and printing code works correctly with all the values we accept.
| * pt: Make PtTarget::push_setting fallible, and take IntoIan Jackson2022-10-032-3/+19
| | | | | | | | | | | | It has its own error type PtTargetInvalidSetting. In check_doc_features, adjust suppression to new code.
| * pt: PtTransportAddr: change None string to "-"Ian Jackson2022-10-031-2/+2
| | | | | | | | | | This is going to appear in config files etc. We don't want the user to have to type "<none>" in a bridge line.
| * pt: Provide accessors for PtTargetIan Jackson2022-09-301-1/+15
| |
| * pt: Make some more types EqIan Jackson2022-09-301-3/+3
| | | | | | | | I wanted this for testing. I think it's reasonable to promise this.
| * pt: Provide constructors for PtTargetIan Jackson2022-09-301-5/+23
| | | | | | | | | | | | | | | | Make PtTargetSettings be Default. No longer wrap it in Arc. We want to be able to update it here during construction. If we want to save memory with copies of the same bridge line, we should do this for the whole Bridge I think.
* | Remove semver.md files now that arti 1.0.1 is out.Nick Mathewson2022-10-031-1/+0
| |
* | Bump crates that have had backward compatible API changes.Nick Mathewson2022-10-031-2/+2
| |
* | Update README.md files.Nick Mathewson2022-09-301-0/+18
|/
* Mark all bridge and pt features as experimental for now.Nick Mathewson2022-09-292-0/+20
| | | | | | Also, document the features. Closes #588.
* pt: Reject a pluggable transport named BridgeIan Jackson2022-09-271-0/+5
| | | | https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/91
* Remove docsrs thing which is in wrong place?Ian Jackson2022-09-271-1/+0
|
* pt: Try to fix docsrs problemIan Jackson2022-09-271-0/+1
|
* pt: Use PtTransportName in PtTargetIan Jackson2022-09-271-1/+1
|
* pt: Use PtTransportName in TransportIdIan Jackson2022-09-271-2/+2
|
* pt: PtTransportName: Provide TryFrom, into_inner, AsRefIan Jackson2022-09-271-4/+27
| | | | This seems a minimal API for such a thing.
* pt: tor-linkspec: Shorten some names with useIan Jackson2022-09-271-12/+17
| | | | This repetition was getting repetitive.
* pt: Introduce PtTransportNameIan Jackson2022-09-272-5/+33
| | | | | The config parsing wants this. Also there are some anomalies in the types here that ought to be tidied up.
* Add a few comments based on review.Nick Mathewson2022-09-231-0/+8
|
* Clarify and combine PtTargetAddr constructors.Nick Mathewson2022-09-231-16/+23
|
* Rename various Transport* types to Pt*.Nick Mathewson2022-09-232-43/+42
| | | | | This clarifies that the types apply to pluggable transports only, and not (typically) to the default plain-old-TCP transport.
* Clarify note on "none" transport ID.Ian Jackson2022-09-231-0/+3
|
* Add a HasChanMethods trait, with a bunch of open TODO questions.Nick Mathewson2022-09-233-2/+24
| | | | We'll need to sort these out as we implement pluggable transports.
* New data types to describe transport targets.Nick Mathewson2022-09-232-1/+54
| | | | | I've tried to name and structure these for consistency, and comment reasonably well. We'll still probably want to make changes.
* Add TransportTargetAddr as the target address for a PT-using channelNick Mathewson2022-09-232-1/+118
| | | | | | As with `TransportId`, this type only gets complicated when `pt-client` is enabled: it's meant to stay simple for relays and non-PT-using clients.
* Create an API for TransportIdNick Mathewson2022-09-234-0/+168
|
* Remove semver.md from arti-1.0.0Nick Mathewson2022-09-071-2/+0
|
* Bump crate versions in preparation for Arti 1.0.0 release.Nick Mathewson2022-09-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we want to work more on ensuring that our semver stability story is solid, we are _not_ bumping arti-client to 1.0.0 right now. Here are the bumps we _are_ doing. Crates with "minor" bumps have had API breaks; crates with "patch" bumps have had new APIs added. Note that `tor-congestion` is not bumped here: it's a new crate, and hasn't been published before. ``` tor-basic-utils minor fs-mistrust minor tor-config minor tor-rtcompat minor tor-rtmock minor tor-llcrypto patch tor-bytes patch tor-linkspec minor tor-cell minor tor-proto minor tor-netdoc patch tor-netdir minor tor-persist patch tor-chanmgr minor tor-guardmgr minor tor-circmgr minor tor-dirmgr minor arti-client minor arti-hyper minor arti major arti-bench minor arti-testing minor ```
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-242-0/+4
|
* tor-netdir: Add a static assertion about RelayIdType::COUNTNick Mathewson2022-08-101-1/+16
| | | | | | | Doing this will make sure that we fix a correctness issue in netdir that will be caused if we add more IDs. (Also add RelayIdType::COUNT in tor-linkspec.)
* Implement `Into<RelayIdRef>` for `&RelayId`.Nick Mathewson2022-08-101-0/+6
| | | | | This will let us use `&RelayId` in all the places that take `Into<RelayIdRef>`.
* Final (?) API revisions for tor-linkspecNick Mathewson2022-08-104-66/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, each individual identity type becomes optional. The functions that expose them unconditionally are now in a "legacy" trait that only some downstream types are expected to implement. There are new convenience APIs in HasRelayIds: * to return Option<&keytype>, * to see if one identity-set contains another. This commit will break several downstream crates! For the reviewer's convenience, I will put the fixes for those crates into a series of squash! commits on this one. tor-netdir ---------- Revise tor-netdir to accept optional identities. This required some caveats and workarounds about the cases where we have to deal with a key type that the tor-netdir code does not currently recognize at all. If we start to add more identity types in the future, we may well want more internal indices in this code. tor-proto --------- In order to make tor-proto support optional identities, there were fewer changes than I thought. Some "check" functions needed to start looking at "all the ids we want" rather than at "the two known IDs"; they also needed to accommodate that case where we don't have an ID that we demand. This change will also help with bridges, since we want to be able to connect to a bridge without knowing all of its IDs up front. The protocol currently _requires_ the two current ID types in some places. To deal with that, I added a new `MissingId` error. I also removed a couple of unconditional identity accessors for chanmgr; code should use `target().identity(...)` instead. tor-chanmgr ----------- This is an incomplete conversion: it does not at all handle channel targets without Ed25519 identities yet. It still uses those identities to index its internal map from identity to channel; but it gives a new `MissingId` error type if it's given a channel target that doesn't have one. We'll want to revise the map type again down the road when we implement bridges, but I'd rather not step on the channel-padding work in progress right now. tor-guardmgr ------------ This change is mostly a matter of constructing owned identity types more sensibly, rather than unwrapping them directly. There are some places marked with TODOs where we still depend on particular identity types, because of how the directory protocol works. This will need revisiting when we add bridge support here. tor-circmgr ----------- These changes are just relatively simple API changes in the tests.
* linkspec: Add more accessors (some internal) for ids.Nick Mathewson2022-08-101-0/+68
| | | | These will all be used shortly.
* Remove get_ed_identity_key as unused.Nick Mathewson2022-08-101-23/+0
|