Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 34FE8200C24 for ; Wed, 8 Feb 2017 21:58:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 33996160B49; Wed, 8 Feb 2017 20:58:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 80334160B5A for ; Wed, 8 Feb 2017 21:58:51 +0100 (CET) Received: (qmail 52197 invoked by uid 500); 8 Feb 2017 20:58:50 -0000 Mailing-List: contact dev-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list dev@atlas.incubator.apache.org Received: (qmail 52181 invoked by uid 99); 8 Feb 2017 20:58:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2017 20:58:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 038DE1A04F7 for ; Wed, 8 Feb 2017 20:58:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.768 X-Spam-Level: X-Spam-Status: No, score=-4.768 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id xojJ0ioLkDSz for ; Wed, 8 Feb 2017 20:58:48 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 09ED35F613 for ; Wed, 8 Feb 2017 20:58:47 +0000 (UTC) Received: (qmail 52072 invoked by uid 99); 8 Feb 2017 20:58:47 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2017 20:58:47 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 7E6F12DF8AE; Wed, 8 Feb 2017 20:58:46 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2279004930260643638==" MIME-Version: 1.0 Subject: Review Request 56463: ATLAS-1539 Attempt to load policy store and user credential files as classloader resource if configured file path does not exist, in the same manner that the atlas-application.properties is located. From: David Kantor To: David Kantor , atlas Date: Wed, 08 Feb 2017 20:58:46 -0000 Message-ID: <20170208205846.31774.938@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: David Kantor X-ReviewGroup: atlas X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/56463/ X-Sender: David Kantor X-ReviewBoard-Diff-For: typesystem/src/main/resources/users-credentials.properties X-ReviewBoard-Diff-For: typesystem/src/main/resources/policy-store.txt Reply-To: David Kantor X-ReviewRequest-Repository: atlas archived-at: Wed, 08 Feb 2017 20:58:52 -0000 --===============2279004930260643638== 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/56463/ ----------------------------------------------------------- Review request for atlas. Bugs: ATLAS-1539 https://issues.apache.org/jira/browse/ATLAS-1539 Repository: atlas Description ------- Integration tests in projects which use the typesystem test jar (e.g. webapp) were failing when the tests were invoked in the project directory rather than the top level project, because properties for user-credentials.properties and policy store files where using a path relative to the working directory, which amounted to a hard-coded assumption that the tests would only ever be run from the top level. Fix: Attempt to load policy store and user credential files as classloader resource if configured file path does not exist, in the same manner that the atlas-application.properties is located. Use test copies of these files bundled in the typesystem test jar and change bundled atlas-application.properties to specify just the filenames rather than a path relative the top level maven project. Diffs ----- authorization/src/main/java/org/apache/atlas/authorize/simple/FileReaderUtil.java 36db7007a14c2afbda7582409e5dfa474fa9a7b6 authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyUtil.java 4f9255a3dee5ac59dcef95e76eae423445be6bdd authorization/src/main/java/org/apache/atlas/authorize/simple/SimpleAtlasAuthorizer.java d6e785366a5fd4dc60496d37b2639ebafa06d087 typesystem/src/main/resources/policy-store.txt PRE-CREATION typesystem/src/main/resources/users-credentials.properties PRE-CREATION typesystem/src/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java 254d836e5389780b6d10a8d1a664a96b06ad8d1b Diff: https://reviews.apache.org/r/56463/diff/ Testing ------- Ran all unit and integration tests with no regressions. Thanks, David Kantor --===============2279004930260643638==--