You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Anita Jebaraj <aj...@us.ibm.com> on 2017/05/23 21:50:21 UTC

Review Request 59503: Create custom admin user during ambari server setup

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

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


Diffs
-----

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


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


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.

> On May 23, 2017, 10 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/CreateUserHelper.java
> > Lines 19 (patched)
> > <https://reviews.apache.org/r/59503/diff/1/?file=1730396#file1730396line19>
> >
> >     Use braces and add javadoc

Included javadoc and braces in the new patch


> On May 23, 2017, 10 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/python/ambari_server/serverSetup.py
> > Lines 972 (patched)
> > <https://reviews.apache.org/r/59503/diff/1/?file=1730398#file1730398line972>
> >
> >     We should allow special characters in passwords

I have added this validation only for username, password allows special characters. I have matched the validation for username to be the same as in UI


> On May 23, 2017, 10 p.m., Alejandro Fernandez wrote:
> > ambari-server/src/main/python/ambari_server/serverSetup.py
> > Lines 975 (patched)
> > <https://reviews.apache.org/r/59503/diff/1/?file=1730398#file1730398line975>
> >
> >     May want to check that it isn't a list of spaces either.

I have added a strip() for admin_user, which would remove the leading and trailing white spaces, verified this behavior in the UI as well


- Anita


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


On May 23, 2017, 11:26 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 23, 2017, 11:26 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/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/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/2/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59503/#review175864
-----------------------------------------------------------




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

    Use braces and add javadoc



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

    We should allow special characters in passwords



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

    May want to check that it isn't a list of spaces either.


- Alejandro Fernandez


On May 23, 2017, 9:50 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 23, 2017, 9:50 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/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/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/1/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.

> On May 24, 2017, 1:51 p.m., Robert Levas wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
> > Lines 351-356 (patched)
> > <https://reviews.apache.org/r/59503/diff/2/?file=1730906#file1730906line351>
> >
> >     Is this necessary?  It seems like the option is only releated to setup, not for normal runtime.
> 
> Anita Jebaraj wrote:
>     yes it is only used during setup, but I added it here to be included in the index.md, please let me know if it is not required
> 
> Robert Levas wrote:
>     I don't think that this is necessary. That index.md file is documentation for the properties that go in the ambari.properites file. Since the value for this is only used during Ambari setup, it will not need to be set as a configuration option and ambari.properties.
> 
> Anita Jebaraj wrote:
>     I am using this property as a flag in ambari.properties, the prompt to create custom admin user will be given only the first time of setup if the flag is set to true then the  admin user is created and the prompt is not required again

I am using the property server.jdbc.database_name to determine if the setup is run or not, this is the same property which is used during ambari-server start to check if setup is done, so using the same


- Anita


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


On June 1, 2017, 6:08 a.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated June 1, 2017, 6:08 a.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/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/5/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.

> On May 24, 2017, 1:51 p.m., Robert Levas wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
> > Lines 351-356 (patched)
> > <https://reviews.apache.org/r/59503/diff/2/?file=1730906#file1730906line351>
> >
> >     Is this necessary?  It seems like the option is only releated to setup, not for normal runtime.

yes it is only used during setup, but I added it here to be included in the index.md, please let me know if it is not required


- Anita


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


On May 23, 2017, 11:26 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 23, 2017, 11:26 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/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/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/2/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

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

> On May 24, 2017, 9:51 a.m., Robert Levas wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
> > Lines 351-356 (patched)
> > <https://reviews.apache.org/r/59503/diff/2/?file=1730906#file1730906line351>
> >
> >     Is this necessary?  It seems like the option is only releated to setup, not for normal runtime.
> 
> Anita Jebaraj wrote:
>     yes it is only used during setup, but I added it here to be included in the index.md, please let me know if it is not required

I don't think that this is necessary. That index.md file is documentation for the properties that go in the ambari.properites file. Since the value for this is only used during Ambari setup, it will not need to be set as a configuration option and ambari.properties.


- Robert


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


On May 23, 2017, 7:26 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 23, 2017, 7:26 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/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/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/2/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.

> On May 24, 2017, 1:51 p.m., Robert Levas wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
> > Lines 351-356 (patched)
> > <https://reviews.apache.org/r/59503/diff/2/?file=1730906#file1730906line351>
> >
> >     Is this necessary?  It seems like the option is only releated to setup, not for normal runtime.
> 
> Anita Jebaraj wrote:
>     yes it is only used during setup, but I added it here to be included in the index.md, please let me know if it is not required
> 
> Robert Levas wrote:
>     I don't think that this is necessary. That index.md file is documentation for the properties that go in the ambari.properites file. Since the value for this is only used during Ambari setup, it will not need to be set as a configuration option and ambari.properties.

I am using this property as a flag in ambari.properties, the prompt to create custom admin user will be given only the first time of setup if the flag is set to true then the  admin user is created and the prompt is not required again


- Anita


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


On May 23, 2017, 11:26 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 23, 2017, 11:26 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/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/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/2/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

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




ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
Lines 351-356 (patched)
<https://reviews.apache.org/r/59503/#comment249265>

    Is this necessary?  It seems like the option is only releated to setup, not for normal runtime.


- Robert Levas


On May 23, 2017, 7:26 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 23, 2017, 7:26 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/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/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/2/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Tim Thorpe <tt...@ca.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59503/#review175918
-----------------------------------------------------------


Ship it!




Ship It!

- Tim Thorpe


On May 23, 2017, 11:26 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 23, 2017, 11:26 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/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/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/2/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.

> On May 24, 2017, 3:37 p.m., Robert Levas wrote:
> > This update will create a security issue.  We need to ensure that an admin user is only created once via this script.  This should occur during the *first* call to `ambari-server setup` - which is expected to be done by a system administrator - ideally `root`.  After that, `ambari-server` may be exectued by another user, if an alternate user is set to execute Ambari. 
> > 
> > If a non-administrative user can execute `ambari-server setup` and that user is allowed to set or update users in the Ambari database (without first being authenticated by Ambari), then users other than Ambari Administrators can effectively manage Ambari users. We should not allow this to happen.
> > 
> > I think that if we want to allow this feature, we need to first query the Ambari database to see if there is already a user with administrator privileges.  If not, then the setup script should be allowed to create the first Ambari Administrator account. If one exists, than the setup script should not be allowed to create new or update existing users in the database. Because `org.apache.ambari.server.controller.CreateUserHelper` is an executable class, the check needs to be done there to ensure OS-level users with the ability to read this class do not gain the ability to create (and possibly update) Ambari user accounts while by-passing needed authorization checks.

Thank you Robert for your suggestions, 

I have modified the implementation so for the first time the ambari-server setup is run the admin user gets created and the create.admin.flag is set to true in ambari.properties. If the class CreateUserHelper is executed, it looks if admin user exists and it fails there, so the users cannot be modified/created just by executing the class later. Even if the create.admin.flag in ambari.properties is switched to false and ambari-server setup is run, new admin user cannot be created, since it looks for existing admin users and it fails with the message "User cannot be created, Admin user already exists, login to Ambari UI to create/modify users"


- Anita


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


On May 24, 2017, 8: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, 8: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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

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



This update will create a security issue.  We need to ensure that an admin user is only created once via this script.  This should occur during the *first* call to `ambari-server setup` - which is expected to be done by a system administrator - ideally `root`.  After that, `ambari-server` may be exectued by another user, if an alternate user is set to execute Ambari. 

If a non-administrative user can execute `ambari-server setup` and that user is allowed to set or update users in the Ambari database (without first being authenticated by Ambari), then users other than Ambari Administrators can effectively manage Ambari users. We should not allow this to happen.

I think that if we want to allow this feature, we need to first query the Ambari database to see if there is already a user with administrator privileges.  If not, then the setup script should be allowed to create the first Ambari Administrator account. If one exists, than the setup script should not be allowed to create new or update existing users in the database. Because `org.apache.ambari.server.controller.CreateUserHelper` is an executable class, the check needs to be done there to ensure OS-level users with the ability to read this class do not gain the ability to create (and possibly update) Ambari user accounts while by-passing needed authorization checks.

- Robert Levas


On May 23, 2017, 7:26 p.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated May 23, 2017, 7:26 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/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/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/2/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.

> On May 26, 2017, 2:57 p.m., Robert Levas wrote:
> > ambari-server/src/main/python/ambari_server/serverSetup.py
> > Lines 1234 (patched)
> > <https://reviews.apache.org/r/59503/diff/3/?file=1731985#file1731985line1234>
> >
> >     Why not combine the prompt and the creating of the account here?

It can be done, but currently all the prompts are given during setup and then the creation is done (creating tables, creating schema etc.), so I just wanted to follow similar approach, rather than prompting create admin user later


- Anita


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


On May 24, 2017, 8: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, 8: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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

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

> On May 26, 2017, 10:57 a.m., Robert Levas wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
> > Line 350 (original), 350-356 (patched)
> > <https://reviews.apache.org/r/59503/diff/3/?file=1731981#file1731981line350>
> >
> >     This is no longer needed if the trigger to create the admin user is based on the existing of an administrator user or not.
> 
> Anita Jebaraj wrote:
>     Hi Robert, the check if an administrator user exists or not is done in the createUserHelper class, but this doesn't stop the prompt from being displayed during ambari-server setup, If I dont have this flag, then the user will be prompted to enter custom admin user, and later it fails. I thought there is no point in displaying the prompt during setup again if the user is already created
>     
>     I am not sure if having a java executable command to check if admin user exists is a good idea. Please let me know how you want this to be handled.

Somehow the setup program knows it has been executed once. Can this information be used instead?  Or maybe a combination of that data and a query on the database to check for an administrator user?  This flag feels to be unnecessary and will unnecessarily clutter up the ambari.properties file.


- Robert


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


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


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.

> On May 26, 2017, 2:57 p.m., Robert Levas wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
> > Line 350 (original), 350-356 (patched)
> > <https://reviews.apache.org/r/59503/diff/3/?file=1731981#file1731981line350>
> >
> >     This is no longer needed if the trigger to create the admin user is based on the existing of an administrator user or not.
> 
> Anita Jebaraj wrote:
>     Hi Robert, the check if an administrator user exists or not is done in the createUserHelper class, but this doesn't stop the prompt from being displayed during ambari-server setup, If I dont have this flag, then the user will be prompted to enter custom admin user, and later it fails. I thought there is no point in displaying the prompt during setup again if the user is already created
>     
>     I am not sure if having a java executable command to check if admin user exists is a good idea. Please let me know how you want this to be handled.
> 
> Robert Levas wrote:
>     Somehow the setup program knows it has been executed once. Can this information be used instead?  Or maybe a combination of that data and a query on the database to check for an administrator user?  This flag feels to be unnecessary and will unnecessarily clutter up the ambari.properties file.

same as above, using the property server.jdbc.database_name


- Anita


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


On June 1, 2017, 6:08 a.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated June 1, 2017, 6:08 a.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/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/5/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.

> On May 26, 2017, 2:57 p.m., Robert Levas wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
> > Line 350 (original), 350-356 (patched)
> > <https://reviews.apache.org/r/59503/diff/3/?file=1731981#file1731981line350>
> >
> >     This is no longer needed if the trigger to create the admin user is based on the existing of an administrator user or not.

Hi Robert, the check if an administrator user exists or not is done in the createUserHelper class, but this doesn't stop the prompt from being displayed during ambari-server setup, If I dont have this flag, then the user will be prompted to enter custom admin user, and later it fails. I thought there is no point in displaying the prompt during setup again if the user is already created

I am not sure if having a java executable command to check if admin user exists is a good idea. Please let me know how you want this to be handled.


- Anita


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


On May 24, 2017, 8: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, 8: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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Robert Levas <rl...@hortonworks.com>.
-----------------------------------------------------------
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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

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




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

    Add a test case testing that a user will not be created if an admin user already exists.


- Robert Levas


On June 1, 2017, 2:08 a.m., Anita Jebaraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59503/
> -----------------------------------------------------------
> 
> (Updated June 1, 2017, 2:08 a.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/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/5/
> 
> 
> 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
> 
>


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59503/
-----------------------------------------------------------

(Updated June 26, 2017, 8:16 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 (updated)
-----

  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 e341405 
  ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql ce8736e 
  ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql ace3738 
  ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 5899179 
  ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 6164b2d 
  ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 52d2b87 
  ambari-server/src/test/java/org/apache/ambari/server/controller/CreateUserHelperTest.java PRE-CREATION 


Diff: https://reviews.apache.org/r/59503/diff/6/

Changes: https://reviews.apache.org/r/59503/diff/5-6/


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


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59503/
-----------------------------------------------------------

(Updated June 1, 2017, 6:08 a.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 (updated)
-----

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

Changes: https://reviews.apache.org/r/59503/diff/4-5/


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


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59503/
-----------------------------------------------------------

(Updated June 1, 2017, 5:54 a.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 (updated)
-----

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

Changes: https://reviews.apache.org/r/59503/diff/3-4/


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


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59503/
-----------------------------------------------------------

(Updated May 24, 2017, 8: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 (updated)
-----

  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/

Changes: https://reviews.apache.org/r/59503/diff/2-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


Re: Review Request 59503: Create custom admin user during ambari server setup

Posted by Anita Jebaraj <aj...@us.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59503/
-----------------------------------------------------------

(Updated May 23, 2017, 11:26 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 (updated)
-----

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

Changes: https://reviews.apache.org/r/59503/diff/1-2/


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