pub struct PathValidator {
pub raw_prefix_match: bool,
}Expand description
The default validator: permission check + path-prefix check.
A request is allowed when:
- the token is not expired (
TokenClaims::exp), and - it carries the
Permissionrequired byaction, and - the requested path starts with one of
allowed_paths.
Paths are compared on a segment boundary: allowed_paths = ["/docs"]
matches /docs, /docs/a.txt and /docs/ but not /docshop/x.
The root prefix "/" (or "") grants access to the whole tree. An
empty allowed_paths list denies everything.
Fields§
§raw_prefix_match: boolWhen true, allowed_paths are treated as raw string prefixes
(no segment-boundary normalization). Default: false.
Implementations§
Source§impl PathValidator
impl PathValidator
Trait Implementations§
Source§impl Clone for PathValidator
impl Clone for PathValidator
Source§fn clone(&self) -> PathValidator
fn clone(&self) -> PathValidator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathValidator
impl Debug for PathValidator
Source§impl Default for PathValidator
impl Default for PathValidator
Source§fn default() -> PathValidator
fn default() -> PathValidator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PathValidator
impl RefUnwindSafe for PathValidator
impl Send for PathValidator
impl Sync for PathValidator
impl Unpin for PathValidator
impl UnsafeUnpin for PathValidator
impl UnwindSafe for PathValidator
Blanket Implementations§
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
Mutably borrows from an owned value. Read more