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.Executables 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 Authenticationauthenticate(Queue.Item item)Deprecated.Authenticationauthenticate(Queue.Task task)Deprecated.org.springframework.security.core.Authenticationauthenticate2(Queue.Item item)Determines the identity in which theQueue.Executablewill run as.org.springframework.security.core.Authenticationauthenticate2(Queue.Task task)Determines the identity in which theQueue.Executablewill run as.QueueItemAuthenticatorDescriptorgetDescriptor()By default looks for a nested class (conventionally namedDescriptorImpl) implementingDescriptorand marked withExtension.
-
-
-
Method Detail
-
authenticate2
@CheckForNull public org.springframework.security.core.Authentication authenticate2(Queue.Item item)
Determines the identity in which theQueue.Executablewill 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.Actions 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
QueueItemAuthenticatorwill 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.Executablewill 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
QueueItemAuthenticatorwill 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:AbstractDescribableImplBy default looks for a nested class (conventionally namedDescriptorImpl) implementingDescriptorand marked withExtension.Gets the descriptor for this instance.
Descriptoris a singleton for every concreteDescribableimplementation, 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:
getDescriptorin interfaceDescribable<QueueItemAuthenticator>- Overrides:
getDescriptorin classAbstractDescribableImpl<QueueItemAuthenticator>
-
-