Examples of IOpenShiftSSHKey


Examples of com.openshift.client.IOpenShiftSSHKey

   * @param name
   * @param keys
   * @return
   */
  public static IOpenShiftSSHKey getKey(String name, List<IOpenShiftSSHKey> keys) {
    IOpenShiftSSHKey matchingKey = null;
    for (IOpenShiftSSHKey key : keys) {
      if (name.equals(key.getName())) {
        matchingKey = key;
        break;
      }
View Full Code Here

Examples of com.openshift.client.IOpenShiftSSHKey

        .mockUpdateKey(keyName, Samples.PUT_BBCC_DSA_USER_KEYS_SOMEKEY);

    // operation
    List<IOpenShiftSSHKey> keys = user.getSSHKeys();
    assertThat(keys).hasSize(1);
    IOpenShiftSSHKey key = keys.get(0);

    // verification
    assertThat(key.getKeyType()).isEqualTo(SSHKeyType.SSH_RSA);

    // operation
    key.setKeyType(SSHKeyType.SSH_DSA, newPublicKeyContent);

    // verification
    assertThat(key.getKeyType()).isEqualTo(SSHKeyType.SSH_DSA);
    assertThat(key.getPublicKey()).isEqualTo(newPublicKeyContent);
    mockDirector.verifyUpdateKey(
        keyName,
        new StringParameter("type", SSHKeyTestUtils.SSH_DSA),
        new StringParameter("content", key.getPublicKey()));
  }
View Full Code Here

Examples of com.openshift.client.IOpenShiftSSHKey

        .mockUpdateKey(keyName, Samples.PUT_BBCC_DSA_USER_KEYS_SOMEKEY);

    // operation
    List<IOpenShiftSSHKey> keys = user.getSSHKeys();
    assertThat(keys).hasSize(1);
    IOpenShiftSSHKey key = keys.get(0);
    assertThat(key.getKeyType()).isEqualTo(SSHKeyType.SSH_RSA);
    assertThat(key.getPublicKey()).isNotEqualTo(newPublicKeyContent);
    key.setPublicKey(newPublicKeyContent);

    // verification
    assertThat(key.getKeyType()).isEqualTo(SSHKeyType.SSH_DSA);
    assertThat(key.getPublicKey()).isEqualTo(newPublicKeyContent);
    HashMap<String, Object> parameterMap = new HashMap<String, Object>();
    parameterMap.put("type", SSHKeyTestUtils.SSH_RSA);
    mockDirector.verifyUpdateKey(
        keyName,
        new StringParameter("type", SSHKeyTestUtils.SSH_RSA),
        new StringParameter("content", key.getPublicKey()));
  }
View Full Code Here

Examples of com.openshift.client.IOpenShiftSSHKey

                                                    CredentialItem.StringType stringType
                                                            = (CredentialItem.StringType)item;

                                                    int idx = ++i < sshkeys.size() ? i : 0;
                                                    if (idx < sshkeys.size()) {
                                                        IOpenShiftSSHKey sshKey = sshkeys
                                                                .get(idx);
                                                        String passphrase = sshKey.getPublicKey();
                                                        LOGGER.info("For item " + item + " index " + i
                                                                + " using passphrase: " + passphrase);
                                                        stringType.setValue(passphrase);
                                                    } else {
                                                        LOGGER.warn("No ssh keys we can pass into git!");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.