-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Handle ACL and readability in reporting/Engine.cpp
#36488
base: master
Are you sure you want to change the base?
Handle ACL and readability in reporting/Engine.cpp
#36488
Conversation
PR #36488: Size comparison from 45a75ba to 1df0e39 Full report (11 builds for cc13x4_26x4, cc32xx, qpg, stm32, tizen)
|
PR #36488: Size comparison from 45a75ba to 122a60c Full report (19 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, qpg, stm32, tizen)
|
PR #36488: Size comparison from 45a75ba to 7bab9a7 Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
/// Returns the status of ACL validation. | ||
/// if the status is set, the status is FINAL (i.e. permanent failure OR success due to path expansion logic.) | ||
/// if the status is not set, the processing can continue | ||
std::optional<CHIP_ERROR> ValidateReadACL(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::optional<CHIP_ERROR> ValidateReadACL(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, | |
std::optional<CHIP_ERROR> ValidateReadAttributeACL(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, |
|
||
std::optional<DataModel::AttributeInfo> info = dataModel->GetAttributeInfo(path); | ||
|
||
chip::Access::Privilege requiredPrivilege = chip::Access::Privilege::kView; // default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all the extra chip::
prefixes?
chip::Access::Privilege requiredPrivilege = chip::Access::Privilege::kView; // default | ||
if (info.has_value() && info->readPrivilege.has_value()) | ||
{ | ||
// set a default even if we do not know and later report the real error if ACL looks ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what this comment is trying to say.
return std::nullopt; | ||
} | ||
|
||
// attribute does not exist, however we do not now if this is a unsupported endpoint, cluster or attribute, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does attribute not exist? All we know is we did an access check and it succeeeded.
This code is not making any sense to me. Stopping here.
This is part of #36484: move the ACL validation out of
DataModel::Provider::ReadAttribute
and have this handled by the interaction model reporting engine based on the metadata passed in by the provider.