2
0

IAuthenticationManager.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #nullable enable
  2. using System.Collections.Generic;
  3. using System.Threading.Tasks;
  4. namespace MediaBrowser.Controller.Security
  5. {
  6. /// <summary>
  7. /// Handles the retrieval and storage of API keys.
  8. /// </summary>
  9. public interface IAuthenticationManager
  10. {
  11. /// <summary>
  12. /// Creates an API key.
  13. /// </summary>
  14. /// <param name="name">The name of the key.</param>
  15. /// <returns>A task representing the creation of the key.</returns>
  16. Task CreateApiKey(string name);
  17. /// <summary>
  18. /// Gets the API keys.
  19. /// </summary>
  20. /// <returns>A task representing the retrieval of the API keys.</returns>
  21. Task<IReadOnlyList<AuthenticationInfo>> GetApiKeys();
  22. /// <summary>
  23. /// Deletes an API key with the provided access token.
  24. /// </summary>
  25. /// <param name="accessToken">The access token.</param>
  26. /// <returns>A task representing the deletion of the API key.</returns>
  27. Task DeleteApiKey(string accessToken);
  28. }
  29. }