IAuthenticationManager.cs 1.0 KB

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