Commit 0b491148 authored by Ian Jackson's avatar Ian Jackson
Browse files

Remove arti-hyper

This has been obsolete for a very long time.

We have already published a version with a "won't be updated" warning.
parent 0926eb04
Loading
Loading
Loading
Loading
+17 −199
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ dependencies = [
 "fs-mistrust",
 "futures",
 "hickory-proto",
 "humantime 2.1.0",
 "humantime",
 "humantime-serde",
 "itertools 0.13.0",
 "libc",
@@ -277,7 +277,7 @@ dependencies = [
 "fs-mistrust",
 "futures",
 "hostname-validator",
 "humantime 2.1.0",
 "humantime",
 "humantime-serde",
 "libc",
 "once_cell",
@@ -322,25 +322,6 @@ dependencies = [
name = "arti-config"
version = "0.17.0"

[[package]]
name = "arti-hyper"
version = "0.19.0"
dependencies = [
 "anyhow",
 "arti-client",
 "educe",
 "hyper 0.14.29",
 "pin-project",
 "thiserror",
 "tls-api",
 "tls-api-native-tls",
 "tls-api-openssl",
 "tokio",
 "tor-error",
 "tor-rtcompat",
 "tracing-subscriber",
]

[[package]]
name = "arti-relay"
version = "0.18.0"
@@ -704,17 +685,6 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"

[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
 "hermit-abi 0.1.19",
 "libc",
 "winapi",
]

[[package]]
name = "autocfg"
version = "1.3.0"
@@ -797,12 +767,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1ce0365f4d5fb6646220bb52fe547afd51796d90f914d4063cb0b032ebee088"

[[package]]
name = "base64"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"

[[package]]
name = "base64"
version = "0.22.1"
@@ -1622,19 +1586,6 @@ dependencies = [
 "syn 2.0.68",
]

[[package]]
name = "env_logger"
version = "0.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38"
dependencies = [
 "atty",
 "humantime 1.3.0",
 "log",
 "regex",
 "termcolor",
]

[[package]]
name = "equivalent"
version = "1.0.1"
@@ -2208,15 +2159,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"

[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
 "libc",
]

[[package]]
name = "hermit-abi"
version = "0.3.9"
@@ -2357,15 +2299,6 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"

[[package]]
name = "humantime"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
dependencies = [
 "quick-error",
]

[[package]]
name = "humantime"
version = "2.1.0"
@@ -2378,7 +2311,7 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c"
dependencies = [
 "humantime 2.1.0",
 "humantime",
 "serde",
]

@@ -3267,17 +3200,6 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"

[[package]]
name = "pem"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb"
dependencies = [
 "base64 0.13.1",
 "once_cell",
 "regex",
]

[[package]]
name = "pem-rfc7468"
version = "0.7.0"
@@ -3577,12 +3499,6 @@ dependencies = [
 "thiserror",
]

[[package]]
name = "quick-error"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"

[[package]]
name = "quote"
version = "1.0.36"
@@ -4172,7 +4088,7 @@ version = "3.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20"
dependencies = [
 "base64 0.22.1",
 "base64",
 "chrono",
 "hex",
 "indexmap 1.9.3",
@@ -4589,15 +4505,6 @@ dependencies = [
 "windows-sys 0.52.0",
]

[[package]]
name = "termcolor"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
dependencies = [
 "winapi-util",
]

[[package]]
name = "terminal_size"
version = "0.3.0"
@@ -4608,17 +4515,6 @@ dependencies = [
 "windows-sys 0.48.0",
]

[[package]]
name = "test-cert-gen"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "345f92b7cac59507cdaba298c5493f7c40e2063d31f6fc621105183344d5d50a"
dependencies = [
 "once_cell",
 "pem",
 "tempfile",
]

[[package]]
name = "test-temp-dir"
version = "0.2.2"
@@ -4723,68 +4619,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"

[[package]]
name = "tls-api"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66d1b3dfb0a60da3e8a130c9f2432063d9979928a05c2b2cdcfc9fd05e4f53a3"
dependencies = [
 "anyhow",
 "log",
 "pem",
 "tempfile",
 "thiserror",
 "tokio",
 "void",
 "webpki",
]

[[package]]
name = "tls-api-native-tls"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b935bda2458120a5d2cea542013796fcf13937566580027f6a08f42a52206f7"
dependencies = [
 "anyhow",
 "native-tls",
 "thiserror",
 "tls-api",
 "tls-api-test",
 "tokio",
]

[[package]]
name = "tls-api-openssl"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82155f245c99a3b652627f32abeacd4eae9e0fec996c1090df121e01379d28f3"
dependencies = [
 "anyhow",
 "openssl",
 "openssl-sys",
 "thiserror",
 "tls-api",
 "tls-api-test",
 "tokio",
]

[[package]]
name = "tls-api-test"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9df107843d725428d76bb159040fbae6d1524dcf25d5b24c56daa6b37ce9dbb5"
dependencies = [
 "anyhow",
 "env_logger",
 "log",
 "pem",
 "test-cert-gen",
 "tls-api",
 "tokio",
 "untrusted 0.6.2",
 "webpki",
]

[[package]]
name = "tokio"
version = "1.38.0"
@@ -4996,7 +4830,7 @@ dependencies = [
 "derive_more",
 "digest",
 "hex-literal",
 "humantime 2.1.0",
 "humantime",
 "rand",
 "thiserror",
 "tor-bytes",
@@ -5043,7 +4877,7 @@ dependencies = [
name = "tor-checkable"
version = "0.19.0"
dependencies = [
 "humantime 2.1.0",
 "humantime",
 "signature",
 "thiserror",
 "tor-llcrypto",
@@ -5198,7 +5032,7 @@ dependencies = [
 "futures",
 "hex",
 "hex-literal",
 "humantime 2.1.0",
 "humantime",
 "humantime-serde",
 "itertools 0.13.0",
 "memmap2 0.9.4",
@@ -5292,7 +5126,7 @@ dependencies = [
 "float_eq",
 "fs-mistrust",
 "futures",
 "humantime 2.1.0",
 "humantime",
 "humantime-serde",
 "itertools 0.13.0",
 "num_enum",
@@ -5334,7 +5168,7 @@ dependencies = [
 "educe",
 "either",
 "futures",
 "humantime 2.1.0",
 "humantime",
 "itertools 0.13.0",
 "postage",
 "rand",
@@ -5379,7 +5213,7 @@ dependencies = [
 "digest",
 "hex",
 "hex-literal",
 "humantime 2.1.0",
 "humantime",
 "itertools 0.13.0",
 "paste",
 "rand",
@@ -5450,7 +5284,7 @@ dependencies = [
 "futures",
 "growable-bloom-filter",
 "hex",
 "humantime 2.1.0",
 "humantime",
 "itertools 0.13.0",
 "k12",
 "libc",
@@ -5509,7 +5343,7 @@ dependencies = [
 "dyn-clone",
 "fs-mistrust",
 "glob-match",
 "humantime 2.1.0",
 "humantime",
 "inventory",
 "itertools 0.13.0",
 "rand",
@@ -5595,7 +5429,7 @@ name = "tor-log-ratelim"
version = "0.19.0"
dependencies = [
 "futures",
 "humantime 2.1.0",
 "humantime",
 "once_cell",
 "thiserror",
 "tor-error",
@@ -5641,7 +5475,7 @@ dependencies = [
 "futures",
 "hex",
 "hex-literal",
 "humantime 2.1.0",
 "humantime",
 "itertools 0.13.0",
 "num_enum",
 "postage",
@@ -5680,7 +5514,7 @@ dependencies = [
 "educe",
 "hex",
 "hex-literal",
 "humantime 2.1.0",
 "humantime",
 "itertools 0.13.0",
 "once_cell",
 "phf",
@@ -5755,7 +5589,7 @@ dependencies = [
 "hex-literal",
 "hkdf",
 "hmac",
 "humantime 2.1.0",
 "humantime",
 "itertools 0.13.0",
 "pin-project",
 "rand",
@@ -5899,7 +5733,7 @@ dependencies = [
 "educe",
 "futures",
 "futures-await-test",
 "humantime 2.1.0",
 "humantime",
 "itertools 0.13.0",
 "pin-project",
 "priority-queue",
@@ -6150,12 +5984,6 @@ dependencies = [
 "tinyvec",
]

[[package]]
name = "untrusted"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f"

[[package]]
name = "untrusted"
version = "0.7.1"
@@ -6358,16 +6186,6 @@ dependencies = [
 "wasm-bindgen",
]

[[package]]
name = "webpki"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53"
dependencies = [
 "ring 0.17.8",
 "untrusted 0.9.0",
]

[[package]]
name = "wide"
version = "0.7.24"
+0 −1
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ members = [
    "crates/arti-relay",
    "crates/arti-rpcserver",
    "crates/arti-config",
    "crates/arti-hyper",
    "crates/arti",
    "crates/arti-bench",
    "crates/arti-testing",

crates/arti-hyper/Cargo.toml

deleted100644 → 0
+0 −58
Original line number Diff line number Diff line
[package]
name = "arti-hyper"
version = "0.19.0"
authors = ["The Tor Project, Inc.", "Nick Mathewson <nickm@torproject.org>"]
edition = "2021"
rust-version = "1.70"
license = "MIT OR Apache-2.0"
homepage = "https://gitlab.torproject.org/tpo/core/arti/-/wikis/home"
description = "Adapter for making anonymous http requests using the Tor network and hyper"
keywords = ["tor", "arti", "privacy", "anonymity", "hyper"]
categories = ["network-programming", "cryptography"]
repository = "https://gitlab.torproject.org/tpo/core/arti.git/"

[features]
default = ["native-tls"]

native-tls = ["arti-client/native-tls", "tor-rtcompat/native-tls"]

# This is not nonadditive from a software POV, but we mark it as such because it
# includes code licensed under the old OpenSSL license (which was 4-clause BSD),
# which in turn introduces a GPL-incompatibility.
rustls = ["arti-client/rustls", "tor-rtcompat/rustls", "__is_nonadditive"]

static = ["arti-client/static", "__is_nonadditive"]

experimental = ["experimental-api"]
# Enable experimental APIs that are not yet officially supported.
#
# These APIs are not covered by semantic versioning.  Using this
# feature voids your "semver warrantee".
experimental-api = ["__is_experimental"]
full = ["native-tls", "arti-client/full", "tor-error/full", "tor-rtcompat/full"]

__is_experimental = []
__is_nonadditive = []

[dependencies]
anyhow = "1.0.23"
arti-client = { path = "../arti-client", version = "0.19.0" }
educe = "0.4.6"
hyper = { version = "0.14", features = ["http1", "client", "runtime"] }
pin-project = "1"
thiserror = "1"
tls-api = "0.9.0"
tls-api-native-tls = "0.9.0"
tokio = { package = "tokio", version = "1.7", features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros"] }
tor-error = { path = "../tor-error", version = "0.19.0" }
tor-rtcompat = { path = "../tor-rtcompat", version = "0.19.0", features = ["tokio"] }

[target.'cfg(target_vendor="apple")'.dev-dependencies]
tls-api-openssl = "0.9.0"

[dev-dependencies]
tracing-subscriber = "0.3.0"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

crates/arti-hyper/README.md

deleted100644 → 0
+0 −30
Original line number Diff line number Diff line
# arti-hyper

**THIS CRATE IS OBSOLETE AND UNMAINTAINED**

Using Arti with `hyper` version 1.x is fairly straightforward,
and does not need this shim crate.

See the following examples in the Arti source tree:

 * [hyper-http-client-example](https://gitlab.torproject.org/tpo/core/arti/-/tree/main/examples/hyper/hyper-http-client-example?ref_type=heads)
 * [hyper-http-hs-example](https://gitlab.torproject.org/tpo/core/arti/-/tree/main/examples/hyper/hyper-http-hs-example?ref_type=heads)

You may continue to use this crate, but it
**will not receive security patches**
if any vulnerabilities are found.

## Description

High-level layer for making http(s) requests the Tor network as a client,
**when using `hyper` prior to 1.0.**

This can be used by applications which embed Arti,
and could also be used as an example of how to build on top of [`arti_client`].

There is an example program [`hyper.rs`] which uses `arti-hyper`
to connect to Tor and make a single HTTP\[S] request.

[`hyper.rs`]: <https://gitlab.torproject.org/tpo/core/arti/-/blob/main/crates/arti-hyper/examples/hyper.rs>

License: MIT OR Apache-2.0
+0 −74
Original line number Diff line number Diff line
// @@ begin example lint list maintained by maint/add_warning @@
#![allow(unknown_lints)] // @@REMOVE_WHEN(ci_arti_nightly)
#![allow(clippy::bool_assert_comparison)]
#![allow(clippy::clone_on_copy)]
#![allow(clippy::dbg_macro)]
#![allow(clippy::mixed_attributes_style)]
#![allow(clippy::print_stderr)]
#![allow(clippy::print_stdout)]
#![allow(clippy::single_char_pattern)]
#![allow(clippy::unwrap_used)]
#![allow(clippy::unchecked_duration_subtraction)]
#![allow(clippy::useless_vec)]
#![allow(clippy::needless_pass_by_value)]
//! <!-- @@ end example lint list maintained by maint/add_warning @@ -->

#![allow(clippy::uninlined_format_args)]

use arti_hyper::*;

use anyhow::Result;
use arti_client::{TorClient, TorClientConfig};
use hyper::Body;
use tls_api::{TlsConnector as TlsConnectorTrait, TlsConnectorBuilder};

// On apple-darwin targets there is an issue with the native and rustls
// tls implementation so this makes it fall back to the openssl variant.
//
// https://gitlab.torproject.org/tpo/core/arti/-/issues/715
#[cfg(not(target_vendor = "apple"))]
use tls_api_native_tls::TlsConnector;
#[cfg(target_vendor = "apple")]
use tls_api_openssl::TlsConnector;

#[tokio::main]
async fn main() -> Result<()> {
    // Arti uses the `tracing` crate for logging. Install a handler for this, to print Arti's logs.
    // (You'll need to set RUST_LOG=info as an environment variable to actually see much; also try
    // =debug for more detailed logging.)
    tracing_subscriber::fmt::init();

    // You can run this example with any arbitrary (HTTP-only!) URL, but we'll default to icanhazip
    // because it's a good way of demonstrating that the connection is via Tor.
    let url = std::env::args()
        .nth(1)
        .unwrap_or_else(|| "http://icanhazip.com".into());

    eprintln!("starting Arti...");

    // The client config includes things like where to store persistent Tor network state.
    // The defaults provided are the same as the Arti standalone application, and save data
    // to a conventional place depending on operating system (for example, ~/.local/share/arti
    // on Linux platforms)
    let config = TorClientConfig::default();

    // We now let the Arti client start and bootstrap a connection to the network.
    // (This takes a while to gather the necessary consensus state, etc.)
    let tor_client = TorClient::create_bootstrapped(config).await?;

    let tls_connector = TlsConnector::builder()?.build()?;

    // The `ArtiHttpConnector` lets us make HTTP requests via the Tor network.
    let tor_connector = ArtiHttpConnector::new(tor_client, tls_connector);
    let http = hyper::Client::builder().build::<_, Body>(tor_connector);

    // The rest is just standard usage of Hyper.
    eprintln!("requesting {} via Tor...", url);
    let mut resp = http.get(url.try_into()?).await?;

    eprintln!("status: {}", resp.status());

    let body = hyper::body::to_bytes(resp.body_mut()).await?;
    eprintln!("body: {}", std::str::from_utf8(&body)?);
    Ok(())
}
Loading