pub struct SitePolicy { /* private fields */ }Expand description
A site-policy label table: a set of explicit per-node rules plus a conservative floor for every other enumerated node.
This is the genesis content. It is deliberately not a wildcard matcher: rules
are keyed on the exact normalized node path, and materialize
emits one concrete GenesisMap assignment per enumerated node (matched rule,
else the floor). That materialization is what the genesis mechanism sanctions —
the completeness check then sees real per-node coverage, never an implicit
catch-all inside the map.
The default (SitePolicy::conservative) reflects the current world’s actual
sensitivity — control-plane services above data services above public
structure — so the genesis is not the “label-everything-public” no-op the
mechanism warns against. Real per-node labels ultimately come from S3
$scope/TE annotations; this table is the site-policy seam until then.
Implementations§
Source§impl SitePolicy
impl SitePolicy
Sourcepub fn floor_only(floor: SecurityLabel) -> Self
pub fn floor_only(floor: SecurityLabel) -> Self
A site policy with only a floor and no explicit elevations. Every
enumerated node materializes to floor.
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
The default conservative site policy for the current world.
- Control plane (
policy,oauth,ledger) →Confidential: the authorization/identity/audit services are the most sensitive surface. - Data / internal services and the non-service mounts →
Internal(the floor): model/registry/worker/etc. content is org-internal, not world-readable. - Structural export roots (
/srv,/worktree,/stream) →Public: these are container directories whose listing is not itself sensitive.
Assurance is left at the Unverified floor across the board: elevating the
crypto-assurance axis (#548) is a per-object decision, not a blanket
genesis floor — a genesis that demanded PqHybrid everywhere would make
most objects unreachable before the assurance-binding layer is wired.
Sourcepub fn with_rule(self, path: impl AsRef<str>, label: SecurityLabel) -> Self
pub fn with_rule(self, path: impl AsRef<str>, label: SecurityLabel) -> Self
Add or override an explicit per-node rule (builder).
Sourcepub fn floor(&self) -> SecurityLabel
pub fn floor(&self) -> SecurityLabel
The floor label materialized for unmatched nodes.
Sourcepub fn label_for(&self, node: &str) -> SecurityLabel
pub fn label_for(&self, node: &str) -> SecurityLabel
The label this policy assigns to node: its explicit rule if any, else the
floor. Total — every node gets a concrete label (that’s the point).
Sourcepub fn materialize<'a>(
&self,
nodes: impl IntoIterator<Item = &'a str>,
) -> GenesisMap
pub fn materialize<'a>( &self, nodes: impl IntoIterator<Item = &'a str>, ) -> GenesisMap
Materialize this policy into a GenesisMap over nodes: one explicit
assignment per node (matched rule, else floor). No implicit catch-all is
left in the map — every assignment is concrete, so the completeness check
sees real coverage.
Trait Implementations§
Source§impl Clone for SitePolicy
impl Clone for SitePolicy
Source§fn clone(&self) -> SitePolicy
fn clone(&self) -> SitePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SitePolicy
impl RefUnwindSafe for SitePolicy
impl Send for SitePolicy
impl Sync for SitePolicy
impl Unpin for SitePolicy
impl UnsafeUnpin for SitePolicy
impl UnwindSafe for SitePolicy
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§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 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