pub struct SectorAccessPolicy {
pub name: String,
pub sector: String,
pub field_tiers: HashMap<String, AccessTier>,
pub default_tier: AccessTier,
}Expand description
Maps JSON field names to their minimum access tier.
Fields not listed fall back to Self::default_tier. Matching is by
normalized leaf key name (case- and separator-insensitive), so a policy
key disassemblyInstructions also covers a payload key
disassembly_instructions — closing the casing/nesting drift that let
elevated fields leak at the Public tier (crypto Gap 6).
Fields§
§name: StringHuman-readable policy name (e.g., "textile-v1.1").
sector: StringThe sector this policy applies to.
field_tiers: HashMap<String, AccessTier>Map of JSON field name → minimum access tier. A listed field is matched wherever it appears in the document (any nesting depth), by normalized key.
default_tier: AccessTierTier applied to fields not listed in field_tiers. Defaults to
Public (backward-compatible: only elevated fields need listing). Set to
Confidential for a true default-deny (fail-closed) policy, where every
public field must be explicitly listed as Public.
Implementations§
Source§impl SectorAccessPolicy
impl SectorAccessPolicy
Sourcepub fn from_catalog(catalog: &SectorCatalog, sector_key: &str) -> Option<Self>
pub fn from_catalog(catalog: &SectorCatalog, sector_key: &str) -> Option<Self>
Build a sector’s access policy from the catalog’s declared per-field tiers, folding in the universal confidential fields.
This works for every sector with no per-sector Rust code — the tiers
are data in the sector manifests (access_tiers). Returns None if
sector_key is not in the catalog.
Sourcepub fn passport_default() -> Self
pub fn passport_default() -> Self
Default access policy for top-level passport fields (sector-agnostic).
Sourcepub fn tier_for_field(&self, field_name: &str) -> AccessTier
pub fn tier_for_field(&self, field_name: &str) -> AccessTier
Get the minimum access tier for a field, matched by normalized key name
(case/separator-insensitive). Unlisted fields fall back to default_tier.
Trait Implementations§
Source§impl Clone for SectorAccessPolicy
impl Clone for SectorAccessPolicy
Source§fn clone(&self) -> SectorAccessPolicy
fn clone(&self) -> SectorAccessPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more