added auth with a simple UI
This commit is contained in:
10
api/OED.Api/Core/Interfaces/Services/ISessionService.cs
Normal file
10
api/OED.Api/Core/Interfaces/Services/ISessionService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using OED.Api.Core.Models.Eve;
|
||||
|
||||
namespace OED.Api.Core.Interfaces.Services;
|
||||
|
||||
public interface ISessionService
|
||||
{
|
||||
Task<string> CreateAsync(EveSession session);
|
||||
Task<EveSession?> GetAsync(string sessionId);
|
||||
Task DeleteAsync(string sessionId);
|
||||
}
|
||||
9
api/OED.Api/Core/Interfaces/Services/ITokenStore.cs
Normal file
9
api/OED.Api/Core/Interfaces/Services/ITokenStore.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace OED.Api.Core.Interfaces.Services;
|
||||
|
||||
public interface ITokenStore
|
||||
{
|
||||
Task SetAccessTokenAsync(long characterId, string token, TimeSpan expiry);
|
||||
Task<string?> GetAccessTokenAsync(long characterId);
|
||||
Task SetRefreshTokenAsync(long characterId, string token);
|
||||
Task<string?> GetRefreshTokenAsync(long characterId);
|
||||
}
|
||||
11
api/OED.Api/Core/Models/Eve/EveCharacter.cs
Normal file
11
api/OED.Api/Core/Models/Eve/EveCharacter.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace OED.Api.Core.Models.Eve;
|
||||
|
||||
public record EveCharacter
|
||||
{
|
||||
public long CharacterId { get; init; }
|
||||
public string CharacterName { get; init; } = string.Empty;
|
||||
public string[] Scopes { get; init; } = [];
|
||||
public string AccessToken { get; init; } = string.Empty;
|
||||
public string RefreshToken { get; init; } = string.Empty;
|
||||
public DateTimeOffset AccessTokenExpiry { get; init; }
|
||||
}
|
||||
8
api/OED.Api/Core/Models/Eve/EveSession.cs
Normal file
8
api/OED.Api/Core/Models/Eve/EveSession.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace OED.Api.Core.Models.Eve;
|
||||
|
||||
public record EveSession
|
||||
{
|
||||
public long CharacterId { get; init; }
|
||||
public string CharacterName { get; init; } = string.Empty;
|
||||
public string[] Scopes { get; init; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user