Skip to content

Commit 75e707b

Browse files
authored
API docs for IIS (#26387)
1 parent 67ac167 commit 75e707b

15 files changed

+105
-6
lines changed

src/Servers/IIS/IIS/src/BadHttpRequestException.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Microsoft.AspNetCore.Server.IIS
1010
{
11+
///<inheritdoc/>
1112
[Obsolete("Moved to Microsoft.AspNetCore.Http.BadHttpRequestException")]
1213
public sealed class BadHttpRequestException : Microsoft.AspNetCore.Http.BadHttpRequestException
1314
{
@@ -17,6 +18,7 @@ internal BadHttpRequestException(string message, int statusCode, RequestRejectio
1718
Reason = reason;
1819
}
1920

21+
///<inheritdoc/>
2022
public new int StatusCode { get => base.StatusCode; }
2123

2224
internal RequestRejectionReason Reason { get; }

src/Servers/IIS/IIS/src/Core/IISServerAuthenticationHandler.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88

99
namespace Microsoft.AspNetCore.Server.IIS.Core
1010
{
11+
/// <summary>
12+
/// The default authentication handler with IIS In-Process
13+
/// </summary>
1114
public class IISServerAuthenticationHandler : IAuthenticationHandler
1215
{
1316
private HttpContext _context;
1417
private IISHttpContext _iisHttpContext;
1518

1619
internal AuthenticationScheme Scheme { get; private set; }
1720

21+
///<inheritdoc/>
1822
public Task<AuthenticateResult> AuthenticateAsync()
1923
{
2024
var user = _iisHttpContext.WindowsUser;
@@ -28,19 +32,22 @@ public Task<AuthenticateResult> AuthenticateAsync()
2832
}
2933
}
3034

35+
///<inheritdoc/>
3136
public Task ChallengeAsync(AuthenticationProperties properties)
3237
{
3338
// We would normally set the www-authenticate header here, but IIS does that for us.
3439
_context.Response.StatusCode = 401;
3540
return Task.CompletedTask;
3641
}
3742

43+
///<inheritdoc/>
3844
public Task ForbidAsync(AuthenticationProperties properties)
3945
{
4046
_context.Response.StatusCode = 403;
4147
return Task.CompletedTask;
4248
}
4349

50+
///<inheritdoc/>
4451
public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context)
4552
{
4653
_iisHttpContext = context.Features.Get<IISHttpContext>();

src/Servers/IIS/IIS/src/Core/ThrowingWasUpgradedWriteOnlyStream.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,31 @@
88

99
namespace Microsoft.AspNetCore.Server.IIS.Core
1010
{
11+
/// <summary>
12+
/// A <see cref="Stream"/> which throws on calls to write after the stream was upgraded
13+
/// </summary>
14+
/// <remarks>
15+
/// Users should not need to instantiate this class.
16+
/// </remarks>
1117
public class ThrowingWasUpgradedWriteOnlyStream : WriteOnlyStream
1218
{
19+
///<inheritdoc/>
1320
public override void Write(byte[] buffer, int offset, int count)
1421
=> throw new InvalidOperationException(CoreStrings.ResponseStreamWasUpgraded);
1522

23+
///<inheritdoc/>
1624
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
1725
=> throw new InvalidOperationException(CoreStrings.ResponseStreamWasUpgraded);
1826

27+
///<inheritdoc/>
1928
public override void Flush()
2029
=> throw new InvalidOperationException(CoreStrings.ResponseStreamWasUpgraded);
2130

31+
///<inheritdoc/>
2232
public override long Seek(long offset, SeekOrigin origin)
2333
=> throw new NotSupportedException();
2434

35+
///<inheritdoc/>
2536
public override void SetLength(long value)
2637
=> throw new NotSupportedException();
2738
}

src/Servers/IIS/IIS/src/Core/WriteOnlyStream.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,56 @@
88

99
namespace Microsoft.AspNetCore.Server.IIS.Core
1010
{
11+
/// <summary>
12+
/// A <see cref="Stream"/> which only allows for writes.
13+
/// </summary>
1114
public abstract class WriteOnlyStream : Stream
1215
{
16+
///<inheritdoc/>
1317
public override bool CanRead => false;
1418

19+
///<inheritdoc/>
1520
public override bool CanWrite => true;
1621

22+
///<inheritdoc/>
1723
public override int ReadTimeout
1824
{
1925
get => throw new NotSupportedException();
2026
set => throw new NotSupportedException();
2127
}
2228

29+
///<inheritdoc/>
2330
public override bool CanSeek => false;
2431

32+
///<inheritdoc/>
2533
public override long Length => throw new NotSupportedException();
2634

35+
///<inheritdoc/>
2736
public override long Position
2837
{
2938
get => throw new NotSupportedException();
3039
set => throw new NotSupportedException();
3140
}
3241

42+
///<inheritdoc/>
3343
public override int Read(byte[] buffer, int offset, int count)
3444
{
3545
throw new NotSupportedException();
3646
}
3747

48+
///<inheritdoc/>
3849
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
3950
{
4051
throw new NotSupportedException();
4152
}
4253

54+
///<inheritdoc/>
4355
public override long Seek(long offset, SeekOrigin origin)
4456
{
4557
throw new NotSupportedException();
4658
}
4759

60+
///<inheritdoc/>
4861
public override void SetLength(long value)
4962
{
5063
throw new NotSupportedException();

src/Servers/IIS/IIS/src/IISServerDefaults.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33

44
namespace Microsoft.AspNetCore.Server.IIS
55
{
6+
/// <summary>
7+
/// String constants used to configure IIS In-Process.
8+
/// </summary>
69
public class IISServerDefaults
710
{
11+
/// <summary>
12+
/// Default authentication scheme, which is "Windows".
13+
/// </summary>
814
public const string AuthenticationScheme = "Windows";
915
}
1016
}

src/Servers/IIS/IIS/src/IISServerOptions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace Microsoft.AspNetCore.Builder
1010
{
11+
/// <summary>
12+
/// Provides configuration for IIS In-Process.
13+
/// </summary>
1114
public class IISServerOptions
1215
{
1316
/// <summary>

src/Servers/IIS/IIS/src/Microsoft.AspNetCore.Server.IIS.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<IsAspNetCoreApp>true</IsAspNetCoreApp>
66
<PackageId>Microsoft.AspNetCore.Server.IIS</PackageId>
77
<Description>Provides support for hosting ASP.NET Core in IIS using the AspNetCoreModule.</Description>
8-
<NoWarn>$(NoWarn);CS1591</NoWarn>
98
<GenerateDocumentationFile>true</GenerateDocumentationFile>
109
<PackageTags>aspnetcore;iis</PackageTags>
1110
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1211
<NativeAssetsTargetFramework>$(DefaultNetCoreTargetFramework)</NativeAssetsTargetFramework>
1312
<IsPackable>false</IsPackable>
1413

1514
<!-- Ignore platform compatibility warnings for this project. We know this only works on windows.-->
15+
<NoWarn>$(NoWarn.Replace('1591', ''))</NoWarn>
1616
<NoWarn>$(NoWarn);CA1416</NoWarn>
1717
</PropertyGroup>
1818

src/Servers/IIS/IIS/src/WebHostBuilderIISExtensions.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212

1313
namespace Microsoft.AspNetCore.Hosting
1414
{
15+
/// <summary>
16+
/// Extension methods for the IIS In-Process.
17+
/// </summary>
1518
public static class WebHostBuilderIISExtensions
1619
{
1720
/// <summary>
1821
/// Configures the port and base path the server should listen on when running behind AspNetCoreModule.
1922
/// The app will also be configured to capture startup errors.
2023
/// </summary>
21-
/// <param name="hostBuilder"></param>
22-
/// <returns></returns>
24+
/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param>
25+
/// <returns>The <see cref="IWebHostBuilder"/>.</returns>
2326
public static IWebHostBuilder UseIIS(this IWebHostBuilder hostBuilder)
2427
{
2528
if (hostBuilder == null)

src/Servers/IIS/IISIntegration/src/IISDefaults.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,22 @@
33

44
namespace Microsoft.AspNetCore.Server.IISIntegration
55
{
6+
/// <summary>
7+
/// String constants used to configure IIS Out-Of-Process.
8+
/// </summary>
69
public class IISDefaults
710
{
11+
/// <summary>
12+
/// Default authentication scheme, which is "Windows".
13+
/// </summary>
814
public const string AuthenticationScheme = "Windows";
15+
/// <summary>
16+
/// Default negotiate string, which is "Negotiate".
17+
/// </summary>
918
public const string Negotiate = "Negotiate";
19+
/// <summary>
20+
/// Default NTLM string, which is "NTLM".
21+
/// </summary>
1022
public const string Ntlm = "NTLM";
1123
}
1224
}

src/Servers/IIS/IISIntegration/src/IISHostingStartup.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@
77

88
namespace Microsoft.AspNetCore.Server.IISIntegration
99
{
10+
/// <summary>
11+
/// The <see cref="IHostingStartup"/> to add IISIntegration to apps.
12+
/// </summary>
13+
/// <remarks>
14+
/// This API isn't meant to be used by user code.
15+
/// </remarks>
1016
public class IISHostingStartup : IHostingStartup
1117
{
18+
/// <summary>
19+
/// Adds IISIntegration into the middleware pipeline.
20+
/// </summary>
21+
/// <param name="builder">The <see cref="IWebHostBuilder"/>.</param>
1222
public void Configure(IWebHostBuilder builder)
1323
{
1424
builder.UseIISIntegration();

0 commit comments

Comments
 (0)