Skip to content
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
59 changes: 8 additions & 51 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Any breaking changes to the `topology.yaml` or `shotover` rust API should be documented here.
This assists us in knowing when to make the next release a breaking release and assists users with making upgrades to new breaking releases.

## 0.8.0

* Removed websocket support

## 0.6.0

Redis has been renamed to Valkey.
Expand Down
5 changes: 0 additions & 5 deletions docs/src/sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ Cassandra:
# The transport that cassandra communication will occur over.
# TCP is the only Cassandra protocol conforming transport.
transport: Tcp

# alternatively:
#
# Use the Cassandra protocol over WebSockets using a Shotover compatible driver.
# transport: WebSocket

chain:
Transform1
Expand Down
62 changes: 1 addition & 61 deletions shotover-proxy/tests/cassandra_int_tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::{CONNECTION_REFUSED_OS_ERROR, shotover_process};
use cassandra_protocol::frame::message_error::{ErrorBody, ErrorType};
use cassandra_protocol::types::cassandra_type::CassandraType;
use cdrs_tokio::frame::events::{
SchemaChange, SchemaChangeOptions, SchemaChangeTarget, SchemaChangeType, ServerEvent,
};
use fred::rustls::crypto::aws_lc_rs::default_provider;
use futures::Future;
use futures::future::join_all;
use pretty_assertions::assert_eq;
Expand All @@ -23,8 +21,7 @@ use test_helpers::connection::cassandra::Compression;
use test_helpers::connection::cassandra::ProtocolVersion;
use test_helpers::connection::cassandra::{
CassandraConnection, CassandraConnectionBuilder, CassandraDriver, CassandraDriver::Cdrs,
CassandraDriver::Java, CassandraDriver::Scylla, CqlWsSession, ResultValue, assert_query_result,
run_query,
CassandraDriver::Java, CassandraDriver::Scylla, ResultValue, assert_query_result, run_query,
};
use test_helpers::connection::valkey_connection::ValkeyConnectionCreator;
use test_helpers::docker_compose::docker_compose;
Expand Down Expand Up @@ -1072,63 +1069,6 @@ async fn test_protocol_v5_compression_encode(#[case] driver: CassandraDriver) {
}
}

#[tokio::test(flavor = "multi_thread")]
async fn passthrough_websockets() {
let _docker_compose =
docker_compose("tests/test-configs/cassandra/passthrough-websocket/docker-compose.yaml");

let shotover =
shotover_process("tests/test-configs/cassandra/passthrough-websocket/topology.yaml")
.start()
.await;

let mut session = CqlWsSession::new("ws://0.0.0.0:9042").await;
let rows = session.query("SELECT bootstrapped FROM system.local").await;
assert_eq!(rows, vec![vec![CassandraType::Varchar("COMPLETED".into())]]);

shotover.shutdown_and_then_consume_events(&[]).await;
}

#[cfg(feature = "alpha-transforms")]
#[tokio::test(flavor = "multi_thread")]
async fn encode_websockets() {
let _docker_compose =
docker_compose("tests/test-configs/cassandra/passthrough-websocket/docker-compose.yaml");

let shotover =
shotover_process("tests/test-configs/cassandra/passthrough-websocket/topology-encode.yaml")
.start()
.await;

let mut session = CqlWsSession::new("ws://0.0.0.0:9042").await;
let rows = session.query("SELECT bootstrapped FROM system.local").await;
assert_eq!(rows, vec![vec![CassandraType::Varchar("COMPLETED".into())]]);

shotover.shutdown_and_then_consume_events(&[]).await;
}

#[tokio::test(flavor = "multi_thread")]
async fn passthrough_tls_websockets() {
test_helpers::cert::generate_cassandra_test_certs();
let _docker_compose = docker_compose(
"tests/test-configs/cassandra/passthrough-websocket-tls/docker-compose.yaml",
);

let shotover =
shotover_process("tests/test-configs/cassandra/passthrough-websocket-tls/topology.yaml")
.start()
.await;

let ca_cert = "tests/test-configs/cassandra/tls/certs/localhost_CA.crt";

default_provider().install_default().ok();
let mut session = CqlWsSession::new_tls("wss://0.0.0.0:9042", ca_cert).await;
let rows = session.query("SELECT bootstrapped FROM system.local").await;
assert_eq!(rows, vec![vec![CassandraType::Varchar("COMPLETED".into())]]);

shotover.shutdown_and_then_consume_events(&[]).await;
}

#[apply(all_cassandra_drivers)]
#[tokio::test(flavor = "multi_thread")]
async fn cassandra_5_passthrough(#[case] driver: CassandraDriver) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion shotover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ tokio = { version = "1.44.2", features = [
"fs",
"sync",
"time",
"io-util"
] }
tokio-util.workspace = true
csv = { workspace = true, optional = true }
hex = { workspace = true, optional = true }
async-trait.workspace = true
typetag.workspace = true
tokio-tungstenite = "0.27.0"

# Error handling
thiserror = "2.0"
Expand Down
14 changes: 0 additions & 14 deletions shotover/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,6 @@ impl MessageType {
MessageType::Dummy => false,
}
}

pub fn websocket_subprotocol(&self) -> &'static str {
match self {
#[cfg(feature = "cassandra")]
MessageType::Cassandra => "cql",
#[cfg(feature = "valkey")]
MessageType::Valkey => "valkey",
#[cfg(feature = "kafka")]
MessageType::Kafka => "kafka",
#[cfg(feature = "opensearch")]
MessageType::OpenSearch => "opensearch",
MessageType::Dummy => "dummy",
}
}
}

impl From<&CodecState> for MessageType {
Expand Down
Loading