Skip to content

Commit

Permalink
Access control cluster xml (#12274)
Browse files Browse the repository at this point in the history
* Add access control cluster xml

Issue #11204

* Zap regeneration

* Update src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

* Update src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

* Update src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

* Remove lengths from array attributes

Apparently length is not required, which is good, because it can vary by
implementation.

* Remove ACL-cluster.xml from zcl.json

Later will add its replacement (access-control-cluster.xml).

* Fix duplicate attribute description in XML

Introduced by a code review suggestion, fixed now.

* Fix nullable attribute in XML

Introduced by a code review suggestion, fixed now.

* Fix fabric index type in xml

s/fabric-idx/fabric_idx/g

Silently generates the wrong code if it's wrong.

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jun 27, 2022
1 parent 1d7164b commit 3248445
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 261 deletions.
38 changes: 0 additions & 38 deletions src/app/zap-templates/zcl/data-model/chip/ACL-cluster.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2021 Project CHIP Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configurator>
<domain name="CHIP"/>

<enum name="Privilege" type="ENUM8">
<cluster code="0x001F"/>
<item name="View" value="0x01"/>
<item name="ProxyView" value="0x02"/>
<item name="Operate" value="0x03"/>
<item name="Manage" value="0x04"/>
<item name="Administer" value="0x05"/>
</enum>

<enum name="AuthMode" type="ENUM8">
<cluster code="0x001F"/>
<item name="PASE" value="0x01"/>
<item name="CASE" value="0x02"/>
<item name="Group" value="0x03"/>
</enum>

<struct name="Target">
<cluster code="0x001F"/>
<item fieldId="0" name="Cluster" type="INT32U" isNullable="true"/>
<item fieldId="1" name="Endpoint" type="INT16U" isNullable="true"/>
<item fieldId="2" name="DeviceType" type="INT32U" isNullable="true"/>
</struct>

<struct name="AccessControlEntry">
<cluster code="0x001F"/>
<item fieldId="0" name="FabricIndex" type="fabric_idx"/>
<item fieldId="1" name="Privilege" type="Privilege"/>
<item fieldId="2" name="AuthMode" type="AuthMode"/>
<item fieldId="3" name="Subjects" type="INT64U" isNullable="true" array="true"/>
<item fieldId="4" name="Targets" type="Target" isNullable="true" array="true"/>
</struct>

<struct name="ExtensionEntry">
<cluster code="0x001F"/>
<item fieldId="0" name="FabricIndex" type="fabric_idx"/>
<item fieldId="1" name="Data" type="OCTET_STRING" length="254"/>
</struct>

<cluster>
<domain>General</domain>
<name>Access Control</name>
<code>0x001F</code>
<define>ACCESS_CONTROL_CLUSTER</define>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<description>The Access Control Cluster exposes a data model view of a
Node’s Access Control List (ACL), which codifies the rules used to manage
and enforce Access Control for the Node’s endpoints and their associated
cluster instances.</description>
<!-- Base data types -->
<attribute side="server" code="0x0000" define="ACL" type="ARRAY" entryType="AccessControlEntry" writable="true" isNullable="true">
<description>ACL</description>
<access op="read" privilege="administer"/>
<access op="write" privilege="administer"/>
<access modifier="fabric-scoped"/>
</attribute>
<attribute side="server" code="0x0001" define="EXTENSION" type="ARRAY" entryType="ExtensionEntry" writable="true" isNullable="true">
<description>Extension</description>
<access op="read" privilege="administer"/>
<access op="write" privilege="administer"/>
<access modifier="fabric-scoped"/>
</attribute>
</cluster>
</configurator>
5 changes: 4 additions & 1 deletion src/app/zap-templates/zcl/data-model/chip/matter-devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ limitations under the License.
<profileId editable="false">0x0103</profileId>
<deviceId editable="false">0x0016</deviceId>
<clusters lockOthers="true">
<include cluster="Access Control" client="false" server="true" clientLocked="true" serverLocked="true">
<requireAttribute>ACL</requireAttribute>
<requireAttribute>EXTENSION</requireAttribute>
</include>
<include cluster="Basic" client="false" server="true" clientLocked="true" serverLocked="true">
<requireAttribute>INTERACTION_MODEL_VERSION</requireAttribute>
<requireAttribute>VENDOR_NAME</requireAttribute>
Expand All @@ -42,7 +46,6 @@ limitations under the License.
<requireAttribute>CLIENT_LIST</requireAttribute>
<requireAttribute>PARTS_LIST</requireAttribute>
</include>
<include cluster="ACL" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="Power Source Configuration" client="false" server="false" clientLocked="true" serverLocked="false"></include>
<include cluster="Time Synchronization" client="false" server="false" clientLocked="true" serverLocked="false"></include>
<include cluster="Group Key Management" client="false" server="true" clientLocked="true" serverLocked="true"></include>
Expand Down
1 change: 0 additions & 1 deletion src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"version": "ZCL Test Data",
"xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/"],
"xmlFile": [
"ACL-cluster.xml",
"account-login-cluster.xml",
"administrator-commissioning-cluster.xml",
"application-basic-cluster.xml",
Expand Down
38 changes: 0 additions & 38 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 0 additions & 112 deletions zzz_generated/app-common/app-common/zap-generated/callback.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3248445

Please sign in to comment.