Skip to content
Closed
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ audit:
cargo deny check

PUBLISH_CRATES := praxis-proxy-tls praxis-proxy-core \
praxis-proxy-filter praxis-proxy-protocol praxis-proxy
praxis-proxy-filter praxis-proxy-ext-proc praxis-proxy-protocol praxis-proxy

publish-dry-run:
@for crate in $(PUBLISH_CRATES); do \
Expand Down
2 changes: 1 addition & 1 deletion filter/ext-proc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Envoy-compatible ext_proc filter for Praxis"
license = "MIT AND Apache-2.0 AND BSD-3-Clause"
repository.workspace = true
readme = "../../README.md"
publish = false
publish = true

[lib]
name = "praxis_ext_proc"
Expand Down
17 changes: 12 additions & 5 deletions filter/ext-proc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@
//! use praxis_filter::FilterRegistry;
//!
//! let mut registry = FilterRegistry::with_builtins();
//! registry.register(
//! "ext_proc",
//! praxis_filter::http_builtin(praxis_ext_proc::ExtProcFilter::from_config),
//! ).unwrap();
//! praxis_ext_proc::register_filters(&mut registry);
//! ```
//!
//! # Protocol Types
//!
//! Generated Envoy protobuf and gRPC types are exposed under [`proto`]
//! so downstream tests and external processor implementations can use
//! the same vendored protocol definitions as the filter.
//!
//! [`HttpFilter`]: praxis_filter::HttpFilter
//! [`FilterRegistry::with_builtins`]: praxis_filter::FilterRegistry::with_builtins
//! [`ext_proc`]: https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/ext_proc/v3/external_processor.proto
Expand All @@ -59,7 +62,7 @@
mod callout;
pub(crate) mod duplex;
mod mutations;
pub(crate) mod proto;
pub mod proto;
use std::time::Duration;

use async_trait::async_trait;
Expand Down Expand Up @@ -1161,5 +1164,9 @@ impl HttpFilter for ExtProcFilter {
}
}

praxis_filter::export_filters! {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Medium] The export_filters! invocation generates a new public register_filters() function -- the recommended API documented in the crate doc comment -- but no test in this crate exercises it. The existing pipeline_builds_with_ext_proc_and_failure_mode test manually registers via registry.register("ext_proc", http_builtin(...)) instead.

Update that test to use register_filters() so the published API has end-to-end coverage:

let mut registry = praxis_filter::FilterRegistry::with_builtins();
register_filters(&mut registry);

http "ext_proc" => ExtProcFilter::from_config,
}

#[cfg(test)]
mod tests;
13 changes: 9 additions & 4 deletions filter/ext-proc/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
//!
//! Compiled from vendored `.proto` files at build time.

/// Envoy API protobuf modules.
#[allow(
clippy::allow_attributes,
clippy::missing_docs_in_private_items,
reason = "generated protobuf module tree"
)]
pub(crate) mod envoy {
pub(crate) mod service {
pub(crate) mod common {
pub mod envoy {
/// Envoy service protobuf modules.
pub mod service {
/// Shared Envoy service protobuf types.
pub mod common {
#[allow(
dead_code,
missing_docs,
Expand All @@ -41,7 +44,8 @@ pub(crate) mod envoy {
}
}

pub(crate) mod ext_proc {
/// Envoy external processing protobuf types and gRPC service.
pub mod ext_proc {
#[allow(
dead_code,
missing_docs,
Expand All @@ -57,6 +61,7 @@ pub(crate) mod envoy {
clippy::doc_markdown,
clippy::enum_variant_names,
clippy::missing_docs_in_private_items,
clippy::missing_errors_doc,
clippy::needless_borrows_for_generic_args,
clippy::too_many_lines,
clippy::trivially_copy_pass_by_ref,
Expand Down
Loading