diff --git a/backend-tests/ChatControllerTests.cs b/backend-tests/ChatControllerTests.cs new file mode 100644 index 0000000..aff5a27 --- /dev/null +++ b/backend-tests/ChatControllerTests.cs @@ -0,0 +1,17 @@ +using System.Reflection; +using Microsoft.AspNetCore.Authorization; +using Nexus.Api.Controllers; +using Xunit; + +namespace Nexus.Api.Tests; + +public sealed class ChatControllerTests +{ + [Fact] + public void ChatController_RequiresAuthorization() + { + var attribute = typeof(ChatController).GetCustomAttribute(); + + Assert.NotNull(attribute); + } +} diff --git a/backend/Controllers/ChatController.cs b/backend/Controllers/ChatController.cs index 7e407e1..02dceb3 100644 --- a/backend/Controllers/ChatController.cs +++ b/backend/Controllers/ChatController.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.RateLimiting; using Nexus.Api.DTOs; @@ -5,6 +6,7 @@ using Nexus.Api.Integrations; namespace Nexus.Api.Controllers; +[Authorize] [ApiController] [Route("api/v1/chat")] public class ChatController(IAgentRuntime runtime, ILogger logger) : ControllerBase