-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add API for Kestrel named pipes transport #44612
Comments
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API Review Notes:
namespace Microsoft.AspNetCore.Connections.Features;
+ public interface IConnectionNamedPipeFeature
+ {
+ NamedPipeServerStream NamedPipe { get; }
+ }
+ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes;
+ public sealed class NamedPipeTransportOptions
+ {
+ public long? MaxReadBufferSize { get; set; } = 1024 * 1024;
+ public long? MaxWriteBufferSize { get; set; } = 64 * 1024;
+ public bool CurrentUserOnly { get; set; } = true;
+ public PipeSecurity? PipeSecurity { get; set; }
+ }
namespace Microsoft.Extensions.DependencyInjection;
+ public static class ServiceCollectionNamedPipeExtensions
+ {
+ public static IServiceCollection AddNamedPipesTransport(this IServiceCollection services);
+ public static IServiceCollection AddNamedPipesTransport(this IServiceCollection services, Action<NamedPipeTransportOptions> configureOptions);
+ }
namespace Microsoft.AspNetCore.Server.Kestrel.Core;
public class KestrelServerOptions
{
+ public void ListenNamedPipe(string pipeName);
+ public void ListenNamedPipe(string pipeName, Action<ListenOptions> configure);
} |
Feedback from @JamesNK
And.
namespace Microsoft.AspNetCore.Connections;
+ public sealed class NamedPipeEndPoint : EndPoint
+ {
+ // A server name of "." refers to the local machine.
+ public NamedPipeEndPoint(string pipeName) : this(pipeName, serverName: ".");
+ public NamedPipeEndPoint(string pipeName, string serverName);
+ public string ServerName { get; }
+ public string PipeName { get; }
+ }
|
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API review notes:
API Approved! Again! namespace Microsoft.AspNetCore.Connections.Features;
+ public interface IConnectionNamedPipeFeature
+ {
+ NamedPipeServerStream NamedPipe { get; }
+ }
+ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes;
+ public sealed class NamedPipeTransportOptions
+ {
+ public long? MaxReadBufferSize { get; set; } = 1024 * 1024;
+ public long? MaxWriteBufferSize { get; set; } = 64 * 1024;
+ public bool CurrentUserOnly { get; set; } = true;
+ public PipeSecurity? PipeSecurity { get; set; }
+ }
namespace Microsoft.AspNetCore.Hosting;
public static class WebHostBuilderNamedPipeExtensions
{
+ public static IWebHostBuilder UseNamedPipes(this IWebHostBuilder hostBuilder);
+ public static IWebHostBuilder UseNamedPipes(this IWebHostBuilder hostBuilder, Action<NamedPipeTransportOptions> configureOptions);
}
namespace Microsoft.AspNetCore.Server.Kestrel.Core;
public class KestrelServerOptions
{
+ public void ListenNamedPipe(string pipeName);
+ public void ListenNamedPipe(string pipeName, Action<ListenOptions> configure);
}
public class ListenOptions
{
+ public string? PipeName { get; }
}
// Microsoft.AspNetCore.Connections.Abstractions.dll
namespace Microsoft.AspNetCore.Connections;
+ public sealed class NamedPipeEndPoint : EndPoint
+ {
+ // A server name of "." refers to the local machine.
+ public NamedPipeEndPoint(string pipeName) : this(pipeName, serverName: ".");
+ public NamedPipeEndPoint(string pipeName, string serverName);
+ public string ServerName { get; }
+ public string PipeName { get; }
+ } |
@JamesNK can this be closed? |
Background and Motivation
Public API for named pipes transport - #44426
The transport is still work-in-progress. This API issue reflects its ideal final API shape, not the PR's current state.
Proposed API
Feature to get the server stream of the name pipe connection. Used to access methods like
GetImpersonatedUser
andRunAs
from the pipe. Similar toIConnectionSocketFeature
.Options type for named pipes transport. Similar to
SocketTransportOptions
.Extension methods to register named pipes services and/or customize options.
New methods on KestrelServerOptions to register listener. There isn't a public
NamedPipeEndPoint
to pass toListen(EndPoint)
so these methods will be the only way to listen for a named pipe.Usage Examples
Alternative Designs
Risks
The text was updated successfully, but these errors were encountered: