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 runQueue.Executable
s under a specific identity for better access control. You must override eitherauthenticate2(hudson.model.Queue.Item)
, orauthenticate2(hudson.model.Queue.Task)
, or both.- Since:
- 1.520
- Author:
- Kohsuke Kawaguchi
- See Also:
QueueItemAuthenticatorConfiguration
,QueueItemAuthenticatorProvider
,Queue.Item.authenticate()
,Tasks.getAuthenticationOf(hudson.model.Queue.Task)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description QueueItemAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Authentication
authenticate(Queue.Item item)
Deprecated.Authentication
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.QueueItemAuthenticatorDescriptor
getDescriptor()
By default looks for a nested class (conventionally namedDescriptorImpl
) implementingDescriptor
and marked withExtension
.
-
-
-
Method Detail
-
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 @CheckForNull public Authentication authenticate(Queue.Item item)
Deprecated.
-
authenticate
@Deprecated @CheckForNull public Authentication authenticate(Queue.Task task)
Deprecated.- Since:
- 1.560
-
getDescriptor
public QueueItemAuthenticatorDescriptor 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>
-
-