ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhay Kulkarni <akulka...@hortonworks.com>
Subject Review Request 68153: RANGER-2180: Handle token replacement correctly when token is not defined in the request context
Date Wed, 01 Aug 2018 21:21:41 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68153/
-----------------------------------------------------------

Review request for ranger and Madhan Neethiraj.


Bugs: RANGER-2180
    https://issues.apache.org/jira/browse/RANGER-2180


Repository: ranger


Description
-------

When a policy resource contains a token (such as {USER}), and request context does not have
an entry for the token (in this case, USER), then the replacement fails and the expanded policy
resource is set to null. A null policy-resource will not match any policy, and may cause NPE.

In such case, the original policy resource string should be returned as the expanded policy
resource string.


Diffs
-----

  agents-common/src/main/java/org/apache/ranger/plugin/util/StringTokenReplacer.java 2ec809cee

  agents-common/src/test/resources/resourcematcher/test_resourcematcher_dynamic.json 5237d4773

  agents-common/src/test/resources/resourcematcher/test_resourcematcher_wildcards_as_delimiters.json
c907f414e 


Diff: https://reviews.apache.org/r/68153/diff/1/


Testing
-------

Passes all unit tests


Thanks,

Abhay Kulkarni


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message