Skip to content

Commit

Permalink
TEIIDDES-2352: Save the jdbc password token to xml
Browse files Browse the repository at this point in the history
* The jdbc password token is not being saved to the xml file hence the
  password is not found and reverting to the default upon reloading

* Completes the cycle by saving the jdbc password token in the same manner
  as the admin password
  • Loading branch information
Paul Richardson authored and blafond committed Oct 23, 2014
1 parent db9b5d2 commit b470ace
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ private void saveState() throws TransformerFactoryConfigurationError {
String passToken = teiidServer.getTeiidAdminInfo().getPassToken();
if (passToken != null)
adminElement.setAttribute(PASSWORD_ATTR, Base64.encodeBytes(passToken.getBytes("UTF-8"))); //$NON-NLS-1$

adminElement.setAttribute(SECURE_ATTR, Boolean.toString(teiidServer.getTeiidAdminInfo().isSecure()));
}

Expand All @@ -1026,12 +1026,13 @@ private void saveState() throws TransformerFactoryConfigurationError {
jdbcElement.setAttribute(JDBC_PORT_ATTR, teiidServer.getTeiidJdbcInfo().getPort());
jdbcElement.setAttribute(JDBC_USER_ATTR, teiidServer.getTeiidJdbcInfo().getUsername());

/* password is saved in the eclipse secure storage */

// if( teiidServer.getTeiidJdbcInfo().getPassword() != null) {
// jdbcElement.setAttribute(JDBC_PASSWORD_ATTR, Base64.encodeBytes(teiidServer.getTeiidJdbcInfo().getPassword().getBytes()));
// }

/* The token of the password is saved to file while the password is saved in the eclipse secure storage
* Saving the token ensures that its possible to find the password again.
*/
String passToken = teiidServer.getTeiidJdbcInfo().getPassToken();
if (passToken != null)
jdbcElement.setAttribute(JDBC_PASSWORD_ATTR, Base64.encodeBytes(passToken.getBytes("UTF-8"))); //$NON-NLS-1$

jdbcElement.setAttribute(JDBC_SECURE_ATTR, Boolean.toString(teiidServer.getTeiidJdbcInfo().isSecure()));
}

Expand Down

0 comments on commit b470ace

Please sign in to comment.