pub struct ContentSecurityPolicy {
pub default_src: Vec<String>,
pub script_src: Vec<String>,
pub style_src: Vec<String>,
pub img_src: Vec<String>,
pub font_src: Vec<String>,
pub connect_src: Vec<String>,
pub frame_ancestors: Vec<String>,
pub base_uri: Vec<String>,
pub form_action: Vec<String>,
}Expand description
Content Security Policy configuration for admin panel.
Provides a structured way to build CSP headers with appropriate directives for the admin panel.
Fields§
§default_src: Vec<String>default-src directive
script_src: Vec<String>script-src directive
style_src: Vec<String>style-src directive
img_src: Vec<String>img-src directive
font_src: Vec<String>font-src directive
connect_src: Vec<String>connect-src directive
frame_ancestors: Vec<String>frame-ancestors directive
base_uri: Vec<String>base-uri directive
form_action: Vec<String>form-action directive
Implementations§
Source§impl ContentSecurityPolicy
impl ContentSecurityPolicy
Sourcepub fn admin_default() -> Self
pub fn admin_default() -> Self
Creates a default CSP suitable for admin panel usage.
Allows:
- Scripts from same origin with WASM evaluation
- Inline styles (required for admin UI components)
- Images from same origin and data URIs (for favicons)
- Connections to same origin only (for API calls)
- No framing allowed
Trait Implementations§
Source§impl Clone for ContentSecurityPolicy
impl Clone for ContentSecurityPolicy
Source§fn clone(&self) -> ContentSecurityPolicy
fn clone(&self) -> ContentSecurityPolicy
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 moreAuto Trait Implementations§
impl Freeze for ContentSecurityPolicy
impl RefUnwindSafe for ContentSecurityPolicy
impl Send for ContentSecurityPolicy
impl Sync for ContentSecurityPolicy
impl Unpin for ContentSecurityPolicy
impl UnsafeUnpin for ContentSecurityPolicy
impl UnwindSafe for ContentSecurityPolicy
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> 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> ⓘ
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