pub enum JavaScriptPolicy {
AllowParse,
DenyExecution,
StripOnFlatten,
}Expand description
JavaScript may be parsed and inspected so hardening code can locate and remove active content, but this crate must never execute document-supplied JavaScript. PDF/XFA inputs are untrusted and JavaScript actions can reach viewer APIs, network/file operations, and mutable form state. Keeping parse, execution, and flatten behavior as explicit policy values prevents hidden no-op fallbacks from becoming accidental execution paths in future work.
Variants§
AllowParse
JavaScript syntax/payloads may be parsed or inspected for audit/strip.
DenyExecution
JavaScript execution is denied for all document-supplied entrypoints.
StripOnFlatten
JavaScript-bearing actions are stripped from flattened/hardened output.
Trait Implementations§
Source§impl Clone for JavaScriptPolicy
impl Clone for JavaScriptPolicy
Source§fn clone(&self) -> JavaScriptPolicy
fn clone(&self) -> JavaScriptPolicy
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 JavaScriptPolicy
impl Debug for JavaScriptPolicy
Source§impl PartialEq for JavaScriptPolicy
impl PartialEq for JavaScriptPolicy
Source§fn eq(&self, other: &JavaScriptPolicy) -> bool
fn eq(&self, other: &JavaScriptPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for JavaScriptPolicy
impl Eq for JavaScriptPolicy
impl StructuralPartialEq for JavaScriptPolicy
Auto Trait Implementations§
impl Freeze for JavaScriptPolicy
impl RefUnwindSafe for JavaScriptPolicy
impl Send for JavaScriptPolicy
impl Sync for JavaScriptPolicy
impl Unpin for JavaScriptPolicy
impl UnsafeUnpin for JavaScriptPolicy
impl UnwindSafe for JavaScriptPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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