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
@Extension public class UserCredentialsProvider extends CredentialsProvider
A store of credentials tied to a specificUser
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UserCredentialsProvider.StoreImpl
Our implementationstatic class
UserCredentialsProvider.UserCredentialsProperty
Need a user property to hold the user's personal credentials.static class
UserCredentialsProvider.UserFacingAction
-
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
Constructors Constructor Description UserCredentialsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <C extends Credentials>
List<C>getCredentials(Class<C> type, ItemGroup itemGroup, Authentication authentication)
Returns the credentials provided by this provider which are available to the specifiedAuthentication
for items in the specifiedItemGroup
<C extends Credentials>
List<C>getCredentials(Class<C> type, ItemGroup itemGroup, 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.String
getIconClassName()
Set<CredentialsScope>
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.CredentialsStore
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, getCredentialIds, getCredentialIds, getCredentials, getCredentials, getCredentialsDescriptors, getDescriptor, getDisplayName, getFingerprintOf, getOrCreateFingerprintOf, hasCredentialsDescriptors, hasStores, isApplicable, isApplicable, isEnabled, isEnabled, listCredentials, listCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, 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
-
-
-
-
Method Detail
-
getScopes
public Set<CredentialsScope> 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.- 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
public CredentialsStore getStore(@CheckForNull 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
.- 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
.
-
getCredentials
@NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication)
Returns the credentials provided by this provider which are available to the specifiedAuthentication
for items in the specifiedItemGroup
- Specified by:
getCredentials
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.SYSTEM
.- Returns:
- the list of credentials.
-
getCredentials
@NonNull public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable 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:
getCredentials
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.SYSTEM
.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
public String getIconClassName()
- Specified by:
getIconClassName
in interfaceIconSpec
- Overrides:
getIconClassName
in classCredentialsProvider
-
-