-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
o.nadymov
committed
Feb 23, 2024
1 parent
bc8e0d6
commit fe4f289
Showing
3 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Spoleto.BookApi.Interfaces.Models.Auth | ||
{ | ||
/// <summary> | ||
/// The Bearer token. | ||
/// </summary> | ||
public class BearerToken | ||
{ | ||
/// <summary> | ||
/// Gets or sets the access token. | ||
/// </summary> | ||
public string AccessToken { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the refresh token. | ||
/// </summary> | ||
public string RefreshToken { get; set; } | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/Spoleto.BookApi.Interfaces/Models/Auth/RefreshToken.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
|
||
namespace Spoleto.BookApi.Interfaces.Models.Auth | ||
{ | ||
/// <summary> | ||
/// The refresh token. | ||
/// </summary> | ||
public class RefreshToken : PersistentObjectBase | ||
{ | ||
/// <summary> | ||
/// Gets or sets the hash value for this refresh token. | ||
/// </summary> | ||
public string ValueToken { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the active flag of this token. | ||
/// </summary> | ||
public bool Active { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the date issued in UTC of this token. | ||
/// </summary> | ||
public DateTime DateIssued { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the date expires in UTC of this token. | ||
/// </summary> | ||
public DateTime DateExpires { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the target user identifier for this refresh token. | ||
/// </summary> | ||
public Guid UserId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the target user for this refresh token. | ||
/// </summary> | ||
public User User { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
namespace Spoleto.BookApi.Interfaces.Models.Auth | ||
{ | ||
/// <summary> | ||
/// The user for database authentication. | ||
/// </summary> | ||
public class User : PersistentObjectBase | ||
{ | ||
/// <summary> | ||
/// Gets or sets the user's first name. | ||
/// </summary> | ||
public string FirstName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the user's middle name. Optional, can be null if not provided. | ||
/// </summary> | ||
public string MiddleName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the user's last name. Optional, can be null if not provided. | ||
/// </summary> | ||
public string LastName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the user's phone number. | ||
/// </summary> | ||
/// <remarks> | ||
/// It is required if <see cref="Email"/> is not initialized.<br/> | ||
/// In this case <see cref="Phone"/> is expected to be unique. | ||
/// </remarks> | ||
public string Phone { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the user's email address. | ||
/// </summary> | ||
/// <remarks> | ||
/// It is required if <see cref="Phone"/> is not initialized.<br/> | ||
/// In this case <see cref="Email"/> is expected to be unique. | ||
/// </remarks> | ||
public string Email { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the user's password (hash). | ||
/// </summary> | ||
public string Password { get; set; } | ||
} | ||
} |