aboutsummaryrefslogtreecommitdiff
path: root/VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation
diff options
context:
space:
mode:
Diffstat (limited to 'VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation')
-rw-r--r--VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevocationContext.cs38
-rw-r--r--VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevokedTokenStore.cs6
2 files changed, 3 insertions, 41 deletions
diff --git a/VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevocationContext.cs b/VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevocationContext.cs
deleted file mode 100644
index 4ff64b9..0000000
--- a/VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevocationContext.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-* Copyright (c) 2022 Vaughn Nugent
-*
-* Library: VNLib
-* Package: VNLib.Plugins.Essentials.Accounts.Registration
-* File: RevocationContext.cs
-*
-* RevocationContext.cs is part of VNLib.Plugins.Essentials.Accounts.Registration which is part of the larger
-* VNLib collection of libraries and utilities.
-*
-* VNLib.Plugins.Essentials.Accounts.Registration is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* VNLib.Plugins.Essentials.Accounts.Registration is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see https://www.gnu.org/licenses/.
-*/
-
-using Microsoft.EntityFrameworkCore;
-
-using VNLib.Plugins.Extensions.Data;
-
-namespace VNLib.Plugins.Essentials.Accounts.Registration.TokenRevocation
-{
- internal class RevocationContext : TransactionalDbContext
- {
- public DbSet<RevokedToken> RevokedRegistrationTokens { get; set; }
-
- public RevocationContext(DbContextOptions options) : base(options)
- {}
- }
-} \ No newline at end of file
diff --git a/VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevokedTokenStore.cs b/VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevokedTokenStore.cs
index c9217be..89f4bd6 100644
--- a/VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevokedTokenStore.cs
+++ b/VNLib.Plugins.Essentials.Accounts.Registration/src/TokenRevocation/RevokedTokenStore.cs
@@ -41,7 +41,7 @@ namespace VNLib.Plugins.Essentials.Accounts.Registration.TokenRevocation
public async Task<bool> IsRevokedAsync(string token, CancellationToken cancellation)
{
- await using RevocationContext context = new (Options);
+ await using RegistrationContext context = new (Options);
await context.OpenTransactionAsync(cancellation);
//Select any that match tokens
@@ -55,7 +55,7 @@ namespace VNLib.Plugins.Essentials.Accounts.Registration.TokenRevocation
public async Task RevokeAsync(string token, CancellationToken cancellation)
{
- await using RevocationContext context = new (Options);
+ await using RegistrationContext context = new (Options);
await context.OpenTransactionAsync(cancellation);
//Add to table
@@ -80,7 +80,7 @@ namespace VNLib.Plugins.Essentials.Accounts.Registration.TokenRevocation
{
DateTime expiredBefore = DateTime.UtcNow.Subtract(validFor);
- await using RevocationContext context = new (Options);
+ await using RegistrationContext context = new (Options);
await context.OpenTransactionAsync(cancellation);
//Select any that match tokens