Interface Credentials
-
- All Superinterfaces:
Describable<Credentials>
,ExtensionPoint
,Serializable
- All Known Subinterfaces:
CertificateCredentials
,DomainRestrictedCredentials
,IdCredentials
,PasswordCredentials
,StandardCertificateCredentials
,StandardCredentials
,StandardUsernameCredentials
,StandardUsernamePasswordCredentials
,UsernameCredentials
,UsernamePasswordCredentials
- All Known Implementing Classes:
BaseCredentials
,BaseStandardCredentials
,CertificateCredentialsImpl
,UsernamePasswordCredentialsImpl
public interface Credentials extends Describable<Credentials>, Serializable, ExtensionPoint
A generic type of credentials. In general please extend fromBaseCredentials
rather than implement this interface. The interface is provided:- To allow for orthogonal traits to be built up in interfaces that extend credentials, e.g. username/password vs username/ssh-key vs email/password - a single credentials impl could provide all four fields and different credentials consumers might request the different flavours
- In order to facility cases where it is just not possible to change the base class when retrofitting support for credentials into an existing plugin.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Credentials
forRun(Run<?,?> context)
Optionally produce a special value when used in the context of a particular build.CredentialsDescriptor
getDescriptor()
CredentialsScope
getScope()
Gets the scope of the credential.
-
-
-
Method Detail
-
getScope
@CheckForNull CredentialsScope getScope()
Gets the scope of the credential.- Returns:
- the scope of the credential.
-
getDescriptor
@NonNull CredentialsDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Credentials>
-
forRun
@NonNull default Credentials forRun(@NonNull Run<?,?> context)
Optionally produce a special value when used in the context of a particular build.- Parameters:
context
- a build wishing to consume these credentials- Returns:
- contextualized credentials, preferably implementing the same interfaces (if not of the same concrete type); by default,
this
- See Also:
CredentialsProvider.findCredentialById(java.lang.String, java.lang.Class, hudson.model.Run, com.cloudbees.plugins.credentials.domains.DomainRequirement...)
-
-