Skip to main content

AccessControl

Struct AccessControl 

Source
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>

Source

pub fn new(acl: &'a RefCell<Acl<C, N, S, T>>) -> Self

A cluster over a node’s access control list.

Source

pub const fn acl(&self) -> &'a RefCell<Acl<C, N, S, T>>

The list this cluster edits.

Source

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.

Source

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>

Source§

const ID: ClusterId = ID

The cluster id this implementation serves.
Source§

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)

§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>

Writes the value of resolved’s attribute under tag. Read more
Source§

fn write( &self, resolved: &Resolved<'_>, data: &[u8], op: WriteOp, ctx: &InteractionContext<'_>, ) -> Result<(), Status>

Writes data — the encoded TLV element, tag included — into the attribute. Read more
Source§

fn data_version(&self, _resolved: &Resolved<'_>) -> Option<u32>

The cluster instance’s data version (§7.10.3), if it tracks one. Read more
Source§

fn invoke( &self, _resolved: &ResolvedCommand<'_>, _fields: Option<&[u8]>, _ctx: &InteractionContext<'_>, _w: &mut TlvWriter<'_>, _tag: Tag, ) -> Result<Option<CommandId>, StatusIb>

Runs a command. Read more
Source§

impl<'a, C: Debug + Config, const N: usize, const S: usize, const T: usize> Debug for AccessControl<'a, C, N, S, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !Freeze for AccessControl<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !RefUnwindSafe for AccessControl<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !Send for AccessControl<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !Sync for AccessControl<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !UnwindSafe for AccessControl<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> Forget for AccessControl<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> Move for AccessControl<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> Unpin for AccessControl<'a, C, N, S, T>
where &'a RefCell<Acl<C, N, S, T>>: Unpin, RefCell<VecInner<EntryChanged<S, T>, usize, VecStorageInner<[MaybeUninit<EntryChanged<S, T>>; 8]>>>: Unpin,

§

impl<'a, C, const N: usize, const S: usize, const T: usize> UnsafeUnpin for AccessControl<'a, C, N, S, T>
where &'a RefCell<Acl<C, N, S, T>>: UnsafeUnpin, RefCell<VecInner<EntryChanged<S, T>, usize, VecStorageInner<[MaybeUninit<EntryChanged<S, T>>; 8]>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.