pub struct LogPrivacy {
pub anonymize_ip: AnonymizeIp,
pub ip_hash_key: Arc<[u8]>,
pub redact_headers: Vec<String>,
pub redact_query: Vec<String>,
}Expand description
The access log’s privacy settings (see the module docs). The default is everything off.
Fields§
§anonymize_ip: AnonymizeIpHow client addresses are written.
ip_hash_key: Arc<[u8]>The HMAC key for AnonymizeIp::Hash (empty: truncate instead).
redact_headers: Vec<String>Lower-case header names redacted besides ALWAYS_REDACTED_HEADERS.
redact_query: Vec<String>Query parameter names whose values are redacted (matched ignoring ASCII case).
Implementations§
Source§impl LogPrivacy
impl LogPrivacy
Sourcepub fn from_env() -> LogPrivacy
pub fn from_env() -> LogPrivacy
From the RWS_CONFIG_* variables above; an unknown
ACCESS_LOG_ANONYMIZE_IP value truncates (fails towards privacy —
rws --check reports it).
Sourcepub fn redacts_header(&self, name: &str) -> bool
pub fn redacts_header(&self, name: &str) -> bool
Whether the value of header name is redacted.
Sourcepub fn redact_target<'a>(&self, target: &'a str, push: impl FnMut(&'a str))
pub fn redact_target<'a>(&self, target: &'a str, push: impl FnMut(&'a str))
target (a request target or URL) with the values of the
redact_query parameters replaced by
REDACTED, passed to push piece by piece (so a caller can escape
as it writes). Without such parameters target goes through whole.
Sourcepub fn redacted_target(&self, target: &str) -> String
pub fn redacted_target(&self, target: &str) -> String
redact_target as a String.
Trait Implementations§
Source§impl Clone for LogPrivacy
impl Clone for LogPrivacy
Source§fn clone(&self) -> LogPrivacy
fn clone(&self) -> LogPrivacy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogPrivacy
The key is never printed.
impl Debug for LogPrivacy
The key is never printed.
Source§impl Default for LogPrivacy
impl Default for LogPrivacy
Source§fn default() -> LogPrivacy
fn default() -> LogPrivacy
Source§impl PartialEq for LogPrivacy
impl PartialEq for LogPrivacy
impl StructuralPartialEq for LogPrivacy
Auto Trait Implementations§
impl Freeze for LogPrivacy
impl RefUnwindSafe for LogPrivacy
impl Send for LogPrivacy
impl Sync for LogPrivacy
impl Unpin for LogPrivacy
impl UnsafeUnpin for LogPrivacy
impl UnwindSafe for LogPrivacy
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
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> ⓘ
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> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
map-response-body only.Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
trace only.Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
trace only.