Authorization handler that allows anonymous access to all endpoints in the Development environment.
Remarks: This handler bypasses authorization requirements when both the application is in Development mode and
Atc.Rest.Options.RestApiOptions.AllowAnonymousAccessForDevelopmentis enabled.
public class AllowAnonymousAccessForDevelopmentHandler : IAuthorizationHandler
Task HandleAsync(AuthorizationHandlerContext context)Summary: Handles authorization by succeeding all pending requirements in Development mode.
Parameters:
context- The authorization handler context.Returns: A task representing the asynchronous operation.
Extension methods for Microsoft.AspNetCore.Routing.IEndpointRouteBuilder to map API specification and assembly information endpoints.
public static class EndpointRouteBuilderExExtensions
void MapApiAssemblyInformations(this IEndpointRouteBuilder endpoints, string pattern)Summary: Maps an endpoint to serve assembly information for all loaded assemblies in the current application domain.
Parameters:
endpoints- The endpoint route builder.
pattern- The URL pattern for the endpoint. Defaults to /assembly-informations if null or empty.Remarks: The endpoint is tagged with "API-Management" and allows anonymous access. Returns a JSON array of assembly information including name, version, and other metadata.
void MapApiManagementAssemblyInformations(this IEndpointRouteBuilder endpoints)Summary: Maps an endpoint at /management/assembly-informations to serve assembly information.
Parameters:
endpoints- The endpoint route builder.
void MapApiSpecificationEndpoint(this IEndpointRouteBuilder endpoints, List<AssemblyPairOptions> assemblyPairs)Summary: Maps endpoints for serving OpenAPI specification YAML files from embedded assembly resources.
Parameters:
endpoints- The endpoint route builder.
assemblyPairs- The list of assembly pairs containing API specifications.Remarks: This method creates an endpoint for each assembly's embedded YAML specification and a summary endpoint at /ApiSpecifications that returns a list of all available specification URLs. The YAML files are cached in memory for performance.