Class UserCredentialsProvider
java.lang.Object
hudson.model.Descriptor<CredentialsProvider>
com.cloudbees.plugins.credentials.CredentialsProvider
com.cloudbees.plugins.credentials.UserCredentialsProvider
- All Implemented Interfaces:
ExtensionPoint
,Describable<CredentialsProvider>
,Saveable
,OnMaster
,IconSpec
A store of credentials tied to a specific
User
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Our implementationstatic class
Need a user property to hold the user's personal credentials.static class
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class com.cloudbees.plugins.credentials.CredentialsProvider
CREATE, DELETE, GROUP, MANAGE_DOMAINS, NONE, UPDATE, USE_ITEM, USE_OWN, VIEW
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<C extends Credentials>
List<C>getCredentialsInItemGroup
(Class<C> type, ItemGroup itemGroup, org.springframework.security.core.Authentication authentication, List<DomainRequirement> domainRequirements) Returns the credentials provided by this provider which are available to the specifiedAuthentication
for items in the specifiedItemGroup
and are appropriate for the specified.plugins.credentials.domains.DomainRequirement
s.getScopes
(ModelObject object) Returns the scopes allowed for credentials stored within the specified object ornull
if the object is not relevant for scopes and the object's container should be considered instead.getStore
(ModelObject object) Returns theCredentialsStore
that thisCredentialsProvider
maintains specifically for thisModelObject
ornull
if either the object is not a credentials container or thisCredentialsProvider
does not maintain a store specifically bound to thisModelObject
.Methods inherited from class com.cloudbees.plugins.credentials.CredentialsProvider
_isApplicable, all, allCredentialsDescriptors, enabled, enabled, findCredentialById, findCredentialById, findCredentialById, getCredentialIds, getCredentialIds, getCredentialIdsInItem, getCredentialIdsInItemGroup, getCredentials, getCredentials, getCredentials, getCredentials, getCredentialsDescriptors, getCredentialsInItem, getDescriptor, getDisplayName, getFingerprintOf, getOrCreateFingerprintOf, hasCredentialsDescriptors, hasStores, isApplicable, isApplicable, isEnabled, isEnabled, listCredentials, listCredentials, listCredentialsInItem, listCredentialsInItemGroup, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentialsInItem, lookupCredentialsInItem, lookupCredentialsInItemGroup, lookupCredentialsInItemGroup, lookupScopes, lookupStores, saveAll, snapshot, snapshot, track, track, track, trackAll, trackAll, trackAll, trackAll, trackAll, trackAll
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, 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
-
Constructor Details
-
UserCredentialsProvider
public UserCredentialsProvider()
-
-
Method Details
-
getScopes
Returns the scopes allowed for credentials stored within the specified object ornull
if the object is not relevant for scopes and the object's container should be considered instead.- Overrides:
getScopes
in classCredentialsProvider
- Parameters:
object
- the object.- Returns:
- the set of scopes that are relevant for the object or
null
if the object is not a credentials container.
-
getStore
Returns theCredentialsStore
that thisCredentialsProvider
maintains specifically for thisModelObject
ornull
if either the object is not a credentials container or thisCredentialsProvider
does not maintain a store specifically bound to thisModelObject
.- Overrides:
getStore
in classCredentialsProvider
- Parameters:
object
- theItem
orItemGroup
orUser
that the store is being requested of.- Returns:
- either
null
or a scopedCredentialsStore
whereCredentialsStore.getContext()
== object
.
-
getCredentialsInItemGroup
@NonNull public <C extends Credentials> List<C> getCredentialsInItemGroup(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable org.springframework.security.core.Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) Returns the credentials provided by this provider which are available to the specifiedAuthentication
for items in the specifiedItemGroup
and are appropriate for the specified.plugins.credentials.domains.DomainRequirement
s.- Overrides:
getCredentialsInItemGroup
in classCredentialsProvider
- Type Parameters:
C
- the credentials type.- Parameters:
type
- the type of credentials to return.itemGroup
- the item group (ifnull
assumeJenkins.get()
.authentication
- the authentication (ifnull
assumeACL.SYSTEM2
.domainRequirements
- the credential domains to match (if theCredentialsProvider
does not supportDomainRequirement
s then it should assume the match is true).- Returns:
- the list of credentials.
-
getIconClassName
- Specified by:
getIconClassName
in interfaceIconSpec
- Overrides:
getIconClassName
in classCredentialsProvider
-