You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by David Kantor <dk...@us.ibm.com> on 2017/02/08 20:58:46 UTC

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.

-----------------------------------------------------------
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


Re: 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.

Posted by Apoorv Naik <na...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/#review164801
-----------------------------------------------------------




authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyUtil.java (line 126)
<https://reviews.apache.org/r/56463/#comment236589>

    System.getProperty can return null.


- Apoorv Naik


On Feb. 8, 2017, 10:29 p.m., David Kantor wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56463/
> -----------------------------------------------------------
> 
> (Updated Feb. 8, 2017, 10:29 p.m.)
> 
> 
> 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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
>   typesystem/src/test/resources/policy-store.txt PRE-CREATION 
>   typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
>   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
> 
>


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.

> On Feb. 9, 2017, 7:01 p.m., Apoorv Naik wrote:
> > I see that atlas has multiple ways of loading properties/configuration, do you think it'd be a better idea to introduce a property/config framework (maybe in an enhancement JIRA) that produces apache commons configuration object or java properties object for more streamlined use. I've seen 3 mixes of config 
> > 
> > 1. Load directly into property files
> > 2. Use spring bean placeholder
> > 3. Read into apache commons configuration

I agree that a introducing a property/config framework is a good idea.  However, I think that is beyond the scope of this change.  For now, I am trying to apply a smaller short term change that addresses the issue described in this Jira and also follow the pattern for other Atlas config files that check the use atlas.conf and the classpath.


- David


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


On Feb. 9, 2017, 12:47 a.m., David Kantor wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56463/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2017, 12:47 a.m.)
> 
> 
> 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 in the typesystem src/test/resources 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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
>   typesystem/src/test/resources/policy-store.txt PRE-CREATION 
>   typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
>   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
> 
>


Re: 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.

Posted by Apoorv Naik <na...@gmail.com>.

> On Feb. 9, 2017, 7:01 p.m., Apoorv Naik wrote:
> > I see that atlas has multiple ways of loading properties/configuration, do you think it'd be a better idea to introduce a property/config framework (maybe in an enhancement JIRA) that produces apache commons configuration object or java properties object for more streamlined use. I've seen 3 mixes of config 
> > 
> > 1. Load directly into property files
> > 2. Use spring bean placeholder
> > 3. Read into apache commons configuration
> 
> David Kantor wrote:
>     I agree that a introducing a property/config framework is a good idea.  However, I think that is beyond the scope of this change.  For now, I am trying to apply a smaller short term change that addresses the issue described in this Jira and also follow the pattern for other Atlas config files that check the use atlas.conf and the classpath.

Yes agreed. This can be taken up in a different JIRA.


- Apoorv


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


On Feb. 9, 2017, 12:47 a.m., David Kantor wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56463/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2017, 12:47 a.m.)
> 
> 
> 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 in the typesystem src/test/resources 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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
>   typesystem/src/test/resources/policy-store.txt PRE-CREATION 
>   typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
>   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
> 
>


Re: 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.

Posted by Apoorv Naik <na...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/#review164967
-----------------------------------------------------------



I see that atlas has multiple ways of loading properties/configuration, do you think it'd be a better idea to introduce a property/config framework (maybe in an enhancement JIRA) that produces apache commons configuration object or java properties object for more streamlined use. I've seen 3 mixes of config 

1. Load directly into property files
2. Use spring bean placeholder
3. Read into apache commons configuration

- Apoorv Naik


On Feb. 9, 2017, 12:47 a.m., David Kantor wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56463/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2017, 12:47 a.m.)
> 
> 
> 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 in the typesystem src/test/resources 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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
>   typesystem/src/test/resources/policy-store.txt PRE-CREATION 
>   typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
>   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
> 
>


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.

> On Feb. 10, 2017, 8:46 p.m., Jeff Hagelberg wrote:
> > authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyUtil.java, line 125
> > <https://reviews.apache.org/r/56463/diff/4/?file=1628058#file1628058line125>
> >
> >     Is it worth documenting this new behavior anywhere?

Documented in javadoc of ApplicationProperties.getFileAsInputStream.


> On Feb. 10, 2017, 8:46 p.m., Jeff Hagelberg wrote:
> > authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyUtil.java, line 160
> > <https://reviews.apache.org/r/56463/diff/4/?file=1628058#file1628058line160>
> >
> >     Should we use the Thread's context classloader here?

Fixed


> On Feb. 10, 2017, 8:46 p.m., Jeff Hagelberg wrote:
> > webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java, line 66
> > <https://reviews.apache.org/r/56463/diff/4/?file=1628063#file1628063line66>
> >
> >     This seems to largely duplicate the logic above, and my comment about the classloader applies here as well.  Can the logic be moved to some utility method?  It seems like the only thing different is the names of the properties being used and the default value.

Great idea, refactored logic into new utility method ApplicationProperties.getFileAsInputStream()


- David


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


On Feb. 12, 2017, 5:41 p.m., David Kantor wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56463/
> -----------------------------------------------------------
> 
> (Updated Feb. 12, 2017, 5:41 p.m.)
> 
> 
> 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 in the typesystem src/test/resources 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 
>   common/src/main/java/org/apache/atlas/ApplicationProperties.java 9b1e9cd48a52da1cc388a808a67817e41741209d 
>   typesystem/src/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
>   typesystem/src/test/resources/policy-store.txt PRE-CREATION 
>   typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
>   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
> 
>


Re: 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.

Posted by Jeff Hagelberg <jn...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/#review165171
-----------------------------------------------------------


Fix it, then Ship it!




Just a couple minor comments.


authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyUtil.java (line 125)
<https://reviews.apache.org/r/56463/#comment236981>

    Is it worth documenting this new behavior anywhere?



authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyUtil.java (line 160)
<https://reviews.apache.org/r/56463/#comment236978>

    Should we use the Thread's context classloader here?



webapp/src/main/java/org/apache/atlas/web/dao/UserDao.java (line 66)
<https://reviews.apache.org/r/56463/#comment236979>

    This seems to largely duplicate the logic above, and my comment about the classloader applies here as well.  Can the logic be moved to some utility method?  It seems like the only thing different is the names of the properties being used and the default value.


- Jeff Hagelberg


On Feb. 9, 2017, 12:47 a.m., David Kantor wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56463/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2017, 12:47 a.m.)
> 
> 
> 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 in the typesystem src/test/resources 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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
>   typesystem/src/test/resources/policy-store.txt PRE-CREATION 
>   typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
>   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
> 
>


Re: 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.

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/#review165265
-----------------------------------------------------------




authorization/src/main/java/org/apache/atlas/authorize/simple/FileReaderUtil.java (line 38)
<https://reviews.apache.org/r/56463/#comment237118>

    Consider removing {} in the message, as the argument has been removed. Please review other occurance at the end of this method as well.



authorization/src/main/java/org/apache/atlas/authorize/simple/SimpleAtlasAuthorizer.java (line 84)
<https://reviews.apache.org/r/56463/#comment237120>

    Shouldn't 'policyStoreStream' be closed? Please review.
    
    One option is to have FileReaderUtil.readFile() deal with the stream, with the following rename/new-version:
    
    FileReaderUtil.readFromConfigFile(String configName, String defaultFileName) {
      InputStream inStr = ApplicationProperties.getFileAsInputStream(ApplicationProperties.get(), configName, defaultFileName);
      
      ...
      
      inStr.close();
    }
    
    This method can be called from UserDao.loadFileLoginsDetails() as well.


- Madhan Neethiraj


On Feb. 12, 2017, 5:47 p.m., David Kantor wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56463/
> -----------------------------------------------------------
> 
> (Updated Feb. 12, 2017, 5:47 p.m.)
> 
> 
> 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 in the typesystem src/test/resources 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 
>   common/src/main/java/org/apache/atlas/ApplicationProperties.java 9b1e9cd48a52da1cc388a808a67817e41741209d 
>   typesystem/src/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
>   typesystem/src/test/resources/policy-store.txt PRE-CREATION 
>   typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
>   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
> 
>


Re: 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.

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/#review165271
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On Feb. 12, 2017, 7:48 p.m., David Kantor wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56463/
> -----------------------------------------------------------
> 
> (Updated Feb. 12, 2017, 7:48 p.m.)
> 
> 
> 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 in the typesystem src/test/resources 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 
>   common/src/main/java/org/apache/atlas/ApplicationProperties.java 9b1e9cd48a52da1cc388a808a67817e41741209d 
>   common/src/test/java/org/apache/atlas/ApplicationPropertiesTest.java PRE-CREATION 
>   common/src/test/resources/test.properties PRE-CREATION 
>   typesystem/src/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
>   typesystem/src/test/resources/policy-store.txt PRE-CREATION 
>   typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
>   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
> 
>


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/
-----------------------------------------------------------

(Updated Feb. 12, 2017, 7:48 p.m.)


Review request for atlas.


Changes
-------

Addressed Madhan's review comments.  Added ApplicationPropertiesTest.


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 in the typesystem src/test/resources rather than a path relative the top level maven project.


Diffs (updated)
-----

  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 
  common/src/main/java/org/apache/atlas/ApplicationProperties.java 9b1e9cd48a52da1cc388a808a67817e41741209d 
  common/src/test/java/org/apache/atlas/ApplicationPropertiesTest.java PRE-CREATION 
  common/src/test/resources/test.properties PRE-CREATION 
  typesystem/src/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
  typesystem/src/test/resources/policy-store.txt PRE-CREATION 
  typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
  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


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/
-----------------------------------------------------------

(Updated Feb. 12, 2017, 5:47 p.m.)


Review request for atlas.


Changes
-------

Remove whitespace


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 in the typesystem src/test/resources rather than a path relative the top level maven project.


Diffs (updated)
-----

  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 
  common/src/main/java/org/apache/atlas/ApplicationProperties.java 9b1e9cd48a52da1cc388a808a67817e41741209d 
  typesystem/src/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
  typesystem/src/test/resources/policy-store.txt PRE-CREATION 
  typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
  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


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/
-----------------------------------------------------------

(Updated Feb. 12, 2017, 5:41 p.m.)


Review request for atlas.


Changes
-------

Addressed Jeff's review comments.


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 in the typesystem src/test/resources rather than a path relative the top level maven project.


Diffs (updated)
-----

  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 
  common/src/main/java/org/apache/atlas/ApplicationProperties.java 9b1e9cd48a52da1cc388a808a67817e41741209d 
  typesystem/src/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
  typesystem/src/test/resources/policy-store.txt PRE-CREATION 
  typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
  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


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/
-----------------------------------------------------------

(Updated Feb. 9, 2017, 12:47 a.m.)


Review request for atlas.


Bugs: ATLAS-1539
    https://issues.apache.org/jira/browse/ATLAS-1539


Repository: atlas


Description (updated)
-------

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 in the typesystem src/test/resources 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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
  typesystem/src/test/resources/policy-store.txt PRE-CREATION 
  typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
  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


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/
-----------------------------------------------------------

(Updated Feb. 9, 2017, 12:41 a.m.)


Review request for atlas.


Changes
-------

Remove whitespace


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 (updated)
-----

  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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
  typesystem/src/test/resources/policy-store.txt PRE-CREATION 
  typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
  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


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/
-----------------------------------------------------------

(Updated Feb. 9, 2017, 12:38 a.m.)


Review request for atlas.


Changes
-------

Addressed review comment


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 (updated)
-----

  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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
  typesystem/src/test/resources/policy-store.txt PRE-CREATION 
  typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
  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


Re: 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.

Posted by David Kantor <dk...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56463/
-----------------------------------------------------------

(Updated Feb. 8, 2017, 10:29 p.m.)


Review request for atlas.


Changes
-------

Move policy-store.txt and users-credentials.properties to src/test/resources


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 (updated)
-----

  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/test/resources/atlas-application.properties 0e6bc4187ad064820d11da137cee3b8b1857560e 
  typesystem/src/test/resources/policy-store.txt PRE-CREATION 
  typesystem/src/test/resources/users-credentials.properties PRE-CREATION 
  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