Package org.dcache.xrootd.core
Class XrootdAuthenticationHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.dcache.xrootd.core.XrootdAuthenticationHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class XrootdAuthenticationHandler extends io.netty.channel.ChannelInboundHandlerAdapterNetty handler implementing Xrootd kXR_login, kXR_auth, and kXR_endsess. 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 theauthenticatedmethod to add additional operations after authentication.
-
-
Constructor Summary
Constructors Constructor Description XrootdAuthenticationHandler(AuthenticationFactory authenticationFactory, ProxyDelegationClient proxyDelegationClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx)voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg)ProxyDelegationClientgetCredentialStoreClient()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.voidsetSigningPolicy(SigningPolicy signingPolicy)voidsetTlsSessionInfo(TLSSessionInfo tlsSessionInfo)-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
-
-
-
-
Constructor Detail
-
XrootdAuthenticationHandler
public XrootdAuthenticationHandler(AuthenticationFactory authenticationFactory, ProxyDelegationClient proxyDelegationClient)
-
-
Method Detail
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
getCredentialStoreClient
public ProxyDelegationClient getCredentialStoreClient()
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter
-
setSigningPolicy
public void setSigningPolicy(SigningPolicy signingPolicy)
-
setTlsSessionInfo
public void setTlsSessionInfo(TLSSessionInfo tlsSessionInfo)
-
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
-
-