aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Security
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2021-04-01 17:08:22 -0400
committerPatrick Barron <barronpm@gmail.com>2021-04-01 17:08:22 -0400
commit499785bebb5699c61b211dcb6ea0ee2001effa6f (patch)
treecce1b72884e2d31dc261899cf25ab374305b7e82 /MediaBrowser.Controller/Security
parent1c501b17d7b6ceeba3450e0be768cfdbf7d581d0 (diff)
Use new entities for API key endpoints
Diffstat (limited to 'MediaBrowser.Controller/Security')
-rw-r--r--MediaBrowser.Controller/Security/IAuthenticationManager.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Security/IAuthenticationManager.cs b/MediaBrowser.Controller/Security/IAuthenticationManager.cs
new file mode 100644
index 000000000..46d0c6622
--- /dev/null
+++ b/MediaBrowser.Controller/Security/IAuthenticationManager.cs
@@ -0,0 +1,34 @@
+#nullable enable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Controller.Security
+{
+ /// <summary>
+ /// Handles the retrieval and storage of API keys.
+ /// </summary>
+ public interface IAuthenticationManager
+ {
+ /// <summary>
+ /// Creates an API key.
+ /// </summary>
+ /// <param name="name">The name of the key.</param>
+ /// <returns>A task representing the creation of the key.</returns>
+ Task CreateApiKey(string name);
+
+ /// <summary>
+ /// Gets the API keys.
+ /// </summary>
+ /// <returns>A task representing the retrieval of the API keys.</returns>
+ Task<IReadOnlyList<AuthenticationInfo>> GetApiKeys();
+
+ /// <summary>
+ /// Deletes an API key with the provided access token.
+ /// </summary>
+ /// <param name="accessToken">The access token.</param>
+ /// <returns>A task representing the deletion of the API key.</returns>
+ Task DeleteApiKey(Guid accessToken);
+ }
+}