public final class CredentialsHelper extends Object
Constructor and Description |
---|
CredentialsHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
convertCredentials(String description,
String identity,
Secret credential)
Converts old identity/credential new UsernamePassword credential-plugin record.
|
static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials |
getCredentialsById(String id)
Use the ssh-slaves-plugin to retrieve a credentials object by its Id.
|
static String |
getPassword(Secret s) |
static String |
getPrivateKey(com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey supk) |
static ContextBuilder |
setCredentials(ContextBuilder cb,
String id)
Populates the credential of a JClouds ContextBuilder from a credentials record.
|
static void |
setProject(String id,
Properties overrides)
Handles new OpenstackKeystoneV3 credentials and sets jclouds overrides accordingly.
|
static String |
storeCredentials(com.cloudbees.plugins.credentials.common.StandardUsernameCredentials u)
Stores a new credentials record (Used only during migration).
|
public static String storeCredentials(com.cloudbees.plugins.credentials.common.StandardUsernameCredentials u) throws IOException
u
- The new credentials to store;null
on failure.IOException
- on error.public static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentialsById(String id)
id
- The Id of the credentials object.public static String convertCredentials(String description, String identity, Secret credential)
description
- The for the credentials record.identity
- The old identity (AKA username).credential
- The old credential (AKA password).public static void setProject(String id, Properties overrides)
public static ContextBuilder setCredentials(ContextBuilder cb, String id)
cb
- The ContextBuilder
which should get the credential.id
- The Id of the credentials object.ContextBuilder
public static String getPrivateKey(com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey supk)
Copyright © 2016–2021. All rights reserved.