@NameWith(value=GoogleRobotUsernamePassword.NameProvider.class, priority=99) public class GoogleRobotUsernamePassword extends com.cloudbees.plugins.credentials.impl.BaseStandardCredentials implements com.cloudbees.plugins.credentials.domains.DomainRestrictedCredentials, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials
GoogleRobotCredentials as a username and password for use with a
SCM.
BACKGROUND: For Cloud projects with a private repository, Google accepts a username/password combination that is truly email/oauth-refresh-token. For service accounts, for which a refresh token may not be readily available (e.g. with Compute Engine's metadata service) it also supports using: email/oauth-access-token.
This credential wraps a service account credential to provide it in this
manner as a StandardUsernamePasswordCredentials for usage with the
new Credentials-aware SCM plugins.
| Modifier and Type | Class and Description |
|---|---|
static class |
GoogleRobotUsernamePassword.EnclosingDomainRequirementProvider
We do not have a descriptor, so that we won't show up in the user interface
as a credential that can be explicitly created, so we will not be
discovered by the DescribableDomainRequirementProvider.
|
static class |
GoogleRobotUsernamePassword.NameProvider
Provide a name that the user will understand, in the dropdown
shown by
SCMs. |
| Constructor and Description |
|---|
GoogleRobotUsernamePassword(String credentialsId,
GoogleRobotUsernamePasswordModule module)
Constructs a username and password credential wrapper around the existing
credential, specified by
credentialsId. |
| Modifier and Type | Method and Description |
|---|---|
com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials |
getCredentials()
Retrieve our wrapped credentials based on the above ID we store.
|
String |
getCredentialsId()
Return the unique ID of the inner
GoogleRobotCredentials that this
Username/Password proxy is wrapping. |
String |
getDescription() |
com.cloudbees.plugins.credentials.CredentialsDescriptor |
getDescriptor() |
hudson.util.Secret |
getPassword() |
String |
getUsername() |
boolean |
matches(List<com.cloudbees.plugins.credentials.domains.DomainRequirement> requirements)
This type of credentials only works for authenticating against
"code.google.com" and "source.developers.google.com" hosted repositories,
for which we require "https".
|
equals, getId, hashCode@DataBoundConstructor public GoogleRobotUsernamePassword(String credentialsId, @Nullable GoogleRobotUsernamePasswordModule module)
credentialsId.public boolean matches(List<com.cloudbees.plugins.credentials.domains.DomainRequirement> requirements)
matches in interface com.cloudbees.plugins.credentials.domains.DomainRestrictedCredentialspublic String getCredentialsId()
GoogleRobotCredentials that this
Username/Password proxy is wrapping.@Nullable public com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials getCredentials()
public String getDescription()
getDescription in interface com.cloudbees.plugins.credentials.common.StandardCredentialsgetDescription in class com.cloudbees.plugins.credentials.impl.BaseStandardCredentialspublic com.cloudbees.plugins.credentials.CredentialsDescriptor getDescriptor()
getDescriptor in interface com.cloudbees.plugins.credentials.CredentialsgetDescriptor in interface hudson.model.Describable<com.cloudbees.plugins.credentials.Credentials>getDescriptor in class com.cloudbees.plugins.credentials.BaseCredentialspublic String getUsername()
getUsername in interface com.cloudbees.plugins.credentials.common.UsernameCredentialspublic hudson.util.Secret getPassword()
getPassword in interface com.cloudbees.plugins.credentials.common.PasswordCredentialsCopyright © 2004-2016. All Rights Reserved.