#![cfg_attr(
not(test),
warn(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::indexing_slicing
)
)]
mod backend;
mod observe;
pub mod otlp;
#[cfg(feature = "streaming-body")]
mod streaming;
#[cfg(feature = "streaming-body")]
pub use streaming::{
StreamingDecision, StreamingFilterRuntime, StreamingLimits, run_streaming_body,
};
#[cfg(any(feature = "outbound-http", feature = "outbound-tcp"))]
mod outbound;
#[cfg(any(feature = "outbound-http", feature = "outbound-tcp"))]
pub use outbound::AddrVerdict;
#[cfg(feature = "outbound-http")]
pub use outbound::{AllowEntry, OutboundPolicy, Scheme};
#[cfg(feature = "outbound-tcp")]
pub use outbound::{OutboundTcpPolicy, TcpAllowEntry};
#[cfg(feature = "outbound-http")]
mod outbound_http;
#[cfg(feature = "outbound-tcp")]
mod outbound_tcp;
#[cfg(any(feature = "outbound-http", feature = "outbound-tcp"))]
mod resolver;
#[cfg(feature = "fat-guest")]
mod stdio;
mod conformance;
mod contract;
mod dev_signer;
mod engine;
mod errors;
mod filter;
mod host;
mod options;
mod pool;
mod quota;
mod runtime;
mod state;
mod trust;
mod util;
#[doc(hidden)]
#[cfg(feature = "test-support")]
#[allow(clippy::expect_used)]
pub mod test_support;
pub use backend::{Acquire, Bucket, KvBackend, MemoryBackend, RedbBackend, apply_bucket};
pub use conformance::{ConformanceCheck, ConformanceReport, check as run_conformance};
pub use contract::{ContractVersion, FILTER_WIT, header};
pub use dev_signer::{DEV_KEY_MARKER, DevKeyError, DevSigner, bound_sbom, public_key_path_for};
pub use observe::{
FanOutSink, FilterSpan, Hook, InMemorySink, MetricsSink, MetricsSnapshot, NoopSink,
RequestTrace, SpanOutcome, TelemetrySink,
};
mod bindings {
wasmtime::component::bindgen!({
path: "wit",
world: "filter",
exports: { default: async },
});
}
pub use bindings::plecto::filter::host_log::Level as LogLevel;
pub use bindings::plecto::filter::types::{
Header, HttpRequest, HttpResponse, RequestBodyDecision, RequestDecision, RequestEdit,
ResponseDecision, ResponseEdit,
};
pub use errors::{LoadError, RunError};
pub use filter::LoadedFilter;
pub use host::Host;
pub use options::{Isolation, LoadOptions};
pub use state::LogLine;
pub use trust::{SignedArtifact, TrustPolicy};