From dev-return-18788-archive-asf-public=cust-asf.ponee.io@ranger.apache.org Thu Aug 2 02:48:53 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E3705180634 for ; Thu, 2 Aug 2018 02:48:52 +0200 (CEST) Received: (qmail 36931 invoked by uid 500); 2 Aug 2018 00:48:52 -0000 Mailing-List: contact dev-help@ranger.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ranger.apache.org Delivered-To: mailing list dev@ranger.apache.org Received: (qmail 36912 invoked by uid 99); 2 Aug 2018 00:48:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2018 00:48:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 04426CDED2; Thu, 2 Aug 2018 00:48:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.7 X-Spam-Level: X-Spam-Status: No, score=0.7 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id QlTxSD1DG0ub; Thu, 2 Aug 2018 00:48:50 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 02A6D5F30C; Thu, 2 Aug 2018 00:48:50 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 98E6FE01C2; Thu, 2 Aug 2018 00:48:49 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id 424CEC40151; Thu, 2 Aug 2018 00:48:49 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6342785016369389258==" MIME-Version: 1.0 Subject: Re: Review Request 68153: RANGER-2180: Handle token replacement correctly when token is not defined in the request context From: Madhan Neethiraj To: Madhan Neethiraj Cc: Abhay Kulkarni , ranger Date: Thu, 02 Aug 2018 00:48:49 -0000 Message-ID: <20180802004849.53842.465@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Madhan Neethiraj X-ReviewGroup: ranger X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/68153/ X-Sender: Madhan Neethiraj X-ReviewBoard-ShipIt: 1 References: <20180801212141.53842.13413@reviews-vm2.apache.org> In-Reply-To: <20180801212141.53842.13413@reviews-vm2.apache.org> X-ReviewBoard-ShipIt-Only: 1 Reply-To: Madhan Neethiraj X-ReviewRequest-Repository: ranger --===============6342785016369389258== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/68153/#review206777 ----------------------------------------------------------- Ship it! Ship It! - Madhan Neethiraj On Aug. 1, 2018, 9:21 p.m., Abhay Kulkarni wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/68153/ > ----------------------------------------------------------- > > (Updated Aug. 1, 2018, 9:21 p.m.) > > > 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 > > --===============6342785016369389258==--