pub type ValidateFn = Arc<dyn for<'h> Fn(&str, &Authority, Box<dyn Iterator<Item = (&'h str, &'h str)> + Send + Sync + 'h>, Option<&[u8]>) -> AclClassification + Send + Sync>;Expand description
A function that validates an HTTP request against an ACL.
Called by HttpAcl::is_valid with the request’s scheme, authority (host and
port), headers, and optional body, in that order. It is the only hook for checks
that don’t fit the built-in categories (e.g. inspecting the body, or applying
custom cross-field logic). Return AclClassification::DeniedUserAcl or
AclClassification::Denied to reject the request, or
AclClassification::AllowedDefault to let it through.
A ValidateFn is attached via HttpAclBuilder::build_full or
HttpAclBuilder::try_build_full rather than a dedicated builder setter, since
it is typically a closure that captures state from outside the builder.
Aliased Type§
pub struct ValidateFn { /* private fields */ }