mirror of
https://github.com/craigerl/aprsd.git
synced 2025-04-11 14:09:03 -04:00
RPC Server logs the client IP on failed auth
this patch adds an error log for the client IP of who connects to the rpc server without proper auth key.
This commit is contained in:
parent
859f904602
commit
9582812041
@ -16,8 +16,13 @@ LOG = logging.getLogger("APRSD")
|
||||
|
||||
|
||||
def magic_word_authenticator(sock):
|
||||
client_ip = sock.getpeername()[0]
|
||||
magic = sock.recv(len(CONF.rpc_settings.magic_word)).decode()
|
||||
if magic != CONF.rpc_settings.magic_word:
|
||||
LOG.error(
|
||||
f"wrong magic word passed from {client_ip} "
|
||||
"'{magic}' != '{CONF.rpc_settings.magic_word}'",
|
||||
)
|
||||
raise AuthenticationError(
|
||||
f"wrong magic word passed in '{magic}'"
|
||||
f" != '{CONF.rpc_settings.magic_word}'",
|
||||
|
Loading…
Reference in New Issue
Block a user