> On Feb. 16, 2016, 11:13 p.m., Hao Hao wrote:
> > sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/CommonPrivilege.java,
> > line 107
> > <https://reviews.apache.org/r/42287/diff/4/?file=1236963#file1236963line107>
> >
> > Should we name impliesValue to be impliesResource?
> > And will it be more type other than URL, string later on. How will we
> > handle it?
I'll update the name, for the specific type other than URL, String. We had to
add new type to ImplyMethodType and update the CommonPrivilege as following:
```
if (ImplyMethodType.URL == implyMethodType) {
return PathUtils.impliesURI(policyValue, requestValue);
} else if (ImplyMethodType.newType == implyMethodType) {
return impliesNewType(policyValue, requestValue);
}
```
> On Feb. 16, 2016, 11:13 p.m., Hao Hao wrote:
> > sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/CommonPrivilege.java,
> > line 115
> > <https://reviews.apache.org/r/42287/diff/4/?file=1236963#file1236963line115>
> >
> > Could you please add comments for impliesAction and impliesValue to
> > make it more clear?
Thanks for reminder, I'll update it.
> On Feb. 16, 2016, 11:13 p.m., Hao Hao wrote:
> > sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/CommonPrivilege.java,
> > line 35
> > <https://reviews.apache.org/r/42287/diff/4/?file=1236963#file1236963line35>
> >
> > I think we need to enforce the validator here when creating the
> > privileges other than do it after.
CommonPrivilege is responsible for compare 2 valid privileges, I think
validator shouldn't be used in CommonPrivilege.
There are 2 entry should be added validator:
1. In file-backend, validate the privilege string from ini file.
2. When do the import, validate the privilege.
- Colin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42287/#review119372
-----------------------------------------------------------
On Feb. 6, 2016, 2:14 a.m., Colin Ma wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42287/
> -----------------------------------------------------------
>
> (Updated Feb. 6, 2016, 2:14 a.m.)
>
>
> Review request for sentry.
>
>
> Repository: sentry
>
>
> Description
> -------
>
> Create CommonPrivilege for every component.
> The main change is for the interface Privilege, implies(Privilege p) --->
> implies(Privilege privilege, Map<String, String> implyMethodMap, Map<String,
> Integer> actionMap)
> The actionMap is stored the mapping between action name and action value, eg:
> for Hive: select ---> 1 (binary: 0000001)
> insert ---> 3 (binary: 0000011)
> create ---> 4 (binary: 0000100)
> all ---> 7 (binary: 0000111)
> when compare the action, use the action value with the & operator
> The implyMethodMap is stored the mapping between resource type and imply
> method, eg:
> for Hive: db ---> string (imply as string value)
> url ---> url (imply as url value)
>
>
> Diffs
> -----
>
>
> sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/BitFieldAction.java
> ce0e4fb
>
> sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/ImplyMethodType.java
> PRE-CREATION
>
> sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/Model.java
> PRE-CREATION
>
> sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/Resource.java
> PRE-CREATION
> sentry-policy/sentry-policy-common/pom.xml fbec06f
>
> sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/CommonPrivilege.java
> PRE-CREATION
>
> sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/PolicyConstants.java
> 0bad8c1
>
> sentry-policy/sentry-policy-common/src/test/java/org/apache/sentry/policy/common/ModelForTest.java
> PRE-CREATION
>
> sentry-policy/sentry-policy-common/src/test/java/org/apache/sentry/policy/common/TestCommonPrivilege.java
> PRE-CREATION
>
> sentry-policy/sentry-policy-common/src/test/java/org/apache/sentry/policy/common/TestKeyValue.java
> 2dfc7c5
>
> Diff: https://reviews.apache.org/r/42287/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Colin Ma
>
>