diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Common/Authentication/ApiKeyAuthentication.cs | 2 | ||||
| -rw-r--r-- | src/slskd/Core/Security/SecurityService.cs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/slskd/Common/Authentication/ApiKeyAuthentication.cs b/src/slskd/Common/Authentication/ApiKeyAuthentication.cs index fb209478..e2733442 100644 --- a/src/slskd/Common/Authentication/ApiKeyAuthentication.cs +++ b/src/slskd/Common/Authentication/ApiKeyAuthentication.cs @@ -88,7 +88,7 @@ namespace slskd.Authentication } catch (Exception ex) { - Log.Warning(ex, "Unauthorized: {Message}", ex.Message); + Log.Warning("Unauthorized request from IP address {IP}: {Message}", Request.HttpContext.Connection.RemoteIpAddress, ex.Message); return AuthenticateResult.Fail(ex); } } diff --git a/src/slskd/Core/Security/SecurityService.cs b/src/slskd/Core/Security/SecurityService.cs index 8b3afa44..e98dd5eb 100644 --- a/src/slskd/Core/Security/SecurityService.cs +++ b/src/slskd/Core/Security/SecurityService.cs @@ -115,7 +115,7 @@ public class SecurityService .Select(cidr => IPAddressRange.Parse(cidr)) .Any(range => range.Contains(callerIpAddress))) { - throw new OutOfRangeException($"IP Address {callerIpAddress} not included in CIDR(s) for API key {record.Key}: {record.Value.Cidr}"); + throw new OutOfRangeException($"IP address {callerIpAddress} not included in CIDR range(s) for API key {record.Key}; allowed: {record.Value.Cidr}"); } return (record.Key, record.Value.Role.ToEnum<Role>()); |
