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




ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
Line 350 (original), 350-356 (patched)
<https://reviews.apache.org/r/59503/#comment249541>

    This is no longer needed if the trigger to create the admin user is based 
on the existing of an administrator user or not.



ambari-server/src/main/java/org/apache/ambari/server/controller/CreateUserHelper.java
Lines 28 (patched)
<https://reviews.apache.org/r/59503/#comment249546>

    This check seems to be unnecessary.  Why not just pass in the username and 
password.  Let the caller of this determine what the _default_ account 
credentials should be.



ambari-server/src/main/java/org/apache/ambari/server/controller/CreateUserHelper.java
Lines 47 (patched)
<https://reviews.apache.org/r/59503/#comment249543>

    Technically, this should only execute if no users exist.



ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
Lines 970-977 (patched)
<https://reviews.apache.org/r/59503/#comment249542>

    This could be really slow if a lot of users exist.
    
    It would be better to
    
    1. Look up the Ambari Administrator permission entity using 
`org.apache.ambari.server.orm.dao.PermissionDAO#findByName`.
    2. Look up the privilege entities that have the Ambari Administrator 
permission using something like 
`org.apache.ambari.server.orm.dao.PrivilegeDAO#findByPermissionId` (a new 
method is needed)
    3. If any privilege entity references a user principal, then an 
administrtrator user exists



ambari-server/src/main/python/ambari_server/serverConfiguration.py
Lines 54-56 (patched)
<https://reviews.apache.org/r/59503/#comment249544>

    Not needed



ambari-server/src/main/python/ambari_server/serverConfiguration.py
Lines 632-640 (patched)
<https://reviews.apache.org/r/59503/#comment249545>

    Not needed



ambari-server/src/main/python/ambari_server/serverSetup.py
Lines 954 (patched)
<https://reviews.apache.org/r/59503/#comment249547>

    `prompt_initial_admin_credentials`, maybe?



ambari-server/src/main/python/ambari_server/serverSetup.py
Lines 963-964 (patched)
<https://reviews.apache.org/r/59503/#comment249548>

    ```
    options.custom_admin_user_name = "admin"
    options.custom_admin_user_password = "admin"
    ```



ambari-server/src/main/python/ambari_server/serverSetup.py
Lines 1234 (patched)
<https://reviews.apache.org/r/59503/#comment249549>

    Why not combine the prompt and the creating of the account here?



ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
Lines 1129-1130 (original), 1129-1130 (patched)
<https://reviews.apache.org/r/59503/#comment249550>

    Remove this, and similar from the other DDL files.



ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
Lines 1423-1424 (original), 1420-1421 (patched)
<https://reviews.apache.org/r/59503/#comment249551>

    Remove this and similar from other DDL files.



ambari-server/src/test/java/org/apache/ambari/server/controller/CreateUserHelperTest.java
Lines 36-39 (patched)
<https://reviews.apache.org/r/59503/#comment249552>

    This is not testing anything.


- Robert Levas


On May 24, 2017, 4:40 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 24, 2017, 4:40 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Di Li, Jonathan Hurley, 
> Robert Levas, and Tim Thorpe.
> 
> 
> Bugs: AMBARI-21083
>     https://issues.apache.org/jira/browse/AMBARI-21083
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Provide the ability to create custom admin user during ambari server setup, 
> so that the user will have the option to either create the admin user with 
> the username/password of their preference or can use the default username.
> 
> 
> Diffs
> -----
> 
>   ambari-server/docs/configuration/index.md ff9ce54 
>   
> ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
>  114046f 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/CreateUserHelper.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
>  9cdde8f 
>   ambari-server/src/main/python/ambari_server/serverConfiguration.py 4780338 
>   ambari-server/src/main/python/ambari_server/serverSetup.py c6de088 
>   ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql 15670f3 
>   ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 7e41399 
>   ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 4d0274f 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql cc933fa 
>   ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 5fc14d4 
>   ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 12e66f9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/CreateUserHelperTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/59503/diff/3/
> 
> 
> Testing
> -------
> 
> Added 1 test case
> 
> 
> Ran mvn test
> 
> 
> File Attachments
> ----------------
> 
> custom_admin.PNG
>   
> https://reviews.apache.org/media/uploaded/files/2017/05/23/53d168bc-6c83-4acf-ae9b-74bf3fa005d3__custom_admin.PNG
> 
> 
> Thanks,
> 
> Anita Jebaraj
> 
>

Reply via email to