Enum PacShExpMatch
pub enum PacShExpMatch {
Reference,
Literal,
}js and pac and std only.Expand description
How shExpMatch(str, shexp) reads its pattern.
Variants§
Reference
What the reference implementations do: rewrite the expression into an
anchored regex — escaping ., mapping * to .* and ? to . —
which leaves every other regex metacharacter live.
This is the default because it is what a PAC file is written against:
a pattern like vpn[0-9].corp.example keeps its reference character
class semantics. It inherits the quirks that come with the transform —
an unparenthesised | anchors only one of its branches, and a bracket
expression that was meant literally (http://[2001:db8::1]/*) is a
character class — so a deployment that would rather have neither can
pick Self::Literal. Matching uses Rust’s bounded regex engine rather
than ECMAScript RegExp; unsupported constructs and UTF-16 code-unit
edge cases can therefore differ from a browser.
Literal
Treat every character but * and ? literally.
Diverges from browsers deliberately: a pattern means exactly what it spells, so no part of an operator’s rule can be satisfied by input a client chose. A rule relying on regex metacharacters stops matching instead, which is visible in testing rather than at an attacker’s choosing.
Trait Implementations§
§impl Clone for PacShExpMatch
impl Clone for PacShExpMatch
§fn clone(&self) -> PacShExpMatch
fn clone(&self) -> PacShExpMatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PacShExpMatch
§impl Debug for PacShExpMatch
impl Debug for PacShExpMatch
§impl Default for PacShExpMatch
impl Default for PacShExpMatch
§fn default() -> PacShExpMatch
fn default() -> PacShExpMatch
impl Eq for PacShExpMatch
§impl PartialEq for PacShExpMatch
impl PartialEq for PacShExpMatch
impl StructuralPartialEq for PacShExpMatch
Auto Trait Implementations§
impl Freeze for PacShExpMatch
impl RefUnwindSafe for PacShExpMatch
impl Send for PacShExpMatch
impl Sync for PacShExpMatch
impl Unpin for PacShExpMatch
impl UnsafeUnpin for PacShExpMatch
impl UnwindSafe for PacShExpMatch
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more