io.fabric8.zookeeper.utils.ZooKeeperUtils.generateContainerToken()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中io.fabric8.zookeeper.utils.ZooKeeperUtils.generateContainerToken()方法的一些代码示例,展示了ZooKeeperUtils.generateContainerToken()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperUtils.generateContainerToken()方法的具体详情如下:
包路径:io.fabric8.zookeeper.utils.ZooKeeperUtils
类名称:ZooKeeperUtils
方法名:generateContainerToken

ZooKeeperUtils.generateContainerToken介绍

暂无

代码示例

代码示例来源:origin: jboss-fuse/fabric8

@Override
  public Object call(Git git, GitContext context) throws Exception {
    ProfileRegistry registry = fabricService.adapt(ProfileRegistry.class);
    Map<String, String> properties = registry.getDataStoreProperties();
    String username;
    String password;
    if (properties != null && properties.containsKey("gitRemoteUser")
        && properties.containsKey("gitRemotePassword")) {
      username = properties.get("gitRemoteUser");
      password = properties.get("gitRemotePassword");
    } else {
      username = ZooKeeperUtils.getContainerLogin(runtimeProperties);
      password = ZooKeeperUtils.generateContainerToken(runtimeProperties, curator);
    }
    remoteUrl[0] = git.getRepository().getConfig().getString("remote", "origin", "url");
    Iterable<PushResult> results = git.push()
        .setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password))
        .setPushTags()
        .setPushAll()
        .call();
    logPushResult(results, git.getRepository(), verbose);
    return null;
  }
};

代码示例来源:origin: jboss-fuse/fabric8

private CredentialsProvider getCredentialsProvider() {
  Map<String, String> properties = getDataStoreProperties();
  String username;
  String password;
  RuntimeProperties sysprops = runtimeProperties.get();
  username = ZooKeeperUtils.getContainerLogin(sysprops);
  password = ZooKeeperUtils.generateContainerToken(sysprops, curator.get());
  if (isExternalGitConfigured(properties)) {
    username = getExternalUser(properties);
    password = getExternalCredential(properties);
  }
  return new UsernamePasswordCredentialsProvider(username, password);
}

代码示例来源:origin: io.fabric8/fabric-git

private CredentialsProvider getCredentialsProvider() {
  Map<String, String> properties = getDataStoreProperties();
  String username;
  String password;
  if (isExternalGitConfigured(properties)) {
    username = getExternalUser(properties);
    password = getExternalCredential(properties);
  } else {
    RuntimeProperties sysprops = runtimeProperties.get();
    username = ZooKeeperUtils.getContainerLogin(sysprops);
    password = ZooKeeperUtils.generateContainerToken(sysprops, curator.get());
  }
  return new UsernamePasswordCredentialsProvider(username, password);
}

相关文章