pub struct PolicySpec {
pub version: u32,
pub description: Option<String>,
pub classifications: Vec<Classification>,
pub rules: Vec<PolicyRule>,
}policy only.Expand description
A data-flow policy: classifications (which columns carry which label)
and rules (what a labelled column requires of the sink it lands in).
Declared once — in a policy file passed with --policy, in a deployment
overlay, or as a top-level policy: block — and evaluated against every
pipeline before any data moves; a value detector re-checks at run time.
Fields§
§version: u32Policy grammar version. Only 1 exists.
description: Option<String>Free-form description shown by faucet policy.
classifications: Vec<Classification>How columns get their labels.
rules: Vec<PolicyRule>What each label demands of a destination.
Implementations§
Source§impl PolicySpec
impl PolicySpec
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Fail-fast validation, surfaced at config load. A policy that does not validate is refused outright — a broken policy must fail closed.
Sourcepub fn merge(self, other: PolicySpec) -> Result<PolicySpec, String>
pub fn merge(self, other: PolicySpec) -> Result<PolicySpec, String>
Merge another policy in (classifications and rules appended). A rule name present on both sides is an error — two sources must not silently override each other.
Sourcepub fn has_value_detectors(&self) -> bool
pub fn has_value_detectors(&self) -> bool
Whether any classification uses a value detector (so the runtime backstop has something to do).
Trait Implementations§
Source§impl Clone for PolicySpec
impl Clone for PolicySpec
Source§impl Debug for PolicySpec
impl Debug for PolicySpec
Source§impl Default for PolicySpec
impl Default for PolicySpec
Source§impl<'de> Deserialize<'de> for PolicySpec
impl<'de> Deserialize<'de> for PolicySpec
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 PolicySpec
impl JsonSchema for PolicySpec
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 moreSource§impl PartialEq for PolicySpec
impl PartialEq for PolicySpec
Source§impl Serialize for PolicySpec
impl Serialize for PolicySpec
impl StructuralPartialEq for PolicySpec
Auto Trait Implementations§
impl Freeze for PolicySpec
impl RefUnwindSafe for PolicySpec
impl Send for PolicySpec
impl Sync for PolicySpec
impl Unpin for PolicySpec
impl UnsafeUnpin for PolicySpec
impl UnwindSafe for PolicySpec
Blanket Implementations§
impl<T> Allocation for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request