2020-01-31 21:46:10 +00:00
|
|
|
#nullable enable
|
|
|
|
|
2020-05-20 17:07:53 +00:00
|
|
|
using Jellyfin.Data.Entities;
|
2019-01-13 20:01:16 +00:00
|
|
|
using MediaBrowser.Model.Services;
|
2019-11-23 15:31:02 +00:00
|
|
|
using Microsoft.AspNetCore.Http;
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Net
|
|
|
|
{
|
2020-06-15 18:49:54 +00:00
|
|
|
/// <summary>
|
|
|
|
/// IAuthService.
|
|
|
|
/// </summary>
|
2018-12-27 23:27:57 +00:00
|
|
|
public interface IAuthService
|
|
|
|
{
|
2020-06-15 18:49:54 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Authenticate and authorize request.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request">Request.</param>
|
|
|
|
/// <param name="authAttribtutes">Authorization attributes.</param>
|
|
|
|
void Authenticate(IRequest request, IAuthenticationAttributes authAttribtutes);
|
2020-05-20 17:07:53 +00:00
|
|
|
|
2020-06-15 18:49:54 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Authenticate and authorize request.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request">Request.</param>
|
|
|
|
/// <param name="authAttribtutes">Authorization attributes.</param>
|
|
|
|
/// <returns>Authenticated user.</returns>
|
|
|
|
User? Authenticate(HttpRequest request, IAuthenticationAttributes authAttribtutes);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Authenticate request.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request">The request.</param>
|
|
|
|
/// <returns>Authorization information. Null if unauthenticated.</returns>
|
|
|
|
AuthorizationInfo Authenticate(HttpRequest request);
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|