pub struct Masking {
pub max_bytes: u64,
pub fields: Vec<String>,
pub groups: BTreeMap<String, Vec<String>>,
}Expand description
Response field masking policy (DW-029, feature analysis 5-Security
“response field masking”): RFC 6901 pointers whose values are
replaced with the fixed MASKED_VALUE sentinel on the route’s
responses, before any other body-handling stage. The
mass-assignment/data-leak guard: a field named here NEVER reaches
the client, whatever the upstream put in it.
Semantics (frozen; enforcement lives in dataplane::transforms):
- PRECEDENCE is the deny-anywhere-wins analog for a redaction
policy: the effective pointer set is the UNION of
fields(the floor, every consumer on the route) and everygroupsentry the authenticated consumer belongs to. A group entry can only ADD pointers — there is deliberately no mechanism by which a group is EXEMPTED from the route floor (that would be a allow-anywhere escape hatch on a security policy). - The redacted value is the FIXED string
MASKED_VALUE, not configurable: one sentinel everywhere, so clients and audit tooling can rely on the exact shape. - Masking is explicitly buffering under
max_bytesand FAILS CLOSED: a response that is content-encoded, not JSON, over the cap, unparseable, or misses a configured pointer answers 502 — never a passthrough of bytes the gateway could not prove clean (see the module docs; the inverse of the DW-028 transform gates).
Fields§
§max_bytes: u64Maximum response body size (bytes) this route will buffer to mask. Must be >= 1 (validation); no upper bound, the same operator-owns-the-memory-budget stance as the DW-028 transform cap.
fields: Vec<String>Pointers masked for EVERY consumer on this route (the floor). Each must parse as an RFC 6901 pointer and not be the root (validation); each must RESOLVE on every JSON response the route serves, or the response fails closed (schema drift, the same strictness as the DW-028 body transform).
groups: BTreeMap<String, Vec<String>>Extra pointers masked per consumer GROUP: group name -> pointers
(unioned with fields for members of the group; consumers in
no listed group get the floor alone). Validation checks the
group names resolve against some config consumer’s groups
(the same store-only-group caveat as authorization group rules).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Masking
impl<'de> Deserialize<'de> for Masking
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>,
Source§impl JsonSchema for Masking
impl JsonSchema for Masking
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for Masking
Auto Trait Implementations§
impl Freeze for Masking
impl RefUnwindSafe for Masking
impl Send for Masking
impl Sync for Masking
impl Unpin for Masking
impl UnwindSafe for Masking
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more