public abstract class CredentialsProvider extends hudson.model.Descriptor<CredentialsProvider> implements hudson.ExtensionPoint, hudson.model.Describable<CredentialsProvider>, org.jenkins.ui.icon.IconSpec
Credentials.| Modifier and Type | Field and Description |
|---|---|
static hudson.security.Permission |
CREATE
The permission for adding credentials to a
CredentialsStore. |
static hudson.security.Permission |
DELETE
The permission for removing credentials from a
CredentialsStore. |
static hudson.security.PermissionGroup |
GROUP
The permission group for credentials.
|
static hudson.security.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 hudson.security.Permission |
UPDATE
The permission for updating credentials in a
CredentialsStore. |
static hudson.security.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 hudson.security.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 hudson.security.Permission |
VIEW
The permission for viewing credentials in a
CredentialsStore. |
| Constructor and Description |
|---|
CredentialsProvider()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
_isApplicable(hudson.model.Descriptor<?> descriptor)
CredentialsProvider subtypes can override this method to veto some Descriptors
from being available from their store. |
static hudson.ExtensionList<CredentialsProvider> |
all()
Returns the list of all
CredentialsProvider. |
static hudson.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,
hudson.model.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,
hudson.model.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,
hudson.model.Item item,
org.acegisecurity.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 DomainRequirements. |
<C extends IdCredentials> |
getCredentialIds(Class<C> type,
hudson.model.ItemGroup itemGroup,
org.acegisecurity.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 DomainRequirements. |
<C extends Credentials> |
getCredentials(Class<C> type,
hudson.model.Item item,
org.acegisecurity.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,
hudson.model.Item item,
org.acegisecurity.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 DomainRequirements. |
abstract <C extends Credentials> |
getCredentials(Class<C> type,
hudson.model.ItemGroup itemGroup,
org.acegisecurity.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,
hudson.model.ItemGroup itemGroup,
org.acegisecurity.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.DomainRequirements. |
List<CredentialsDescriptor> |
getCredentialsDescriptors()
Returns the list of
CredentialsDescriptor instances that are applicable within this
CredentialsProvider. |
hudson.model.Descriptor<CredentialsProvider> |
getDescriptor() |
String |
getDisplayName() |
static hudson.model.Fingerprint |
getFingerprintOf(Credentials c)
Retrieves the
Fingerprint for a specific credential. |
String |
getIconClassName() |
static hudson.model.Fingerprint |
getOrCreateFingerprintOf(Credentials c)
Creates a fingerprint that can be used to track the usage of a specific credential.
|
Set<CredentialsScope> |
getScopes(hudson.model.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(hudson.model.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(hudson.model.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(hudson.model.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,
hudson.model.Item item,
org.acegisecurity.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,
hudson.model.ItemGroup itemGroup,
org.acegisecurity.Authentication authentication,
List<DomainRequirement> domainRequirements,
CredentialsMatcher matcher)
Returns a
ListBoxModel of all credentials which are available to the specified Authentication
for use by the Items in the specified ItemGroup. |
static <C extends Credentials> |
lookupCredentials(Class<C> type)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
org.acegisecurity.Authentication authentication)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
hudson.model.Item item)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
hudson.model.Item item,
org.acegisecurity.Authentication authentication)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
hudson.model.Item item,
org.acegisecurity.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,
hudson.model.Item item,
org.acegisecurity.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,
hudson.model.ItemGroup itemGroup)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
hudson.model.ItemGroup itemGroup,
org.acegisecurity.Authentication authentication)
|
static <C extends Credentials> |
lookupCredentials(Class<C> type,
hudson.model.ItemGroup itemGroup,
org.acegisecurity.Authentication authentication,
DomainRequirement... domainRequirements)
Returns all credentials which are available to the specified
Authentication
for use by the Items in the specified ItemGroup. |
static <C extends Credentials> |
lookupCredentials(Class<C> type,
hudson.model.ItemGroup itemGroup,
org.acegisecurity.Authentication authentication,
List<DomainRequirement> domainRequirements)
Returns all credentials which are available to the specified
Authentication
for use by the Items in the specified ItemGroup. |
static Set<CredentialsScope> |
lookupScopes(hudson.model.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(hudson.model.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(hudson.model.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(hudson.model.Node node,
C credentials)
Track the usage of credentials in a specific node.
|
static <C extends Credentials> |
track(hudson.model.Run build,
C credentials)
Track the usage of credentials in a specific build.
|
static <C extends Credentials> |
trackAll(hudson.model.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(hudson.model.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(hudson.model.Node node,
C... credentials)
Track the usage of credentials in a specific node.
|
static <C extends Credentials> |
trackAll(hudson.model.Node node,
List<C> credentials)
Track the usage of credentials in a specific node.
|
static <C extends Credentials> |
trackAll(hudson.model.Run build,
C... credentials)
Track the usage of credentials in a specific build.
|
static <C extends Credentials> |
trackAll(hudson.model.Run build,
List<C> credentials)
Track the usage of credentials in a specific build.
|
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMappublic static final CredentialsProvider NONE
CredentialsProvider that does nothing for use as a markerpublic static final hudson.security.PermissionGroup GROUP
public static final hudson.security.Permission USE_OWN
public static final hudson.security.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 hudson.security.Permission CREATE
CredentialsStore.public static final hudson.security.Permission UPDATE
CredentialsStore.public static final hudson.security.Permission VIEW
CredentialsStore.public static final hudson.security.Permission DELETE
CredentialsStore.public static final hudson.security.Permission MANAGE_DOMAINS
CredentialsStore.public static hudson.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.getInstance().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 org.acegisecurity.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.getInstance().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 hudson.model.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 hudson.model.ItemGroup itemGroup)
lookupCredentials(Class, ItemGroup, Authentication, List)
or lookupCredentials(Class, ItemGroup, Authentication, DomainRequirement...)ACL.SYSTEM Authentication
for use by the Items 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 hudson.model.ItemGroup itemGroup, @Nullable org.acegisecurity.Authentication authentication)
lookupCredentials(Class, ItemGroup, Authentication, List)
or lookupCredentials(Class, ItemGroup, Authentication, DomainRequirement...)Authentication
for use by the Items 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 hudson.model.Item item, @Nullable org.acegisecurity.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 hudson.model.ItemGroup itemGroup, @Nullable org.acegisecurity.Authentication authentication, @Nullable DomainRequirement... domainRequirements)
Authentication
for use by the Items 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 hudson.model.ItemGroup itemGroup, @Nullable org.acegisecurity.Authentication authentication, @Nullable List<DomainRequirement> domainRequirements)
Authentication
for use by the Items 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> hudson.util.ListBoxModel listCredentials(@NonNull Class<C> type, @Nullable hudson.model.ItemGroup itemGroup, @Nullable org.acegisecurity.Authentication authentication, @Nullable List<DomainRequirement> domainRequirements, @Nullable CredentialsMatcher matcher)
ListBoxModel of all credentials which are available to the specified Authentication
for use by the Items 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 hudson.model.Item item, @Nullable org.acegisecurity.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 hudson.model.Item item, @Nullable org.acegisecurity.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> hudson.util.ListBoxModel listCredentials(@NonNull Class<C> type, @Nullable hudson.model.Item item, @Nullable org.acegisecurity.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(hudson.model.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(hudson.model.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(hudson.model.ModelObject context)
Iterable of all the CredentialsStore instances contributing credentials to the
supplied object.context - the Item or ItemGroup or User to get the CredentialsStores of.Iterable of all CredentialsStore instances.public static <C extends Credentials> C snapshot(C credential)
CredentialsSnapshotTaker that can handle such a
tripple 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 hudson.model.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 hudson.model.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 hudson.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 hudson.model.Descriptor<CredentialsProvider> getDescriptor()
getDescriptor in interface hudson.model.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 hudson.model.Descriptor<CredentialsProvider>public String getIconClassName()
getIconClassName in interface org.jenkins.ui.icon.IconSpecpublic Set<CredentialsScope> getScopes(hudson.model.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 hudson.model.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 hudson.model.ItemGroup itemGroup, @Nullable org.acegisecurity.Authentication authentication)
Authentication
for items in the specified ItemGroupC - the credentials type.type - the type of credentials to return.itemGroup - the item group (if null assume Hudson.getInstance().authentication - the authentication (if null assume ACL.SYSTEM.@NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable hudson.model.ItemGroup itemGroup, @Nullable org.acegisecurity.Authentication authentication, @NonNull List<DomainRequirement> domainRequirements)
Authentication
for items in the specified ItemGroup and are appropriate for the specified .plugins.credentials.domains.DomainRequirements.C - the credentials type.type - the type of credentials to return.itemGroup - the item group (if null assume Hudson.getInstance().authentication - the authentication (if null assume ACL.SYSTEM.domainRequirements - the credential domains to match (if the CredentialsProvider does not support
DomainRequirements then it should
assume the match is true).@NonNull public <C extends IdCredentials> hudson.util.ListBoxModel getCredentialIds(@NonNull Class<C> type, @Nullable hudson.model.ItemGroup itemGroup, @Nullable org.acegisecurity.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 DomainRequirements.
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 tracability
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
nullC - the credentials type.type - the type of credentials to return.itemGroup - the item group (if null assume Hudson.getInstance().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 hudson.model.Item item, @Nullable org.acegisecurity.Authentication authentication)
Authentication
for the specified ItemC - 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 hudson.model.Item item, @Nullable org.acegisecurity.Authentication authentication, @NonNull List<DomainRequirement> domainRequirements)
Authentication
for the specified Item and are appropriate for the specified DomainRequirements.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> hudson.util.ListBoxModel getCredentialIds(@NonNull Class<C> type, @NonNull hudson.model.Item item, @Nullable org.acegisecurity.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 DomainRequirements.
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 tracability
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(hudson.model.Descriptor<?> descriptor)
descriptor - the Descriptor to check.true if and only if the supplied Descriptor is applicable in this
CredentialsProvider.protected boolean _isApplicable(hudson.model.Descriptor<?> descriptor)
CredentialsProvider subtypes can override this method to veto some Descriptors
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 CredentialsProviderpublic 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 hudson.model.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 hudson.model.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 hudson.model.Run build, @CheckForNull 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 hudson.model.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 hudson.model.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 hudson.model.Node node, @CheckForNull 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 hudson.model.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 hudson.model.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 hudson.model.Item item, @CheckForNull 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 hudson.model.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 hudson.model.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–2017. All rights reserved.