Github user robertdale commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/534#discussion_r102062737
  
    --- Diff: 
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpBasicAuthenticationHandler.java
 ---
    @@ -92,6 +102,13 @@ public void channelRead(final ChannelHandlerContext 
ctx, final Object msg) {
                 try {
                     authenticator.authenticate(credentials);
                     ctx.fireChannelRead(request);
    +
    +                // User name logged with the remote socket address and 
authenticator classname for audit logging
    +                if (authenticationSettings.enableAuditLog) {
    +                    String[] authClassParts = 
authenticator.getClass().toString().split("[.]");
    +                    auditLogger.info("User {} with address {} 
authenticated by {}", credentials.get(PROPERTY_USERNAME),
    +                            
ctx.channel().remoteAddress().toString().substring(1), 
authClassParts[authClassParts.length - 1]);
    --- End diff --
    
    substring(1) assumes that the remoteAddress always has an unresolved 
(reverse lookup) hostname. I don't know if this is always the case.
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to