AuthorizationInfo.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using Jellyfin.Data.Entities;
  3. namespace MediaBrowser.Controller.Net
  4. {
  5. /// <summary>
  6. /// The request authorization info.
  7. /// </summary>
  8. public class AuthorizationInfo
  9. {
  10. /// <summary>
  11. /// Gets the user identifier.
  12. /// </summary>
  13. /// <value>The user identifier.</value>
  14. public Guid UserId => User?.Id ?? Guid.Empty;
  15. /// <summary>
  16. /// Gets or sets the device identifier.
  17. /// </summary>
  18. /// <value>The device identifier.</value>
  19. public string DeviceId { get; set; }
  20. /// <summary>
  21. /// Gets or sets the device.
  22. /// </summary>
  23. /// <value>The device.</value>
  24. public string Device { get; set; }
  25. /// <summary>
  26. /// Gets or sets the client.
  27. /// </summary>
  28. /// <value>The client.</value>
  29. public string Client { get; set; }
  30. /// <summary>
  31. /// Gets or sets the version.
  32. /// </summary>
  33. /// <value>The version.</value>
  34. public string Version { get; set; }
  35. /// <summary>
  36. /// Gets or sets the token.
  37. /// </summary>
  38. /// <value>The token.</value>
  39. public string Token { get; set; }
  40. /// <summary>
  41. /// Gets or sets a value indicating whether the authorization is from an api key.
  42. /// </summary>
  43. public bool IsApiKey { get; set; }
  44. /// <summary>
  45. /// Gets or sets the user making the request.
  46. /// </summary>
  47. public User User { get; set; }
  48. /// <summary>
  49. /// Gets or sets a value indicating whether the token is authenticated.
  50. /// </summary>
  51. public bool IsAuthenticated { get; set; }
  52. /// <summary>
  53. /// Gets or sets a value indicating whether the request has a token.
  54. /// </summary>
  55. public bool HasToken { get; set; }
  56. }
  57. }