From b51692140ad74ff1302acd8196e0bb564cad6bca Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 26 Apr 2025 22:35:08 -0400 Subject: [PATCH] Minor cleanups --- src/Tgstation.Server.Host/GraphQL/Subscription.cs | 3 +-- src/Tgstation.Server.Host/GraphQL/Types/SwarmNode.cs | 2 +- src/Tgstation.Server.Host/GraphQL/Types/UserGroups.cs | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Tgstation.Server.Host/GraphQL/Subscription.cs b/src/Tgstation.Server.Host/GraphQL/Subscription.cs index 1d8838186b..b989fded2f 100644 --- a/src/Tgstation.Server.Host/GraphQL/Subscription.cs +++ b/src/Tgstation.Server.Host/GraphQL/Subscription.cs @@ -17,6 +17,7 @@ namespace Tgstation.Server.Host.GraphQL /// Root type for GraphQL subscriptions. /// /// Intentionally left mostly empty, use type extensions to properly scope operations to domains. + [Authorize] [GraphQLDescription(GraphQLDescription)] public sealed class Subscription { @@ -44,7 +45,6 @@ namespace Tgstation.Server.Host.GraphQL /// The for the request. /// The for the operation. /// A resulting in a of the for the . - [Authorize] public ValueTask> SessionInvalidatedStream( [Service] HotChocolate.Subscriptions.ITopicEventReceiver receiver, // Intentionally not using our override here, topic callers are built to explicitly handle cases of server shutdown [Service] ISessionInvalidationTracker invalidationTracker, @@ -65,7 +65,6 @@ namespace Tgstation.Server.Host.GraphQL /// The received from the publisher. /// The . [Subscribe(With = nameof(SessionInvalidatedStream))] - [Authorize] public SessionInvalidationReason SessionInvalidated([EventMessage] SessionInvalidationReason sessionInvalidationReason) => sessionInvalidationReason; } diff --git a/src/Tgstation.Server.Host/GraphQL/Types/SwarmNode.cs b/src/Tgstation.Server.Host/GraphQL/Types/SwarmNode.cs index 807356711b..91045c6920 100644 --- a/src/Tgstation.Server.Host/GraphQL/Types/SwarmNode.cs +++ b/src/Tgstation.Server.Host/GraphQL/Types/SwarmNode.cs @@ -21,7 +21,7 @@ namespace Tgstation.Server.Host.GraphQL.Types /// Represents a node server in a swarm. /// [Node] - public class SwarmNode : IServerNode + public sealed class SwarmNode : IServerNode { /// /// The node ID. diff --git a/src/Tgstation.Server.Host/GraphQL/Types/UserGroups.cs b/src/Tgstation.Server.Host/GraphQL/Types/UserGroups.cs index 001d158618..e086dcfe7a 100644 --- a/src/Tgstation.Server.Host/GraphQL/Types/UserGroups.cs +++ b/src/Tgstation.Server.Host/GraphQL/Types/UserGroups.cs @@ -4,6 +4,7 @@ using System.Threading; using System.Threading.Tasks; using HotChocolate; +using HotChocolate.Authorization; using HotChocolate.Data; using HotChocolate.Types; using HotChocolate.Types.Relay; @@ -16,6 +17,7 @@ namespace Tgstation.Server.Host.GraphQL.Types /// /// Wrapper for accessing s. /// + [Authorize] public sealed class UserGroups { ///