From a7fb4d4ef0c21d15462528c246a62c621c9e58a2 Mon Sep 17 00:00:00 2001 From: Matthew Strasiotto <39424834+matthewstrasiotto@users.noreply.github.com> Date: Sat, 18 Jun 2022 21:52:08 +1000 Subject: [PATCH] Code cleanup --- SSO-Auth/Api/RequestHelpers.cs | 16 ---------------- SSO-Auth/Api/SSOController.cs | 2 +- SSO-Auth/Api/SSOViewsController.cs | 17 ----------------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/SSO-Auth/Api/RequestHelpers.cs b/SSO-Auth/Api/RequestHelpers.cs index af29df9..90a898c 100644 --- a/SSO-Auth/Api/RequestHelpers.cs +++ b/SSO-Auth/Api/RequestHelpers.cs @@ -8,26 +8,10 @@ // These helpers were not published within a Nuget package, so it was neccessary to re-implement. using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Mime; -using System.Text.RegularExpressions; using System.Threading.Tasks; -using IdentityModel.OidcClient; -using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; -using Jellyfin.Plugin.SSO_Auth.Config; -using Jellyfin.Plugin.SSO_Auth.Helpers; -using MediaBrowser.Controller.Authentication; -using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Net; -using MediaBrowser.Controller.Session; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace Jellyfin.Plugin.SSO_Auth.Helpers; diff --git a/SSO-Auth/Api/SSOController.cs b/SSO-Auth/Api/SSOController.cs index 4da3876..deb77ae 100644 --- a/SSO-Auth/Api/SSOController.cs +++ b/SSO-Auth/Api/SSOController.cs @@ -668,7 +668,7 @@ public class SSOController : ControllerBase } /// - /// Removes a user from SSO auth and switches it back to another auth provider. Requires administrator privileges. + /// Create a canonical link for a given user. Must be performed by the user being changed, or admin. /// /// The mode of the function; SAML or OID. /// The name of the provider to link to a jellyfin account. diff --git a/SSO-Auth/Api/SSOViewsController.cs b/SSO-Auth/Api/SSOViewsController.cs index 483cfdc..c710291 100644 --- a/SSO-Auth/Api/SSOViewsController.cs +++ b/SSO-Auth/Api/SSOViewsController.cs @@ -1,30 +1,14 @@ -using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net.Mime; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using IdentityModel.OidcClient; -using Jellyfin.Data.Entities; -using Jellyfin.Data.Enums; -using Jellyfin.Plugin.SSO_Auth; -using Jellyfin.Plugin.SSO_Auth.Config; -using Jellyfin.Plugin.SSO_Auth.Helpers; -using MediaBrowser.Controller.Authentication; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Session; using MediaBrowser.Model; using MediaBrowser.Model.Plugins; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Logging; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace Jellyfin.Plugin.SSO_Auth.Views; @@ -94,7 +78,6 @@ public class SSOViewsController : ControllerBase /// /// The name of the view / asset to fetch. /// The html view with the specified name. - // [Authorize(Policy = "DefaultAuthorization")] [HttpGet("{viewName}")] public ActionResult GetView([FromRoute] string viewName) {