You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Robert Levas <rl...@hortonworks.com> on 2015/11/17 01:52:25 UTC

Review Request 40373: Create API entry points for getting authorization information

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

Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.


Bugs: AMBARI-13916
    https://issues.apache.org/jira/browse/AMBARI-13916


Repository: ambari


Description
-------

Create API entry points for getting authorization information.  

The following entry points need to be created:
```
GET /api/v1/authorizations
GET /api/v1/permissions/:PERMISSION_ID/authorizations
GET /api/v1/users/:USERNAME/authorizations
```

The following entry points need to be updated to supply more information:
```
GET /api/v1/permissions/:PERMISSION_ID
```

# Note: The data layer is stubbed out and left for implementation in AMBARI-13865


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
  ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
  ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java 823ac8a 
  ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java 0979298 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 

Diff: https://reviews.apache.org/r/40373/diff/


Testing
-------

Manually tested

# Local test results: PASSED

# Jenkins test results: PENDING


Thanks,

Robert Levas


Re: Review Request 40373: Create API entry points for getting authorization information

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40373/#review106873
-----------------------------------------------------------

Ship it!


Sorry, forgot to mark Ship It (even if the other stuff isn't fixed, it still looks ok to me)

- Nate Cole


On Nov. 17, 2015, 10:04 a.m., Robert Levas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40373/
> -----------------------------------------------------------
> 
> (Updated Nov. 17, 2015, 10:04 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-13916
>     https://issues.apache.org/jira/browse/AMBARI-13916
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Create API entry points for getting authorization information.  
> 
> The following entry points need to be created:
> ```
> GET /api/v1/authorizations
> GET /api/v1/permissions/:PERMISSION_ID/authorizations
> GET /api/v1/users/:USERNAME/authorizations
> ```
> 
> The following entry points need to be updated to supply more information:
> ```
> GET /api/v1/permissions/:PERMISSION_ID
> ```
> 
> # Note: The data layer is stubbed out and left for implementation in AMBARI-13865
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java 823ac8a 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java 0979298 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 
> 
> Diff: https://reviews.apache.org/r/40373/diff/
> 
> 
> Testing
> -------
> 
> Manually tested
> 
> # Local test results: PASSED
> 
> # Jenkins test results: PENDING
> 
> 
> Thanks,
> 
> Robert Levas
> 
>


Re: Review Request 40373: Create API entry points for getting authorization information

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40373/#review106905
-----------------------------------------------------------

Ship it!


Ship It!

- Nate Cole


On Nov. 17, 2015, 12:40 p.m., Robert Levas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40373/
> -----------------------------------------------------------
> 
> (Updated Nov. 17, 2015, 12:40 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-13916
>     https://issues.apache.org/jira/browse/AMBARI-13916
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Create API entry points for getting authorization information.  
> 
> The following entry points need to be created:
> ```
> GET /api/v1/authorizations
> GET /api/v1/permissions/:PERMISSION_ID/authorizations
> GET /api/v1/users/:USERNAME/authorizations
> ```
> 
> The following entry points need to be updated to supply more information:
> ```
> GET /api/v1/permissions/:PERMISSION_ID
> ```
> 
> # Note: The data layer is stubbed out and left for implementation in AMBARI-13865
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 
> 
> Diff: https://reviews.apache.org/r/40373/diff/
> 
> 
> Testing
> -------
> 
> Manually tested
> 
> # Local test results: PASSED
> 
> # Jenkins test results: PENDING
> 
> 
> Thanks,
> 
> Robert Levas
> 
>


Re: Review Request 40373: Create API entry points for getting authorization information

Posted by Robert Levas <rl...@hortonworks.com>.

> On Nov. 17, 2015, 1:55 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java, line 36
> > <https://reviews.apache.org/r/40373/diff/4/?file=1128691#file1128691line36>
> >
> >     Documentation.

I'll add this to the followup patch where I add the data layer.


> On Nov. 17, 2015, 1:55 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java, line 35
> > <https://reviews.apache.org/r/40373/diff/4/?file=1128692#file1128692line35>
> >
> >     Documentation.

I'll add this to the followup patch where I add the data layer.


> On Nov. 17, 2015, 1:55 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java, line 211
> > <https://reviews.apache.org/r/40373/diff/4/?file=1128695#file1128695line211>
> >
> >     Would you ever need to expose constants like "VIEW.USE" ? If so, better to do it now than go back later since you might miss stuff.

These values will be stored in the database.  Ideally the set of _authorizations_ are static so I guess it couldn't hurt to create constants for each, but then that would be one more thing to maintain when the set changes.  Adding these constants can be done when we write the code to enforce the priviliges if needed.


- Robert


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


On Nov. 17, 2015, 12:40 p.m., Robert Levas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40373/
> -----------------------------------------------------------
> 
> (Updated Nov. 17, 2015, 12:40 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-13916
>     https://issues.apache.org/jira/browse/AMBARI-13916
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Create API entry points for getting authorization information.  
> 
> The following entry points need to be created:
> ```
> GET /api/v1/authorizations
> GET /api/v1/permissions/:PERMISSION_ID/authorizations
> GET /api/v1/users/:USERNAME/authorizations
> ```
> 
> The following entry points need to be updated to supply more information:
> ```
> GET /api/v1/permissions/:PERMISSION_ID
> ```
> 
> # Note: The data layer is stubbed out and left for implementation in AMBARI-13865
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 
> 
> Diff: https://reviews.apache.org/r/40373/diff/
> 
> 
> Testing
> -------
> 
> Manually tested
> 
> # Local test results: PASSED
> 
> # Jenkins test results: PENDING
> 
> 
> Thanks,
> 
> Robert Levas
> 
>


Re: Review Request 40373: Create API entry points for getting authorization information

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40373/#review106907
-----------------------------------------------------------

Ship it!



ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java (line 36)
<https://reviews.apache.org/r/40373/#comment165708>

    Documentation.



ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java (line 35)
<https://reviews.apache.org/r/40373/#comment165709>

    Documentation.



ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java (line 211)
<https://reviews.apache.org/r/40373/#comment165710>

    Would you ever need to expose constants like "VIEW.USE" ? If so, better to do it now than go back later since you might miss stuff.


- Jonathan Hurley


On Nov. 17, 2015, 12:40 p.m., Robert Levas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40373/
> -----------------------------------------------------------
> 
> (Updated Nov. 17, 2015, 12:40 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-13916
>     https://issues.apache.org/jira/browse/AMBARI-13916
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Create API entry points for getting authorization information.  
> 
> The following entry points need to be created:
> ```
> GET /api/v1/authorizations
> GET /api/v1/permissions/:PERMISSION_ID/authorizations
> GET /api/v1/users/:USERNAME/authorizations
> ```
> 
> The following entry points need to be updated to supply more information:
> ```
> GET /api/v1/permissions/:PERMISSION_ID
> ```
> 
> # Note: The data layer is stubbed out and left for implementation in AMBARI-13865
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 
> 
> Diff: https://reviews.apache.org/r/40373/diff/
> 
> 
> Testing
> -------
> 
> Manually tested
> 
> # Local test results: PASSED
> 
> # Jenkins test results: PENDING
> 
> 
> Thanks,
> 
> Robert Levas
> 
>


Re: Review Request 40373: Create API entry points for getting authorization information

Posted by Robert Levas <rl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40373/
-----------------------------------------------------------

(Updated Nov. 17, 2015, 12:40 p.m.)


Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.


Changes
-------

Addressed Nate's concerns about installFactories.


Bugs: AMBARI-13916
    https://issues.apache.org/jira/browse/AMBARI-13916


Repository: ambari


Description
-------

Create API entry points for getting authorization information.  

The following entry points need to be created:
```
GET /api/v1/authorizations
GET /api/v1/permissions/:PERMISSION_ID/authorizations
GET /api/v1/users/:USERNAME/authorizations
```

The following entry points need to be updated to supply more information:
```
GET /api/v1/permissions/:PERMISSION_ID
```

# Note: The data layer is stubbed out and left for implementation in AMBARI-13865


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
  ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 

Diff: https://reviews.apache.org/r/40373/diff/


Testing
-------

Manually tested

# Local test results: PASSED

# Jenkins test results: PENDING


Thanks,

Robert Levas


Re: Review Request 40373: Create API entry points for getting authorization information

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40373/#review106850
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java (lines 423 - 424)
<https://reviews.apache.org/r/40373/#comment165659>

    We don't need to do this anymore in installFactories().  The ResourceProviderFactory.class is no longer required for resource providers.  I think the idea at one time was to use Guice to load all the resource providers, but it didn't work like that after we got more than 4 or 5 providers.



ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java (lines 93 - 95)
<https://reviews.apache.org/r/40373/#comment165660>

    Can use @StaticallyInject on the class and make this static (or a Provider<PermissionDAO>)


- Nate Cole


On Nov. 17, 2015, 10:04 a.m., Robert Levas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40373/
> -----------------------------------------------------------
> 
> (Updated Nov. 17, 2015, 10:04 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-13916
>     https://issues.apache.org/jira/browse/AMBARI-13916
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Create API entry points for getting authorization information.  
> 
> The following entry points need to be created:
> ```
> GET /api/v1/authorizations
> GET /api/v1/permissions/:PERMISSION_ID/authorizations
> GET /api/v1/users/:USERNAME/authorizations
> ```
> 
> The following entry points need to be updated to supply more information:
> ```
> GET /api/v1/permissions/:PERMISSION_ID
> ```
> 
> # Note: The data layer is stubbed out and left for implementation in AMBARI-13865
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java 823ac8a 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java 0979298 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 
> 
> Diff: https://reviews.apache.org/r/40373/diff/
> 
> 
> Testing
> -------
> 
> Manually tested
> 
> # Local test results: PASSED
> 
> # Jenkins test results: PENDING
> 
> 
> Thanks,
> 
> Robert Levas
> 
>


Re: Review Request 40373: Create API entry points for getting authorization information

Posted by Robert Levas <rl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40373/
-----------------------------------------------------------

(Updated Nov. 17, 2015, 10:04 a.m.)


Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.


Changes
-------

Cosmetic changes related to method location and documentation. Added missing properties to property ID set.


Bugs: AMBARI-13916
    https://issues.apache.org/jira/browse/AMBARI-13916


Repository: ambari


Description
-------

Create API entry points for getting authorization information.  

The following entry points need to be created:
```
GET /api/v1/authorizations
GET /api/v1/permissions/:PERMISSION_ID/authorizations
GET /api/v1/users/:USERNAME/authorizations
```

The following entry points need to be updated to supply more information:
```
GET /api/v1/permissions/:PERMISSION_ID
```

# Note: The data layer is stubbed out and left for implementation in AMBARI-13865


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
  ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
  ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java 823ac8a 
  ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java 0979298 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 

Diff: https://reviews.apache.org/r/40373/diff/


Testing
-------

Manually tested

# Local test results: PASSED

# Jenkins test results: PENDING


Thanks,

Robert Levas


Re: Review Request 40373: Create API entry points for getting authorization information

Posted by Robert Levas <rl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40373/
-----------------------------------------------------------

(Updated Nov. 17, 2015, 9:32 a.m.)


Review request for Ambari, Jonathan Hurley, Nate Cole, Robert Nettleton, and Sumit Mohanty.


Changes
-------

Changed the scheama of AuthorizationInfo to provide more inforamation for VIEW entries to properly identify a view instance the user has access to.


Bugs: AMBARI-13916
    https://issues.apache.org/jira/browse/AMBARI-13916


Repository: ambari


Description
-------

Create API entry points for getting authorization information.  

The following entry points need to be created:
```
GET /api/v1/authorizations
GET /api/v1/permissions/:PERMISSION_ID/authorizations
GET /api/v1/users/:USERNAME/authorizations
```

The following entry points need to be updated to supply more information:
```
GET /api/v1/permissions/:PERMISSION_ID
```

# Note: The data layer is stubbed out and left for implementation in AMBARI-13865


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/api/resources/PermissionResourceDefinition.java 56127b9 
  ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java e7bbec4 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/PermissionService.java 594caba 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/RoleAuthorizationService.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java 05ee6b1 
  ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java 823ac8a 
  ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java 0979298 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java 0310fdc 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserAuthorizationResourceProvider.java PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java fbbc7c8 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java 0ad3b47 
  ambari-server/src/test/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImplTest.java 081a6eb 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProviderTest.java ebe9b93 

Diff: https://reviews.apache.org/r/40373/diff/


Testing
-------

Manually tested

# Local test results: PASSED

# Jenkins test results: PENDING


Thanks,

Robert Levas