diff options
author | crupest <crupest@outlook.com> | 2022-03-23 21:30:14 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-03-23 21:30:31 +0800 |
commit | da9139b7bab95f6e5ba5f4bb2d99011c2d6db03a (patch) | |
tree | 051fd4ca4bc511db7e04b019a33fddaab2d0cc6b /BackEnd/Timeline/Services/Token/IUserTokenManager.cs | |
parent | 3d6c9fd916e18c99b3a5497b8313672680571b5e (diff) | |
download | timeline-da9139b7bab95f6e5ba5f4bb2d99011c2d6db03a.tar.gz timeline-da9139b7bab95f6e5ba5f4bb2d99011c2d6db03a.tar.bz2 timeline-da9139b7bab95f6e5ba5f4bb2d99011c2d6db03a.zip |
…
Diffstat (limited to 'BackEnd/Timeline/Services/Token/IUserTokenManager.cs')
-rw-r--r-- | BackEnd/Timeline/Services/Token/IUserTokenManager.cs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/BackEnd/Timeline/Services/Token/IUserTokenManager.cs b/BackEnd/Timeline/Services/Token/IUserTokenManager.cs deleted file mode 100644 index 39009d69..00000000 --- a/BackEnd/Timeline/Services/Token/IUserTokenManager.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System;
-using System.Threading.Tasks;
-using Timeline.Entities;
-using Timeline.Services.User;
-
-namespace Timeline.Services.Token
-{
- public interface IUserTokenManager
- {
- /// <summary>
- /// Try to create a token for given username and password.
- /// </summary>
- /// <param name="username">The username.</param>
- /// <param name="password">The password.</param>
- /// <param name="expireAt">The expire time of the token.</param>
- /// <returns>The created token and the user info.</returns>
- /// <exception cref="ArgumentNullException">Thrown when <paramref name="username"/> or <paramref name="password"/> is null.</exception>
- /// <exception cref="ArgumentException">Thrown when <paramref name="username"/> is of bad format.</exception>
- /// <exception cref="EntityNotExistException">Thrown when the user with <paramref name="username"/> does not exist.</exception>
- /// <exception cref="BadPasswordException">Thrown when <paramref name="password"/> is wrong.</exception>
- public Task<UserTokenCreateResult> CreateTokenAsync(string username, string password, DateTime? expireAt = null);
-
- /// <summary>
- /// Verify a token and get the saved user info. This also check the database for existence of the user.
- /// </summary>
- /// <param name="token">The token.</param>
- /// <returns>The user stored in token.</returns>
- /// <exception cref="ArgumentNullException">Thrown when <paramref name="token"/> is null.</exception>
- /// <exception cref="UserTokenTimeExpiredException">Thrown when the token is expired.</exception>
- /// <exception cref="UserTokenVersionExpiredException">Thrown when the token is of bad version.</exception>
- /// <exception cref="UserTokenBadFormatException">Thrown when the token is of bad format.</exception>
- /// <exception cref="UserTokenUserNotExistException">Thrown when the user specified by the token does not exist. Usually the user had been deleted after the token was issued.</exception>
- public Task<UserEntity> VerifyTokenAsync(string token);
- }
-}
|