pub struct AdminCspSettings {
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>,
}Available on
server only.Expand description
Content Security Policy settings for the admin panel.
Controls which resources can be loaded by the admin UI.
Default values match ContentSecurityPolicy::admin_default() in the
security module, ensuring consistency between hardcoded and
configuration-driven CSP.
§Examples
use reinhardt_admin::settings::AdminCspSettings;
let csp = AdminCspSettings::default();
assert_eq!(csp.default_src, vec!["'self'"]);
assert_eq!(csp.script_src, vec!["'self'", "'wasm-unsafe-eval'"]);Fields§
§default_src: Vec<String>Sources allowed for default resource loading.
script_src: Vec<String>Sources allowed for script execution.
style_src: Vec<String>Sources allowed for stylesheets.
img_src: Vec<String>Sources allowed for images.
font_src: Vec<String>Sources allowed for fonts.
connect_src: Vec<String>Sources allowed for fetch/XHR/WebSocket connections.
frame_ancestors: Vec<String>Restricts which origins can embed the page in a frame.
base_uri: Vec<String>Restricts base URI for relative URLs.
form_action: Vec<String>Restricts form submission targets.
Trait Implementations§
Source§impl Clone for AdminCspSettings
impl Clone for AdminCspSettings
Source§fn clone(&self) -> AdminCspSettings
fn clone(&self) -> AdminCspSettings
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 AdminCspSettings
impl Debug for AdminCspSettings
Source§impl Default for AdminCspSettings
impl Default for AdminCspSettings
Source§impl<'de> Deserialize<'de> for AdminCspSettings
impl<'de> Deserialize<'de> for AdminCspSettings
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AdminCspSettings
impl PartialEq for AdminCspSettings
Source§impl Serialize for AdminCspSettings
impl Serialize for AdminCspSettings
impl StructuralPartialEq for AdminCspSettings
Auto Trait Implementations§
impl Freeze for AdminCspSettings
impl RefUnwindSafe for AdminCspSettings
impl Send for AdminCspSettings
impl Sync for AdminCspSettings
impl Unpin for AdminCspSettings
impl UnsafeUnpin for AdminCspSettings
impl UnwindSafe for AdminCspSettings
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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