Skip to content

Latest commit

 

History

History
72 lines (60 loc) · 3.17 KB

File metadata and controls

72 lines (60 loc) · 3.17 KB

Atc.Rest.Extensions


AllowAnonymousAccessForDevelopmentHandler

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.AllowAnonymousAccessForDevelopment is enabled.

public class AllowAnonymousAccessForDevelopmentHandler : IAuthorizationHandler

Methods

HandleAsync

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.


EndpointRouteBuilderExExtensions

Extension methods for Microsoft.AspNetCore.Routing.IEndpointRouteBuilder to map API specification and assembly information endpoints.

public static class EndpointRouteBuilderExExtensions

Static Methods

MapApiAssemblyInformations

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.

MapApiManagementAssemblyInformations

void MapApiManagementAssemblyInformations(this IEndpointRouteBuilder endpoints)

Summary: Maps an endpoint at /management/assembly-informations to serve assembly information.

Parameters:
     endpoints  -  The endpoint route builder.

MapApiSpecificationEndpoint

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.


Generated by MarkdownCodeDoc version 1.2