You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Oliver Szabo <os...@hortonworks.com> on 2016/01/26 14:10:40 UTC

Review Request 42796: AMBARI-14798: Users cannot login with uppercase username

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

Review request for Ambari, Myroslav Papirkovskyy, Robert Levas, and Sebastian Toader.


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


Repository: ambari


Description
-------

In Ambari DB, every username is stored in lowercase format. If a remote server store users in uppercase format (e.g. an active directory), the user cannot login with using uppercase letters in the username.
(earlier, in ambari 2.1.2, UI forced to use lowercase username on login)

Solution: 
Username converted lowercase on service level: predicate for usernames is defined based on the input of createResource() That is because: before rendering the resources for the response, this predicate has to be evaluated. (in that case: Users/user_name = 'Myuser'. If the response contains user_name = 'myuser', the response resource is filtered out)


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java c4403df 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java 6861d3d 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserPrivilegeService.java 80769cf 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java fea5eca 

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


Testing
-------

Unit testing done, FT: manually tested
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:07:55.903s (Wall Clock)
[INFO] Finished at: Tue Jan 26 13:17:14 CET 2016
[INFO] Final Memory: 85M/763M
[INFO] ------------------------------------------------------------------------


Thanks,

Oliver Szabo


Re: Review Request 42796: AMBARI-14798: Users cannot login with uppercase username

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


Ship it!




Ship It!

- Robert Levas


On Jan. 26, 2016, 10:41 a.m., Oliver Szabo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42796/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2016, 10:41 a.m.)
> 
> 
> Review request for Ambari, Myroslav Papirkovskyy, Robert Levas, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-14798
>     https://issues.apache.org/jira/browse/AMBARI-14798
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In Ambari DB, every username is stored in lowercase format. If a remote server store users in uppercase format (e.g. an active directory), the user cannot login with using uppercase letters in the username.
> (earlier, in ambari 2.1.2, UI forced to use lowercase username on login)
> 
> Solution: 
> Username converted lowercase on service level: predicate for usernames is defined based on the input of createResource() That is because: before rendering the resources for the response, this predicate has to be evaluated. (in that case: Users/user_name = 'Myuser'. If the response contains user_name = 'myuser', the response resource is filtered out)
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java c4403df 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java 6861d3d 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserPrivilegeService.java 80769cf 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java fea5eca 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutServiceTest.java PRE-CREATION 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/UserAuthorizationServiceTest.java 9627d19 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/UserPrivilegeServiceTest.java 269315a 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/UserServiceTest.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/42796/diff/
> 
> 
> Testing
> -------
> 
> Unit testing done, FT: manually tested
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 1:07:55.903s (Wall Clock)
> [INFO] Finished at: Tue Jan 26 13:17:14 CET 2016
> [INFO] Final Memory: 85M/763M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>


Re: Review Request 42796: AMBARI-14798: Users cannot login with uppercase username

Posted by Oliver Szabo <os...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42796/
-----------------------------------------------------------

(Updated Jan. 26, 2016, 3:41 p.m.)


Review request for Ambari, Myroslav Papirkovskyy, Robert Levas, and Sebastian Toader.


Changes
-------

added unit tests


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


Repository: ambari


Description
-------

In Ambari DB, every username is stored in lowercase format. If a remote server store users in uppercase format (e.g. an active directory), the user cannot login with using uppercase letters in the username.
(earlier, in ambari 2.1.2, UI forced to use lowercase username on login)

Solution: 
Username converted lowercase on service level: predicate for usernames is defined based on the input of createResource() That is because: before rendering the resources for the response, this predicate has to be evaluated. (in that case: Users/user_name = 'Myuser'. If the response contains user_name = 'myuser', the response resource is filtered out)


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java c4403df 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java 6861d3d 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserPrivilegeService.java 80769cf 
  ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java fea5eca 
  ambari-server/src/test/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutServiceTest.java PRE-CREATION 
  ambari-server/src/test/java/org/apache/ambari/server/api/services/UserAuthorizationServiceTest.java 9627d19 
  ambari-server/src/test/java/org/apache/ambari/server/api/services/UserPrivilegeServiceTest.java 269315a 
  ambari-server/src/test/java/org/apache/ambari/server/api/services/UserServiceTest.java PRE-CREATION 

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


Testing
-------

Unit testing done, FT: manually tested
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:07:55.903s (Wall Clock)
[INFO] Finished at: Tue Jan 26 13:17:14 CET 2016
[INFO] Final Memory: 85M/763M
[INFO] ------------------------------------------------------------------------


Thanks,

Oliver Szabo


Re: Review Request 42796: AMBARI-14798: Users cannot login with uppercase username

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



Can you add some unit tests that test this as well as ensure that usernames remain lowercase in the future - else the test will fail alerting someone that there may be an issue somewhere.

- Robert Levas


On Jan. 26, 2016, 8:10 a.m., Oliver Szabo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42796/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2016, 8:10 a.m.)
> 
> 
> Review request for Ambari, Myroslav Papirkovskyy, Robert Levas, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-14798
>     https://issues.apache.org/jira/browse/AMBARI-14798
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In Ambari DB, every username is stored in lowercase format. If a remote server store users in uppercase format (e.g. an active directory), the user cannot login with using uppercase letters in the username.
> (earlier, in ambari 2.1.2, UI forced to use lowercase username on login)
> 
> Solution: 
> Username converted lowercase on service level: predicate for usernames is defined based on the input of createResource() That is because: before rendering the resources for the response, this predicate has to be evaluated. (in that case: Users/user_name = 'Myuser'. If the response contains user_name = 'myuser', the response resource is filtered out)
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutService.java c4403df 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserAuthorizationService.java 6861d3d 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserPrivilegeService.java 80769cf 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java fea5eca 
> 
> Diff: https://reviews.apache.org/r/42796/diff/
> 
> 
> Testing
> -------
> 
> Unit testing done, FT: manually tested
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 1:07:55.903s (Wall Clock)
> [INFO] Finished at: Tue Jan 26 13:17:14 CET 2016
> [INFO] Final Memory: 85M/763M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>