public abstract class CredentialsProvider extends Descriptor<CredentialsProvider> implements ExtensionPoint, Describable<CredentialsProvider>, IconSpec
Credentials
.Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
static Permission |
CREATE
The permission for adding credentials to a
CredentialsStore . |
static Permission |
DELETE
The permission for removing credentials from a
CredentialsStore . |
static PermissionGroup |
GROUP
The permission group for credentials.
|
static Permission |
MANAGE_DOMAINS
The permission for managing credential domains in a
CredentialsStore . |
static CredentialsProvider |
NONE
A
CredentialsProvider that does nothing for use as a marker |
static Permission |
UPDATE
The permission for updating credentials in a
CredentialsStore . |
static Permission |
USE_ITEM
Where an immediate action against a job requires that a credential be selected by the user triggering the
action, this permission allows the user to select a credential from those credentials available within the
scope of the job.
|
static Permission |
USE_OWN
Where an immediate action against a job requires that a credential be selected by the user triggering the
action, this permission allows the user to select a credential from their private credential store.
|
static Permission |
VIEW
The permission for viewing credentials in a
CredentialsStore . |
clazz
Constructor and Description |
---|
CredentialsProvider()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_isApplicable(Descriptor<?> descriptor)
CredentialsProvider subtypes can override this method to veto some Descriptor s
from being available from their store. |
static ExtensionList<CredentialsProvider> |
all()
Returns the list of all
CredentialsProvider . |
static DescriptorExtensionList<Credentials,CredentialsDescriptor> |
allCredentialsDescriptors()
Returns all the registered
Credentials descriptors. |
static List<CredentialsProvider> |
enabled()
Returns only those
CredentialsProvider that are isEnabled() . |
static List<CredentialsProvider> |
enabled(Object context)
Returns only those
CredentialsProvider that are isEnabled() within a specific context. |
static <C extends IdCredentials> |
findCredentialById(String id,
Class<C> type,
Run<?,?> run,
DomainRequirement... domainRequirements)
A common requirement for plugins is to resolve a specific credential by id in the context of a specific run.
|
static <C extends IdCredentials> |
findCredentialById(String id,
Class<C> type,
Run<?,?> run,
List<DomainRequirement> domainRequirements)
A common requirement for plugins is to resolve a specific credential by id in the context of a specific run.
|
<C extends IdCredentials> |
getCredentialIds(Class<C> type,
Item item,
Authentication authentication,
List<DomainRequirement> domainRequirements,
CredentialsMatcher matcher)
Returns a
ListBoxModel of the credentials provided by this provider which are available to the
specified Authentication for the specified Item and are appropriate for the
specified DomainRequirement s. |
<C extends IdCredentials> |
getCredentialIds(Class<C> type,
ItemGroup itemGroup,
Authentication authentication,
List<DomainRequirement> domainRequirements,
CredentialsMatcher matcher)
Returns a
ListBoxModel of the credentials provided by this provider which are available to the
specified Authentication for items in the specified ItemGroup and are appropriate for the
specified DomainRequirement s. |
<C extends Credentials> |
getCredentials(Class<C> type,
Item item,
Authentication authentication)
Returns the credentials provided by this provider which are available to the specified
Authentication
for the specified Item |
<C extends Credentials> |
getCredentials(Class<C> type,
Item item,
Authentication authentication,
List<DomainRequirement> domainRequirements)
Returns the credentials provided by this provider which are available to the specified
Authentication
for the specified Item and are appropriate for the specified DomainRequirement s. |
abstract <C extends Credentials> |
getCredentials(Class<C> type,
ItemGroup itemGroup,
Authentication authentication)
Returns the credentials provided by this provider which are available to the specified
Authentication
for items in the specified ItemGroup |
<C extends Credentials> |
getCredentials(Class<C> type,
ItemGroup itemGroup,
Authentication authentication,
List<DomainRequirement> domainRequirements)
Returns the credentials provided by this provider which are available to the specified
Authentication
for items in the specified ItemGroup and are appropriate for the specified .plugins.credentials.domains.DomainRequirement s. |
List<CredentialsDescriptor> |
getCredentialsDescriptors()
Returns the list of
CredentialsDescriptor instances that are applicable within this
CredentialsProvider . |
Descriptor<CredentialsProvider> |
getDescriptor() |
String |
getDisplayName() |
static Fingerprint |
getFingerprintOf(Credentials c)
Retrieves the
Fingerprint for a specific credential. |
String |
getIconClassName() |
static Fingerprint |
getOrCreateFingerprintOf(Credentials c)
Creates a fingerprint that can be used to track the usage of a specific credential.
|
Set<CredentialsScope> |
getScopes(ModelObject object)
Returns the scopes allowed for credentials stored within the specified object or
null if the
object is not relevant for scopes and the object's container should be considered instead. |
CredentialsStore |
getStore(ModelObject object)
Returns the
CredentialsStore that this CredentialsProvider maintains specifically for this
ModelObject or null if either the object is not a credentials container or this
CredentialsProvider does not maintain a store specifically bound to this ModelObject . |
boolean |
hasCredentialsDescriptors()
Checks if there is at least one
CredentialsDescriptor applicable within this CredentialsProvider . |
static boolean |
hasStores(ModelObject context)
Tests if the supplied context has any credentials stores associated with it.
|
boolean |
isApplicable(Class<? extends Credentials> clazz)
Returns
true if this CredentialsProvider can provide credentials of the supplied type. |
boolean |
isApplicable(Descriptor<?> descriptor)
|
boolean |
isEnabled()
Returns
true if this CredentialsProvider is enabled. |
boolean |
isEnabled(Object context)
Returns
true if this CredentialsProvider is enabled in the specified context. |
static <C extends IdCredentials> |
listCredentials(Class<C> type,
Item item,
Authentication authentication,
List<DomainRequirement> domainRequirements,
CredentialsMatcher matcher)
Returns a
ListBoxModel of all credentials which are available to the specified Authentication
for use by the specified Item . |
static <C extends IdCredentials> |
listCredentials(Class<C> type,
ItemGroup itemGroup,
Authentication authentication,
List<DomainRequirement> domainRequirements,
CredentialsMatcher matcher)
Returns a
ListBoxModel of all credentials which are available to the specified Authentication
for use by the Item s in the specified ItemGroup . |
static <C extends Credentials> |
lookupCredentials(Class<C> type)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
Authentication authentication)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
Item item)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
Item item,
Authentication authentication)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
Item item,
Authentication authentication,
DomainRequirement... domainRequirements)
Returns all credentials which are available to the specified
Authentication
for use by the specified Item . |
static <C extends Credentials> |
lookupCredentials(Class<C> type,
Item item,
Authentication authentication,
List<DomainRequirement> domainRequirements)
Returns all credentials which are available to the specified
Authentication
for use by the specified Item . |
static <C extends Credentials> |
lookupCredentials(Class<C> type,
ItemGroup itemGroup)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
ItemGroup itemGroup,
Authentication authentication)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
ItemGroup itemGroup,
Authentication authentication,
DomainRequirement... domainRequirements)
Returns all credentials which are available to the specified
Authentication
for use by the Item s in the specified ItemGroup . |
static <C extends Credentials> |
lookupCredentials(Class<C> type,
ItemGroup itemGroup,
Authentication authentication,
List<DomainRequirement> domainRequirements)
Returns all credentials which are available to the specified
Authentication
for use by the Item s in the specified ItemGroup . |
static Set<CredentialsScope> |
lookupScopes(ModelObject object)
Returns the scopes allowed for credentials stored within the specified object or
null if the
object is not relevant for scopes and the object's container should be considered instead. |
static Iterable<CredentialsStore> |
lookupStores(ModelObject context)
Returns a lazy
Iterable of all the CredentialsStore instances contributing credentials to the
supplied object. |
static void |
saveAll()
A helper method for Groovy Scripting to address use cases such as JENKINS-39317 where all credential stores
need to be resaved.
|
static <C extends Credentials> |
snapshot(C credential)
Make a best effort to ensure that the supplied credential is a snapshot credential (i.e.
|
static <C extends Credentials> |
snapshot(Class<C> clazz,
C credential)
Make a best effort to ensure that the supplied credential is a snapshot credential (i.e.
|
static <C extends Credentials> |
track(Item item,
C credentials)
Track the usage of credentials in a specific item but not associated with a specific build, for example SCM
polling.
|
static <C extends Credentials> |
track(Node node,
C credentials)
Track the usage of credentials in a specific node.
|
static <C extends Credentials> |
track(Run build,
C credentials)
Track the usage of credentials in a specific build.
|
static <C extends Credentials> |
trackAll(Item item,
C... credentials)
Track the usage of credentials in a specific item but not associated with a specific build, for example SCM
polling.
|
static <C extends Credentials> |
trackAll(Item item,
List<C> credentials)
Track the usage of credentials in a specific item but not associated with a specific build, for example SCM
polling.
|
static <C extends Credentials> |
trackAll(Node node,
C... credentials)
Track the usage of credentials in a specific node.
|
static <C extends Credentials> |
trackAll(Node node,
List<C> credentials)
Track the usage of credentials in a specific node.
|
static <C extends Credentials> |
trackAll(Run build,
C... credentials)
Track the usage of credentials in a specific build.
|
static <C extends Credentials> |
trackAll(Run build,
List<C> credentials)
Track the usage of credentials in a specific build.
|
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
public static final CredentialsProvider NONE
CredentialsProvider
that does nothing for use as a markerpublic static final PermissionGroup GROUP
public static final Permission USE_OWN
public static final Permission USE_ITEM
Item.CONFIGURE
as anyone who can configure the job can configure the
job to use credentials within the item scope anyway.public static final Permission CREATE
CredentialsStore
.public static final Permission UPDATE
CredentialsStore
.public static final Permission VIEW
CredentialsStore
.public static final Permission DELETE
CredentialsStore
.public static final Permission MANAGE_DOMAINS
CredentialsStore
.public static DescriptorExtensionList<Credentials,CredentialsDescriptor> allCredentialsDescriptors()
Credentials
descriptors.Credentials
descriptors.@Deprecated @NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type)
lookupCredentials(Class, Item, Authentication, List)
,
lookupCredentials(Class, Item, Authentication, DomainRequirement...)
,
lookupCredentials(Class, ItemGroup, Authentication, List)
or lookupCredentials(Class, ItemGroup, Authentication, DomainRequirement...)
ACL.SYSTEM
Authentication
within the Jenkins.get()
.C
- the credentials type.type
- the type of credentials to get.@Deprecated @NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable Authentication authentication)
lookupCredentials(Class, Item, Authentication, List)
,
lookupCredentials(Class, Item, Authentication, DomainRequirement...)
,
lookupCredentials(Class, ItemGroup, Authentication, List)
or lookupCredentials(Class, ItemGroup, Authentication, DomainRequirement...)
Authentication
within the Jenkins.get()
.C
- the credentials type.type
- the type of credentials to get.authentication
- the authentication.@Deprecated @NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable Item item)
lookupCredentials(Class, Item, Authentication, List)
or lookupCredentials(Class, Item, Authentication, DomainRequirement...)
ACL.SYSTEM
Authentication
for use by the specified Item
.C
- the credentials type.type
- the type of credentials to get.item
- the item.@Deprecated @NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup)
lookupCredentials(Class, ItemGroup, Authentication, List)
or lookupCredentials(Class, ItemGroup, Authentication, DomainRequirement...)
ACL.SYSTEM
Authentication
for use by the Item
s in the specified ItemGroup
.C
- the credentials type.type
- the type of credentials to get.itemGroup
- the item group.@Deprecated @NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication)
lookupCredentials(Class, ItemGroup, Authentication, List)
or lookupCredentials(Class, ItemGroup, Authentication, DomainRequirement...)
Authentication
for use by the Item
s in the specified ItemGroup
.C
- the credentials type.type
- the type of credentials to get.itemGroup
- the item group.authentication
- the authentication.@Deprecated @NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable Item item, @Nullable Authentication authentication)
lookupCredentials(Class, Item, Authentication, List)
or lookupCredentials(Class, Item, Authentication, DomainRequirement...)
Authentication
for use by the specified Item
.C
- the credentials type.type
- the type of credentials to get.authentication
- the authentication.item
- the item.@NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @Nullable DomainRequirement... domainRequirements)
Authentication
for use by the Item
s in the specified ItemGroup
.C
- the credentials type.type
- the type of credentials to get.itemGroup
- the item group.authentication
- the authentication.domainRequirements
- the credential domains to match.@NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @Nullable List<DomainRequirement> domainRequirements)
Authentication
for use by the Item
s in the specified ItemGroup
.C
- the credentials type.type
- the type of credentials to get.itemGroup
- the item group.authentication
- the authentication.domainRequirements
- the credential domains to match.public static <C extends IdCredentials> ListBoxModel listCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @Nullable List<DomainRequirement> domainRequirements, @Nullable CredentialsMatcher matcher)
ListBoxModel
of all credentials which are available to the specified Authentication
for use by the Item
s in the specified ItemGroup
.C
- the credentials type.type
- the type of credentials to get.authentication
- the authentication.itemGroup
- the item group.domainRequirements
- the credential domains to match.matcher
- the additional filtering to apply to the credentialsListBoxModel
of IdCredentials.getId()
with the corresponding display names as
provided by CredentialsNameProvider
.@NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable Item item, @Nullable Authentication authentication, DomainRequirement... domainRequirements)
Authentication
for use by the specified Item
.C
- the credentials type.type
- the type of credentials to get.authentication
- the authentication.item
- the item.domainRequirements
- the credential domains to match.@NonNull public static <C extends Credentials> List<C> lookupCredentials(@NonNull Class<C> type, @Nullable Item item, @Nullable Authentication authentication, @Nullable List<DomainRequirement> domainRequirements)
Authentication
for use by the specified Item
.C
- the credentials type.type
- the type of credentials to get.authentication
- the authentication.item
- the item.domainRequirements
- the credential domains to match.@NonNull public static <C extends IdCredentials> ListBoxModel listCredentials(@NonNull Class<C> type, @Nullable Item item, @Nullable Authentication authentication, @Nullable List<DomainRequirement> domainRequirements, @Nullable CredentialsMatcher matcher)
ListBoxModel
of all credentials which are available to the specified Authentication
for use by the specified Item
.C
- the credentials type.type
- the type of credentials to get.authentication
- the authentication.item
- the item.domainRequirements
- the credential domains to match.matcher
- the additional filtering to apply to the credentialsListBoxModel
of IdCredentials.getId()
with the corresponding display names as
provided by CredentialsNameProvider
.@CheckForNull public static Set<CredentialsScope> lookupScopes(ModelObject object)
null
if the
object is not relevant for scopes and the object's container should be considered instead.object
- the object.null
if the object is not a credentials
container.public static boolean hasStores(ModelObject context)
context
- the context object.true
if and only if the supplied context has at least one CredentialsStore
associated
with it.public static Iterable<CredentialsStore> lookupStores(ModelObject context)
Iterable
of all the CredentialsStore
instances contributing credentials to the
supplied object.context
- the Item
or ItemGroup
or User
to get the CredentialsStore
s of.Iterable
of all CredentialsStore
instances.public static <C extends Credentials> C snapshot(C credential)
CredentialsSnapshotTaker
that can handle such a
triple play.C
- the type of credential.credential
- the credential.public static <C extends Credentials> C snapshot(Class<C> clazz, C credential)
C
- the type of credential.clazz
- the type of credential that we are trying to snapshot (specified so that if there is more than
one type of snapshot able credential interface implemented by the credentials,
then they can be separated out.credential
- the credential.@CheckForNull public static <C extends IdCredentials> C findCredentialById(@NonNull String id, @NonNull Class<C> type, @NonNull Run<?,?> run, DomainRequirement... domainRequirements)
C
- the credentials type.id
- either the id of the credential to find or a parameter expression for the id.type
- the type of credential to find.run
- the Run
defining the context within which to find the credential.domainRequirements
- the domain requirements of the credential.null
if either the credential cannot be found or the user triggering the run
is not permitted to use the credential in the context of the run.@CheckForNull public static <C extends IdCredentials> C findCredentialById(@NonNull String id, @NonNull Class<C> type, @NonNull Run<?,?> run, @Nullable List<DomainRequirement> domainRequirements)
C
- the credentials type.id
- either the id of the credential to find or a parameter expression for the id.type
- the type of credential to find.run
- the Run
defining the context within which to find the credential.domainRequirements
- the domain requirements of the credential.null
if either the credential cannot be found or the user triggering the run
is not permitted to use the credential in the context of the run.public static ExtensionList<CredentialsProvider> all()
CredentialsProvider
.CredentialsProvider
.public static List<CredentialsProvider> enabled()
CredentialsProvider
that are isEnabled()
.CredentialsProvider
that are isEnabled()
.public static List<CredentialsProvider> enabled(Object context)
CredentialsProvider
that are isEnabled()
within a specific context.context
- the context in which to get the list.CredentialsProvider
that are isEnabled()
.public Descriptor<CredentialsProvider> getDescriptor()
getDescriptor
in interface Describable<CredentialsProvider>
public final boolean isEnabled()
true
if this CredentialsProvider
is enabled.true
if this CredentialsProvider
is enabled.public boolean isEnabled(Object context)
true
if this CredentialsProvider
is enabled in the specified context.context
- the context.true
if this CredentialsProvider
is enabled in the specified context.public String getDisplayName()
getDisplayName
in class Descriptor<CredentialsProvider>
public String getIconClassName()
getIconClassName
in interface IconSpec
public Set<CredentialsScope> getScopes(ModelObject object)
null
if the
object is not relevant for scopes and the object's container should be considered instead.object
- the object.null
if the object is not a credentials
container.@CheckForNull public CredentialsStore getStore(@CheckForNull ModelObject object)
CredentialsStore
that this CredentialsProvider
maintains specifically for this
ModelObject
or null
if either the object is not a credentials container or this
CredentialsProvider
does not maintain a store specifically bound to this ModelObject
.object
- the Item
or ItemGroup
or User
that the store is being requested of.null
or a scoped CredentialsStore
where
CredentialsStore.getContext()
== object
.@NonNull public abstract <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication)
Authentication
for items in the specified ItemGroup
C
- the credentials type.type
- the type of credentials to return.itemGroup
- the item group (if null
assume Jenkins.get()
.authentication
- the authentication (if null
assume ACL.SYSTEM
.@NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements)
Authentication
for items in the specified ItemGroup
and are appropriate for the specified .plugins.credentials.domains.DomainRequirement
s.C
- the credentials type.type
- the type of credentials to return.itemGroup
- the item group (if null
assume Jenkins.get()
.authentication
- the authentication (if null
assume ACL.SYSTEM
.domainRequirements
- the credential domains to match (if the CredentialsProvider
does not support
DomainRequirement
s then it should
assume the match is true).@NonNull public <C extends IdCredentials> ListBoxModel getCredentialIds(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements, @NonNull CredentialsMatcher matcher)
ListBoxModel
of the credentials provided by this provider which are available to the
specified Authentication
for items in the specified ItemGroup
and are appropriate for the
specified DomainRequirement
s.
NOTE: implementations are recommended to override this method if the actual secret information
is being stored external from Jenkins and the non-secret information can be accessed with lesser traceability
requirements. The default implementation just uses getCredentials(Class, Item, Authentication, List)
to build the ListBoxModel
. Handling the CredentialsMatcher
may require standing up a proxy
instance to apply the matcher against if CredentialsMatchers.describe(CredentialsMatcher)
returns
null
C
- the credentials type.type
- the type of credentials to return.itemGroup
- the item group (if null
assume Jenkins.get()
.authentication
- the authentication (if null
assume ACL.SYSTEM
.domainRequirements
- the credential domain to match.matcher
- the additional filtering to apply to the credentialsListBoxModel
of IdCredentials.getId()
with names provided by
CredentialsNameProvider
.@NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication)
Authentication
for the specified Item
C
- the credentials type.type
- the type of credentials to return.item
- the item.authentication
- the authentication (if null
assume ACL.SYSTEM
.@NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements)
Authentication
for the specified Item
and are appropriate for the specified DomainRequirement
s.C
- the credentials type.type
- the type of credentials to return.item
- the item.authentication
- the authentication (if null
assume ACL.SYSTEM
.domainRequirements
- the credential domain to match.@NonNull public <C extends IdCredentials> ListBoxModel getCredentialIds(@NonNull Class<C> type, @NonNull Item item, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements, @NonNull CredentialsMatcher matcher)
ListBoxModel
of the credentials provided by this provider which are available to the
specified Authentication
for the specified Item
and are appropriate for the
specified DomainRequirement
s.
NOTE: implementations are recommended to override this method if the actual secret information
is being stored external from Jenkins and the non-secret information can be accessed with lesser traceability
requirements. The default implementation just uses getCredentials(Class, Item, Authentication, List)
to build the ListBoxModel
. Handling the CredentialsMatcher
may require standing up a proxy
instance to apply the matcher against.C
- the credentials type.type
- the type of credentials to return.item
- the item.authentication
- the authentication (if null
assume ACL.SYSTEM
.domainRequirements
- the credential domain to match.matcher
- the additional filtering to apply to the credentialsListBoxModel
of IdCredentials.getId()
with names provided by
CredentialsNameProvider
.public final boolean isApplicable(Class<? extends Credentials> clazz)
true
if this CredentialsProvider
can provide credentials of the supplied type.clazz
- the base type of Credentials
to check.true
if and only if there is at least one CredentialsDescriptor
matching the required
Credentials
interface that isApplicable(Descriptor)
.public final boolean isApplicable(Descriptor<?> descriptor)
descriptor
- the Descriptor
to check.true
if and only if the supplied Descriptor
is applicable in this
CredentialsProvider
.protected boolean _isApplicable(Descriptor<?> descriptor)
CredentialsProvider
subtypes can override this method to veto some Descriptor
s
from being available from their store. This is often useful when you are building
a custom store that holds a specific type of credentials or where you want to limit the
number of choices given to the users.descriptor
- the Descriptor
to check.true
if the supplied Descriptor
is applicable in this CredentialsProvider
public final List<CredentialsDescriptor> getCredentialsDescriptors()
CredentialsDescriptor
instances that are applicable within this
CredentialsProvider
.CredentialsDescriptor
instances that are applicable within this
CredentialsProvider
.public final boolean hasCredentialsDescriptors()
CredentialsDescriptor
applicable within this CredentialsProvider
.true
if and ony if there is at least one CredentialsDescriptor
applicable within this
CredentialsProvider
.@CheckForNull public static Fingerprint getFingerprintOf(@NonNull Credentials c) throws IOException
Fingerprint
for a specific credential.c
- the credential.Fingerprint
or null
if the credential has no fingerprint associated with it.IOException
- if the credential's fingerprint hash could not be computed.@NonNull public static Fingerprint getOrCreateFingerprintOf(@NonNull Credentials c) throws IOException
c
- the credential to fingerprint.IOException
- if the credential's fingerprint hash could not be computed.@CheckForNull public static <C extends Credentials> C track(@NonNull Run build, @CheckForNull C credentials)
C
- the credentials type.build
- the run to tag the fingerprintcredentials
- the credentials to fingerprint.@SafeVarargs @NonNull public static <C extends Credentials> List<C> trackAll(@NonNull Run build, C... credentials)
C
- the credentials type.build
- the run to tag the fingerprintcredentials
- the credentials to fingerprint.@NonNull public static <C extends Credentials> List<C> trackAll(@NonNull Run build, @NonNull List<C> credentials)
C
- the credentials type.build
- the run to tag the fingerprintcredentials
- the credentials to fingerprint.@CheckForNull public static <C extends Credentials> C track(@NonNull Node node, @CheckForNull C credentials)
C
- the credentials type.node
- the node to tag the fingerprintcredentials
- the credentials to fingerprint.@SafeVarargs @NonNull public static <C extends Credentials> List<C> trackAll(@NonNull Node node, C... credentials)
C
- the credentials type.node
- the node to tag the fingerprintcredentials
- the credentials to fingerprint.@NonNull public static <C extends Credentials> List<C> trackAll(@NonNull Node node, @NonNull List<C> credentials)
C
- the credentials type.node
- the node to tag the fingerprintcredentials
- the credentials to fingerprint.@CheckForNull public static <C extends Credentials> C track(@NonNull Item item, @CheckForNull C credentials)
C
- the credentials type.item
- the item to tag the fingerprint againstcredentials
- the credentials to fingerprint.@SafeVarargs @NonNull public static <C extends Credentials> List<C> trackAll(@NonNull Item item, C... credentials)
C
- the credentials type.item
- the item to tag the fingerprint againstcredentials
- the credentials to fingerprint.@NonNull public static <C extends Credentials> List<C> trackAll(@NonNull Item item, @NonNull List<C> credentials)
C
- the credentials type.item
- the item to tag the fingerprint againstcredentials
- the credentials to fingerprint.@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) public static void saveAll() throws IOException
DoNotUse
in order to ensure that no plugin attempts to call this method. If invoking this method
from an init.d
Groovy script, ensure that the call is guarded by a marker file such thatIOException
- if things go wrong.Copyright © 2016–2021. All rights reserved.