Switch Authentication to asynchronous streaming calls (#16)

* add base grpc service and swap auth service to streaming

* remove Authorize from hub itself

* remove unused usings

* heave files server to net 7, add exception handling in grpc auth stream

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
rootdarkarchon
2022-10-13 16:55:23 +02:00
committed by GitHub
parent d37c1208fe
commit c98e2b2dd6
20 changed files with 313 additions and 159 deletions

View File

@@ -3,6 +3,7 @@ using MareSynchronosShared.Authentication;
using MareSynchronosShared.Data;
using MareSynchronosShared.Metrics;
using MareSynchronosShared.Protos;
using MareSynchronosShared.Services;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
@@ -47,6 +48,7 @@ public class Startup
}
};
services.AddSingleton<GrpcAuthenticationService>();
services.AddSingleton(new MareMetrics(new List<string> {
}, new List<string>
{
@@ -72,6 +74,7 @@ public class Startup
}, mareSettings.GetValue("DbContextPoolSize", 1024));
services.AddHostedService<CleanupService>();
services.AddHostedService(p => p.GetService<GrpcAuthenticationService>());
services.AddAuthentication(options =>
{