pub struct Context {
pub mode: Mode,
pub allowed: Vec<PathBuf>,
pub protected: Vec<PathBuf>,
pub log: PathBuf,
}Expand description
What one attempt’s proxy enforces, fixed when the attempt launches.
Fields§
§mode: Mode§allowed: Vec<PathBuf>The directories a container may bind-mount from, already resolved.
protected: Vec<PathBuf>Host paths the operator protected (host protect-path), already
resolved: never mountable, even inside an allowed directory. The
service’s own sandbox hides them, but the engine runs outside it.
log: PathBufThe violation log.
Implementations§
Source§impl Context
impl Context
Sourcepub fn records(&self, violation: &Violation) -> bool
pub fn records(&self, violation: &Violation) -> bool
Whether violation is recorded: every one unless the policy is off,
and a protected path’s always.
Sourcepub fn refuses(&self, violation: &Violation) -> bool
pub fn refuses(&self, violation: &Violation) -> bool
Whether violation refuses its request: every one in
Mode::Enforce, and a protected path’s in every mode.
Sourcepub fn access(&self, source: &Path) -> Access
pub fn access(&self, source: &Path) -> Access
Whether a container may bind-mount source.
A path with .. is refused outright. Otherwise the longest existing
prefix is resolved through every link on the host, so that a link the
job left in its own directory cannot point a mount anywhere else, and
the rest is appended as written: Docker creates a missing bind source
as a directory.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Forget for Context
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.