Class GoogleRobotPrivateKeyCredentials
- java.lang.Object
-
- com.cloudbees.plugins.credentials.BaseCredentials
-
- com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
-
- com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials
-
- com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials
-
- All Implemented Interfaces:
com.cloudbees.plugins.credentials.common.IdCredentials
,com.cloudbees.plugins.credentials.common.StandardCredentials
,com.cloudbees.plugins.credentials.common.StandardUsernameCredentials
,com.cloudbees.plugins.credentials.common.UsernameCredentials
,com.cloudbees.plugins.credentials.Credentials
,GoogleOAuth2Credentials
,com.google.jenkins.plugins.credentials.oauth.OAuth2Credentials<GoogleOAuth2ScopeRequirement>
,com.google.jenkins.plugins.credentials.oauth.StandardUsernameOAuth2Credentials<GoogleOAuth2ScopeRequirement>
,ExtensionPoint
,Describable<com.cloudbees.plugins.credentials.Credentials>
,Serializable
@NameWith(value=GoogleRobotNameProvider.class, priority=50) public final class GoogleRobotPrivateKeyCredentials extends GoogleRobotCredentials
A set of Google service account credentials for a cloud project to use for authenticating against Google service APIs.Example APIs: Google Cloud Storage, Google Compute Engine
- Author:
- Matt Moore
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GoogleRobotPrivateKeyCredentials.AccountIdNotSetException
Exception that gets thrown if AccountId is not set.static class
GoogleRobotPrivateKeyCredentials.Descriptor
Descriptor for our unlimited service account extension.static class
GoogleRobotPrivateKeyCredentials.InvalidSecretsFileException
Exception that gets thrown if an invalid SecretsFile is set while upgrading legacyGoogleRobotPrivateKeyCredentials
static class
GoogleRobotPrivateKeyCredentials.KeyTypeNotSetException
Exception that gets thrown if ServiceAccountConfig is not set.static class
GoogleRobotPrivateKeyCredentials.MissingSecretsFileException
Exception that gets thrown if SecretsFile is not set while upgrading legacyGoogleRobotPrivateKeyCredentials
static class
GoogleRobotPrivateKeyCredentials.PrivateKeyNotSetException
Exception that gets thrown if PrivateKey is not set.static class
GoogleRobotPrivateKeyCredentials.SecretsFileNotFoundException
Exception that gets thrown if SecretsFile could not be found while upgrading legacyGoogleRobotPrivateKeyCredentials
-
Nested classes/interfaces inherited from class com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials
GoogleRobotCredentials.AbstractGoogleRobotCredentialsDescriptor, GoogleRobotCredentials.CredentialsListBoxModel
-
Nested classes/interfaces inherited from class com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
com.cloudbees.plugins.credentials.impl.BaseStandardCredentials.BaseStandardCredentialsDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.IdCredentials
com.cloudbees.plugins.credentials.common.IdCredentials.Helpers
-
-
Constructor Summary
Constructors Constructor Description GoogleRobotPrivateKeyCredentials(com.cloudbees.plugins.credentials.CredentialsScope scope, String id, String projectId, ServiceAccountConfig serviceAccountConfig, GoogleRobotCredentialsModule module)
Deprecated.GoogleRobotPrivateKeyCredentials(com.cloudbees.plugins.credentials.CredentialsScope scope, String id, String projectId, String description, ServiceAccountConfig serviceAccountConfig, GoogleRobotCredentialsModule module)
Construct a set of service account credentials with a specific id.GoogleRobotPrivateKeyCredentials(String projectId, ServiceAccountConfig serviceAccountConfig, GoogleRobotCredentialsModule module)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.api.client.googleapis.auth.oauth2.GoogleCredential
getGoogleCredential(GoogleOAuth2ScopeRequirement requirement)
Fetches a Credential for the set of OAuth 2.0 scopes required.static String
getHelpFile()
Used for populating the help file on the<a:credentials .../>
tag.ServiceAccountConfig
getServiceAccountConfig()
static List<ServiceAccountConfig.Descriptor>
getServiceAccountConfigDescriptors()
Used for populating the configuration for eachServiceAccountConfig
String
getUsername()
Object
readResolve()
-
Methods inherited from class com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials
forRemote, getAccessToken, getById, getCredentialsListBox, getDescriptor, getModule, getProjectId
-
Methods inherited from class com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
equals, getDescription, getId, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
GoogleRobotPrivateKeyCredentials
@Deprecated public GoogleRobotPrivateKeyCredentials(String projectId, ServiceAccountConfig serviceAccountConfig, @Nullable GoogleRobotCredentialsModule module) throws Exception
Deprecated.Construct a set of service account credentials.- Parameters:
projectId
- The project id associated with this service accountserviceAccountConfig
- The ServiceAccountConfig to usemodule
- The module for instantiating dependent objects, or null.- Throws:
Exception
-
GoogleRobotPrivateKeyCredentials
@DataBoundConstructor public GoogleRobotPrivateKeyCredentials(@CheckForNull com.cloudbees.plugins.credentials.CredentialsScope scope, String id, String projectId, String description, ServiceAccountConfig serviceAccountConfig, @Nullable GoogleRobotCredentialsModule module) throws Exception
Construct a set of service account credentials with a specific id. It helps for updating credentials, as well as for migrating old credentials that had no id and relied on the project id.- Parameters:
scope
- The scope of the credentials, determining where they can be used in Jenkins. Can be either GLOBAL or SYSTEM.id
- the id to assignprojectId
- The project id associated with this service accountdescription
- The credential descriptionserviceAccountConfig
- The ServiceAccountConfig to usemodule
- The module for instantiating dependent objects, or null.- Throws:
Exception
-
GoogleRobotPrivateKeyCredentials
@Deprecated public GoogleRobotPrivateKeyCredentials(@CheckForNull com.cloudbees.plugins.credentials.CredentialsScope scope, String id, String projectId, ServiceAccountConfig serviceAccountConfig, @Nullable GoogleRobotCredentialsModule module) throws Exception
Deprecated.- Throws:
Exception
-
-
Method Detail
-
getServiceAccountConfigDescriptors
public static List<ServiceAccountConfig.Descriptor> getServiceAccountConfigDescriptors()
Used for populating the configuration for eachServiceAccountConfig
- Returns:
- list of possible
ServiceAccountConfig
s
-
getUsername
@NonNull public String getUsername() throws GoogleRobotPrivateKeyCredentials.KeyTypeNotSetException, GoogleRobotPrivateKeyCredentials.AccountIdNotSetException
-
getHelpFile
public static String getHelpFile()
Used for populating the help file on the<a:credentials .../>
tag. For more details see/lib/auth/credentials.jelly
.
-
getGoogleCredential
public com.google.api.client.googleapis.auth.oauth2.GoogleCredential getGoogleCredential(GoogleOAuth2ScopeRequirement requirement) throws GoogleRobotPrivateKeyCredentials.KeyTypeNotSetException, GoogleRobotPrivateKeyCredentials.AccountIdNotSetException, GoogleRobotPrivateKeyCredentials.PrivateKeyNotSetException
Description copied from interface:GoogleOAuth2Credentials
Fetches a Credential for the set of OAuth 2.0 scopes required.- Parameters:
requirement
- The set of required OAuth 2.0 scopes- Returns:
- The Credential authorizing usage of the API scopes
- Throws:
GoogleRobotPrivateKeyCredentials.KeyTypeNotSetException
GoogleRobotPrivateKeyCredentials.AccountIdNotSetException
GoogleRobotPrivateKeyCredentials.PrivateKeyNotSetException
-
getServiceAccountConfig
public ServiceAccountConfig getServiceAccountConfig()
-
-