Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d157918

Browse files
tleacmcsabzbarsky-apple
authored andcommittedJul 31, 2024
Add ARL feature to access control cluster and regen (project-chip#34535)
* Add ARL feature to access control cluster and regen Edits to src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml then zap_regen_all.py * Fixed kotlin generation * Fixed response for ReviewFabricRestrictions command * review updates * Fix Python ZAP codegen mis-merge. * Updated acces-control-cluster.xml with alchemy minor hand edits required to zap_regen_all.py successfully. --------- Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent 6ec3fde commit d157918

File tree

141 files changed

+9388
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+9388
-136
lines changed
 

‎examples/air-purifier-app/air-purifier-common/air-purifier-app.matter

+55-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ cluster Descriptor = 29 {
106106
and enforce Access Control for the Node's endpoints and their associated
107107
cluster instances. */
108108
cluster AccessControl = 31 {
109-
revision 1; // NOTE: Default/not specifically set
109+
revision 2;
110110

111111
enum AccessControlEntryAuthModeEnum : enum8 {
112112
kPASE = 1;
@@ -122,12 +122,42 @@ cluster AccessControl = 31 {
122122
kAdminister = 5;
123123
}
124124

125+
enum AccessRestrictionTypeEnum : enum8 {
126+
kAttributeAccessForbidden = 0;
127+
kAttributeWriteForbidden = 1;
128+
kCommandForbidden = 2;
129+
kEventForbidden = 3;
130+
}
131+
125132
enum ChangeTypeEnum : enum8 {
126133
kChanged = 0;
127134
kAdded = 1;
128135
kRemoved = 2;
129136
}
130137

138+
bitmap Feature : bitmap32 {
139+
kExtension = 0x1;
140+
kManagedDevice = 0x2;
141+
}
142+
143+
struct AccessRestrictionStruct {
144+
AccessRestrictionTypeEnum type = 0;
145+
nullable int32u id = 1;
146+
}
147+
148+
struct CommissioningAccessRestrictionEntryStruct {
149+
endpoint_no endpoint = 0;
150+
cluster_id cluster = 1;
151+
AccessRestrictionStruct restrictions[] = 2;
152+
}
153+
154+
fabric_scoped struct AccessRestrictionEntryStruct {
155+
fabric_sensitive endpoint_no endpoint = 0;
156+
fabric_sensitive cluster_id cluster = 1;
157+
fabric_sensitive AccessRestrictionStruct restrictions[] = 2;
158+
fabric_idx fabricIndex = 254;
159+
}
160+
131161
struct AccessControlTargetStruct {
132162
nullable cluster_id cluster = 0;
133163
nullable endpoint_no endpoint = 1;
@@ -163,17 +193,41 @@ cluster AccessControl = 31 {
163193
fabric_idx fabricIndex = 254;
164194
}
165195

196+
fabric_sensitive info event access(read: administer) AccessRestrictionEntryChanged = 2 {
197+
fabric_idx fabricIndex = 254;
198+
}
199+
200+
fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 3 {
201+
int64u token = 0;
202+
nullable long_char_string instruction = 1;
203+
nullable long_char_string redirectURL = 2;
204+
fabric_idx fabricIndex = 254;
205+
}
206+
166207
attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
167208
attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1;
168209
readonly attribute int16u subjectsPerAccessControlEntry = 2;
169210
readonly attribute int16u targetsPerAccessControlEntry = 3;
170211
readonly attribute int16u accessControlEntriesPerFabric = 4;
212+
readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5;
213+
readonly attribute optional AccessRestrictionEntryStruct arl[] = 6;
171214
readonly attribute command_id generatedCommandList[] = 65528;
172215
readonly attribute command_id acceptedCommandList[] = 65529;
173216
readonly attribute event_id eventList[] = 65530;
174217
readonly attribute attrib_id attributeList[] = 65531;
175218
readonly attribute bitmap32 featureMap = 65532;
176219
readonly attribute int16u clusterRevision = 65533;
220+
221+
request struct ReviewFabricRestrictionsRequest {
222+
AccessRestrictionStruct arl[] = 0;
223+
}
224+
225+
response struct ReviewFabricRestrictionsResponse = 1 {
226+
int64u token = 0;
227+
}
228+
229+
/** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */
230+
fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): DefaultSuccess = 0;
177231
}
178232

179233
/** This cluster provides attributes and events for determining basic information about Nodes, which supports both

‎examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter

+55-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ cluster Descriptor = 29 {
106106
and enforce Access Control for the Node's endpoints and their associated
107107
cluster instances. */
108108
cluster AccessControl = 31 {
109-
revision 1; // NOTE: Default/not specifically set
109+
revision 2;
110110

111111
enum AccessControlEntryAuthModeEnum : enum8 {
112112
kPASE = 1;
@@ -122,12 +122,42 @@ cluster AccessControl = 31 {
122122
kAdminister = 5;
123123
}
124124

125+
enum AccessRestrictionTypeEnum : enum8 {
126+
kAttributeAccessForbidden = 0;
127+
kAttributeWriteForbidden = 1;
128+
kCommandForbidden = 2;
129+
kEventForbidden = 3;
130+
}
131+
125132
enum ChangeTypeEnum : enum8 {
126133
kChanged = 0;
127134
kAdded = 1;
128135
kRemoved = 2;
129136
}
130137

138+
bitmap Feature : bitmap32 {
139+
kExtension = 0x1;
140+
kManagedDevice = 0x2;
141+
}
142+
143+
struct AccessRestrictionStruct {
144+
AccessRestrictionTypeEnum type = 0;
145+
nullable int32u id = 1;
146+
}
147+
148+
struct CommissioningAccessRestrictionEntryStruct {
149+
endpoint_no endpoint = 0;
150+
cluster_id cluster = 1;
151+
AccessRestrictionStruct restrictions[] = 2;
152+
}
153+
154+
fabric_scoped struct AccessRestrictionEntryStruct {
155+
fabric_sensitive endpoint_no endpoint = 0;
156+
fabric_sensitive cluster_id cluster = 1;
157+
fabric_sensitive AccessRestrictionStruct restrictions[] = 2;
158+
fabric_idx fabricIndex = 254;
159+
}
160+
131161
struct AccessControlTargetStruct {
132162
nullable cluster_id cluster = 0;
133163
nullable endpoint_no endpoint = 1;
@@ -163,17 +193,41 @@ cluster AccessControl = 31 {
163193
fabric_idx fabricIndex = 254;
164194
}
165195

196+
fabric_sensitive info event access(read: administer) AccessRestrictionEntryChanged = 2 {
197+
fabric_idx fabricIndex = 254;
198+
}
199+
200+
fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 3 {
201+
int64u token = 0;
202+
nullable long_char_string instruction = 1;
203+
nullable long_char_string redirectURL = 2;
204+
fabric_idx fabricIndex = 254;
205+
}
206+
166207
attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
167208
attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1;
168209
readonly attribute int16u subjectsPerAccessControlEntry = 2;
169210
readonly attribute int16u targetsPerAccessControlEntry = 3;
170211
readonly attribute int16u accessControlEntriesPerFabric = 4;
212+
readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5;
213+
readonly attribute optional AccessRestrictionEntryStruct arl[] = 6;
171214
readonly attribute command_id generatedCommandList[] = 65528;
172215
readonly attribute command_id acceptedCommandList[] = 65529;
173216
readonly attribute event_id eventList[] = 65530;
174217
readonly attribute attrib_id attributeList[] = 65531;
175218
readonly attribute bitmap32 featureMap = 65532;
176219
readonly attribute int16u clusterRevision = 65533;
220+
221+
request struct ReviewFabricRestrictionsRequest {
222+
AccessRestrictionStruct arl[] = 0;
223+
}
224+
225+
response struct ReviewFabricRestrictionsResponse = 1 {
226+
int64u token = 0;
227+
}
228+
229+
/** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */
230+
fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): DefaultSuccess = 0;
177231
}
178232

179233
/** This cluster provides attributes and events for determining basic information about Nodes, which supports both

0 commit comments

Comments
 (0)