Skip to content

Commit 8118a25

Browse files
authored
Add API ref docs for HTTPSys (#26649)
* Add API ref docs for HTTPSys * Spacing * Feedback
1 parent 8f17d4a commit 8118a25

10 files changed

+108
-1
lines changed

src/Servers/HttpSys/src/AuthenticationSchemes.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,39 @@
55

66
namespace Microsoft.AspNetCore.Server.HttpSys
77
{
8-
// REVIEW: this appears to be very similar to System.Net.AuthenticationSchemes
8+
/// <summary>
9+
/// Specifies protocols for authentication.
10+
/// </summary>
911
[Flags]
1012
public enum AuthenticationSchemes
1113
{
14+
/// <summary>
15+
/// No authentication is enabled. This should only be used when HttpSysOptions.Authentication.AllowAnonymous is enabled (see <see cref="AuthenticationManager.AllowAnonymous"/>).
16+
/// </summary>
1217
None = 0x0,
18+
19+
/// <summary>
20+
/// Specifies basic authentication.
21+
/// </summary>
1322
Basic = 0x1,
23+
24+
1425
// Digest = 0x2, // TODO: Verify this is no longer supported by Http.Sys
26+
27+
/// <summary>
28+
/// Specifies NTLM authentication.
29+
/// </summary>
1530
NTLM = 0x4,
31+
32+
/// <summary>
33+
/// Negotiates with the client to determine the authentication scheme. If both client and server support Kerberos, it is used;
34+
/// otherwise, NTLM is used.
35+
/// </summary>
1636
Negotiate = 0x8,
37+
38+
/// <summary>
39+
/// Specifies Kerberos authentication.
40+
/// </summary>
1741
Kerberos = 0x10
1842
}
1943
}

src/Servers/HttpSys/src/DelegationRule.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ internal DelegationRule(string queueName, string urlPrefix, ILogger logger)
3131
Queue = new RequestQueue(queueName, UrlPrefix, _logger, receiver: true);
3232
}
3333

34+
/// <inheritdoc />
3435
public void Dispose()
3536
{
3637
Queue.UrlGroup?.Dispose();

src/Servers/HttpSys/src/HttpSysDefaults.cs

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

44
namespace Microsoft.AspNetCore.Server.HttpSys
55
{
6+
/// <summary>
7+
/// Constants for HttpSys.
8+
/// </summary>
69
public static class HttpSysDefaults
710
{
811
/// <summary>

src/Servers/HttpSys/src/HttpSysException.cs

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

99
namespace Microsoft.AspNetCore.Server.HttpSys
1010
{
11+
/// <summary>
12+
/// Exception thrown by HttpSys when an error occurs
13+
/// </summary>
1114
[SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable")]
1215
public class HttpSysException : Win32Exception
1316
{
@@ -28,6 +31,7 @@ internal HttpSysException(int errorCode, string message)
2831

2932
// the base class returns the HResult with this property
3033
// we need the Win32 Error Code, hence the override.
34+
/// <inheritdoc />
3135
public override int ErrorCode
3236
{
3337
get

src/Servers/HttpSys/src/HttpSysOptions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Microsoft.AspNetCore.Server.HttpSys
99
{
10+
/// <summary>
11+
/// Contains the options used by HttpSys.
12+
/// </summary>
1013
public class HttpSysOptions
1114
{
1215
private const uint MaximumRequestQueueNameLength = 260;
@@ -26,6 +29,9 @@ public class HttpSysOptions
2629
private long? _maxRequestBodySize = DefaultMaxRequestBodySize;
2730
private string _requestQueueName;
2831

32+
/// <summary>
33+
/// Initializes a new <see cref="HttpSysOptions"/>.
34+
/// </summary>
2935
public HttpSysOptions()
3036
{
3137
}

src/Servers/HttpSys/src/IHttpSysRequestDelegationFeature.cs

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

44
namespace Microsoft.AspNetCore.Server.HttpSys
55
{
6+
/// <summary>
7+
/// Interface for delegating requests to other Http.Sys request queues.
8+
/// </summary>
69
public interface IHttpSysRequestDelegationFeature
710
{
811
/// <summary>
@@ -15,6 +18,7 @@ public interface IHttpSysRequestDelegationFeature
1518
/// must not be read nor the response started before this is invoked. Check <see cref="CanDelegate"/>
1619
/// before invoking.
1720
/// </summary>
21+
/// <param name="destination">The rule maintaining the handle to the destination queue.</param>
1822
void DelegateRequest(DelegationRule destination);
1923
}
2024
}

src/Servers/HttpSys/src/IServerDelegationFeature.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33

44
namespace Microsoft.AspNetCore.Server.HttpSys
55
{
6+
/// <summary>
7+
/// This exposes the creation of delegation rules on request queues owned by the server.
8+
/// </summary>
69
public interface IServerDelegationFeature
710
{
811
/// <summary>
912
/// Create a delegation rule on request queue owned by the server.
1013
/// </summary>
14+
/// <param name="queueName">The name of the Http.Sys request queue.</param>
15+
/// <param name="urlPrefix">The URL of the Http.Sys Url Prefix.</param>
1116
/// <returns>
1217
/// Creates a <see cref="DelegationRule"/> that can used to delegate individual requests.
1318
/// </returns>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

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

1718
<ItemGroup>

src/Servers/HttpSys/src/UrlPrefix.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Microsoft.AspNetCore.Server.HttpSys
99
{
10+
/// <summary>
11+
/// A set of URL parameters used to listen for incoming requests.
12+
/// </summary>
1013
public class UrlPrefix
1114
{
1215
private UrlPrefix(bool isHttps, string scheme, string host, string port, int portValue, string path)
@@ -94,6 +97,10 @@ public static UrlPrefix Create(string scheme, string host, int? portValue, strin
9497
return new UrlPrefix(isHttps, scheme, host, port, portValue.Value, path);
9598
}
9699

100+
/// <summary>
101+
/// http://msdn.microsoft.com/en-us/library/windows/desktop/aa364698(v=vs.85).aspx
102+
/// </summary>
103+
/// <param name="prefix">The string that the <see cref="UrlPrefix"/> will be created from.</param>
97104
public static UrlPrefix Create(string prefix)
98105
{
99106
string scheme = null;
@@ -146,26 +153,58 @@ public static UrlPrefix Create(string prefix)
146153
return Create(scheme, host, port, path);
147154
}
148155

156+
/// <summary>
157+
/// Gets a value that determines if the prefix's scheme is HTTPS.
158+
/// </summary>
149159
public bool IsHttps { get; }
160+
161+
/// <summary>
162+
/// Gets the scheme used by the prefix.
163+
/// </summary>
150164
public string Scheme { get; }
165+
166+
/// <summary>
167+
/// Gets the host domain name used by the prefix.
168+
/// </summary>
151169
public string Host { get; }
170+
171+
/// <summary>
172+
/// Gets a string representation of the port used by the prefix.
173+
/// </summary>
152174
public string Port { get; }
175+
153176
internal string HostAndPort { get; }
177+
178+
/// <summary>
179+
/// Gets an integer representation of the port used by the prefix.
180+
/// </summary>
154181
public int PortValue { get; }
182+
183+
/// <summary>
184+
/// Gets the path component of the prefix.
185+
/// </summary>
155186
public string Path { get; }
187+
156188
internal string PathWithoutTrailingSlash { get; }
189+
190+
/// <summary>
191+
/// Gets a string representation of the prefix
192+
/// </summary>
157193
public string FullPrefix { get; }
158194

195+
/// <inheritdoc />
159196
public override bool Equals(object obj)
160197
{
161198
return string.Equals(FullPrefix, Convert.ToString(obj), StringComparison.OrdinalIgnoreCase);
162199
}
163200

201+
/// <inheritdoc />
164202
public override int GetHashCode()
165203
{
166204
return StringComparer.OrdinalIgnoreCase.GetHashCode(FullPrefix);
167205
}
168206

207+
/// <inheritdoc />
169208
public override string ToString()
170209
{
171210
return FullPrefix;

src/Servers/HttpSys/src/UrlPrefixCollection.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ internal UrlPrefixCollection()
3030
{
3131
}
3232

33+
/// <inheritdoc />
3334
public int Count
3435
{
3536
get
@@ -41,16 +42,27 @@ public int Count
4142
}
4243
}
4344

45+
/// <summary>
46+
/// Gets a value that determines if this collection is readOnly.
47+
/// </summary>
4448
public bool IsReadOnly
4549
{
4650
get { return false; }
4751
}
4852

53+
/// <summary>
54+
/// Creates a <see cref="UrlPrefix"/> from the given string, and adds it to this collection.
55+
/// </summary>
56+
/// <param name="prefix">The string representing the <see cref="UrlPrefix"/> to add to this collection.</param>
4957
public void Add(string prefix)
5058
{
5159
Add(UrlPrefix.Create(prefix));
5260
}
5361

62+
/// <summary>
63+
/// Adds a <see cref="UrlPrefix"/> to this collection.
64+
/// </summary>
65+
/// <param name="item">The prefix to add to this collection.</param>
5466
public void Add(UrlPrefix item)
5567
{
5668
lock (_prefixes)
@@ -98,6 +110,7 @@ internal bool TryMatchLongestPrefix(bool isHttps, string host, string originalPa
98110
return found;
99111
}
100112

113+
/// <inheritdoc />
101114
public void Clear()
102115
{
103116
lock (_prefixes)
@@ -110,6 +123,7 @@ public void Clear()
110123
}
111124
}
112125

126+
/// <inheritdoc />
113127
public bool Contains(UrlPrefix item)
114128
{
115129
lock (_prefixes)
@@ -118,6 +132,7 @@ public bool Contains(UrlPrefix item)
118132
}
119133
}
120134

135+
/// <inheritdoc />
121136
public void CopyTo(UrlPrefix[] array, int arrayIndex)
122137
{
123138
lock (_prefixes)
@@ -126,11 +141,13 @@ public void CopyTo(UrlPrefix[] array, int arrayIndex)
126141
}
127142
}
128143

144+
/// <inheritdoc />
129145
public bool Remove(string prefix)
130146
{
131147
return Remove(UrlPrefix.Create(prefix));
132148
}
133149

150+
/// <inheritdoc />
134151
public bool Remove(UrlPrefix item)
135152
{
136153
lock (_prefixes)
@@ -156,6 +173,9 @@ public bool Remove(UrlPrefix item)
156173
}
157174
}
158175

176+
/// <summary>
177+
/// Returns an enumerator that iterates through this collection.
178+
/// </summary>
159179
public IEnumerator<UrlPrefix> GetEnumerator()
160180
{
161181
lock (_prefixes)

0 commit comments

Comments
 (0)