pub struct AllowlistWebPermissions(/* private fields */);
web
only.Expand description
Permissions manager for the web related extensions
Allows only operations that are explicitly enabled
Uses interior mutability to allow changing the permissions at runtime
Implementations§
Source§impl AllowlistWebPermissions
impl AllowlistWebPermissions
Sourcepub fn set_hrtime(&self, value: bool)
pub fn set_hrtime(&self, value: bool)
Set the hrtime
permission
If true, timers will be allowed to use high resolution time
Sourcepub fn set_exec(&self, value: bool)
pub fn set_exec(&self, value: bool)
Set the exec
permission
If true, FFI execution will be allowed
Sourcepub fn set_read_all(&self, value: bool)
pub fn set_read_all(&self, value: bool)
Set the read_all
permission
If false all reads will be denied
Sourcepub fn set_write_all(&self, value: bool)
pub fn set_write_all(&self, value: bool)
Set the write_all
permission
If false all writes will be denied
Sourcepub fn allow_open(&self, path: &str, read: bool, write: bool)
pub fn allow_open(&self, path: &str, read: bool, write: bool)
Whitelist a path for opening
If read
is true, the path will be allowed to be opened for reading
If write
is true, the path will be allowed to be opened for writing
Sourcepub fn allow_read(&self, path: &str)
pub fn allow_read(&self, path: &str)
Whitelist a path for reading
Sourcepub fn allow_write(&self, path: &str)
pub fn allow_write(&self, path: &str)
Whitelist a path for writing
Sourcepub fn deny_write(&self, path: &str)
pub fn deny_write(&self, path: &str)
Blacklist a path for writing
Sourcepub fn allow_host(&self, host: &str)
pub fn allow_host(&self, host: &str)
Whitelist a host
Sourcepub fn allow_vsock(&self, cid: u32, port: u32)
pub fn allow_vsock(&self, cid: u32, port: u32)
Whitelist a virtual socket
Sourcepub fn deny_vsock(&self, cid: u32, port: u32)
pub fn deny_vsock(&self, cid: u32, port: u32)
Blacklist a virtual socket
Sourcepub fn allow_sys(&self, kind: SystemsPermissionKind)
pub fn allow_sys(&self, kind: SystemsPermissionKind)
Whitelist a system operation
Sourcepub fn deny_sys(&self, kind: SystemsPermissionKind)
pub fn deny_sys(&self, kind: SystemsPermissionKind)
Blacklist a system operation
Trait Implementations§
Source§impl Clone for AllowlistWebPermissions
impl Clone for AllowlistWebPermissions
Source§fn clone(&self) -> AllowlistWebPermissions
fn clone(&self) -> AllowlistWebPermissions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AllowlistWebPermissions
impl Debug for AllowlistWebPermissions
Source§impl Default for AllowlistWebPermissions
impl Default for AllowlistWebPermissions
Source§fn default() -> AllowlistWebPermissions
fn default() -> AllowlistWebPermissions
Source§impl WebPermissions for AllowlistWebPermissions
impl WebPermissions for AllowlistWebPermissions
Source§fn allow_hrtime(&self) -> bool
fn allow_hrtime(&self) -> bool
hrtime
is allowed Read moreSource§fn check_host(
&self,
host: &str,
port: Option<u16>,
api_name: &str,
) -> Result<(), PermissionCheckError>
fn check_host( &self, host: &str, port: Option<u16>, api_name: &str, ) -> Result<(), PermissionCheckError>
Source§fn check_vsock(
&self,
cid: u32,
port: u32,
api_name: &str,
) -> Result<(), PermissionCheckError>
fn check_vsock( &self, cid: u32, port: u32, api_name: &str, ) -> Result<(), PermissionCheckError>
Source§fn check_url(
&self,
url: &Url,
api_name: &str,
) -> Result<(), PermissionCheckError>
fn check_url( &self, url: &Url, api_name: &str, ) -> Result<(), PermissionCheckError>
Source§fn check_read<'a>(
&self,
p: Cow<'a, Path>,
api_name: Option<&str>,
) -> Result<Cow<'a, Path>, PermissionCheckError>
fn check_read<'a>( &self, p: Cow<'a, Path>, api_name: Option<&str>, ) -> Result<Cow<'a, Path>, PermissionCheckError>
Source§fn check_write<'a>(
&self,
p: Cow<'a, Path>,
api_name: Option<&str>,
) -> Result<Cow<'a, Path>, PermissionCheckError>
fn check_write<'a>( &self, p: Cow<'a, Path>, api_name: Option<&str>, ) -> Result<Cow<'a, Path>, PermissionCheckError>
Source§fn check_open<'a>(
&self,
resolved: bool,
read: bool,
write: bool,
path: Cow<'a, Path>,
api_name: &str,
) -> Option<Cow<'a, Path>>
fn check_open<'a>( &self, resolved: bool, read: bool, write: bool, path: Cow<'a, Path>, api_name: &str, ) -> Option<Cow<'a, Path>>
Source§fn check_read_all(
&self,
api_name: Option<&str>,
) -> Result<(), PermissionCheckError>
fn check_read_all( &self, api_name: Option<&str>, ) -> Result<(), PermissionCheckError>
Source§fn check_read_blind(
&self,
p: &Path,
display: &str,
api_name: &str,
) -> Result<(), PermissionCheckError>
fn check_read_blind( &self, p: &Path, display: &str, api_name: &str, ) -> Result<(), PermissionCheckError>
Source§fn check_write_all(&self, api_name: &str) -> Result<(), PermissionCheckError>
fn check_write_all(&self, api_name: &str) -> Result<(), PermissionCheckError>
Source§fn check_write_blind(
&self,
path: &Path,
display: &str,
api_name: &str,
) -> Result<(), PermissionCheckError>
fn check_write_blind( &self, path: &Path, display: &str, api_name: &str, ) -> Result<(), PermissionCheckError>
Source§fn check_write_partial<'a>(
&self,
path: Cow<'a, Path>,
api_name: &str,
) -> Result<Cow<'a, Path>, PermissionCheckError>
fn check_write_partial<'a>( &self, path: Cow<'a, Path>, api_name: &str, ) -> Result<Cow<'a, Path>, PermissionCheckError>
Source§fn check_sys(
&self,
kind: SystemsPermissionKind,
api_name: &str,
) -> Result<(), PermissionCheckError>
fn check_sys( &self, kind: SystemsPermissionKind, api_name: &str, ) -> Result<(), PermissionCheckError>
Source§fn check_env(&self, var: &str) -> Result<(), PermissionCheckError>
fn check_env(&self, var: &str) -> Result<(), PermissionCheckError>
Source§fn check_exec(&self) -> Result<(), PermissionCheckError>
fn check_exec(&self) -> Result<(), PermissionCheckError>
Auto Trait Implementations§
impl Freeze for AllowlistWebPermissions
impl Send for AllowlistWebPermissions
impl Sync for AllowlistWebPermissions
impl RefUnwindSafe for AllowlistWebPermissions
impl Unpin for AllowlistWebPermissions
impl UnwindSafe for AllowlistWebPermissions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.