aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-12-13 14:19:13 -0600
committerJP Dillingham <jp@dillingham.me>2025-12-13 14:19:13 -0600
commit942eeb1eeb535dbaa99e3701ffea39cadcabc4db (patch)
tree5c3e355f67d808b2dd82c656114709f759e99ad8 /src
parent1c2983723e4c683f101bb9988844a2812aab749d (diff)
downloadslskd-942eeb1eeb535dbaa99e3701ffea39cadcabc4db.tar.gz
remove serilog
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/Security/SecurityService.cs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/slskd/Core/Security/SecurityService.cs b/src/slskd/Core/Security/SecurityService.cs
index 9a87449e..8b3afa44 100644
--- a/src/slskd/Core/Security/SecurityService.cs
+++ b/src/slskd/Core/Security/SecurityService.cs
@@ -27,7 +27,6 @@ using System.Net;
using System.Security.Claims;
using Microsoft.IdentityModel.Tokens;
using NetTools;
-using Serilog;
using slskd.Authentication;
public class SecurityService
@@ -91,7 +90,6 @@ public class SecurityService
}
}
- private ILogger Log { get; } = Serilog.Log.ForContext<SecurityService>();
private SymmetricSecurityKey JwtSigningKey { get; }
private OptionsAtStartup OptionsAtStartup { get; }
private IOptionsMonitor<Options> OptionsMonitor { get; }
@@ -110,16 +108,14 @@ public class SecurityService
if (record.Key == null)
{
- Log.Warning("Unauthorized access attempt: unknown API key beginning with {FirstFourCharacters}", key.Substring(0, 4));
- throw new NotFoundException($"The provided API key does not match an existing key");
+ throw new NotFoundException($"Unknown API key beginning with: {key.Substring(0, 4)}");
}
if (!record.Value.Cidr.Split(',')
.Select(cidr => IPAddressRange.Parse(cidr))
.Any(range => range.Contains(callerIpAddress)))
{
- Log.Warning("Unauthorized access attempt: IP Address {IP} not included in CIDR(s) for API key {Name}: {CIDR}", callerIpAddress, record.Key, record.Value.Cidr);
- throw new OutOfRangeException("The remote IP address is not within the range specified for the key");
+ throw new OutOfRangeException($"IP Address {callerIpAddress} not included in CIDR(s) for API key {record.Key}: {record.Value.Cidr}");
}
return (record.Key, record.Value.Role.ToEnum<Role>());