Struct poem::middleware::SensitiveHeader
source · pub struct SensitiveHeader { /* private fields */ }
Expand description
Middleware for mark headers value represents sensitive information.
Sensitive data could represent passwords or other data that should not be
stored on disk or in memory. By marking header values as sensitive,
components using this crate can be instructed to treat them with special
care for security reasons. For example, caches can avoid storing sensitive
values, and HPACK
encoders used by HTTP/2.0
implementations can choose
not to compress them.
Additionally, sensitive values will be masked by the Debug
implementation
of HeaderValue.
§Reference
Implementations§
source§impl SensitiveHeader
impl SensitiveHeader
sourcepub fn request_only(self) -> Self
pub fn request_only(self) -> Self
Applies to request headers only.
sourcepub fn response_only(self) -> Self
pub fn response_only(self) -> Self
Applies to responses headers only.
sourcepub fn header<K>(self, key: K) -> Selfwhere
K: TryInto<HeaderName>,
pub fn header<K>(self, key: K) -> Selfwhere
K: TryInto<HeaderName>,
Append a header.
Trait Implementations§
source§impl Default for SensitiveHeader
impl Default for SensitiveHeader
source§fn default() -> SensitiveHeader
fn default() -> SensitiveHeader
Returns the “default value” for a type. Read more
source§impl<E: Endpoint> Middleware<E> for SensitiveHeader
impl<E: Endpoint> Middleware<E> for SensitiveHeader
Auto Trait Implementations§
impl Freeze for SensitiveHeader
impl RefUnwindSafe for SensitiveHeader
impl Send for SensitiveHeader
impl Sync for SensitiveHeader
impl Unpin for SensitiveHeader
impl UnwindSafe for SensitiveHeader
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> 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> TowerCompatExt for T
impl<T> TowerCompatExt for T
source§fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: Body + Send + Sync + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<BoxBody<Bytes, Error>>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static,
Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: Body + Send + Sync + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<BoxBody<Bytes, Error>>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static,
Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
Available on crate feature
tower-compat
only.Converts a tower service to a poem endpoint.