SignalR Security

This commit is contained in:
2025-12-05 23:17:02 +01:00
parent 71c293320b
commit 0c874575d4
2 changed files with 16 additions and 12 deletions

View File

@@ -1,16 +1,15 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.SignalR;
namespace DiunaBI.API.Hubs;
/// <summary>
/// SignalR hub for broadcasting entity change notifications to authenticated clients.
/// Clients can only listen - broadcasting is done server-side by EntityChangeInterceptor.
/// </summary>
[Authorize]
public class EntityChangeHub : Hub
{
public async Task SendEntityChange(string module, string id, string operation)
{
await Clients.All.SendAsync("EntityChanged", new
{
module,
id,
operation
});
}
// No public methods - clients can only listen for "EntityChanged" events
// Broadcasting is handled server-side by EntityChangeInterceptor via IHubContext
}