Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.5.1 #830

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dynamic-proxy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dynamic-proxy"
version = "0.5.0"
name = "plane-dynamic-proxy"
version = "0.5.1"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion dynamic-proxy/tests/common/hello_world_service.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bytes::Bytes;
use dynamic_proxy::body::{to_simple_body, SimpleBody};
use http_body_util::{BodyExt, Full};
use hyper::{body::Incoming, service::Service, Request, Response};
use plane_dynamic_proxy::body::{to_simple_body, SimpleBody};
use std::{convert::Infallible, future::Future, pin::Pin};

/// A service that returns a greeting with the X-Forwarded-For and X-Forwarded-Proto headers.
Expand Down
2 changes: 1 addition & 1 deletion dynamic-proxy/tests/common/simple_upgrade_service.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use bytes::Bytes;
use dynamic_proxy::body::{to_simple_body, SimpleBody};
use http::header::CONNECTION;
use http_body_util::{Empty, Full};
use hyper::{
Expand All @@ -10,6 +9,7 @@ use hyper::{
Request, Response, StatusCode,
};
use hyper_util::rt::TokioIo;
use plane_dynamic_proxy::body::{to_simple_body, SimpleBody};
use std::{convert::Infallible, future::Future, pin::Pin};
use tokio::io::{AsyncReadExt, AsyncWriteExt};

Expand Down
6 changes: 3 additions & 3 deletions dynamic-proxy/tests/graceful.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bytes::Bytes;
use dynamic_proxy::body::to_simple_body;
use dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use hyper::StatusCode;
use plane_dynamic_proxy::body::to_simple_body;
use plane_dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use std::convert::Infallible;
use std::net::SocketAddr;
use tokio::net::TcpListener;
Expand All @@ -11,7 +11,7 @@ use tokio::time::Duration;

async fn slow_hello_world(
_: hyper::Request<hyper::body::Incoming>,
) -> Result<hyper::Response<dynamic_proxy::body::SimpleBody>, Infallible> {
) -> Result<hyper::Response<plane_dynamic_proxy::body::SimpleBody>, Infallible> {
tokio::time::sleep(Duration::from_secs(1)).await; // emulate slow request
let body = http_body_util::Full::<Bytes>::from("Hello, world!".to_owned());
let body = to_simple_body(body);
Expand Down
6 changes: 3 additions & 3 deletions dynamic-proxy/tests/graceful_https.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use bytes::Bytes;
use common::cert::StaticCertificateResolver;
use dynamic_proxy::body::to_simple_body;
use dynamic_proxy::server::HttpsConfig;
use dynamic_proxy::server::SimpleHttpServer;
use hyper::StatusCode;
use plane_dynamic_proxy::body::to_simple_body;
use plane_dynamic_proxy::server::HttpsConfig;
use plane_dynamic_proxy::server::SimpleHttpServer;
use std::convert::Infallible;
use std::net::SocketAddr;
use tokio::net::TcpListener;
Expand Down
2 changes: 1 addition & 1 deletion dynamic-proxy/tests/hello_world_http.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use common::hello_world_service::HelloWorldService;
use dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use hyper::StatusCode;
use plane_dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use std::net::SocketAddr;
use tokio::net::TcpListener;

Expand Down
2 changes: 1 addition & 1 deletion dynamic-proxy/tests/https_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use common::{cert::StaticCertificateResolver, hello_world_service::HelloWorldService};
use dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use plane_dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use std::net::SocketAddr;
use tokio::net::TcpListener;

Expand Down
4 changes: 2 additions & 2 deletions dynamic-proxy/tests/test_http_redirect.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use dynamic_proxy::{
use http::{header, StatusCode};
use plane_dynamic_proxy::{
https_redirect::HttpsRedirectService,
server::{HttpsConfig, SimpleHttpServer},
};
use http::{header, StatusCode};
Comment on lines +1 to 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Remaining references to dynamic_proxy found.

The following files still contain references to dynamic_proxy that need to be updated:

  • dynamic-proxy/tests/graceful.rs
  • dynamic-proxy/tests/test_upgrade.rs
  • dynamic-proxy/tests/test_proxy_websocket.rs
  • dynamic-proxy/tests/test_proxy_request.rs
  • dynamic-proxy/tests/test_http_versions.rs
  • dynamic-proxy/tests/test_http_redirect.rs
  • dynamic-proxy/tests/https_test.rs
  • dynamic-proxy/tests/hello_world_http.rs
  • dynamic-proxy/tests/graceful_https.rs
  • dynamic-proxy/tests/common/simple_upgrade_service.rs
  • dynamic-proxy/tests/common/hello_world_service.rs
  • plane/src/proxy/request.rs
  • plane/src/proxy/cert_manager.rs
  • plane/src/proxy/proxy_server.rs
  • plane/src/proxy/mod.rs
  • plane/src/proxy/cert_pair.rs
  • plane/plane-tests/tests/common/proxy_mock.rs
  • plane/plane-tests/tests/common/test_env.rs
🔗 Analysis chain

LGTM! Import statements updated correctly.

The changes to the import statements are in line with the PR objectives. The dynamic_proxy module has been correctly renamed to plane_dynamic_proxy, and the necessary http module has been imported.

Let's verify the consistency of these changes across the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all imports of dynamic_proxy have been updated to plane_dynamic_proxy

# Test 1: Check for any remaining imports of dynamic_proxy
echo "Checking for any remaining imports of dynamic_proxy:"
rg "use dynamic_proxy"

# Test 2: Verify the new imports of plane_dynamic_proxy
echo "Verifying new imports of plane_dynamic_proxy:"
rg "use plane_dynamic_proxy"

# Test 3: Check for any missed renames in comments or strings
echo "Checking for any missed renames in comments or strings:"
rg "dynamic_proxy" -g "!Cargo.toml"

Length of output: 4452

use reqwest::{Response, Url};
use std::net::{IpAddr, SocketAddr};
use tokio::net::TcpListener;
Expand Down
2 changes: 1 addition & 1 deletion dynamic-proxy/tests/test_http_versions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use common::hello_world_service::HelloWorldService;
use dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use hyper::StatusCode;
use plane_dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use std::net::SocketAddr;
use tokio::net::TcpListener;

Expand Down
6 changes: 3 additions & 3 deletions dynamic-proxy/tests/test_proxy_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use crate::common::simple_axum_server::SimpleAxumServer;
use anyhow::Result;
use bytes::Bytes;
use common::simple_axum_server::RequestInfo;
use dynamic_proxy::{
use http::{Method, Request, StatusCode};
use http_body_util::{combinators::BoxBody, BodyExt, Full};
use plane_dynamic_proxy::{
body::{simple_empty_body, to_simple_body, BoxedError},
proxy::ProxyClient,
request::MutableRequest,
};
use http::{Method, Request, StatusCode};
use http_body_util::{combinators::BoxBody, BodyExt, Full};

mod common;

Expand Down
8 changes: 4 additions & 4 deletions dynamic-proxy/tests/test_proxy_websocket.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use common::websocket_echo_server::WebSocketEchoServer;
use dynamic_proxy::{
use futures_util::{SinkExt, StreamExt};
use http::{Request, Response};
use hyper::{body::Incoming, service::Service};
use plane_dynamic_proxy::{
body::SimpleBody,
proxy::ProxyClient,
request::MutableRequest,
server::{HttpsConfig, SimpleHttpServer},
};
use futures_util::{SinkExt, StreamExt};
use http::{Request, Response};
use hyper::{body::Incoming, service::Service};
use std::{future::Future, net::SocketAddr, pin::Pin};
use tokio::net::TcpListener;
use tokio_tungstenite::{connect_async, tungstenite::protocol::Message};
Expand Down
2 changes: 1 addition & 1 deletion dynamic-proxy/tests/test_upgrade.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use bytes::Bytes;
use common::simple_upgrade_service::SimpleUpgradeService;
use dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use http_body_util::Empty;
use hyper::{
header::{HeaderValue, CONNECTION, UPGRADE},
Request, StatusCode,
};
use hyper_util::rt::TokioIo;
use plane_dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use std::net::SocketAddr;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::net::{TcpListener, TcpStream};
Expand Down
4 changes: 2 additions & 2 deletions plane/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "plane"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
default-run = "plane"
description = "Session backend orchestrator for ambitious browser-based apps."
Expand All @@ -22,14 +22,14 @@ clap = { version = "4.4.10", features = ["derive"] }
colored = "2.0.4"
dashmap = "6.1"
data-encoding = "2.4.0"
dynamic-proxy = { path="../dynamic-proxy" }
futures-util = "0.3.29"
http-body = "1.0.1"
hyper = { version = "1.4.1", features = ["server"] }
hyper-util = { version = "0.1.9", features = ["client", "client-legacy", "http1", "http2"] }
lru = "0.12.1"
openssl = "0.10.66"
pem = "3.0.2"
plane-dynamic-proxy = { path="../dynamic-proxy", version = "0.5.1" }
paulgb marked this conversation as resolved.
Show resolved Hide resolved
rand = "0.8.5"
reqwest = { version = "0.12.8", features = ["json", "rustls-tls"], default-features = false }
rusqlite = { version = "0.32", features = ["bundled", "serde_json"] }
Expand Down
4 changes: 2 additions & 2 deletions plane/plane-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "plane-tests"
version = "0.5.0"
version = "0.5.1"
edition = "2021"

[dependencies]
Expand All @@ -9,12 +9,12 @@ async-trait = "0.1.74"
axum = { version = "0.7.5", features = ["ws"] }
bollard = "0.17.0"
chrono = { version = "0.4.31", features = ["serde"] }
dynamic-proxy = { path = "../../dynamic-proxy" }
futures-util = "0.3.29"
http = "1.1.0"
http-body-util = "0.1.2"
hyper = { version = "1.4.1", features = ["server"] }
plane = { path = "../plane-dynamic", package = "plane-dynamic" }
plane-dynamic-proxy = { path = "../../dynamic-proxy" }
plane-test-macro = { path = "plane-test-macro" }
reqwest = { version = "0.12.8", features = ["json", "rustls-tls"], default-features = false }
serde = "1.0.210"
Expand Down
2 changes: 1 addition & 1 deletion plane/plane-tests/tests/common/proxy_mock.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use plane::{
names::BackendName,
protocol::{RouteInfoRequest, RouteInfoResponse},
proxy::{connection_monitor::BackendEntry, proxy_server::ProxyState},
};
use plane_dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use std::net::SocketAddr;
use tokio::{net::TcpListener, sync::mpsc};

Expand Down
2 changes: 1 addition & 1 deletion plane/plane-tests/tests/common/test_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use super::{
resources::{database::DevDatabase, pebble::Pebble},
};
use chrono::Duration;
use dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use plane::{
client::PlaneClient,
controller::ControllerServer,
Expand All @@ -25,6 +24,7 @@ use plane::{
types::{ClusterName, DronePoolName},
util::random_string,
};
use plane_dynamic_proxy::server::{HttpsConfig, SimpleHttpServer};
use std::{
net::{IpAddr, Ipv4Addr, SocketAddr},
path::{Path, PathBuf},
Expand Down
2 changes: 1 addition & 1 deletion plane/src/proxy/cert_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use acme2_eab::{
};
use anyhow::{anyhow, Context, Result};
use chrono::Utc;
use dynamic_proxy::tokio_rustls::rustls::{
use plane_dynamic_proxy::tokio_rustls::rustls::{
server::{ClientHello, ResolvesServerCert},
sign::CertifiedKey,
};
Expand Down
6 changes: 3 additions & 3 deletions plane/src/proxy/cert_pair.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::log_types::LoggableTime;
use anyhow::{anyhow, Result};
use dynamic_proxy::rustls::{
use pem::Pem;
use plane_dynamic_proxy::rustls::{
crypto::aws_lc_rs::sign::any_supported_type, pki_types::PrivateKeyDer,
};
use dynamic_proxy::tokio_rustls::rustls::sign::CertifiedKey;
use pem::Pem;
use plane_dynamic_proxy::tokio_rustls::rustls::sign::CertifiedKey;
Comment on lines +3 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Remove unused import: pem::Pem is imported but not used in plane/src/proxy/cert_pair.rs.

  • Consider eliminating the use pem::Pem; statement to clean up the codebase.
🔗 Analysis chain

LGTM: Import changes align with PR objectives.

The updated import paths for rustls and tokio_rustls from plane_dynamic_proxy are consistent with the PR objectives of renaming the dynamic-proxy crate to plane-dynamic-proxy. This change ensures that the code correctly references the new package structure.

To verify the usage of the newly imported pem::Pem, let's run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of pem::Pem in the file

# Test: Search for pem::Pem usage
rg 'pem::Pem' plane/src/proxy/cert_pair.rs

Length of output: 56


Script:

#!/bin/bash
# Description: Search for any usage of Pem in cert_pair.rs excluding the import line

# Search for 'Pem' as a whole word, excluding lines that import it
rg '\\bPem\\b' plane/src/proxy/cert_pair.rs | grep -v 'use pem::Pem;'

Length of output: 71

use rustls_pki_types::CertificateDer;
use serde::{Deserialize, Serialize};
use std::{fs::Permissions, io, os::unix::fs::PermissionsExt, path::Path};
Expand Down
2 changes: 1 addition & 1 deletion plane/src/proxy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::names::ProxyName;
use crate::proxy::cert_manager::watcher_manager_pair;
use crate::{client::PlaneClient, signals::wait_for_shutdown_signal, types::ClusterName};
use anyhow::Result;
use dynamic_proxy::server::{
use plane_dynamic_proxy::server::{
ServerWithHttpRedirect, ServerWithHttpRedirectConfig, ServerWithHttpRedirectHttpsConfig,
};
use proxy_server::ProxyState;
Expand Down
2 changes: 1 addition & 1 deletion plane/src/proxy/proxy_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::{
};
use crate::{names::Name, protocol::RouteInfo, SERVER_NAME};
use bytes::Bytes;
use dynamic_proxy::{
use plane_dynamic_proxy::{
body::{simple_empty_body, SimpleBody},
hyper::{
body::{Body, Incoming},
Expand Down
2 changes: 1 addition & 1 deletion plane/src/proxy/request.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::types::{BearerToken, ClusterName};
use dynamic_proxy::hyper::http::uri::{self, PathAndQuery};
use plane_dynamic_proxy::hyper::http::uri::{self, PathAndQuery};
use std::str::FromStr;

// If a cluster name does not specify a port, :443 is implied.
Expand Down
Loading