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§impl Debug for LogPrivacy
The key is never printed.
impl Debug for LogPrivacy
The key is never printed.