Skip to content

Commit

Permalink
Align naming in Access Control cluster with the spec. (#24239)
Browse files Browse the repository at this point in the history
* Align naming in Access Control cluster with the spec.

Except for Target, because TargetStruct is used in the Bindings cluster already.

* Regenerate generated files.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jul 28, 2023
1 parent 9b7c7ec commit 2305600
Show file tree
Hide file tree
Showing 88 changed files with 2,661 additions and 2,379 deletions.
42 changes: 21 additions & 21 deletions docs/guides/access-control-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,15 @@ strongly typed values:

The privileges are:

- Clusters.AccessControl.Enums.Privilege.kView
- Clusters.AccessControl.Enums.Privilege.kOperate
- Clusters.AccessControl.Enums.Privilege.kManage
- Clusters.AccessControl.Enums.Privilege.kAdminister
- `Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView`
- `Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kOperate`
- `Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kManage`
- `Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kAdminister`

The authentication modes are:

- Clusters.AccessControl.Enums.AuthMode.kCASE
- Clusters.AccessControl.Enums.AuthMode.kGroup
- `Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCASE`
- `Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kGroup`

Some typical clusters:

Expand Down Expand Up @@ -433,14 +433,14 @@ await devCtrl.ReadAttribute(1, [ (0, Clusters.AccessControl.Attributes.Acl ) ] )

```
await devCtrl.WriteAttribute(1, [ (0, Clusters.AccessControl.Attributes.Acl( [
Clusters.AccessControl.Structs.AccessControlEntry(
privilege = Clusters.AccessControl.Enums.Privilege.kAdminister,
authMode = Clusters.AccessControl.Enums.AuthMode.kCase,
Clusters.AccessControl.Structs.AccessControlEntryStruct(
privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kAdminister,
authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase,
subjects = [ 1 ]
),
Clusters.AccessControl.Structs.AccessControlEntry(
privilege = Clusters.AccessControl.Enums.Privilege.kView,
authMode = Clusters.AccessControl.Enums.AuthMode.kCase,
Clusters.AccessControl.Structs.AccessControlEntryStruct(
privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView,
authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase,
subjects = [ 4444, 5555, 6666 ],
),
] ) ) ] )
Expand Down Expand Up @@ -482,19 +482,19 @@ await devCtrl.WriteAttribute(1, [ (0, Clusters.AccessControl.Attributes.Acl( [

```
await devCtrl.WriteAttribute(1, [ (0, Clusters.AccessControl.Attributes.Acl( [
Clusters.AccessControl.Structs.AccessControlEntry(
privilege = Clusters.AccessControl.Enums.Privilege.kAdminister,
authMode = Clusters.AccessControl.Enums.AuthMode.kCase,
Clusters.AccessControl.Structs.AccessControlEntryStruct(
privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kAdminister,
authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase,
subjects = [ 1 ]
),
Clusters.AccessControl.Structs.AccessControlEntry(
privilege = Clusters.AccessControl.Enums.Privilege.kView,
authMode = Clusters.AccessControl.Enums.AuthMode.kCase,
Clusters.AccessControl.Structs.AccessControlEntryStruct(
privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView,
authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase,
subjects = [ 4444, 5555, 6666 ],
),
Clusters.AccessControl.Structs.AccessControlEntry(
privilege = Clusters.AccessControl.Enums.Privilege.kOperate,
authMode = Clusters.AccessControl.Enums.AuthMode.kGroup,
Clusters.AccessControl.Structs.AccessControlEntryStruct(
privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kOperate,
authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kGroup,
subjects = [ 123, 456 ],
targets = [
Clusters.AccessControl.Structs.Target(
Expand Down
12 changes: 6 additions & 6 deletions docs/guides/repl/Matter_Access_Control.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,10 @@
}
],
"source": [
"acl = [ Clusters.AccessControl.Structs.AccessControlEntry(\n",
"acl = [ Clusters.AccessControl.Structs.AccessControlEntryStruct(\n",
" fabricIndex = 1,\n",
" privilege = Clusters.AccessControl.Enums.Privilege.kAdminister,\n",
" authMode = Clusters.AccessControl.Enums.AuthMode.kCase,\n",
" privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kAdminister,\n",
" authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase,\n",
" subjects = [ 1 ] ) \n",
"]\n",
"\n",
Expand Down Expand Up @@ -729,10 +729,10 @@
}
],
"source": [
"acl.append(Clusters.AccessControl.Structs.AccessControlEntry(\n",
"acl.append(Clusters.AccessControl.Structs.AccessControlEntryStruct(\n",
" fabricIndex = 1,\n",
" privilege = Clusters.AccessControl.Enums.Privilege.kOperate,\n",
" authMode = Clusters.AccessControl.Enums.AuthMode.kCase,\n",
" privilege = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kOperate,\n",
" authMode = Clusters.AccessControl.Enums.AccessControlEntryAuthModeEnum.kCase,\n",
" targets = [ Clusters.AccessControl.Structs.Target(\n",
" endpoint = 1,\n",
" ) ] ) )\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,29 +423,29 @@ server cluster Binding = 30 {
}

server cluster AccessControl = 31 {
enum AuthMode : ENUM8 {
enum AccessControlEntryAuthModeEnum : ENUM8 {
kPase = 1;
kCase = 2;
kGroup = 3;
}

enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

enum Privilege : ENUM8 {
enum AccessControlEntryPrivilegeEnum : ENUM8 {
kView = 1;
kProxyView = 2;
kOperate = 3;
kManage = 4;
kAdminister = 5;
}

fabric_scoped struct AccessControlEntry {
fabric_sensitive Privilege privilege = 1;
fabric_sensitive AuthMode authMode = 2;
enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

fabric_scoped struct AccessControlEntryStruct {
fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1;
fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2;
nullable fabric_sensitive int64u subjects[] = 3;
nullable fabric_sensitive Target targets[] = 4;
fabric_idx fabricIndex = 254;
Expand All @@ -457,7 +457,7 @@ server cluster AccessControl = 31 {
nullable devtype_id deviceType = 2;
}

fabric_scoped struct ExtensionEntry {
fabric_scoped struct AccessControlExtensionStruct {
fabric_sensitive octet_string<128> data = 1;
fabric_idx fabricIndex = 254;
}
Expand All @@ -466,20 +466,20 @@ server cluster AccessControl = 31 {
nullable node_id adminNodeID = 1;
nullable INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
nullable AccessControlEntry latestValue = 4;
nullable AccessControlEntryStruct latestValue = 4;
fabric_idx fabricIndex = 254;
}

fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
nullable node_id adminNodeID = 1;
nullable INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
nullable ExtensionEntry latestValue = 4;
nullable AccessControlExtensionStruct latestValue = 4;
fabric_idx fabricIndex = 254;
}

attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0;
attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1;
attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1;
readonly attribute int16u subjectsPerAccessControlEntry = 2;
readonly attribute int16u targetsPerAccessControlEntry = 3;
readonly attribute int16u accessControlEntriesPerFabric = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,29 +373,29 @@ server cluster Binding = 30 {
}

server cluster AccessControl = 31 {
enum AuthMode : ENUM8 {
enum AccessControlEntryAuthModeEnum : ENUM8 {
kPase = 1;
kCase = 2;
kGroup = 3;
}

enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

enum Privilege : ENUM8 {
enum AccessControlEntryPrivilegeEnum : ENUM8 {
kView = 1;
kProxyView = 2;
kOperate = 3;
kManage = 4;
kAdminister = 5;
}

fabric_scoped struct AccessControlEntry {
fabric_sensitive Privilege privilege = 1;
fabric_sensitive AuthMode authMode = 2;
enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

fabric_scoped struct AccessControlEntryStruct {
fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1;
fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2;
nullable fabric_sensitive int64u subjects[] = 3;
nullable fabric_sensitive Target targets[] = 4;
fabric_idx fabricIndex = 254;
Expand All @@ -411,19 +411,19 @@ server cluster AccessControl = 31 {
nullable node_id adminNodeID = 1;
nullable INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
nullable AccessControlEntry latestValue = 4;
nullable AccessControlEntryStruct latestValue = 4;
fabric_idx fabricIndex = 254;
}

fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
nullable node_id adminNodeID = 1;
nullable INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
nullable ExtensionEntry latestValue = 4;
nullable AccessControlExtensionStruct latestValue = 4;
fabric_idx fabricIndex = 254;
}

attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0;
attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
readonly attribute int16u subjectsPerAccessControlEntry = 2;
readonly attribute int16u targetsPerAccessControlEntry = 3;
readonly attribute int16u accessControlEntriesPerFabric = 4;
Expand Down
64 changes: 32 additions & 32 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -226,29 +226,29 @@ client cluster Binding = 30 {
}

client cluster AccessControl = 31 {
enum AuthMode : ENUM8 {
enum AccessControlEntryAuthModeEnum : ENUM8 {
kPase = 1;
kCase = 2;
kGroup = 3;
}

enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

enum Privilege : ENUM8 {
enum AccessControlEntryPrivilegeEnum : ENUM8 {
kView = 1;
kProxyView = 2;
kOperate = 3;
kManage = 4;
kAdminister = 5;
}

fabric_scoped struct AccessControlEntry {
fabric_sensitive Privilege privilege = 1;
fabric_sensitive AuthMode authMode = 2;
enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

fabric_scoped struct AccessControlEntryStruct {
fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1;
fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2;
nullable fabric_sensitive int64u subjects[] = 3;
nullable fabric_sensitive Target targets[] = 4;
fabric_idx fabricIndex = 254;
Expand All @@ -260,7 +260,7 @@ client cluster AccessControl = 31 {
nullable devtype_id deviceType = 2;
}

fabric_scoped struct ExtensionEntry {
fabric_scoped struct AccessControlExtensionStruct {
fabric_sensitive octet_string<128> data = 1;
fabric_idx fabricIndex = 254;
}
Expand All @@ -269,20 +269,20 @@ client cluster AccessControl = 31 {
nullable node_id adminNodeID = 1;
nullable INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
nullable AccessControlEntry latestValue = 4;
nullable AccessControlEntryStruct latestValue = 4;
fabric_idx fabricIndex = 254;
}

fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
nullable node_id adminNodeID = 1;
nullable INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
nullable ExtensionEntry latestValue = 4;
nullable AccessControlExtensionStruct latestValue = 4;
fabric_idx fabricIndex = 254;
}

attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0;
attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1;
attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1;
readonly attribute int16u subjectsPerAccessControlEntry = 2;
readonly attribute int16u targetsPerAccessControlEntry = 3;
readonly attribute int16u accessControlEntriesPerFabric = 4;
Expand All @@ -294,29 +294,29 @@ client cluster AccessControl = 31 {
}

server cluster AccessControl = 31 {
enum AuthMode : ENUM8 {
enum AccessControlEntryAuthModeEnum : ENUM8 {
kPase = 1;
kCase = 2;
kGroup = 3;
}

enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

enum Privilege : ENUM8 {
enum AccessControlEntryPrivilegeEnum : ENUM8 {
kView = 1;
kProxyView = 2;
kOperate = 3;
kManage = 4;
kAdminister = 5;
}

fabric_scoped struct AccessControlEntry {
fabric_sensitive Privilege privilege = 1;
fabric_sensitive AuthMode authMode = 2;
enum ChangeTypeEnum : ENUM8 {
kChanged = 0;
kAdded = 1;
kRemoved = 2;
}

fabric_scoped struct AccessControlEntryStruct {
fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1;
fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2;
nullable fabric_sensitive int64u subjects[] = 3;
nullable fabric_sensitive Target targets[] = 4;
fabric_idx fabricIndex = 254;
Expand All @@ -328,7 +328,7 @@ server cluster AccessControl = 31 {
nullable devtype_id deviceType = 2;
}

fabric_scoped struct ExtensionEntry {
fabric_scoped struct AccessControlExtensionStruct {
fabric_sensitive octet_string<128> data = 1;
fabric_idx fabricIndex = 254;
}
Expand All @@ -337,20 +337,20 @@ server cluster AccessControl = 31 {
nullable node_id adminNodeID = 1;
nullable INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
nullable AccessControlEntry latestValue = 4;
nullable AccessControlEntryStruct latestValue = 4;
fabric_idx fabricIndex = 254;
}

fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
nullable node_id adminNodeID = 1;
nullable INT16U adminPasscodeID = 2;
ChangeTypeEnum changeType = 3;
nullable ExtensionEntry latestValue = 4;
nullable AccessControlExtensionStruct latestValue = 4;
fabric_idx fabricIndex = 254;
}

attribute access(read: administer, write: administer) AccessControlEntry acl[] = 0;
attribute access(read: administer, write: administer) ExtensionEntry extension[] = 1;
attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0;
attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1;
readonly attribute int16u subjectsPerAccessControlEntry = 2;
readonly attribute int16u targetsPerAccessControlEntry = 3;
readonly attribute int16u accessControlEntriesPerFabric = 4;
Expand Down
Loading

0 comments on commit 2305600

Please sign in to comment.