pub struct AccessControl<'a, C: Config, const N: usize, const S: usize, const T: usize> { /* private fields */ }Expand description
The Access Control cluster over a node’s Acl.
The list is borrowed rather than owned, because §6.6.6 consults it on every interaction while this cluster only edits it — the same table has to be visible to both, and a copy would be a second answer to “who may do what”.
Implementations§
Source§impl<'a, C: Config, const N: usize, const S: usize, const T: usize> AccessControl<'a, C, N, S, T>
impl<'a, C: Config, const N: usize, const S: usize, const T: usize> AccessControl<'a, C, N, S, T>
Sourcepub fn new(acl: &'a RefCell<Acl<C, N, S, T>>) -> Self
pub fn new(acl: &'a RefCell<Acl<C, N, S, T>>) -> Self
A cluster over a node’s access control list.
Sourcepub fn add_admin_for_fabric(
&self,
fabric: FabricIndex,
subject: NodeId,
ctx: &InteractionContext<'_>,
) -> Result<()>
pub fn add_admin_for_fabric( &self, fabric: FabricIndex, subject: NodeId, ctx: &InteractionContext<'_>, ) -> Result<()>
§11.18.6.8 step 7’s administrator entry, added through the cluster so that it is recorded like any other change.
AddNOC creates exactly one ACL entry — “there would be no way for the caller on its
given Fabric to eventually add another Access Control Entry for CASE authentication
mode” without it — and it is the only entry on a freshly commissioned fabric. Added
straight to the Acl it is invisible to §9.10.9.1: the cluster never sees it, so the
audit trail of an Access Control cluster begins by omitting the one entry that granted
everything else. That is what the Test Harness reads first, and it is what an auditor
would want first.
ctx is the AddNOC interaction, which is a PASE session — so the event names an
AdminPasscodeID and a null AdminNodeID, as §9.10.9.1 requires of a change made over
PASE. fabric is passed separately because §11.18.6.8 binds the accessing fabric to the
session only at step 10a, after this: taking it from ctx would attribute the event
to fabric 0, where §7.14.4’s fabric sensitivity would hide it from everybody.
Sourcepub fn take_changes(&self) -> Vec<EntryChanged<S, T>, PENDING>
pub fn take_changes(&self) -> Vec<EntryChanged<S, T>, PENDING>
Takes the EntryChanged records the last writes produced (§9.10.9.1).
The device turns these into events in its own store. Draining rather than reading means a record is reported once, and a device that never drains cannot silently accumulate them forever — the buffer is fixed and the oldest records are dropped, the same way §7.14.2’s event ring drops its oldest.
Trait Implementations§
Source§impl<C: Config, const N: usize, const S: usize, const T: usize> Cluster for AccessControl<'_, C, N, S, T>
impl<C: Config, const N: usize, const S: usize, const T: usize> Cluster for AccessControl<'_, C, N, S, T>
Source§impl<C: Config, const N: usize, const S: usize, const T: usize> ClusterHandler for AccessControl<'_, C, N, S, T>
impl<C: Config, const N: usize, const S: usize, const T: usize> ClusterHandler for AccessControl<'_, C, N, S, T>
Source§fn on_lifecycle(&self, event: Lifecycle)
fn on_lifecycle(&self, event: Lifecycle)
§9.10.5.3: every ACL entry carries a FabricIndex, and §11.18.6.12 removes them with
the fabric. An entry that survives grants the next holder of that index whatever it
granted — the one case in this file that is an escalation rather than a leak.
Source§fn read(
&self,
resolved: &Resolved<'_>,
ctx: &InteractionContext<'_>,
w: &mut TlvWriter<'_>,
tag: Tag,
) -> Result<(), Status>
fn read( &self, resolved: &Resolved<'_>, ctx: &InteractionContext<'_>, w: &mut TlvWriter<'_>, tag: Tag, ) -> Result<(), Status>
Source§fn write(
&self,
resolved: &Resolved<'_>,
data: &[u8],
op: WriteOp,
ctx: &InteractionContext<'_>,
) -> Result<(), Status>
fn write( &self, resolved: &Resolved<'_>, data: &[u8], op: WriteOp, ctx: &InteractionContext<'_>, ) -> Result<(), Status>
data — the encoded TLV element, tag included — into the attribute. Read more