Package org.dcache.xrootd.core
Class XrootdAuthenticationHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.dcache.xrootd.core.XrootdRequestHandler
-
- org.dcache.xrootd.core.XrootdAuthenticationHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class XrootdAuthenticationHandler extends XrootdRequestHandler
Netty handler implementing Xrootd kXR_auth.Delegates the authentication steps to an AuthenticationHandler. Rejects all other messages until login has completed.
Note the difference between this class and AuthenticationHandler. The latter is part of a plugin implementing the core authentication logic whereas this class is a Netty handler.
The class may be subclassed to override the
authenticatedmethod to add additional operations after authentication.
-
-
Constructor Summary
Constructors Constructor Description XrootdAuthenticationHandler(java.lang.String name, AuthenticationFactory authenticationFactory, ProxyDelegationClient proxyDelegationClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectdoOnAuthentication(io.netty.channel.ChannelHandlerContext context, AuthenticationRequest request)AuthenticationHandlergetHandler()java.lang.StringgetProtocol()protected java.lang.ObjectgetResponse(io.netty.channel.ChannelHandlerContext ctx, XrootdRequest req)voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx)protected javax.security.auth.Subjectlogin(io.netty.channel.ChannelHandlerContext context, javax.security.auth.Subject subject)Called at the end of successful login/authentication.voidsetSessionHandler(XrootdSessionHandler sessionHandler)-
Methods inherited from class org.dcache.xrootd.core.XrootdRequestHandler
channelActive, channelRead, doOnClose, doOnDirList, doOnEndSession, doOnLocate, doOnLogin, doOnMkDir, doOnMv, doOnOpen, doOnPrepare, doOnProtocolRequest, doOnQuery, doOnRead, doOnReadV, doOnRm, doOnRmDir, doOnSet, doOnStat, doOnStatx, doOnSync, doOnWrite, getDestinationAddress, getSourceAddress, isHealthCheck, requestReceived, respond, unsupported, userEventTriggered, withError, withOk
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
-
-
-
-
Constructor Detail
-
XrootdAuthenticationHandler
public XrootdAuthenticationHandler(java.lang.String name, AuthenticationFactory authenticationFactory, ProxyDelegationClient proxyDelegationClient)
-
-
Method Detail
-
getProtocol
public java.lang.String getProtocol()
-
getHandler
public AuthenticationHandler getHandler()
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter
-
setSessionHandler
public void setSessionHandler(XrootdSessionHandler sessionHandler)
-
doOnAuthentication
protected java.lang.Object doOnAuthentication(io.netty.channel.ChannelHandlerContext context, AuthenticationRequest request) throws XrootdException- Overrides:
doOnAuthenticationin classXrootdRequestHandler- Throws:
XrootdException
-
getResponse
protected java.lang.Object getResponse(io.netty.channel.ChannelHandlerContext ctx, XrootdRequest req)- Overrides:
getResponsein classXrootdRequestHandler
-
login
protected javax.security.auth.Subject login(io.netty.channel.ChannelHandlerContext context, javax.security.auth.Subject subject) throws XrootdExceptionCalled at the end of successful login/authentication.Subclasses may override this method to add additional processing and internal mapping of the Subject.
If the subclass throws XrootdException then the login is aborted.
- Parameters:
context- the Netty contextsubject- the subject that logged in- Throws:
XrootdException
-
-