AuthorizationInfo.cs 1.9 KB

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