From 3316a391d53f5623f8a6cf6cc1d5c90bf43ac075 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 4 Jul 2024 18:27:14 +0200 Subject: [PATCH] [backend] Refactor SignalR namespace --- Iceshrimp.Backend/Core/Extensions/ServiceExtensions.cs | 2 +- Iceshrimp.Backend/Core/Services/StreamingService.cs | 4 ++-- .../{Hubs => SignalR}/Authentication/AuthenticationHelpers.cs | 2 +- Iceshrimp.Backend/{Hubs => SignalR}/ExampleHub.cs | 2 +- .../{Hubs => SignalR}/Helpers/StreamingConnectionAggregate.cs | 2 +- Iceshrimp.Backend/{Hubs => SignalR}/StreamingHub.cs | 2 +- Iceshrimp.Backend/Startup.cs | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) rename Iceshrimp.Backend/{Hubs => SignalR}/Authentication/AuthenticationHelpers.cs (98%) rename Iceshrimp.Backend/{Hubs => SignalR}/ExampleHub.cs (87%) rename Iceshrimp.Backend/{Hubs => SignalR}/Helpers/StreamingConnectionAggregate.cs (99%) rename Iceshrimp.Backend/{Hubs => SignalR}/StreamingHub.cs (97%) diff --git a/Iceshrimp.Backend/Core/Extensions/ServiceExtensions.cs b/Iceshrimp.Backend/Core/Extensions/ServiceExtensions.cs index 5bc2b962..220f8054 100644 --- a/Iceshrimp.Backend/Core/Extensions/ServiceExtensions.cs +++ b/Iceshrimp.Backend/Core/Extensions/ServiceExtensions.cs @@ -10,7 +10,7 @@ using Iceshrimp.Backend.Core.Federation.WebFinger; using Iceshrimp.Backend.Core.Helpers.LibMfm.Conversion; using Iceshrimp.Backend.Core.Middleware; using Iceshrimp.Backend.Core.Services; -using Iceshrimp.Backend.Hubs.Authentication; +using Iceshrimp.Backend.SignalR.Authentication; using Iceshrimp.Shared.Configuration; using Iceshrimp.Shared.Schemas.Web; using Microsoft.AspNetCore.Authentication; diff --git a/Iceshrimp.Backend/Core/Services/StreamingService.cs b/Iceshrimp.Backend/Core/Services/StreamingService.cs index e3bfcc70..e5de6157 100644 --- a/Iceshrimp.Backend/Core/Services/StreamingService.cs +++ b/Iceshrimp.Backend/Core/Services/StreamingService.cs @@ -2,8 +2,8 @@ using System.Collections.Concurrent; using AsyncKeyedLock; using Iceshrimp.Backend.Controllers.Web.Renderers; using Iceshrimp.Backend.Core.Database.Tables; -using Iceshrimp.Backend.Hubs; -using Iceshrimp.Backend.Hubs.Helpers; +using Iceshrimp.Backend.SignalR; +using Iceshrimp.Backend.SignalR.Helpers; using Iceshrimp.Shared.Schemas.SignalR; using Iceshrimp.Shared.Schemas.Web; using Microsoft.AspNetCore.SignalR; diff --git a/Iceshrimp.Backend/Hubs/Authentication/AuthenticationHelpers.cs b/Iceshrimp.Backend/SignalR/Authentication/AuthenticationHelpers.cs similarity index 98% rename from Iceshrimp.Backend/Hubs/Authentication/AuthenticationHelpers.cs rename to Iceshrimp.Backend/SignalR/Authentication/AuthenticationHelpers.cs index 0175efcb..1806f449 100644 --- a/Iceshrimp.Backend/Hubs/Authentication/AuthenticationHelpers.cs +++ b/Iceshrimp.Backend/SignalR/Authentication/AuthenticationHelpers.cs @@ -10,7 +10,7 @@ using Microsoft.AspNetCore.SignalR; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; -namespace Iceshrimp.Backend.Hubs.Authentication; +namespace Iceshrimp.Backend.SignalR.Authentication; public class HubAuthorizationRequirement : IAuthorizationRequirement; diff --git a/Iceshrimp.Backend/Hubs/ExampleHub.cs b/Iceshrimp.Backend/SignalR/ExampleHub.cs similarity index 87% rename from Iceshrimp.Backend/Hubs/ExampleHub.cs rename to Iceshrimp.Backend/SignalR/ExampleHub.cs index 65341854..990fac98 100644 --- a/Iceshrimp.Backend/Hubs/ExampleHub.cs +++ b/Iceshrimp.Backend/SignalR/ExampleHub.cs @@ -1,7 +1,7 @@ using Iceshrimp.Shared.Schemas.SignalR; using Microsoft.AspNetCore.SignalR; -namespace Iceshrimp.Backend.Hubs; +namespace Iceshrimp.Backend.SignalR; public class ExampleHub : Hub, IExampleHubServer { diff --git a/Iceshrimp.Backend/Hubs/Helpers/StreamingConnectionAggregate.cs b/Iceshrimp.Backend/SignalR/Helpers/StreamingConnectionAggregate.cs similarity index 99% rename from Iceshrimp.Backend/Hubs/Helpers/StreamingConnectionAggregate.cs rename to Iceshrimp.Backend/SignalR/Helpers/StreamingConnectionAggregate.cs index a4a227ec..56032166 100644 --- a/Iceshrimp.Backend/Hubs/Helpers/StreamingConnectionAggregate.cs +++ b/Iceshrimp.Backend/SignalR/Helpers/StreamingConnectionAggregate.cs @@ -13,7 +13,7 @@ using JetBrains.Annotations; using Microsoft.AspNetCore.SignalR; using Microsoft.EntityFrameworkCore; -namespace Iceshrimp.Backend.Hubs.Helpers; +namespace Iceshrimp.Backend.SignalR.Helpers; [MustDisposeResource] public sealed class StreamingConnectionAggregate : IDisposable diff --git a/Iceshrimp.Backend/Hubs/StreamingHub.cs b/Iceshrimp.Backend/SignalR/StreamingHub.cs similarity index 97% rename from Iceshrimp.Backend/Hubs/StreamingHub.cs rename to Iceshrimp.Backend/SignalR/StreamingHub.cs index 4ecf52ed..dc74cd37 100644 --- a/Iceshrimp.Backend/Hubs/StreamingHub.cs +++ b/Iceshrimp.Backend/SignalR/StreamingHub.cs @@ -3,7 +3,7 @@ using Iceshrimp.Backend.Core.Services; using Iceshrimp.Shared.Schemas.SignalR; using Microsoft.AspNetCore.SignalR; -namespace Iceshrimp.Backend.Hubs; +namespace Iceshrimp.Backend.SignalR; [Microsoft.AspNetCore.Authorization.Authorize(Policy = "HubAuthorization")] public class StreamingHub(StreamingService streamingService) : Hub, IStreamingHubServer diff --git a/Iceshrimp.Backend/Startup.cs b/Iceshrimp.Backend/Startup.cs index 33f4d0a4..854f6a8e 100644 --- a/Iceshrimp.Backend/Startup.cs +++ b/Iceshrimp.Backend/Startup.cs @@ -1,7 +1,7 @@ using Iceshrimp.Backend.Core.Extensions; using Iceshrimp.Backend.Core.Helpers; -using Iceshrimp.Backend.Hubs; -using Iceshrimp.Backend.Hubs.Authentication; +using Iceshrimp.Backend.SignalR; +using Iceshrimp.Backend.SignalR.Authentication; StartupHelpers.ParseCliArguments(args);