aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/QuickConnect
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2021-06-22 21:09:54 -0400
committerPatrick Barron <barronpm@gmail.com>2021-06-23 20:22:12 -0400
commitae878fa051e73dd1df90f1fed3ca5f7ad28b7beb (patch)
tree8d590d6ae9aea9a84626fa31695f0ed47969e33d /MediaBrowser.Controller/QuickConnect
parentf96722fa749b94b8affbf75da5d6941cab219a84 (diff)
parent94056049131a8573d7a4d0690da04c0e8bc240ad (diff)
Merge branch 'master' into authenticationdb-efcore
# Conflicts: # Emby.Server.Implementations/QuickConnect/QuickConnectManager.cs # Emby.Server.Implementations/Session/SessionManager.cs # Jellyfin.Server.Implementations/Security/AuthorizationContext.cs
Diffstat (limited to 'MediaBrowser.Controller/QuickConnect')
-rw-r--r--MediaBrowser.Controller/QuickConnect/IQuickConnect.cs66
1 files changed, 4 insertions, 62 deletions
diff --git a/MediaBrowser.Controller/QuickConnect/IQuickConnect.cs b/MediaBrowser.Controller/QuickConnect/IQuickConnect.cs
index 59003b187..616409533 100644
--- a/MediaBrowser.Controller/QuickConnect/IQuickConnect.cs
+++ b/MediaBrowser.Controller/QuickConnect/IQuickConnect.cs
@@ -1,6 +1,5 @@
-#nullable disable
-
using System;
+using System.Threading.Tasks;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.QuickConnect;
@@ -12,40 +11,9 @@ namespace MediaBrowser.Controller.QuickConnect
public interface IQuickConnect
{
/// <summary>
- /// Gets or sets the length of user facing codes.
- /// </summary>
- int CodeLength { get; set; }
-
- /// <summary>
- /// Gets or sets the name of internal access tokens.
- /// </summary>
- string TokenName { get; set; }
-
- /// <summary>
- /// Gets the current state of quick connect.
- /// </summary>
- QuickConnectState State { get; }
-
- /// <summary>
- /// Gets or sets the time (in minutes) before quick connect will automatically deactivate.
- /// </summary>
- int Timeout { get; set; }
-
- /// <summary>
- /// Assert that quick connect is currently active and throws an exception if it is not.
- /// </summary>
- void AssertActive();
-
- /// <summary>
- /// Temporarily activates quick connect for a short amount of time.
+ /// Gets a value indicating whether quick connect is enabled or not.
/// </summary>
- void Activate();
-
- /// <summary>
- /// Changes the state of quick connect.
- /// </summary>
- /// <param name="newState">New state to change to.</param>
- void SetState(QuickConnectState newState);
+ bool IsEnabled { get; }
/// <summary>
/// Initiates a new quick connect request.
@@ -61,37 +29,11 @@ namespace MediaBrowser.Controller.QuickConnect
QuickConnectResult CheckRequestStatus(string secret);
/// <summary>
- /// Authenticates a QuickConnect request.
- /// </summary>
- /// <param name="request">The request.</param>
- /// <param name="token">The token.</param>
- void AuthenticateRequest(AuthenticationRequest request, string token);
-
- /// <summary>
/// Authorizes a quick connect request to connect as the calling user.
/// </summary>
/// <param name="userId">User id.</param>
/// <param name="code">Identifying code for the request.</param>
/// <returns>A boolean indicating if the authorization completed successfully.</returns>
- bool AuthorizeRequest(Guid userId, string code);
-
- /// <summary>
- /// Expire quick connect requests that are over the time limit. If <paramref name="expireAll"/> is true, all requests are unconditionally expired.
- /// </summary>
- /// <param name="expireAll">If true, all requests will be expired.</param>
- void ExpireRequests(bool expireAll = false);
-
- /// <summary>
- /// Deletes all quick connect access tokens for the provided user.
- /// </summary>
- /// <param name="user">Guid of the user to delete tokens for.</param>
- /// <returns>A count of the deleted tokens.</returns>
- int DeleteAllDevices(Guid user);
-
- /// <summary>
- /// Generates a short code to display to the user to uniquely identify this request.
- /// </summary>
- /// <returns>A short, unique alphanumeric string.</returns>
- string GenerateCode();
+ Task<bool> AuthorizeRequest(Guid userId, string code);
}
}