pub struct ValidatorConfig {
pub schema_path: PathBuf,
pub schema_type: SchemaType,
pub max_payload_bytes: Option<usize>,
pub schema_cache_max_entries: usize,
pub fail_on_null_body: bool,
pub header_name: Option<String>,
pub fail_on_null_header: bool,
pub schema_aliases: BTreeMap<String, String>,
}Fields§
§schema_path: PathBuf§schema_type: SchemaType§max_payload_bytes: Option<usize>Maximum allowed body size in bytes. Bodies exceeding this limit are
rejected before validation begins. None means no limit.
schema_cache_max_entries: usizeMaximum number of entries in the XSD bridge schema cache. When the cache exceeds this limit, all entries are evicted before inserting the new one. Only relevant for XSD validation.
fail_on_null_body: boolWhen true (default), reject exchanges whose body is empty/null.
When false, empty bodies pass through without validation.
header_name: Option<String>When set, validate the value of this header instead of the body.
fail_on_null_header: boolWhen true (default) and header_name is set, reject exchanges where
the header is missing. When false, missing headers pass through.
schema_aliases: BTreeMap<String, String>Operator-supplied absolute-URI -> root-relative virtual path aliases,
parsed from the single schemaAliases query parameter (a
percent-encoded JSON object of string keys to string values). Empty
when the parameter is absent.
Implementations§
Source§impl ValidatorConfig
impl ValidatorConfig
pub fn from_uri(uri: &str) -> Result<Self, CamelError>
Sourcepub fn validate_schema_aliases(&self) -> Result<(), CamelError>
pub fn validate_schema_aliases(&self) -> Result<(), CamelError>
Rejects a config whose public schema_aliases field was mutated past
the MAX_SCHEMA_ALIASES cap.
ValidatorConfig::from_uri already enforces the cap at parse time
(via [schema_alias_cap_violation]); this is the config-level defense
for a programmatically constructed ValidatorConfig, whose fields are
public and can be set to any length. It is called by
CompiledValidator::compile before any schema-type dispatch or
filesystem access, so an over-cap config fails with a bounded
cap-naming error rather than a generic missing-schema error.
Trait Implementations§
Source§impl Clone for ValidatorConfig
impl Clone for ValidatorConfig
Auto Trait Implementations§
impl Freeze for ValidatorConfig
impl RefUnwindSafe for ValidatorConfig
impl Send for ValidatorConfig
impl Sync for ValidatorConfig
impl Unpin for ValidatorConfig
impl UnsafeUnpin for ValidatorConfig
impl UnwindSafe for ValidatorConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request