|
5 | 5 |
|
6 | 6 | namespace EasyExtensions.EntityFrameworkCore.Database |
7 | 7 | { |
| 8 | + /// <summary> |
| 9 | + /// Represents a refresh token with extended metadata, including client device and location information, for |
| 10 | + /// authentication scenarios. |
| 11 | + /// </summary> |
| 12 | + /// <remarks>This class extends the base refresh token functionality by associating additional context |
| 13 | + /// such as IP address, user agent, authentication type, and geographic details. These properties can be used to |
| 14 | + /// enhance security, auditing, or analytics related to token usage. The class is mapped to the 'refresh_tokens' |
| 15 | + /// database table and enforces uniqueness on the token value.</remarks> |
8 | 16 | [Table("refresh_tokens")] |
9 | 17 | [Index(nameof(Token), IsUnique = true)] |
10 | | - internal class ExtendedRefreshToken : RefreshToken |
| 18 | + public class ExtendedRefreshToken : RefreshToken |
11 | 19 | { |
| 20 | + /// <summary> |
| 21 | + /// Gets or sets the IP address associated with the entity. |
| 22 | + /// </summary> |
12 | 23 | [Column("ip_address")] |
13 | 24 | public IPAddress IpAddress { get; set; } = null!; |
14 | 25 |
|
| 26 | + /// <summary> |
| 27 | + /// Gets or sets the user agent string associated with the entity. |
| 28 | + /// </summary> |
15 | 29 | [Column("user_agent")] |
16 | 30 | public string UserAgent { get; set; } = null!; |
17 | 31 |
|
| 32 | + /// <summary> |
| 33 | + /// Gets or sets the authentication type used for this entity. |
| 34 | + /// </summary> |
18 | 35 | [Column("auth_type")] |
19 | 36 | public AuthType AuthType { get; set; } |
20 | 37 |
|
| 38 | + /// <summary> |
| 39 | + /// Gets or sets the country associated with the entity. |
| 40 | + /// </summary> |
21 | 41 | [Column("country")] |
22 | 42 | public string? Country { get; set; } |
23 | 43 |
|
| 44 | + /// <summary> |
| 45 | + /// Gets or sets the region associated with the entity. |
| 46 | + /// </summary> |
24 | 47 | [Column("region")] |
25 | 48 | public string? Region { get; set; } |
26 | 49 |
|
| 50 | + /// <summary> |
| 51 | + /// Gets or sets the name of the city associated with the entity. |
| 52 | + /// </summary> |
27 | 53 | [Column("city")] |
28 | 54 | public string? City { get; set; } |
29 | 55 |
|
| 56 | + /// <summary> |
| 57 | + /// Gets or sets the name or identifier of the device associated with this entity. |
| 58 | + /// </summary> |
30 | 59 | [Column("device")] |
31 | 60 | public string? Device { get; set; } |
32 | 61 | } |
|
0 commit comments