private ImpersonationInfo getPrincipalForEntity(ImpersonationRequest request) throws IOException { ImpersonationInfo impersonationInfo = SecurityUtil.createImpersonationInfo(ownerAdmin, cConf, request.getEntityId()); LOG.debug("Obtained impersonation info: {} for entity {}", impersonationInfo, request.getEntityId()); return impersonationInfo; }
public Map<String, String> getSystemProperties(Id.Program id) throws IOException, NamespaceNotFoundException { Map<String, String> systemArgs = Maps.newHashMap(); systemArgs.put(Constants.CLUSTER_NAME, cConf.get(Constants.CLUSTER_NAME, "")); systemArgs.put(Constants.AppFabric.APP_SCHEDULER_QUEUE, queueResolver.getQueue(id.getNamespace())); if (SecurityUtil.isKerberosEnabled(cConf)) { ImpersonationInfo impersonationInfo = SecurityUtil.createImpersonationInfo(ownerAdmin, cConf, id.toEntityId()); systemArgs.put(ProgramOptionConstants.PRINCIPAL, impersonationInfo.getPrincipal()); systemArgs.put(ProgramOptionConstants.APP_PRINCIPAL_EXISTS, String.valueOf(ownerAdmin.exists(id.toEntityId().getParent()))); } return systemArgs; } }
public Map<String, String> getSystemProperties(Id.Program id) throws IOException, NamespaceNotFoundException { Map<String, String> systemArgs = Maps.newHashMap(); systemArgs.put(Constants.CLUSTER_NAME, cConf.get(Constants.CLUSTER_NAME, "")); systemArgs.put(Constants.AppFabric.APP_SCHEDULER_QUEUE, queueResolver.getQueue(id.getNamespace())); if (SecurityUtil.isKerberosEnabled(cConf)) { ImpersonationInfo impersonationInfo = SecurityUtil.createImpersonationInfo(ownerAdmin, cConf, id.toEntityId()); systemArgs.put(ProgramOptionConstants.PRINCIPAL, impersonationInfo.getPrincipal()); systemArgs.put(ProgramOptionConstants.APP_PRINCIPAL_EXISTS, String.valueOf(ownerAdmin.exists(id.toEntityId().getParent()))); } return systemArgs; } }