Skip to content

Conversation

@smolnar82
Copy link
Contributor

@rlevas @zeroflag @echekanskiy

Local build result:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33:51 min
[INFO] Finished at: 2018-01-09T16:35:33+01:00
[INFO] Final Memory: 215M/897M
[INFO] ------------------------------------------------------------------------

Besides updating the unit tests I also conducted integration tests against a sample LDAP server (ldap.forumsys.com:389):

  • uid=boyle with proper credentials (password=password) was able to use the API; retrieved HTTP response code of 200
  • uid=boyle with wrong credentials (password!=password) was not able to use the API; retrieved HTTP response code of 403

Continuously checked ambari-server.log to see if LDAP configuration is loaded/reloaded from the DB.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing JavaDoc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed all missing Javadoc issues

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing JavaDoc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing JavaDoc

@vivekratnavel vivekratnavel changed the title AMBARI-22667: Use internal LDAP configuration values rather than ambari.properties [AMBARI-22667] Use internal LDAP configuration values rather than ambari.properties Jan 10, 2018
@vivekratnavel
Copy link
Contributor

@smolnar82 Please read the How to Contribute guide - https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute

I have edited the title of this PR for consistency.

@smolnar82
Copy link
Contributor Author

@vivekratnavel OK; sorry for missing the brackets...I'll include them going forward

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both printStackTrace + logging here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have put this into something like Password.fromFile(path, default), because this part doesn't need the Configuration/CredentialStore dependency.
Also please consider returning a Password objects instead of String/char[] arrays.

Storing password in strings is not perfectly safe because there is no way of deleting it from the memory after it is not needed on the other hand a char[] can be nulled out. So a Password class that wraps a char[] array would be easier to enhance with this ability.

Copy link
Contributor Author

@smolnar82 smolnar82 Jan 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I agree...
However this is out of scope of this task. Let me create a new JIRA to cover this topic.

@smolnar82 smolnar82 force-pushed the AMBARI-22667 branch 2 times, most recently from f5378f2 to 58a433d Compare January 10, 2018 09:17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using logging methods rather than printStackTrace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

…ri.properties values when accessing the configured LDAP server for LDAP sync and authentication
@rlevas rlevas requested a review from echekanskiy January 10, 2018 16:00
@rlevas rlevas merged commit 0341a36 into apache:trunk Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants