Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ public PersistedGrantDbContext(DbContextOptions options, OperationalStoreOptions
/// The keys.
/// </value>
public DbSet<IdentityServerKeyMaterial> Keys { get; set; }

/// <summary>
/// Gets or sets the server side sessions.
/// </summary>
/// <value>
/// The server side sessions.
/// </value>
public DbSet<ServerSideSession> ServerSideSessions { get; set; }

/// <summary>
/// Gets or sets the pushed authorization requests.
/// </summary>
/// <value>
/// The pushed authorization requests.
/// </value>
public DbSet<PushedAuthorizationRequest> PushedAuthorizationRequests { get; set; }

/// <summary>
/// Saves the changes.
Expand Down Expand Up @@ -106,22 +122,4 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)

base.OnModelCreating(modelBuilder);
}

//Schema compatibility, placeholders unused

/// <summary>
/// Gets or sets the server side sessions.
/// </summary>
/// <value>
/// The server side sessions.
/// </value>
public DbSet<ServerSideSession> ServerSideSessions { get; set; }

/// <summary>
/// Gets or sets the pushed authorization requests.
/// </summary>
/// <value>
/// The pushed authorization requests.
/// </value>
public DbSet<PushedAuthorizationRequest> PushedAuthorizationRequests { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public class OperationalStoreOptions: StoreOptions
/// </value>
public TableConfiguration ServerSideSessions { get; set; } = new("ServerSideSessions");

/// <summary>
/// Gets or sets the pushed authorization requests table configuration.
/// </summary>
/// <value>
/// The pushed authorization requests config.
/// </value>
public TableConfiguration PushedAuthorizationRequests { get; set; } = new("PushedAuthorizationRequests");

/// <summary>
/// Gets or sets a value indicating whether stale entries will be automatically cleaned up from the database.
/// This is implemented by periodically connecting to the database (according to the TokenCleanupInterval) from the hosting application.
Expand Down Expand Up @@ -68,12 +76,4 @@ public class OperationalStoreOptions: StoreOptions
/// The keys table config.
/// </value>
public TableConfiguration Keys { get; set; } = new("Keys");

/// <summary>
/// Gets or sets the pushed authorization requests table configuration.
/// </summary>
/// <value>
/// The pushed authorization requests config.
/// </value>
public TableConfiguration PushedAuthorizationRequests { get; set; } = new("PushedAuthorizationRequests");
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private async Task StoreRequest(DbContextOptions<PersistedGrantDbContext> option
DateTime storedExpires)
{
await using var context = new PersistedGrantDbContext(options, StoreOptions);
await context.Database.EnsureCreatedAsync();

context.PushedAuthorizationRequests
.Add(new PushedAuthorizationRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public async Task ProcessAsync_should_log_end_processing()

var _ = await sut.ProcessAsync(context);

logger.Verify(x => x.Log(LogLevel.Trace, It.IsAny<EventId>(), It.Is<It.IsAnyType>((v, t) => v.ToString()!.Contains("End processing pushed authorization request")), It.IsAny<Exception>(), (Func<It.IsAnyType, Exception?, string>)It.IsAny<object>()), Times.Once);
logger.Verify(x => x.Log(LogLevel.Debug, It.IsAny<EventId>(), It.Is<It.IsAnyType>((v, t) => v.ToString()!.Contains("End processing pushed authorization request")), It.IsAny<Exception>(), (Func<It.IsAnyType, Exception?, string>)It.IsAny<object>()), Times.Once);
}

[Fact]
Expand Down
Loading