Skip to content

Commit

Permalink
Merge pull request #228 from telefonicaid/hardening/227_improve_hive_…
Browse files Browse the repository at this point in the history
…auth_provider_logs

hardening/227_improve_hive_auth_provider_logs
  • Loading branch information
fgalan committed Mar 1, 2017
2 parents 2e38bae + 0601b4b commit c506df1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [cosmos-hive-auth-provider][hardening] Improve logs (#227)
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,31 @@ public class OAuth2AuthenticationProviderImpl implements PasswdAuthenticationPro
* Constructor.
*/
public OAuth2AuthenticationProviderImpl() {
// get the cnfigured Identity Manager endpoint
// Get the configured Identity Manager endpoint
HiveConf conf = null;

try {
conf = new HiveConf();
LOGGER.info("Hive configuration read");
} catch (Exception e) {
LOGGER.info("Unable to read the Hive configuration, using default values");
LOGGER.debug("Unable to read the Hive configuration, using default values");
} finally {
if (conf == null) {
idmEndpoint = "https://account.lab.fiware.org";
LOGGER.debug("Using hardcoded Identity Manager endpoint: https://account.lab.fiware.org");
} else {
idmEndpoint = conf.get("com.telefonica.iot.idm.endpoint", "https://account.lab.fiware.org");
LOGGER.debug("com.telefonica.iot.idm.endpoint=" + idmEndpoint);
LOGGER.debug("hive.server2.enable.doAs=" + conf.get("hive.server2.enable.doAs"));
LOGGER.debug("hive.server2.authentication=" + conf.get("hive.server2.authentication"));
LOGGER.debug("hive.server2.custom.authentication.class="
+ conf.get("hive.server2.custom.authentication.class"));
LOGGER.debug("hadoop.proxyuser.hive.groups=" + conf.get("hadoop.proxyuser.hive.groups"));
LOGGER.debug("hadoop.proxyuser.hive.hosts=" + conf.get("hadoop.proxyuser.hive.hosts"));
} // if else

LOGGER.info("Identity Manager endpoint: " + idmEndpoint);
} // try catch finally

// create a factory of Http clients
// Create a factory of Http clients
if (idmEndpoint.startsWith("https")) {
httpClientFactory = new HttpClientFactory(true);
} else {
Expand Down

0 comments on commit c506df1

Please sign in to comment.