Add API docs to healthchecks and CORS (#26416)
* Add API docs to healthchecks and CORS * Clean up * Missing docs
This commit is contained in:
parent
0e5d7ef1d4
commit
792df8a4c2
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
namespace Microsoft.Extensions.Diagnostics.HealthChecks
|
||||
{
|
||||
/// <summary>
|
||||
/// Health check context. Provides health check registrations to <see cref="IHealthCheck.CheckHealthAsync(HealthCheckContext, System.Threading.CancellationToken)"/>.
|
||||
/// </summary>
|
||||
public sealed class HealthCheckContext
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck
|
|||
<RootNamespace>Microsoft.Extensions.Diagnostics.HealthChecks</RootNamespace>
|
||||
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
|
||||
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>diagnostics;healthchecks</PackageTags>
|
||||
<IsAspNetCoreApp>true</IsAspNetCoreApp>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ namespace Microsoft.Extensions.Diagnostics.HealthChecks
|
|||
private TimeSpan _delay;
|
||||
private TimeSpan _period;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="HealthCheckPublisherOptions"/>.
|
||||
/// </summary>
|
||||
public HealthCheckPublisherOptions()
|
||||
{
|
||||
_delay = TimeSpan.FromSeconds(5);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Microsoft.Extensions.Diagnostics.HealthChecks.IHealthChecksBuilder
|
|||
</Description>
|
||||
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
|
||||
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>diagnostics;healthchecks</PackageTags>
|
||||
<IsAspNetCoreApp>true</IsAspNetCoreApp>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ namespace Microsoft.AspNetCore.Cors
|
|||
/// </summary>
|
||||
public class CorsPolicyMetadata : ICorsPolicyMetadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="CorsPolicyMetadata"/> using the specified policy.
|
||||
/// </summary>
|
||||
/// <param name="policy">The policy which needs to be applied.</param>
|
||||
public CorsPolicyMetadata(CorsPolicy policy)
|
||||
{
|
||||
Policy = policy;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ namespace Microsoft.AspNetCore.Cors.Infrastructure
|
|||
internal IDictionary<string, (CorsPolicy policy, Task<CorsPolicy> policyTask)> PolicyMap { get; }
|
||||
= new Dictionary<string, (CorsPolicy, Task<CorsPolicy>)>(StringComparer.Ordinal);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default policy name.
|
||||
/// </summary>
|
||||
public string DefaultPolicyName
|
||||
{
|
||||
get => _defaultPolicyName;
|
||||
|
|
|
|||
|
|
@ -139,11 +139,23 @@ namespace Microsoft.AspNetCore.Cors.Infrastructure
|
|||
AddHeaderValues(result.AllowedHeaders, allowedHeaders);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Evaluate a request using the specified policy. The result is set on the specified <see cref="CorsResult"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="context">The current HTTP context.</param>
|
||||
/// <param name="policy">The <see cref="CorsPolicy"/> to evaluate.</param>
|
||||
/// <param name="result">The <see cref="CorsResult"/> to set the result on.</param>
|
||||
public virtual void EvaluateRequest(HttpContext context, CorsPolicy policy, CorsResult result)
|
||||
{
|
||||
PopulateResult(context, policy, result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Evaluate a preflight request using the specified policy. The result is set on the specified <see cref="CorsResult"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="context">The current HTTP context.</param>
|
||||
/// <param name="policy">The <see cref="CorsPolicy"/> to evaluate.</param>
|
||||
/// <param name="result">The <see cref="CorsResult"/> to set the result on.</param>
|
||||
public virtual void EvaluatePreflightRequest(HttpContext context, CorsPolicy policy, CorsResult result)
|
||||
{
|
||||
PopulateResult(context, policy, result);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Microsoft.AspNetCore.Cors.DisableCorsAttribute
|
|||
Microsoft.AspNetCore.Cors.EnableCorsAttribute</Description>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<IsAspNetCoreApp>true</IsAspNetCoreApp>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;cors</PackageTags>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
|
@ -13,6 +12,9 @@ using Microsoft.Extensions.Diagnostics.HealthChecks;
|
|||
|
||||
namespace Microsoft.Extensions.DependencyInjection
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="IHealthChecksBuilder"/> extension methods for Entity Framework Core.
|
||||
/// </summary>
|
||||
public static class EntityFrameworkCoreHealthChecksBuilderExtensions
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
Components for performing health checks using EntityFrameworkCore.
|
||||
</Description>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>diagnostics;healthchecks;entityframeworkcore</PackageTags>
|
||||
<BaseNamespace>Microsoft.Extensions.Diagnostics.HealthChecks</BaseNamespace>
|
||||
|
|
|
|||
|
|
@ -12,12 +12,18 @@ using Microsoft.Net.Http.Headers;
|
|||
|
||||
namespace Microsoft.AspNetCore.Diagnostics.HealthChecks
|
||||
{
|
||||
/// <summary>
|
||||
/// Middleware that exposes a health checks response with a URL endpoint.
|
||||
/// </summary>
|
||||
public class HealthCheckMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
private readonly HealthCheckOptions _healthCheckOptions;
|
||||
private readonly HealthCheckService _healthCheckService;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="HealthCheckMiddleware"/>.
|
||||
/// </summary>
|
||||
public HealthCheckMiddleware(
|
||||
RequestDelegate next,
|
||||
IOptions<HealthCheckOptions> healthCheckOptions,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core middleware for returning the results of Health Checks in the application</Description>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<IsAspNetCoreApp>true</IsAspNetCoreApp>
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>diagnostics;healthchecks</PackageTags>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
|
|
|||
Loading…
Reference in New Issue