public abstract class CredentialsProvider extends Object implements hudson.ExtensionPoint
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 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() |
Modifier and Type | Method and Description |
---|---|
static hudson.ExtensionList<CredentialsProvider> |
all() |
static hudson.DescriptorExtensionList<Credentials,CredentialsDescriptor> |
allCredentialsDescriptors()
Returns all the registered
Credentials descriptors. |
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 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 items in the specified Item and are appropriate for the specified .credentials.domains.DomainRequirement s. |
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.DomainRequirement s. |
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 . |
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 Item s 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 Item s 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 object)
Returns a lazy
Iterable of all the CredentialsStore instances contributing credentials to the
supplied
object. |
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.
|
public static final hudson.security.PermissionGroup GROUP
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 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 hudson.DescriptorExtensionList<Credentials,CredentialsDescriptor> allCredentialsDescriptors()
Credentials
descriptors.Credentials
descriptors.public 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 ItemGroup
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.DomainRequirement
s.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
DomainRequirement
s then it should
assume the match is true).@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 Item
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 items in the specified Item
and are appropriate for the specified .credentials.domains.DomainRequirement
s.type
- the type of credentials to return.item
- the item.authentication
- the authentication (if null
assume ACL.SYSTEM
.domainRequirements
- the credential domain to match.@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 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 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 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 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 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 hudson.model.ItemGroup itemGroup, @Nullable org.acegisecurity.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.@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.@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 Iterable<CredentialsStore> lookupStores(hudson.model.ModelObject object)
Iterable
of all the CredentialsStore
instances contributing credentials to the
supplied
object.object
- 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
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)
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)
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()
Copyright © 2016. All rights reserved.