Skip to content

Commit

Permalink
Log remote address in case of unauthorized tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
EinsamHauer committed Dec 12, 2021
1 parent d8ef888 commit efa371e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.iponweb.disthene</groupId>
<artifactId>disthene</artifactId>
<packaging>jar</packaging>
<version>1.0.11</version>
<version>1.0.12</version>
<name>disthene</name>
<url>http://maven.apache.org</url>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.apache.commons.codec.binary.Hex;
import org.apache.log4j.Logger;

import java.net.InetSocketAddress;

/**
* @author Andrei Ivanov
*/
Expand Down Expand Up @@ -53,7 +55,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {

if (!tenantService.isTenantAllowed(metric.getTenant())) {
isValid = false;
logger.warn("Unauthorized tenant: " + metric.getTenant() + ". Discarding metric: " + metric);
logger.warn("Unauthorized tenant: " + metric.getTenant() + ". Discarding metric: " + metric + ". Source ip: " + ((InetSocketAddress)ctx.channel().remoteAddress()).getAddress());
}

//noinspection UnstableApiUsage
Expand Down

0 comments on commit efa371e

Please sign in to comment.