ReportingApi
The Reporting HTTP API: report listing, metadata, execution and export, guarded by Gatekeeper bearer authentication. Shared by the host and its E2E tests. Implements [REPORT-SECURITY] and [REPORT-AUTH-BEARER].
public static class ReportingApi
Methods
AddReportingApi(IServiceCollection)
public static IServiceCollection AddReportingApi(this IServiceCollection services)
Registers camelCase JSON and the report viewer CORS policy.
Parameters:
| Name | Type | Description |
|---|---|---|
services |
IServiceCollection |
The service collection. |
Returns: IServiceCollection - The same service collection.
UseReportingBearerAuth(IApplicationBuilder, IConfiguration, ILogger)
public static IApplicationBuilder UseReportingBearerAuth(this IApplicationBuilder app, IConfiguration configuration, ILogger logger)
Rejects every /api request without a valid Gatekeeper bearer token with 401.
Must run after CORS (so preflights succeed) and before the endpoints.
Parameters:
| Name | Type | Description |
|---|---|---|
app |
IApplicationBuilder |
The application builder. |
configuration |
IConfiguration |
Configuration holding Jwt:SigningKey. |
logger |
ILogger |
Logger for rejected requests. |
Returns: IApplicationBuilder - The same application builder.
MapReportingApi(IEndpointRouteBuilder, IConfiguration, ILogger)
public static RouteGroupBuilder MapReportingApi(this IEndpointRouteBuilder endpoints, IConfiguration configuration, ILogger logger)
Maps the /api/reports endpoints over the configured reports and connections.
Parameters:
| Name | Type | Description |
|---|---|---|
endpoints |
IEndpointRouteBuilder |
The endpoint route builder. |
configuration |
IConfiguration |
Configuration with ReportsDirectory and connections. |
logger |
ILogger |
Logger for report loading and execution. |
Returns: RouteGroupBuilder - The report route group.
Values
| Name | Description |
|---|---|
CorsPolicy |
CORS policy name used by the report viewer. |