Package jenkins.security
Class QueueItemAuthenticator
java.lang.Object
hudson.model.AbstractDescribableImpl<QueueItemAuthenticator>
jenkins.security.QueueItemAuthenticator
- All Implemented Interfaces:
ExtensionPoint
,Describable<QueueItemAuthenticator>
public abstract class QueueItemAuthenticator
extends AbstractDescribableImpl<QueueItemAuthenticator>
implements ExtensionPoint
Extension point to run
Queue.Executable
s under a specific identity for better access control.
You must override either authenticate2(hudson.model.Queue.Item)
, or authenticate2(hudson.model.Queue.Task)
, or both.- Since:
- 1.520
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(Queue.Item item) Deprecated.authenticate
(Queue.Task task) Deprecated.org.springframework.security.core.Authentication
authenticate2
(Queue.Item item) Determines the identity in which theQueue.Executable
will run as.org.springframework.security.core.Authentication
authenticate2
(Queue.Task task) Determines the identity in which theQueue.Executable
will run as.By default looks for a nested class (conventionally namedDescriptorImpl
) implementingDescriptor
and marked withExtension
.
-
Constructor Details
-
QueueItemAuthenticator
public QueueItemAuthenticator()
-
-
Method Details
-
authenticate2
@CheckForNull public org.springframework.security.core.Authentication authenticate2(Queue.Item item) Determines the identity in which theQueue.Executable
will run as. The default implementation delegates toauthenticate2(hudson.model.Queue.Task)
.- Parameters:
item
- The contextual information to assist the authentication. The primary interest is likelyQueue.Item.task
, which is oftenAbstractProject
.Action
s associated with the item is also likely of interest, such asCauseAction
.- Returns:
- returning non-null will determine the identity. If null is returned, the next
configured
QueueItemAuthenticator
will be given a chance to authenticate the executor. If everything fails, fall back toQueue.Task.getDefaultAuthentication()
. - Since:
- 2.266
-
authenticate2
@CheckForNull public org.springframework.security.core.Authentication authenticate2(Queue.Task task) Determines the identity in which theQueue.Executable
will run as. The default implementation delegates toauthenticate2(hudson.model.Queue.Item)
(there will be no associated actions).- Parameters:
task
- OftenAbstractProject
.- Returns:
- returning non-null will determine the identity. If null is returned, the next
configured
QueueItemAuthenticator
will be given a chance to authenticate the executor. If everything fails, fall back toQueue.Task.getDefaultAuthentication()
. - Since:
- 2.266
-
authenticate
Deprecated. -
authenticate
Deprecated.- Since:
- 1.560
-
getDescriptor
Description copied from class:AbstractDescribableImpl
By default looks for a nested class (conventionally namedDescriptorImpl
) implementingDescriptor
and marked withExtension
.Gets the descriptor for this instance.
Descriptor
is a singleton for every concreteDescribable
implementation, so ifa.getClass() == b.getClass()
then by defaulta.getDescriptor() == b.getDescriptor()
as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptor
in interfaceDescribable<QueueItemAuthenticator>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<QueueItemAuthenticator>
-
authenticate2(Queue.Item)