Skip to content

Commit

Permalink
xrootd4j: Enable HAProxy aware authorization
Browse files Browse the repository at this point in the history
Authorization plugins can authorize by local and remote socket address. E.g.
the alice authorization token plugin verifies that the token is for a TURL for
the destination address. In the pressence of an HAProxy in front of the server,
the destination address is different from the local address of the channel and
thus the alice token plugin fails.

This patch injects the actual source and destination address into the
authorization plugin.

Target: master,3.2
Acked-by: Anupam Ashish <[email protected]>

Reviewed at https://rb.dcache.org/r/9832/
  • Loading branch information
gbehrmann committed Oct 12, 2016
1 parent 609a55c commit e870e4e
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,14 @@ private String authorize(ChannelHandlerContext ctx,
throws XrootdException
{
try {
Channel channel = ctx.channel();
InetSocketAddress localAddress =
(InetSocketAddress) channel.localAddress();
InetSocketAddress remoteAddress =
(InetSocketAddress) channel.remoteAddress();
InetSocketAddress destinationAddress = getDestinationAddress();
InetSocketAddress sourceAddress = getSourceAddress();

AuthorizationHandler handler =
_authorizationFactory.createHandler();
return handler.authorize(request.getSubject(),
localAddress,
remoteAddress,
destinationAddress,
sourceAddress,
path,
OpaqueStringParser.getOpaqueMap(opaque),
request.getRequestId(),
Expand Down

0 comments on commit e870e4e

Please sign in to comment.