pub struct SecurityHeadersOptions {
pub enabled: bool,
pub hsts: Option<String>,
pub x_content_type_options: Option<String>,
pub x_frame_options: Option<String>,
pub referrer_policy: Option<String>,
pub content_security_policy: Option<String>,
pub permissions_policy: Option<String>,
pub cross_origin_opener_policy: Option<String>,
}Expand description
YAML-configurable values for the security headers hoop.
All fields are populated with sensible defaults via Default;
#[serde(default)] on the struct means a missing block in YAML
produces the same defaults. Explicit null for any optional field
disables that header.
Fields§
§enabled: boolMaster switch. Set to false to skip the hoop entirely.
hsts: Option<String>Strict-Transport-Security. Defaults to one year + subdomains.
Forced off when the listener is HTTP-only (see module docs).
x_content_type_options: Option<String>X-Content-Type-Options. Default nosniff.
x_frame_options: Option<String>X-Frame-Options. Default SAMEORIGIN.
referrer_policy: Option<String>Referrer-Policy. Default strict-origin-when-cross-origin.
content_security_policy: Option<String>Content-Security-Policy. Off by default — apps must opt in.
permissions_policy: Option<String>Permissions-Policy. Off by default.
cross_origin_opener_policy: Option<String>Cross-Origin-Opener-Policy. Off by default.
Trait Implementations§
Source§impl Clone for SecurityHeadersOptions
impl Clone for SecurityHeadersOptions
Source§fn clone(&self) -> SecurityHeadersOptions
fn clone(&self) -> SecurityHeadersOptions
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 SecurityHeadersOptions
impl Debug for SecurityHeadersOptions
Source§impl Default for SecurityHeadersOptions
impl Default for SecurityHeadersOptions
Source§impl<'de> Deserialize<'de> for SecurityHeadersOptionswhere
SecurityHeadersOptions: Default,
impl<'de> Deserialize<'de> for SecurityHeadersOptionswhere
SecurityHeadersOptions: Default,
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
Auto Trait Implementations§
impl Freeze for SecurityHeadersOptions
impl RefUnwindSafe for SecurityHeadersOptions
impl Send for SecurityHeadersOptions
impl Sync for SecurityHeadersOptions
impl Unpin for SecurityHeadersOptions
impl UnsafeUnpin for SecurityHeadersOptions
impl UnwindSafe for SecurityHeadersOptions
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
Mutably borrows from an owned value. Read more
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> 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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request