mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[PR #14011] [MERGED] Fix missing logging of connections by disallowed IPs #13793
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/14011
Author: @lf-
Created: 4/27/2025
Status: ✅ Merged
Merged: 6/4/2025
Merged by: @crobibero
Base:
master← Head:jade/fix-access-policy-diagnostics📝 Commits (2)
4230c60Middleware: Give reasons for rejecting connectionsa3b92a6Middleware: remove redundant LAN filtering middleware📊 Changes
9 files changed (+109 additions, -98 deletions)
View changed files
📝
Jellyfin.Api/Middleware/IpBasedAccessValidationMiddleware.cs(+16 -4)➖
Jellyfin.Api/Middleware/LanFilteringMiddleware.cs(+0 -51)📝
Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs(+0 -10)📝
Jellyfin.Server/Startup.cs(+0 -1)📝
MediaBrowser.Common/Extensions/HttpContextExtensions.cs(+1 -1)📝
MediaBrowser.Common/Net/INetworkManager.cs(+2 -2)➕
MediaBrowser.Common/Net/RemoteAccessPolicyResult.cs(+29 -0)📝
src/Jellyfin.Networking/Manager/NetworkManager.cs(+28 -19)📝
tests/Jellyfin.Networking.Tests/NetworkParseTests.cs(+33 -10)📄 Description
Changes
I rewrote the remote access policy code (intended as no functional change) to give reasons for rejecting/allowing connections as well as restructuring it to be more in line with best practices in authorization code of having the fall-through case be to reject. This then allows for fixing #14008 in a satisfying way: actually reporting why the connection was rejected.
Secondly I deleted the LAN checking middleware, since it is a subset of the functionality of the IP checking middleware anyway and has worse diagnostics.
I have tested this locally (which actually is why I found the redundant LAN middleware).
Issues
Fixes: https://github.com/jellyfin/jellyfin/issues/14008
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.