Skip to content

Commit d38820d

Browse files
authored
Fabric-scoped and fabric-sensitive updates for IDL (project-chip#22955)
* Start defining fabric-sensitive types * Update types: structures are fabric scoped, attributes are fabric sensitive (if applicable) * Tag fabric-scoped structures in matter idl * Allow fields to be marked fabric sensitive * Start supporting fabric scoped and sensitive logic * zap regen * Add parser and tests for fabric-sensitive events * Restyle * Add tag for fabric sensitive events in idl generator * zap regen * Fix typo in readme * Fix typo * Add support for fabric scoped and fabric sensitive * Add unit test for fabric sensitive and scoped stuff * Rename attributes to qualites, tests pass in idl. More code review comments * Fix java codegen tests * Remove unused import * Remove more unused imports * Regen bridge-app.matter * Regen lighting-on-off * Rename fabric_command to fabric_scoped_command
1 parent b44263f commit d38820d

File tree

53 files changed

+943
-844
lines changed

Some content is hidden

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

53 files changed

+943
-844
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+26-26
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ server cluster Descriptor = 29 {
404404
}
405405

406406
server cluster Binding = 30 {
407-
struct TargetStruct {
407+
fabric_scoped struct TargetStruct {
408408
optional node_id node = 1;
409409
optional group_id group = 2;
410410
optional endpoint_no endpoint = 3;
@@ -438,11 +438,11 @@ server cluster AccessControl = 31 {
438438
kAdminister = 5;
439439
}
440440

441-
struct AccessControlEntry {
442-
Privilege privilege = 1;
443-
AuthMode authMode = 2;
444-
nullable int64u subjects[] = 3;
445-
nullable Target targets[] = 4;
441+
fabric_scoped struct AccessControlEntry {
442+
fabric_sensitive Privilege privilege = 1;
443+
fabric_sensitive AuthMode authMode = 2;
444+
nullable fabric_sensitive int64u subjects[] = 3;
445+
nullable fabric_sensitive Target targets[] = 4;
446446
fabric_idx fabricIndex = 254;
447447
}
448448

@@ -452,20 +452,20 @@ server cluster AccessControl = 31 {
452452
nullable devtype_id deviceType = 2;
453453
}
454454

455-
struct ExtensionEntry {
456-
octet_string<128> data = 1;
455+
fabric_scoped struct ExtensionEntry {
456+
fabric_sensitive octet_string<128> data = 1;
457457
fabric_idx fabricIndex = 254;
458458
}
459459

460-
info event access(read: administer) AccessControlEntryChanged = 0 {
460+
fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 {
461461
nullable node_id adminNodeID = 1;
462462
nullable INT16U adminPasscodeID = 2;
463463
ChangeTypeEnum changeType = 3;
464464
nullable AccessControlEntry latestValue = 4;
465465
fabric_idx fabricIndex = 254;
466466
}
467467

468-
info event access(read: administer) AccessControlExtensionChanged = 1 {
468+
fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
469469
nullable node_id adminNodeID = 1;
470470
nullable INT16U adminPasscodeID = 2;
471471
ChangeTypeEnum changeType = 3;
@@ -688,7 +688,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 {
688688
kDelayedOnUserConsent = 8;
689689
}
690690

691-
struct ProviderLocation {
691+
fabric_scoped struct ProviderLocation {
692692
node_id providerNodeID = 1;
693693
endpoint_no endpoint = 2;
694694
fabric_idx fabricIndex = 254;
@@ -1570,13 +1570,13 @@ server cluster OperationalCredentials = 62 {
15701570
kInvalidFabricIndex = 11;
15711571
}
15721572

1573-
struct NOCStruct {
1574-
octet_string noc = 1;
1575-
nullable octet_string icac = 2;
1573+
fabric_scoped struct NOCStruct {
1574+
fabric_sensitive octet_string noc = 1;
1575+
nullable fabric_sensitive octet_string icac = 2;
15761576
fabric_idx fabricIndex = 254;
15771577
}
15781578

1579-
struct FabricDescriptor {
1579+
fabric_scoped struct FabricDescriptor {
15801580
octet_string<65> rootPublicKey = 1;
15811581
vendor_id vendorId = 2;
15821582
fabric_id fabricId = 3;
@@ -1668,13 +1668,13 @@ server cluster GroupKeyManagement = 63 {
16681668
kCacheAndSync = 1;
16691669
}
16701670

1671-
struct GroupKeyMapStruct {
1671+
fabric_scoped struct GroupKeyMapStruct {
16721672
group_id groupId = 1;
16731673
int16u groupKeySetID = 2;
16741674
fabric_idx fabricIndex = 254;
16751675
}
16761676

1677-
struct GroupInfoMapStruct {
1677+
fabric_scoped struct GroupInfoMapStruct {
16781678
group_id groupId = 1;
16791679
endpoint_no endpoints[] = 2;
16801680
optional char_string<16> groupName = 3;
@@ -3601,14 +3601,14 @@ server cluster TestCluster = 4294048773 {
36013601
double h = 7;
36023602
}
36033603

3604-
struct TestFabricScoped {
3605-
int8u fabricSensitiveInt8u = 1;
3606-
optional int8u optionalFabricSensitiveInt8u = 2;
3607-
nullable int8u nullableFabricSensitiveInt8u = 3;
3608-
optional nullable int8u nullableOptionalFabricSensitiveInt8u = 4;
3609-
char_string fabricSensitiveCharString = 5;
3610-
SimpleStruct fabricSensitiveStruct = 6;
3611-
int8u fabricSensitiveInt8uList[] = 7;
3604+
fabric_scoped struct TestFabricScoped {
3605+
fabric_sensitive int8u fabricSensitiveInt8u = 1;
3606+
optional fabric_sensitive int8u optionalFabricSensitiveInt8u = 2;
3607+
nullable fabric_sensitive int8u nullableFabricSensitiveInt8u = 3;
3608+
optional nullable fabric_sensitive int8u nullableOptionalFabricSensitiveInt8u = 4;
3609+
fabric_sensitive char_string fabricSensitiveCharString = 5;
3610+
fabric_sensitive SimpleStruct fabricSensitiveStruct = 6;
3611+
fabric_sensitive int8u fabricSensitiveInt8uList[] = 7;
36123612
fabric_idx fabricIndex = 254;
36133613
}
36143614

@@ -3637,7 +3637,7 @@ server cluster TestCluster = 4294048773 {
36373637
SimpleEnum arg6[] = 6;
36383638
}
36393639

3640-
info event TestFabricScopedEvent = 2 {
3640+
fabric_sensitive info event TestFabricScopedEvent = 2 {
36413641
fabric_idx fabricIndex = 254;
36423642
}
36433643

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter

+24-24
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ server cluster Descriptor = 29 {
354354
}
355355

356356
server cluster Binding = 30 {
357-
struct TargetStruct {
357+
fabric_scoped struct TargetStruct {
358358
optional node_id node = 1;
359359
optional group_id group = 2;
360360
optional endpoint_no endpoint = 3;
@@ -388,11 +388,11 @@ server cluster AccessControl = 31 {
388388
kAdminister = 5;
389389
}
390390

391-
struct AccessControlEntry {
392-
Privilege privilege = 1;
393-
AuthMode authMode = 2;
394-
nullable int64u subjects[] = 3;
395-
nullable Target targets[] = 4;
391+
fabric_scoped struct AccessControlEntry {
392+
fabric_sensitive Privilege privilege = 1;
393+
fabric_sensitive AuthMode authMode = 2;
394+
nullable fabric_sensitive int64u subjects[] = 3;
395+
nullable fabric_sensitive Target targets[] = 4;
396396
fabric_idx fabricIndex = 254;
397397
}
398398

@@ -402,15 +402,15 @@ server cluster AccessControl = 31 {
402402
nullable devtype_id deviceType = 2;
403403
}
404404

405-
info event access(read: administer) AccessControlEntryChanged = 0 {
405+
fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 {
406406
nullable node_id adminNodeID = 1;
407407
nullable INT16U adminPasscodeID = 2;
408408
ChangeTypeEnum changeType = 3;
409409
nullable AccessControlEntry latestValue = 4;
410410
fabric_idx fabricIndex = 254;
411411
}
412412

413-
info event access(read: administer) AccessControlExtensionChanged = 1 {
413+
fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
414414
nullable node_id adminNodeID = 1;
415415
nullable INT16U adminPasscodeID = 2;
416416
ChangeTypeEnum changeType = 3;
@@ -623,7 +623,7 @@ server cluster OtaSoftwareUpdateRequestor = 42 {
623623
kDelayedOnUserConsent = 8;
624624
}
625625

626-
struct ProviderLocation {
626+
fabric_scoped struct ProviderLocation {
627627
node_id providerNodeID = 1;
628628
endpoint_no endpoint = 2;
629629
fabric_idx fabricIndex = 254;
@@ -1415,13 +1415,13 @@ server cluster OperationalCredentials = 62 {
14151415
kInvalidFabricIndex = 11;
14161416
}
14171417

1418-
struct NOCStruct {
1419-
octet_string noc = 1;
1420-
nullable octet_string icac = 2;
1418+
fabric_scoped struct NOCStruct {
1419+
fabric_sensitive octet_string noc = 1;
1420+
nullable fabric_sensitive octet_string icac = 2;
14211421
fabric_idx fabricIndex = 254;
14221422
}
14231423

1424-
struct FabricDescriptor {
1424+
fabric_scoped struct FabricDescriptor {
14251425
octet_string<65> rootPublicKey = 1;
14261426
vendor_id vendorId = 2;
14271427
fabric_id fabricId = 3;
@@ -1513,13 +1513,13 @@ server cluster GroupKeyManagement = 63 {
15131513
kCacheAndSync = 1;
15141514
}
15151515

1516-
struct GroupKeyMapStruct {
1516+
fabric_scoped struct GroupKeyMapStruct {
15171517
group_id groupId = 1;
15181518
int16u groupKeySetID = 2;
15191519
fabric_idx fabricIndex = 254;
15201520
}
15211521

1522-
struct GroupInfoMapStruct {
1522+
fabric_scoped struct GroupInfoMapStruct {
15231523
group_id groupId = 1;
15241524
endpoint_no endpoints[] = 2;
15251525
optional char_string<16> groupName = 3;
@@ -3025,14 +3025,14 @@ server cluster TestCluster = 4294048773 {
30253025
double h = 7;
30263026
}
30273027

3028-
struct TestFabricScoped {
3029-
int8u fabricSensitiveInt8u = 1;
3030-
optional int8u optionalFabricSensitiveInt8u = 2;
3031-
nullable int8u nullableFabricSensitiveInt8u = 3;
3032-
optional nullable int8u nullableOptionalFabricSensitiveInt8u = 4;
3033-
char_string fabricSensitiveCharString = 5;
3034-
SimpleStruct fabricSensitiveStruct = 6;
3035-
int8u fabricSensitiveInt8uList[] = 7;
3028+
fabric_scoped struct TestFabricScoped {
3029+
fabric_sensitive int8u fabricSensitiveInt8u = 1;
3030+
optional fabric_sensitive int8u optionalFabricSensitiveInt8u = 2;
3031+
nullable fabric_sensitive int8u nullableFabricSensitiveInt8u = 3;
3032+
optional nullable fabric_sensitive int8u nullableOptionalFabricSensitiveInt8u = 4;
3033+
fabric_sensitive char_string fabricSensitiveCharString = 5;
3034+
fabric_sensitive SimpleStruct fabricSensitiveStruct = 6;
3035+
fabric_sensitive int8u fabricSensitiveInt8uList[] = 7;
30363036
fabric_idx fabricIndex = 254;
30373037
}
30383038

@@ -3061,7 +3061,7 @@ server cluster TestCluster = 4294048773 {
30613061
SimpleEnum arg6[] = 6;
30623062
}
30633063

3064-
info event TestFabricScopedEvent = 2 {
3064+
fabric_sensitive info event TestFabricScopedEvent = 2 {
30653065
fabric_idx fabricIndex = 254;
30663066
}
30673067

examples/bridge-app/bridge-common/bridge-app.matter

+25-25
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ server cluster Descriptor = 29 {
204204
}
205205

206206
client cluster Binding = 30 {
207-
struct TargetStruct {
207+
fabric_scoped struct TargetStruct {
208208
optional node_id node = 1;
209209
optional group_id group = 2;
210210
optional endpoint_no endpoint = 3;
@@ -241,11 +241,11 @@ client cluster AccessControl = 31 {
241241
kAdminister = 5;
242242
}
243243

244-
struct AccessControlEntry {
245-
Privilege privilege = 1;
246-
AuthMode authMode = 2;
247-
nullable int64u subjects[] = 3;
248-
nullable Target targets[] = 4;
244+
fabric_scoped struct AccessControlEntry {
245+
fabric_sensitive Privilege privilege = 1;
246+
fabric_sensitive AuthMode authMode = 2;
247+
nullable fabric_sensitive int64u subjects[] = 3;
248+
nullable fabric_sensitive Target targets[] = 4;
249249
fabric_idx fabricIndex = 254;
250250
}
251251

@@ -255,20 +255,20 @@ client cluster AccessControl = 31 {
255255
nullable devtype_id deviceType = 2;
256256
}
257257

258-
struct ExtensionEntry {
259-
octet_string<128> data = 1;
258+
fabric_scoped struct ExtensionEntry {
259+
fabric_sensitive octet_string<128> data = 1;
260260
fabric_idx fabricIndex = 254;
261261
}
262262

263-
info event access(read: administer) AccessControlEntryChanged = 0 {
263+
fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 {
264264
nullable node_id adminNodeID = 1;
265265
nullable INT16U adminPasscodeID = 2;
266266
ChangeTypeEnum changeType = 3;
267267
nullable AccessControlEntry latestValue = 4;
268268
fabric_idx fabricIndex = 254;
269269
}
270270

271-
info event access(read: administer) AccessControlExtensionChanged = 1 {
271+
fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
272272
nullable node_id adminNodeID = 1;
273273
nullable INT16U adminPasscodeID = 2;
274274
ChangeTypeEnum changeType = 3;
@@ -309,11 +309,11 @@ server cluster AccessControl = 31 {
309309
kAdminister = 5;
310310
}
311311

312-
struct AccessControlEntry {
313-
Privilege privilege = 1;
314-
AuthMode authMode = 2;
315-
nullable int64u subjects[] = 3;
316-
nullable Target targets[] = 4;
312+
fabric_scoped struct AccessControlEntry {
313+
fabric_sensitive Privilege privilege = 1;
314+
fabric_sensitive AuthMode authMode = 2;
315+
nullable fabric_sensitive int64u subjects[] = 3;
316+
nullable fabric_sensitive Target targets[] = 4;
317317
fabric_idx fabricIndex = 254;
318318
}
319319

@@ -323,20 +323,20 @@ server cluster AccessControl = 31 {
323323
nullable devtype_id deviceType = 2;
324324
}
325325

326-
struct ExtensionEntry {
327-
octet_string<128> data = 1;
326+
fabric_scoped struct ExtensionEntry {
327+
fabric_sensitive octet_string<128> data = 1;
328328
fabric_idx fabricIndex = 254;
329329
}
330330

331-
info event access(read: administer) AccessControlEntryChanged = 0 {
331+
fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 {
332332
nullable node_id adminNodeID = 1;
333333
nullable INT16U adminPasscodeID = 2;
334334
ChangeTypeEnum changeType = 3;
335335
nullable AccessControlEntry latestValue = 4;
336336
fabric_idx fabricIndex = 254;
337337
}
338338

339-
info event access(read: administer) AccessControlExtensionChanged = 1 {
339+
fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 {
340340
nullable node_id adminNodeID = 1;
341341
nullable INT16U adminPasscodeID = 2;
342342
ChangeTypeEnum changeType = 3;
@@ -1260,13 +1260,13 @@ server cluster OperationalCredentials = 62 {
12601260
kInvalidFabricIndex = 11;
12611261
}
12621262

1263-
struct NOCStruct {
1264-
octet_string noc = 1;
1265-
nullable octet_string icac = 2;
1263+
fabric_scoped struct NOCStruct {
1264+
fabric_sensitive octet_string noc = 1;
1265+
nullable fabric_sensitive octet_string icac = 2;
12661266
fabric_idx fabricIndex = 254;
12671267
}
12681268

1269-
struct FabricDescriptor {
1269+
fabric_scoped struct FabricDescriptor {
12701270
octet_string<65> rootPublicKey = 1;
12711271
vendor_id vendorId = 2;
12721272
fabric_id fabricId = 3;
@@ -1361,13 +1361,13 @@ server cluster GroupKeyManagement = 63 {
13611361
kCacheAndSync = 1;
13621362
}
13631363

1364-
struct GroupKeyMapStruct {
1364+
fabric_scoped struct GroupKeyMapStruct {
13651365
group_id groupId = 1;
13661366
int16u groupKeySetID = 2;
13671367
fabric_idx fabricIndex = 254;
13681368
}
13691369

1370-
struct GroupInfoMapStruct {
1370+
fabric_scoped struct GroupInfoMapStruct {
13711371
group_id groupId = 1;
13721372
endpoint_no endpoints[] = 2;
13731373
optional char_string<16> groupName = 3;

0 commit comments

Comments
 (0)