do sessions in memory and also fix glaring security hole

This commit is contained in:
john 2025-06-01 23:28:00 +02:00
parent 7b6c155a73
commit f48b421500
31 changed files with 441 additions and 440 deletions

View file

@ -3,19 +3,24 @@ using Microsoft.Extensions.Logging;
namespace Femto.Common;
/// <summary>
/// We use this to bind a scope to the request scope in the composition root
/// Any scoped services provided by this subcontainer should be accessed via a ScopeBinding injected in the host
/// </summary>
/// <param name="scope"></param>
public class ScopeBinding<T>(IServiceScope scope) : IDisposable
where T : notnull
public class ScopeBinding(IServiceScope scope) : IDisposable
{
public T GetService() {
return scope.ServiceProvider.GetRequiredService<T>();
private IServiceScope Scope { get; } = scope;
public T GetService<T>()
where T : notnull
{
return this.Scope.ServiceProvider.GetRequiredService<T>();
}
public void Dispose() {
scope.Dispose();
public virtual void Dispose()
{
this.Scope.Dispose();
}
}