pub struct Allowlist {
pub share_root: PathBuf,
pub cwd: PathBuf,
pub wizard_dir: PathBuf,
}Expand description
Allowlisted roots for workflow script and next_wizard paths.
Fields§
Resolved {wyvern_share} directory.
cwd: PathBufProcess working directory.
wizard_dir: PathBufDirectory of the current wizard.json.
Implementations§
Source§impl Allowlist
impl Allowlist
Sourcepub fn resolve_allowed(&self, raw: &str) -> Result<PathBuf, WorkflowError>
pub fn resolve_allowed(&self, raw: &str) -> Result<PathBuf, WorkflowError>
Expand {wyvern_share}, canonicalize, and reject .. / symlink escape.
Relative paths try {wyvern_share}, then cwd, then the current wizard
directory.
§Errors
Returns WorkflowError::PathDenied when the resolved path escapes the
allowlist, or WorkflowError::Resolve when expansion / lookup fails.
Trait Implementations§
impl Eq for Allowlist
impl StructuralPartialEq for Allowlist
Auto Trait Implementations§
impl Freeze for Allowlist
impl RefUnwindSafe for Allowlist
impl Send for Allowlist
impl Sync for Allowlist
impl Unpin for Allowlist
impl UnsafeUnpin for Allowlist
impl UnwindSafe for Allowlist
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
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.