mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Enforce permissions on websocket connections
This commit is contained in:
@@ -96,7 +96,7 @@ namespace MediaBrowser.Controller.Net
|
||||
/// Starts sending messages over a web socket.
|
||||
/// </summary>
|
||||
/// <param name="message">The message.</param>
|
||||
private void Start(WebSocketMessageInfo message)
|
||||
protected void Start(WebSocketMessageInfo message)
|
||||
{
|
||||
var vals = message.Data.Split(',');
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.WebSockets;
|
||||
@@ -9,6 +7,9 @@ using MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
namespace MediaBrowser.Controller.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for WebSocket connections.
|
||||
/// </summary>
|
||||
public interface IWebSocketConnection : IAsyncDisposable, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -40,6 +41,11 @@ namespace MediaBrowser.Controller.Net
|
||||
/// <value>The state.</value>
|
||||
WebSocketState State { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the authorization information.
|
||||
/// </summary>
|
||||
public AuthorizationInfo AuthorizationInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the remote end point.
|
||||
/// </summary>
|
||||
@@ -65,6 +71,11 @@ namespace MediaBrowser.Controller.Net
|
||||
/// <exception cref="ArgumentNullException">The message is null.</exception>
|
||||
Task SendAsync<T>(OutboundWebSocketMessage<T> message, CancellationToken cancellationToken);
|
||||
|
||||
Task ProcessAsync(CancellationToken cancellationToken = default);
|
||||
/// <summary>
|
||||
/// Receives a message asynchronously.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task ReceiveAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user