Add networking foundation — 9-project C# solution (compiles clean)
Implements the modular networking layer for SOR Server: - SOR.Networking.Abstractions: pure interfaces (ITransport, IClientConnection, IMessageSerializer, IMessageDispatcher, IMessageHandler, IEventBus, IClientPush) - SOR.Networking.WebSocket: ITransport + IClientConnection over System.Net.WebSockets - SOR.Networking.Nats: IEventBus over NATS.Net (INatsConnection) - SOR.Networking.Redis: IClientPush over Redis Pub/Sub - SOR.Shared: ServiceResult<T>, RedisKeys, NatsSubjects, ServerMessage, JSON serializer - SOR.Shared.Proto: auth.proto with gRPC AuthService contract - SOR.Gateway: accept loop, auth handshake, dispatcher, Redis push subscriber - SOR.Auth: stub gRPC handler (placeholder responses) - SOR.Host: multi-service runner via ENABLED_SERVICES env var; wires all DI All concrete implementations are wired exclusively in SOR.Host — every transport, broker, and push implementation can be swapped by changing only Program.cs. dotnet build SOR.slnx → 0 errors, 0 warnings Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
namespace SOR.Auth;
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
/// <summary>
|
||||
/// Registers Auth service dependencies in the DI container.
|
||||
///
|
||||
/// STATUS: Foundation stub only.
|
||||
/// Real registration (DbContext, repositories, IAuthService) will be added
|
||||
/// when Auth business logic is implemented.
|
||||
///
|
||||
/// Currently only registers the gRPC infrastructure so the handler can be
|
||||
/// mapped in SOR.Host.Program.cs via app.MapGrpcService{AuthGrpcHandler}().
|
||||
/// </summary>
|
||||
public static class ServiceRegistration
|
||||
{
|
||||
public static IServiceCollection AddAuthService(
|
||||
this IServiceCollection services,
|
||||
IConfiguration configuration)
|
||||
{
|
||||
// AddGrpc() registers the gRPC server infrastructure in ASP.NET Core.
|
||||
// Required before MapGrpcService{T} can be called in Program.cs.
|
||||
// Safe to call multiple times — ASP.NET Core deduplicates registrations.
|
||||
services.AddGrpc();
|
||||
|
||||
// TODO (when implementing Auth business logic):
|
||||
// services.Configure<AuthOptions>(configuration.GetSection("Auth"));
|
||||
// services.AddDbContext<AuthDbContext>(opts => opts.UseNpgsql(...));
|
||||
// services.AddScoped<IAuthRepository, AuthRepository>();
|
||||
// services.AddScoped<IAuthService, AuthService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user