-
Notifications
You must be signed in to change notification settings - Fork 13
shv access control2
Fanda Vacek edited this page Apr 18, 2023
·
5 revisions
- Each user has list of groups defined.
- Every group should match one of roles defined.
- When shvbroker receive client request, then it finds
grant
or list ofgrant
s for this request. - Each SHV method defines its
accessLevel
as a number > 0 or string which must be convertible to access level int by node, see methodShvNode::grantToAccessLevel(...)
.accessLevel == 0
means no-access. - If device gets request, then it converts
grant
or[grant, ...]
set by shvbroker toaccessLevel
. IfaccessLevel
for specificgrant
is lower thanaccessLevel
specified by called method, then request is refused.
- shvbroker takes list of groups of current client user
-
groups
should be mapped to theroles
defined. - shvbroker creates flatten list of all roles defined for this user
- Roles flattening proces traverse roles definition tree in order of their definition, level by level.
Flatten roles will be found as A,B,C,D,G,E,F
- For
role
in flatten roles- For
access-rule
in acces-rules in order of their definition- if request matches
access-rule
- assign
grant
defined in rule to RpcRequest. Stop searching with success
- assign
- if request matches
- For
Access rule consist of:
- path-pattern can contain wildcards
*
for single dir and**
for and number of dirs (including zero) - method-pattern, which might have form:
method-name
-
Access rule matches if path-pattern
matches and method-pattern
matches.