Class JsonServiceAccountConfig
java.lang.Object
com.google.jenkins.plugins.credentials.oauth.ServiceAccountConfig
com.google.jenkins.plugins.credentials.oauth.JsonServiceAccountConfig
- All Implemented Interfaces:
- Describable<ServiceAccountConfig>,- Serializable
Provides authentication mechanism for a service account by setting a JSON private key file. The
 JSON file structure needs to be:
 
     {
       "private_key":"-----BEGIN PRIVATE KEY-----\n
                      ...
                      \n-----END PRIVATE KEY-----\n",
       "client_email":"...@developer.gserviceaccount.com",
       ...
     }
 
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classDescriptor for JSON service account authentication.Nested classes/interfaces inherited from class com.google.jenkins.plugins.credentials.oauth.ServiceAccountConfigServiceAccountConfig.Descriptor
- 
Constructor SummaryConstructorsConstructorDescriptionJsonServiceAccountConfig(org.apache.commons.fileupload.FileItem jsonKeyFile, String prevJsonKeyFile) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionIn this context the service account id is represented by the email address for that service account, which should be contained in the JSON key.Deprecated.org.apache.commons.fileupload.FileItemDeprecated.com.cloudbees.plugins.credentials.SecretBytesvoidsetFilename(String filename) voidsetJsonKeyFileUpload(org.apache.commons.fileupload.FileItem jsonKeyFileUpload) voidsetSecretJsonKey(com.cloudbees.plugins.credentials.SecretBytes secretJsonKey) Methods inherited from class com.google.jenkins.plugins.credentials.oauth.ServiceAccountConfiggetSecretBytesFromFile
- 
Constructor Details- 
JsonServiceAccountConfig@DataBoundConstructor public JsonServiceAccountConfig()- Since:
- 0.8
 
- 
JsonServiceAccountConfig@Deprecated public JsonServiceAccountConfig(org.apache.commons.fileupload.FileItem jsonKeyFile, String prevJsonKeyFile) Deprecated.For being able to load credentials created with versions < 0.8 and backwards compatibility with external callers.- Parameters:
- jsonKeyFile- The uploaded JSON key file.
- prevJsonKeyFile- The path of the previous JSON key file.
- Since:
- 0.3
 
 
- 
- 
Method Details- 
setJsonKeyFileUpload@DataBoundSetter public void setJsonKeyFileUpload(org.apache.commons.fileupload.FileItem jsonKeyFileUpload) - Parameters:
- jsonKeyFileUpload- The uploaded JSON key file.
 
- 
setFilename- Parameters:
- filename- The JSON key file name.
 
- 
setSecretJsonKey@DataBoundSetter public void setSecretJsonKey(com.cloudbees.plugins.credentials.SecretBytes secretJsonKey) - Parameters:
- secretJsonKey- The JSON key file content.
 
- 
getDescriptor
- 
getFilename- Returns:
- Original uploaded file name.
- Since:
- 0.7
 
- 
getSecretJsonKey@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @CheckForNull public com.cloudbees.plugins.credentials.SecretBytes getSecretJsonKey()
- 
getJsonKeyFileDeprecated.
- 
getJsonKeyFileUpload@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.apache.commons.fileupload.FileItem getJsonKeyFileUpload()Deprecated.For use in UI, do not use.- Returns:
- The uploaded JSON key file.
 
- 
getAccountIdIn this context the service account id is represented by the email address for that service account, which should be contained in the JSON key.- Specified by:
- getAccountIdin class- ServiceAccountConfig
- Returns:
- The service account identifier. Null if no JSON key has been provided.
 
- 
getPrivateKey- Specified by:
- getPrivateKeyin class- ServiceAccountConfig
- Returns:
- The PrivateKeythat comes from the secret JSON key. Null if this service account config contains no key or if the key is malformed.
 
 
-