builder.append("='").append(namespaceConfig.getPrincipal()).append("', "); if (namespaceConfig.getKeytabURI() != null) { builder.append(ArgumentName.NAMESPACE_KEYTAB_PATH); builder.append("='").append(namespaceConfig.getKeytabURI()).append("', ");
if (config != null && config.getKeytabURI() != null) { String keytabURI = config.getKeytabURI(); if (keytabURI.isEmpty()) { throw new BadRequestException("Cannot update keytab URI with an empty URI.");
if (config != null && config.getKeytabURI() != null) { String keytabURI = config.getKeytabURI(); if (keytabURI.isEmpty()) { throw new BadRequestException("Cannot update keytab URI with an empty URI.");
builder.append("='").append(namespaceConfig.getPrincipal()).append("', "); if (namespaceConfig.getKeytabURI() != null) { builder.append(ArgumentName.NAMESPACE_KEYTAB_PATH); builder.append("='").append(namespaceConfig.getKeytabURI()).append("', ");
if (metadata.getConfig() != null) { String configuredPrincipal = metadata.getConfig().getPrincipal(); String configuredKeytabURI = metadata.getConfig().getKeytabURI(); if ((!Strings.isNullOrEmpty(configuredPrincipal) && Strings.isNullOrEmpty(configuredKeytabURI)) || (Strings.isNullOrEmpty(configuredPrincipal) && !Strings.isNullOrEmpty(configuredKeytabURI))) {
if (metadata.getConfig() != null) { String configuredPrincipal = metadata.getConfig().getPrincipal(); String configuredKeytabURI = metadata.getConfig().getKeytabURI(); if ((!Strings.isNullOrEmpty(configuredPrincipal) && Strings.isNullOrEmpty(configuredKeytabURI)) || (Strings.isNullOrEmpty(configuredPrincipal) && !Strings.isNullOrEmpty(configuredKeytabURI))) {
@Nullable @Override public ImpersonationInfo getImpersonationInfo(NamespacedEntityId entityId) throws IOException { entityId = getEffectiveEntity(entityId); if (!entityId.getEntityType().equals(EntityType.NAMESPACE)) { KerberosPrincipalId effectiveOwner = ownerStore.getOwner(entityId); if (effectiveOwner != null) { return new ImpersonationInfo(effectiveOwner.getPrincipal(), SecurityUtil.getKeytabURIforPrincipal(effectiveOwner.getPrincipal(), cConf)); } } // (CDAP-8176) Since no owner was found for the entity return namespace principal if present. NamespaceConfig nsConfig = getNamespaceConfig(entityId.getNamespaceId()); return nsConfig.getPrincipal() == null ? null : new ImpersonationInfo(nsConfig.getPrincipal(), nsConfig.getKeytabURI()); }
config = GSON.fromJson(namespace.get(CONFIG_FIELD).getAsJsonObject(), NamespaceConfig.class); Assert.assertEquals("new/url", config.getKeytabURI());