IConnectManager.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Model.Connect;
  3. using System.Collections.Generic;
  4. using System.Threading.Tasks;
  5. namespace MediaBrowser.Controller.Connect
  6. {
  7. public interface IConnectManager
  8. {
  9. /// <summary>
  10. /// Gets the wan API address.
  11. /// </summary>
  12. /// <value>The wan API address.</value>
  13. string WanApiAddress { get; }
  14. /// <summary>
  15. /// Links the user.
  16. /// </summary>
  17. /// <param name="userId">The user identifier.</param>
  18. /// <param name="connectUsername">The connect username.</param>
  19. /// <returns>Task.</returns>
  20. Task<UserLinkResult> LinkUser(string userId, string connectUsername);
  21. /// <summary>
  22. /// Removes the link.
  23. /// </summary>
  24. /// <param name="userId">The user identifier.</param>
  25. /// <returns>Task.</returns>
  26. Task RemoveConnect(string userId);
  27. User GetUserFromExchangeToken(string token);
  28. /// <summary>
  29. /// Authenticates the specified username.
  30. /// </summary>
  31. Task<ConnectAuthenticationResult> Authenticate(string username, string password, string passwordMd5);
  32. /// <summary>
  33. /// Determines whether [is authorization token valid] [the specified token].
  34. /// </summary>
  35. /// <param name="token">The token.</param>
  36. /// <returns><c>true</c> if [is authorization token valid] [the specified token]; otherwise, <c>false</c>.</returns>
  37. bool IsAuthorizationTokenValid(string token);
  38. }
  39. }