Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access control device type support #16794

Conversation

mlepage-google
Copy link
Contributor

Problem

Fixes #14431

Change overview

Add device type resolver which can be registered with access control
for looking up device types on endpoints. Provide real and test
implementations.

Testing

  • Unit tests updated.
  • Build and run chip-all-clusters-app using chip-tool on Linux
  • Install ACLs for device types 0x16 (root) and 0x100 (on/off light device)
  • Check that device type targets work as expected

Create a DeviceTypeResolver that can be installed in
AccessControl so device type can work in targets.

Fixes project-chip#14431
@github-actions
Copy link

github-actions bot commented Mar 29, 2022

PR #16794: Size comparison from 32e7c70 to 40c232f

Increases above 0.2%:

platform target config section 32e7c70 40c232f change % change
cyw30739 light cyw930739m2evb_01 .data 604 608 4 0.7
lock cyw930739m2evb_01 .data 568 572 4 0.7
ota-requestor-no-progress-logging cyw930739m2evb_01 .data 508 512 4 0.8
Increases (6 builds for cyw30739, mbed, nrfconnect, telink)
platform target config section 32e7c70 40c232f change % change
cyw30739 light cyw930739m2evb_01 (read/write) 606354 606478 124 0.0
.app_xip_area 513124 513224 100 0.0
.bss 75976 75992 16 0.0
.data 604 608 4 0.7
lock cyw930739m2evb_01 (read/write) 563902 564018 116 0.0
.app_xip_area 472200 472300 100 0.0
.bss 74480 74496 16 0.0
.data 568 572 4 0.7
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 576162 576270 108 0.0
.app_xip_area 474812 474896 84 0.0
.bss 83808 83824 16 0.0
.data 508 512 4 0.8
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2356724 2356812 88 0.0
.bss 185020 185036 16 0.0
.data 5760 5768 8 0.1
.text 1319324 1319412 88 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1144375 1144455 80 0.0
bss 143052 143064 12 0.0
text 784168 784264 96 0.0
telink lighting-app tlsr9518adk80d (read/write) 788608 788724 116 0.0
bss 70268 70276 8 0.0
text 558972 559104 132 0.0
Decreases (1 build for nrfconnect)
platform target config section 32e7c70 40c232f change % change
nrfconnect all-clusters-app nrf52840dk_nrf52840 rodata 142304 142288 -16 -0.0
Full report (6 builds for cyw30739, mbed, nrfconnect, telink)
platform target config section 32e7c70 40c232f change % change
cyw30739 light cyw930739m2evb_01 (read/write) 606354 606478 124 0.0
.app_xip_area 513124 513224 100 0.0
.bss 75976 75992 16 0.0
.data 604 608 4 0.7
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 563902 564018 116 0.0
.app_xip_area 472200 472300 100 0.0
.bss 74480 74496 16 0.0
.data 568 572 4 0.7
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 576162 576270 108 0.0
.app_xip_area 474812 474896 84 0.0
.bss 83808 83824 16 0.0
.data 508 512 4 0.8
.rodata 0 0 0 0.0
.text 112 112 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2356724 2356812 88 0.0
.bss 185020 185036 16 0.0
.data 5760 5768 8 0.1
.text 1319324 1319412 88 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1144375 1144455 80 0.0
bss 143052 143064 12 0.0
rodata 142304 142288 -16 -0.0
text 784168 784264 96 0.0
telink lighting-app tlsr9518adk80d (read/write) 788608 788724 116 0.0
bss 70268 70276 8 0.0
noinit 40416 40416 0 0.0
text 558972 559104 132 0.0

@github-actions
Copy link

github-actions bot commented Mar 29, 2022

PR #16794: Size comparison from 32e7c70 to 6697f9b

Increases above 0.2%:

platform target config section 32e7c70 6697f9b change % change
cyw30739 light cyw930739m2evb_01 .data 604 608 4 0.7
lock cyw930739m2evb_01 .data 568 572 4 0.7
ota-requestor-no-progress-logging cyw930739m2evb_01 .data 508 512 4 0.8
linux door-lock-app debug .data 992 1024 32 3.2
lighting-app debug+rpc .data 1472 1504 32 2.2
ota-provider-app debug .data 1256 1288 32 2.5
ota-requestor-app debug .data 1480 1512 32 2.2
thermostat-no-ble arm64 .data 1040 1048 8 0.8
p6 all-clusters-app default .data 2640 2648 8 0.3
light-app default .data 2496 2504 8 0.3
lock-app default .data 2456 2464 8 0.3
Increases (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 32e7c70 6697f9b change % change
cyw30739 light cyw930739m2evb_01 (read/write) 606354 606478 124 0.0
.app_xip_area 513124 513224 100 0.0
.bss 75976 75992 16 0.0
.data 604 608 4 0.7
lock cyw930739m2evb_01 (read/write) 563902 564018 116 0.0
.app_xip_area 472200 472300 100 0.0
.bss 74480 74496 16 0.0
.data 568 572 4 0.7
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 576162 576270 108 0.0
.app_xip_area 474812 474896 84 0.0
.bss 83808 83824 16 0.0
.data 508 512 4 0.8
efr32 lighting-app BRD4161A (read only) 927456 927600 144 0.0
(read/write) 129112 129120 8 0.0
.bss 127112 127120 8 0.0
.data 1996 2000 4 0.2
.text 927448 927592 144 0.0
BRD4161A+rpc (read only) 956464 956608 144 0.0
(read/write) 145064 145080 16 0.0
.bss 142888 142896 8 0.0
.data 2176 2180 4 0.2
.text 956456 956600 144 0.0
window-app BRD4161A (read only) 856940 857084 144 0.0
(read/write) 127072 127084 12 0.0
.bss 125200 125208 8 0.0
.data 1872 1876 4 0.2
.text 856932 857076 144 0.0
esp32 all-clusters-app c3devkit (read only) 967986 968086 100 0.0
.dram0.bss 62416 62424 8 0.0
.flash.text 967986 968086 100 0.0
m5stack (read only) 1023715 1023847 132 0.0
.dram0.bss 67944 67952 8 0.0
.dram0.data 34024 34032 8 0.0
.flash.text 1018331 1018463 132 0.0
k32w light k32w061+release (read/write) 704944 705056 112 0.0
.bss 77968 77976 8 0.0
.data 1876 1880 4 0.2
.text 619300 619400 100 0.0
lock k32w061+release (read/write) 704060 704164 104 0.0
.bss 77944 77952 8 0.0
.data 1916 1920 4 0.2
.text 618400 618492 92 0.0
linux all-clusters-app debug (read only) 2534601 2535105 504 0.0
(read/write) 143352 143416 64 0.0
.data.rel.ro 78920 79000 80 0.1
.text 2154418 2154866 448 0.0
bridge-app debug+rpc (read only) 1768285 1768821 536 0.0
(read/write) 89520 89584 64 0.1
.data.rel.ro 37936 38008 72 0.2
.text 1508213 1508661 448 0.0
chip-tool debug (read only) 10303493 10303573 80 0.0
.text 8992213 8992325 112 0.0
chip-tool-ipv6only arm64 (read only) 9916780 9916828 48 0.0
(read/write) 475329 475345 16 0.0
.bss 40737 40753 16 0.0
.text 8359252 8359300 48 0.0
door-lock-app debug (read only) 2020945 2021481 536 0.0
(read/write) 116896 117024 128 0.1
.data 992 1024 32 3.2
.data.rel.ro 62840 62952 112 0.2
.text 1689794 1690242 448 0.0
lighting-app debug+rpc (read only) 2197297 2197849 552 0.0
(read/write) 123888 124016 128 0.1
.data 1472 1504 32 2.2
.data.rel.ro 67928 68040 112 0.2
.text 1862930 1863394 464 0.0
ota-provider-app debug (read only) 1961577 1962081 504 0.0
(read/write) 112688 112784 96 0.1
.data 1256 1288 32 2.5
.data.rel.ro 58184 58264 80 0.1
.text 1642562 1643010 448 0.0
ota-requestor-app debug (read only) 1988545 1989049 504 0.0
(read/write) 115912 116008 96 0.1
.data 1480 1512 32 2.2
.data.rel.ro 60440 60520 80 0.1
.text 1672402 1672850 448 0.0
shell debug (read only) 2449353 2449889 536 0.0
(read/write) 147368 147432 64 0.0
.data.rel.ro 73568 73640 72 0.1
.text 2082594 2083042 448 0.0
thermostat-no-ble arm64 (read only) 2279124 2279540 416 0.0
(read/write) 148305 148369 64 0.0
.bss 62817 62833 16 0.0
.data 1040 1048 8 0.8
.data.rel.ro 76928 76968 40 0.1
.text 1915920 1916272 352 0.0
tv-app debug (read only) 2696977 2697481 504 0.0
(read/write) 247520 247616 96 0.0
.data.rel.ro 74048 74152 104 0.1
.text 2316162 2316610 448 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2356724 2356812 88 0.0
.bss 185020 185036 16 0.0
.data 5760 5768 8 0.1
.text 1319324 1319412 88 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1144375 1144455 80 0.0
bss 143052 143064 12 0.0
text 784168 784264 96 0.0
p6 all-clusters-app default (read/write) 2499504 2499648 144 0.0
.bss 118440 118456 16 0.0
.data 2640 2648 8 0.3
.text 1457768 1457912 144 0.0
light-app default (read/write) 2401672 2401816 144 0.0
.bss 111912 111928 16 0.0
.data 2496 2504 8 0.3
.text 1359936 1360080 144 0.0
lock-app default (read/write) 2365304 2365448 144 0.0
.bss 111656 111672 16 0.0
.data 2456 2464 8 0.3
.text 1323568 1323712 144 0.0
telink lighting-app tlsr9518adk80d (read/write) 788608 788724 116 0.0
bss 70268 70276 8 0.0
text 558972 559104 132 0.0
Decreases (13 builds for esp32, linux, nrfconnect)
platform target config section 32e7c70 6697f9b change % change
esp32 all-clusters-app c3devkit .flash.rodata 199112 199096 -16 -0.0
m5stack .flash.rodata 228600 228584 -16 -0.0
linux all-clusters-app debug .rodata 216357 216293 -64 -0.0
bridge-app debug+rpc .rodata 144716 144684 -32 -0.0
chip-tool debug .rodata 525013 524981 -32 -0.0
door-lock-app debug .rodata 181340 181308 -32 -0.0
lighting-app debug+rpc .rodata 175196 175164 -32 -0.0
ota-provider-app debug .rodata 167147 167083 -64 -0.0
ota-requestor-app debug .rodata 163268 163204 -64 -0.0
shell debug .rodata 209810 209778 -32 -0.0
thermostat-no-ble arm64 .rodata 139908 139876 -32 -0.0
tv-app debug .rodata 206187 206123 -64 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 rodata 142304 142288 -16 -0.0
Full report (27 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 32e7c70 6697f9b change % change
cyw30739 light cyw930739m2evb_01 (read/write) 606354 606478 124 0.0
.app_xip_area 513124 513224 100 0.0
.bss 75976 75992 16 0.0
.data 604 608 4 0.7
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 563902 564018 116 0.0
.app_xip_area 472200 472300 100 0.0
.bss 74480 74496 16 0.0
.data 568 572 4 0.7
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 576162 576270 108 0.0
.app_xip_area 474812 474896 84 0.0
.bss 83808 83824 16 0.0
.data 508 512 4 0.8
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 927456 927600 144 0.0
(read/write) 129112 129120 8 0.0
.bss 127112 127120 8 0.0
.data 1996 2000 4 0.2
.text 927448 927592 144 0.0
BRD4161A+rpc (read only) 956464 956608 144 0.0
(read/write) 145064 145080 16 0.0
.bss 142888 142896 8 0.0
.data 2176 2180 4 0.2
.text 956456 956600 144 0.0
window-app BRD4161A (read only) 856940 857084 144 0.0
(read/write) 127072 127084 12 0.0
.bss 125200 125208 8 0.0
.data 1872 1876 4 0.2
.text 856932 857076 144 0.0
esp32 all-clusters-app c3devkit (read only) 967986 968086 100 0.0
(read/write) 1394642 1394642 0 0.0
.dram0.bss 62416 62424 8 0.0
.dram0.data 14204 14204 0 0.0
.flash.rodata 199112 199096 -16 -0.0
.flash.text 967986 968086 100 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1023715 1023847 132 0.0
(read/write) 462404 462404 0 0.0
.dram0.bss 67944 67952 8 0.0
.dram0.data 34024 34032 8 0.0
.flash.rodata 228600 228584 -16 -0.0
.flash.text 1018331 1018463 132 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 704944 705056 112 0.0
.bss 77968 77976 8 0.0
.data 1876 1880 4 0.2
.text 619300 619400 100 0.0
lock k32w061+release (read/write) 704060 704164 104 0.0
.bss 77944 77952 8 0.0
.data 1916 1920 4 0.2
.text 618400 618492 92 0.0
linux all-clusters-app debug (read only) 2534601 2535105 504 0.0
(read/write) 143352 143416 64 0.0
.bss 57408 57408 0 0.0
.data 1280 1280 0 0.0
.data.rel.ro 78920 79000 80 0.1
.dynamic 592 592 0 0.0
.got 4184 4184 0 0.0
.init 27 27 0 0.0
.init_array 944 944 0 0.0
.rodata 216357 216293 -64 -0.0
.text 2154418 2154866 448 0.0
bridge-app debug+rpc (read only) 1768285 1768821 536 0.0
(read/write) 89520 89584 64 0.1
.bss 44520 44520 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 37936 38008 72 0.2
.dynamic 592 592 0 0.0
.got 3928 3928 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 144716 144684 -32 -0.0
.text 1508213 1508661 448 0.0
chip-tool debug (read only) 10303493 10303573 80 0.0
(read/write) 356424 356424 0 0.0
.bss 22464 22464 0 0.0
.data 1072 1072 0 0.0
.data.rel.ro 326792 326792 0 0.0
.dynamic 608 608 0 0.0
.got 4824 4824 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 525013 524981 -32 -0.0
.text 8992213 8992325 112 0.0
chip-tool-ipv6only arm64 (read only) 9916780 9916828 48 0.0
(read/write) 475329 475345 16 0.0
.bss 40737 40753 16 0.0
.data 1144 1144 0 0.0
.data.rel.ro 373512 373512 0 0.0
.dynamic 560 560 0 0.0
.got 56136 56136 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 500212 500212 0 0.0
.text 8359252 8359300 48 0.0
door-lock-app debug (read only) 2020945 2021481 536 0.0
(read/write) 116896 117024 128 0.1
.bss 47648 47648 0 0.0
.data 992 1024 32 3.2
.data.rel.ro 62840 62952 112 0.2
.dynamic 592 592 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 181340 181308 -32 -0.0
.text 1689794 1690242 448 0.0
lighting-app debug+rpc (read only) 2197297 2197849 552 0.0
(read/write) 123888 124016 128 0.1
.bss 48928 48928 0 0.0
.data 1472 1504 32 2.2
.data.rel.ro 67928 68040 112 0.2
.dynamic 608 608 0 0.0
.got 4176 4176 0 0.0
.init 27 27 0 0.0
.init_array 744 744 0 0.0
.rodata 175196 175164 -32 -0.0
.text 1862930 1863394 464 0.0
ota-provider-app debug (read only) 1961577 1962081 504 0.0
(read/write) 112688 112784 96 0.1
.bss 47584 47584 0 0.0
.data 1256 1288 32 2.5
.data.rel.ro 58184 58264 80 0.1
.dynamic 608 608 0 0.0
.got 4384 4384 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 167147 167083 -64 -0.0
.text 1642562 1643010 448 0.0
ota-requestor-app debug (read only) 1988545 1989049 504 0.0
(read/write) 115912 116008 96 0.1
.bss 48512 48512 0 0.0
.data 1480 1512 32 2.2
.data.rel.ro 60440 60520 80 0.1
.dynamic 592 592 0 0.0
.got 4192 4192 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 163268 163204 -64 -0.0
.text 1672402 1672850 448 0.0
shell debug (read only) 2449353 2449889 536 0.0
(read/write) 147368 147432 64 0.0
.bss 67304 67304 0 0.0
.data 800 800 0 0.0
.data.rel.ro 73568 73640 72 0.1
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 209810 209778 -32 -0.0
.text 2082594 2083042 448 0.0
thermostat-no-ble arm64 (read only) 2279124 2279540 416 0.0
(read/write) 148305 148369 64 0.0
.bss 62817 62833 16 0.0
.data 1040 1048 8 0.8
.data.rel.ro 76928 76968 40 0.1
.dynamic 560 560 0 0.0
.got 4504 4504 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 139908 139876 -32 -0.0
.text 1915920 1916272 352 0.0
tv-app debug (read only) 2696977 2697481 504 0.0
(read/write) 247520 247616 96 0.0
.bss 164288 164288 0 0.0
.data 3136 3136 0 0.0
.data.rel.ro 74048 74152 104 0.1
.dynamic 592 592 0 0.0
.got 4552 4552 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 206187 206123 -64 -0.0
.text 2316162 2316610 448 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2356724 2356812 88 0.0
.bss 185020 185036 16 0.0
.data 5760 5768 8 0.1
.text 1319324 1319412 88 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1144375 1144455 80 0.0
bss 143052 143064 12 0.0
rodata 142304 142288 -16 -0.0
text 784168 784264 96 0.0
p6 all-clusters-app default (read/write) 2499504 2499648 144 0.0
.bss 118440 118456 16 0.0
.data 2640 2648 8 0.3
.text 1457768 1457912 144 0.0
light-app default (read/write) 2401672 2401816 144 0.0
.bss 111912 111928 16 0.0
.data 2496 2504 8 0.3
.text 1359936 1360080 144 0.0
lock-app default (read/write) 2365304 2365448 144 0.0
.bss 111656 111672 16 0.0
.data 2456 2464 8 0.3
.text 1323568 1323712 144 0.0
telink lighting-app tlsr9518adk80d (read/write) 788608 788724 116 0.0
bss 70268 70276 8 0.0
noinit 40416 40416 0 0.0
text 558972 559104 132 0.0

@mlepage-google mlepage-google merged commit df68705 into project-chip:master Mar 30, 2022
@mlepage-google mlepage-google deleted the access-control-device-type-support branch March 30, 2022 19:48
rochaferraz pushed a commit to rochaferraz/connectedhomeip that referenced this pull request Mar 31, 2022
Create a DeviceTypeResolver that can be installed in
AccessControl so device type can work in targets.

Fixes project-chip#14431
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
Create a DeviceTypeResolver that can be installed in
AccessControl so device type can work in targets.

Fixes project-chip#14431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle device type targets in access control check
3 participants