2020-04-15 19:28:42 +00:00
|
|
|
using System;
|
2021-06-23 01:09:54 +00:00
|
|
|
using System.Threading.Tasks;
|
2021-06-24 03:07:08 +00:00
|
|
|
using MediaBrowser.Controller.Authentication;
|
|
|
|
using MediaBrowser.Controller.Net;
|
2020-04-15 19:28:42 +00:00
|
|
|
using MediaBrowser.Model.QuickConnect;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.QuickConnect
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Quick connect standard interface.
|
|
|
|
/// </summary>
|
|
|
|
public interface IQuickConnect
|
|
|
|
{
|
|
|
|
/// <summary>
|
2021-06-18 17:31:47 +00:00
|
|
|
/// Gets a value indicating whether quick connect is enabled or not.
|
2020-04-19 06:33:09 +00:00
|
|
|
/// </summary>
|
2021-06-18 17:31:47 +00:00
|
|
|
bool IsEnabled { get; }
|
2020-04-15 19:28:42 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initiates a new quick connect request.
|
|
|
|
/// </summary>
|
2021-06-24 03:07:08 +00:00
|
|
|
/// <param name="authorizationInfo">The initiator authorization info.</param>
|
2020-07-27 04:13:14 +00:00
|
|
|
/// <returns>A quick connect result with tokens to proceed or throws an exception if not active.</returns>
|
2021-06-24 03:07:08 +00:00
|
|
|
QuickConnectResult TryConnect(AuthorizationInfo authorizationInfo);
|
2020-04-15 19:28:42 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Checks the status of an individual request.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="secret">Unique secret identifier of the request.</param>
|
|
|
|
/// <returns>Quick connect result.</returns>
|
|
|
|
QuickConnectResult CheckRequestStatus(string secret);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Authorizes a quick connect request to connect as the calling user.
|
|
|
|
/// </summary>
|
2020-08-17 21:36:45 +00:00
|
|
|
/// <param name="userId">User id.</param>
|
2020-06-18 06:58:58 +00:00
|
|
|
/// <param name="code">Identifying code for the request.</param>
|
2020-04-15 19:28:42 +00:00
|
|
|
/// <returns>A boolean indicating if the authorization completed successfully.</returns>
|
2021-06-23 01:09:54 +00:00
|
|
|
Task<bool> AuthorizeRequest(Guid userId, string code);
|
2021-06-24 03:07:08 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the authorized request for the secret.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="secret">The secret.</param>
|
|
|
|
/// <returns>The authentication result.</returns>
|
|
|
|
AuthenticationResult GetAuthorizedRequest(string secret);
|
2020-04-15 19:28:42 +00:00
|
|
|
}
|
|
|
|
}
|