fix: use HttpContext and ClaimsPrincipal instead of IAuthorizationContext

This commit is contained in:
cvium
2022-10-06 13:57:47 +02:00
parent 927fe33d3a
commit 5dc30c6a6d
44 changed files with 334 additions and 495 deletions

View File

@@ -2,6 +2,7 @@
using System.Threading.Tasks;
using Jellyfin.Api.Attributes;
using Jellyfin.Api.Constants;
using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.Models.ClientLogDtos;
using MediaBrowser.Controller.ClientEvent;
@@ -69,10 +70,10 @@ namespace Jellyfin.Api.Controllers
private (string ClientName, string ClientVersion) GetRequestInformation()
{
var clientName = ClaimHelpers.GetClient(HttpContext.User) ?? "unknown-client";
var clientVersion = ClaimHelpers.GetIsApiKey(HttpContext.User)
var clientName = HttpContext.User.GetClient() ?? "unknown-client";
var clientVersion = HttpContext.User.GetIsApiKey()
? "apikey"
: ClaimHelpers.GetVersion(HttpContext.User) ?? "unknown-version";
: HttpContext.User.GetVersion() ?? "unknown-version";
return (clientName, clientVersion);
}