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

@@ -23,6 +23,7 @@ using MareSynchronosServer.Services;
using System.Net.Http;
using MareSynchronosServer.Utils;
using MareSynchronosServer.RequirementHandlers;
using MareSynchronosShared.Services;
namespace MareSynchronosServer;
@@ -119,8 +120,10 @@ public class Startup
};
});
services.AddSingleton<GrpcAuthenticationService>();
services.AddSingleton<GrpcClientIdentificationService>();
services.AddTransient<IAuthorizationHandler, UserRequirementHandler>();
services.AddHostedService(p => p.GetService<GrpcAuthenticationService>());
services.AddHostedService(p => p.GetService<GrpcClientIdentificationService>());
services.AddDbContextPool<MareDbContext>(options =>