IAuthenticationManager.cs 1.0 KB

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