pub enum KeyShape {
Url,
Opaque,
}Expand description
How a register_capped/register_capped_with_occupied key must be rendered in the
cap-reached log line (#969 S3).
A URL-shaped key is redacted via crate::redact::RedactedUrl; an already-opaque
token (e.g. a hash_routing_key digest) is logged verbatim, since RedactedUrl’s
Maven-coordinate/REST-path false-positive scan would otherwise collapse every such key —
which is exactly one colon plus a hex digest, the shape that scan is designed to catch —
to an identical, information-free "<prefix>:***", destroying the very correlation handle
the log line exists to provide. A closed, two-variant choice rather than an open Display
bypass: a call site declares which shape its key is, but cannot smuggle an unredacted URL
through under the Opaque label by accident in the type system’s own vocabulary — though
nothing stops a caller from mislabeling one at the value level, so get this right: labeling
a URL-shaped key Opaque leaks any query-string credential it carries (the dangerous
direction); labeling an opaque token Url only over-redacts a value that had no secret to
begin with (the safe direction).
Variants§
Url
Redact via crate::redact::RedactedUrl before logging.
Opaque
Log verbatim — this value is known to never carry a credential (e.g. a
hash_routing_key digest, or another fixed, non-URL literal).
Trait Implementations§
impl Copy for KeyShape
impl Eq for KeyShape
impl StructuralPartialEq for KeyShape
Auto Trait Implementations§
impl Freeze for KeyShape
impl RefUnwindSafe for KeyShape
impl Send for KeyShape
impl Sync for KeyShape
impl Unpin for KeyShape
impl UnsafeUnpin for KeyShape
impl UnwindSafe for KeyShape
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.