Files
ScadaBridge/src/ScadaLink.InboundAPI/ServiceCollectionExtensions.cs
T

24 lines
858 B
C#

using Microsoft.Extensions.DependencyInjection;
namespace ScadaLink.InboundAPI;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddInboundAPI(this IServiceCollection services)
{
services.AddScoped<ApiKeyValidator>();
services.AddSingleton<InboundScriptExecutor>();
services.AddScoped<RouteHelper>();
// InboundAPI-017: routed calls go through the IInstanceRouter seam; the
// production implementation delegates to CommunicationService.
services.AddScoped<IInstanceRouter, CommunicationServiceInstanceRouter>();
// InboundAPI-006 / InboundAPI-008: endpoint filter enforcing the request
// body size cap and active-node gating for POST /api/{methodName}.
services.AddSingleton<InboundApiEndpointFilter>();
return services;
}
}