本文整理了Java中co.cask.cdap.proto.NamespaceConfig.getPrincipal()
方法的一些代码示例,展示了NamespaceConfig.getPrincipal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NamespaceConfig.getPrincipal()
方法的具体详情如下:
包路径:co.cask.cdap.proto.NamespaceConfig
类名称:NamespaceConfig
方法名:getPrincipal
暂无
代码示例来源:origin: co.cask.cdap/cdap-app-fabric
@Override
public boolean apply(NamespaceMeta input) {
return principal.getName().equals(input.getConfig().getPrincipal());
}
});
代码示例来源:origin: caskdata/cdap
builder.append("='").append(namespaceConfig.getHiveDatabase()).append("', ");
if (namespaceConfig.getPrincipal() != null) {
builder.append(ArgumentName.PRINCIPAL);
builder.append("='").append(namespaceConfig.getPrincipal()).append("', ");
代码示例来源:origin: co.cask.cdap/cdap-cli
builder.append("='").append(namespaceConfig.getHiveDatabase()).append("', ");
if (namespaceConfig.getPrincipal() != null) {
builder.append(ArgumentName.PRINCIPAL);
builder.append("='").append(namespaceConfig.getPrincipal()).append("', ");
代码示例来源:origin: cdapio/cdap
/**
* Lists all namespaces
*
* @return a list of {@link NamespaceMeta} for all namespaces
*/
@Override
public List
List
final Principal principal = authenticationContext.getPrincipal();
//noinspection ConstantConditions
return AuthorizationUtil.isVisible(namespaces, authorizationEnforcer, principal,
NamespaceMeta::getNamespaceId,
input -> principal.getName().equals(input.getConfig().getPrincipal()));
}
代码示例来源:origin: co.cask.cdap/cdap-app-fabric
"with sufficient privileges for the user %s and then try creating a namespace.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
"namespace with sufficient privileges for the user %s and then try creating a namespace.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
"again with an empty directory mapping and sufficient privileges for the user %s.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
代码示例来源:origin: cdapio/cdap
@Nullable
@Override
public String getImpersonationPrincipal(NamespacedEntityId entityId) throws IOException {
entityId = getEffectiveEntity(entityId);
KerberosPrincipalId effectiveOwner = null;
if (!entityId.getEntityType().equals(EntityType.NAMESPACE)) {
effectiveOwner = ownerStore.getOwner(entityId);
}
// (CDAP-8176) Since no owner was found for the entity return namespace principal if present.
return effectiveOwner != null ? effectiveOwner.getPrincipal() : getNamespaceConfig(entityId).getPrincipal();
}
代码示例来源:origin: cdapio/cdap
if (namespaceMeta != null && principal.getName().equals(namespaceMeta.getConfig().getPrincipal())) {
return namespaceMeta;
代码示例来源:origin: cdapio/cdap
"with sufficient privileges for the user %s and then try creating a namespace.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
"namespace with sufficient privileges for the user %s and then try creating a namespace.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
"again with an empty directory mapping and sufficient privileges for the user %s.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
代码示例来源:origin: co.cask.cdap/cdap-app-fabric
if (namespaceMeta != null && principal.getName().equals(namespaceMeta.getConfig().getPrincipal())) {
return namespaceMeta;
代码示例来源:origin: cdapio/cdap
@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());
}
代码示例来源:origin: co.cask.cdap/cdap-app-fabric
String ownerPrincipal = metadata.getConfig().getPrincipal();
Principal requestingUser = authenticationContext.getPrincipal();
if (ownerPrincipal != null) {
String cOnfiguredPrincipal= metadata.getConfig().getPrincipal();
String cOnfiguredKeytabURI= metadata.getConfig().getKeytabURI();
if ((!Strings.isNullOrEmpty(configuredPrincipal) && Strings.isNullOrEmpty(configuredKeytabURI)) ||
代码示例来源:origin: cdapio/cdap
String ownerPrincipal = metadata.getConfig().getPrincipal();
Principal requestingUser = authenticationContext.getPrincipal();
if (ownerPrincipal != null) {
String cOnfiguredPrincipal= metadata.getConfig().getPrincipal();
String cOnfiguredKeytabURI= metadata.getConfig().getKeytabURI();
if ((!Strings.isNullOrEmpty(configuredPrincipal) && Strings.isNullOrEmpty(configuredKeytabURI)) ||
代码示例来源:origin: cdapio/cdap
/**
* Executes a program without blocking until its completion.
*/
public void execute(final ProgramId id, Map
String originalUserId = SecurityRequestContext.getUserId();
try {
// if the program has a namespace user configured then set that user in the security request context.
// See: CDAP-7396
String nsPrincipal = namespaceQueryAdmin.get(id.getNamespaceId()).getConfig().getPrincipal();
if (nsPrincipal != null && SecurityUtil.isKerberosEnabled(cConf)) {
SecurityRequestContext.setUserId(new KerberosName(nsPrincipal).getServiceName());
}
lifecycleService.runInternal(id, userArgs, sysArgs, false);
} catch (ProgramNotFoundException | ApplicationNotFoundException e) {
throw new TaskExecutionException(String.format(UserMessages.getMessage(UserErrors.PROGRAM_NOT_FOUND), id),
e, false);
} finally {
SecurityRequestContext.setUserId(originalUserId);
}
}
}
代码示例来源:origin: co.cask.cdap/cdap-app-fabric
/**
* Executes a program without blocking until its completion.
*/
public void execute(final ProgramId id, Map
String originalUserId = SecurityRequestContext.getUserId();
try {
// if the program has a namespace user configured then set that user in the security request context.
// See: CDAP-7396
String nsPrincipal = namespaceQueryAdmin.get(id.getNamespaceId()).getConfig().getPrincipal();
if (nsPrincipal != null && SecurityUtil.isKerberosEnabled(cConf)) {
SecurityRequestContext.setUserId(new KerberosName(nsPrincipal).getServiceName());
}
lifecycleService.runInternal(id, userArgs, sysArgs, false);
} catch (ProgramNotFoundException | ApplicationNotFoundException e) {
throw new TaskExecutionException(String.format(UserMessages.getMessage(UserErrors.PROGRAM_NOT_FOUND), id),
e, false);
} finally {
SecurityRequestContext.setUserId(originalUserId);
}
}
}
代码示例来源:origin: caskdata/cdap
public Builder(NamespaceMeta meta) {
this.name = meta.getName();
this.description = meta.getDescription();
NamespaceConfig cOnfig= meta.getConfig();
if (config != null) {
this.schedulerQueueName = config.getSchedulerQueueName();
this.rootDirectory = config.getRootDirectory();
this.hbaseNamespace = config.getHbaseNamespace();
this.hiveDatabase = config.getHiveDatabase();
this.principal = config.getPrincipal();
this.groupName = config.getGroupName();
this.keytabURIWithoutVersion = config.getKeytabURIWithoutVersion();
this.keytabURIVersion = config.getKeytabURIVersion();
this.exploreAsPrincipal = config.isExploreAsPrincipal();
}
}
代码示例来源:origin: co.cask.cdap/cdap-proto
public Builder(NamespaceMeta meta) {
this.name = meta.getName();
this.description = meta.getDescription();
NamespaceConfig cOnfig= meta.getConfig();
if (config != null) {
this.schedulerQueueName = config.getSchedulerQueueName();
this.rootDirectory = config.getRootDirectory();
this.hbaseNamespace = config.getHbaseNamespace();
this.hiveDatabase = config.getHiveDatabase();
this.principal = config.getPrincipal();
this.groupName = config.getGroupName();
this.keytabURIWithoutVersion = config.getKeytabURIWithoutVersion();
this.keytabURIVersion = config.getKeytabURIVersion();
this.exploreAsPrincipal = config.isExploreAsPrincipal();
}
}
代码示例来源:origin: cdapio/cdap
DatasetId datasetId = namespaceId.dataset("whom");
DatasetTypeId datasetTypeId = namespaceId.datasetType(KeyValueTable.class.getName());
String owner = appOwner != null ? appOwner : nsMeta.getConfig().getPrincipal();
KerberosPrincipalId principalId = new KerberosPrincipalId(owner);
Principal principal = new Principal(owner, Principal.PrincipalType.USER);
代码示例来源:origin: cdapio/cdap
impNsMeta.getName(), impNsMeta.getConfig().getPrincipal());