Repository: apex-core Updated Branches: refs/heads/master 1e3d47bef -> 911ccb269
APEXCORE-636 - user level kerberos support Project: http://git-wip-us.apache.org/repos/asf/apex-core/repo Commit: http://git-wip-us.apache.org/repos/asf/apex-core/commit/6f1e051c Tree: http://git-wip-us.apache.org/repos/asf/apex-core/tree/6f1e051c Diff: http://git-wip-us.apache.org/repos/asf/apex-core/diff/6f1e051c Branch: refs/heads/master Commit: 6f1e051c41ea65784f206dffcd03e587d05af89d Parents: f9101d9 Author: devtagare <[email protected]> Authored: Tue Feb 7 18:42:17 2017 -0800 Committer: devtagare <[email protected]> Committed: Thu Feb 23 16:05:43 2017 -0800 ---------------------------------------------------------------------- .../java/com/datatorrent/stram/client/StramAppLauncher.java | 5 +++-- .../java/com/datatorrent/stram/client/StramClientUtils.java | 4 +++- .../java/com/datatorrent/stram/client/StramAppLauncherTest.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/apex-core/blob/6f1e051c/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java ---------------------------------------------------------------------- diff --git a/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java b/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java index 216771d..97420de 100644 --- a/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java +++ b/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java @@ -543,8 +543,8 @@ public class StramAppLauncher private void setTokenRefreshCredentials(LogicalPlan dag, Configuration conf) throws IOException { - String principal = StramUserLogin.getPrincipal(); - String keytabPath = conf.get(StramClientUtils.KEY_TAB_FILE); + String principal = conf.get(StramClientUtils.TOKEN_REFRESH_PRINCIPAL, StramUserLogin.getPrincipal()); + String keytabPath = conf.get(StramClientUtils.TOKEN_REFRESH_KEYTAB, conf.get(StramClientUtils.KEY_TAB_FILE)); if (keytabPath == null) { String keytab = StramUserLogin.getKeytab(); if (keytab != null) { @@ -558,6 +558,7 @@ public class StramAppLauncher } } } + LOG.debug("User principal is {}, keytab is {}", principal, keytabPath); if ((principal != null) && (keytabPath != null)) { dag.setAttribute(LogicalPlan.PRINCIPAL, principal); dag.setAttribute(LogicalPlan.KEY_TAB_FILE, keytabPath); http://git-wip-us.apache.org/repos/asf/apex-core/blob/6f1e051c/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java ---------------------------------------------------------------------- diff --git a/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java b/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java index 461f057..050729d 100644 --- a/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java +++ b/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java @@ -110,10 +110,12 @@ public class StramClientUtils public static final String DT_HDFS_TOKEN_MAX_LIFE_TIME = StreamingApplication.DT_PREFIX + "namenode.delegation.token.max-lifetime"; public static final String HDFS_TOKEN_MAX_LIFE_TIME = "dfs.namenode.delegation.token.max-lifetime"; public static final String DT_RM_TOKEN_MAX_LIFE_TIME = StreamingApplication.DT_PREFIX + "resourcemanager.delegation.token.max-lifetime"; + @Deprecated public static final String KEY_TAB_FILE = StramUserLogin.DT_AUTH_PREFIX + "store.keytab"; public static final String TOKEN_ANTICIPATORY_REFRESH_FACTOR = StramUserLogin.DT_AUTH_PREFIX + "token.refresh.factor"; public static final long DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT = 7 * 24 * 60 * 60 * 1000; - + public static final String TOKEN_REFRESH_PRINCIPAL = StramUserLogin.DT_AUTH_PREFIX + "token.refresh.principal"; + public static final String TOKEN_REFRESH_KEYTAB = StramUserLogin.DT_AUTH_PREFIX + "token.refresh.keytab"; /** * TBD<p> * <br> http://git-wip-us.apache.org/repos/asf/apex-core/blob/6f1e051c/engine/src/test/java/com/datatorrent/stram/client/StramAppLauncherTest.java ---------------------------------------------------------------------- diff --git a/engine/src/test/java/com/datatorrent/stram/client/StramAppLauncherTest.java b/engine/src/test/java/com/datatorrent/stram/client/StramAppLauncherTest.java index ad1dbd6..5d4c84b 100644 --- a/engine/src/test/java/com/datatorrent/stram/client/StramAppLauncherTest.java +++ b/engine/src/test/java/com/datatorrent/stram/client/StramAppLauncherTest.java @@ -98,7 +98,7 @@ public class StramAppLauncherTest { Configuration conf = new Configuration(false); File storeKeytab = new File(dfsDir, "keytab2"); - conf.set(StramClientUtils.KEY_TAB_FILE, storeKeytab.getPath()); + conf.set(StramClientUtils.TOKEN_REFRESH_KEYTAB, storeKeytab.getPath()); StramUserLogin.authenticate(principal, sourceKeytab.getPath()); LogicalPlan dag = applyTokenRefreshKeytab(FileSystem.newInstance(conf), conf); Assert.assertEquals("Token refresh principal", principal, dag.getValue(LogicalPlan.PRINCIPAL));
