⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
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
2 changes: 1 addition & 1 deletion rust/Cargo.lock

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

3 changes: 1 addition & 2 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

[package]
name = "envoy-proxy-dynamic-modules-rust-sdk-examples"
version = "0.1.0"
Expand All @@ -20,4 +19,4 @@ tempfile = "3.16.0"
[lib]
name = "rust_module"
path = "src/lib.rs"
crate-type = ["cdylib"]
crate-type = ["cdylib", "rlib"]
2 changes: 1 addition & 1 deletion rust/src/http_zero_copy_regex_waf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ mod tests {
#[test]
/// This demonstrates how to write a test without Envoy using a mock provided by the SDK.
fn test_filter() {
let mut filter_config = FilterConfig::new("Hello [Ww].+").unwrap();
let filter_config = FilterConfig::new("Hello [Ww].+").unwrap();
let mut envoy_filter = MockEnvoyHttpFilter::new();
let mut filter: Box<dyn HttpFilter<MockEnvoyHttpFilter>> =
filter_config.new_http_filter(&mut envoy_filter);
Expand Down
53 changes: 53 additions & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,65 @@
//! Envoy Dynamic Modules Rust SDK Examples
//!
//! This crate contains example implementations of Envoy dynamic modules using the Rust SDK.
//!
//! # HTTP Filters
//!
//! The main library exports HTTP filter examples that work with `declare_init_functions!`:
//! - `passthrough` - A minimal filter that passes all data through unchanged.
//! - `access_logger` - Logs request/response information.
//! - `random_auth` - Randomly rejects requests (for testing).
//! - `zero_copy_regex_waf` - Zero-copy regex-based WAF filter.
//! - `header_mutation` - Adds/removes/modifies headers.
//! - `metrics` - Collects request/response metrics.
//!
//! # Network Filters
//!
//! Network filter examples are provided as public modules. To use them, create a separate
//! crate that includes this library and uses `declare_network_filter_init_functions!` with
//! the module's `new_filter_config` function.
//!
//! Available network filters:
//! - [`network_echo`] - Echoes data back to the client.
//! - [`network_rate_limiter`] - Limits concurrent connections.
//! - [`network_protocol_logger`] - Logs protocol information.
//! - [`network_redis`] - Redis RESP protocol parser and command filter.
//!
//! # Listener Filters
//!
//! Listener filter examples are provided as public modules. To use them, create a separate
//! crate that includes this library and uses `declare_listener_filter_init_functions!` with
//! the module's `new_filter_config` function.
//!
//! Available listener filters:
//! - [`listener_ip_allowlist`] - IP allowlist/blocklist filter.
//! - [`listener_tls_detector`] - TLS protocol detection filter.
//! - [`listener_sni_router`] - SNI-based routing filter.

use envoy_proxy_dynamic_modules_rust_sdk::*;

// HTTP filter examples.
mod http_access_logger;
mod http_header_mutation;
mod http_metrics;
mod http_passthrough;
mod http_random_auth;
mod http_zero_copy_regex_waf;

// Network filter examples.
// These modules can be used to create standalone network filter cdylibs.
// See each module's documentation for usage instructions.
pub mod network_echo;
pub mod network_protocol_logger;
pub mod network_rate_limiter;
pub mod network_redis;

// Listener filter examples.
// These modules can be used to create standalone listener filter cdylibs.
// See each module's documentation for usage instructions.
pub mod listener_ip_allowlist;
pub mod listener_sni_router;
pub mod listener_tls_detector;

declare_init_functions!(init, new_http_filter_config_fn);

/// This implements the [`envoy_proxy_dynamic_modules_rust_sdk::ProgramInitFunction`].
Expand Down
Loading
Loading