-
Notifications
You must be signed in to change notification settings - Fork 10.4k
AuthorizeHelper will no-op if endpoint routing is used #10471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4cd8a50
c7975b9
ffd7c57
f5065ee
ad335be
3f615f0
e42a014
c85d231
e951d28
2c6094b
e4555a5
943e59b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,6 @@ | |
|
||
using System; | ||
using Microsoft.AspNetCore.Http.Connections; | ||
using Microsoft.AspNetCore.Http.Connections.Internal; | ||
using Microsoft.AspNetCore.Routing; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Microsoft.AspNetCore.Builder | ||
{ | ||
|
@@ -16,25 +13,29 @@ public static class ConnectionsAppBuilderExtensions | |
{ | ||
/// <summary> | ||
/// Adds support for ASP.NET Core Connection Handlers to the <see cref="IApplicationBuilder"/> request execution pipeline. | ||
/// <para> | ||
/// This method is obsolete and will be removed in a future version. | ||
/// The recommended alternative is to use MapConnections or MapConnectionHandler<TConnectionHandler> inside Microsoft.AspNetCore.Builder.UseEndpoints(...). | ||
/// </para> | ||
/// </summary> | ||
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param> | ||
/// <param name="configure">A callback to configure connection routes.</param> | ||
/// <returns>The same instance of the <see cref="IApplicationBuilder"/> for chaining.</returns> | ||
[Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is to use MapConnections or MapConnectionHandler<TConnectionHandler> inside Microsoft.AspNetCore.Builder.UseEndpoints(...).")] | ||
public static IApplicationBuilder UseConnections(this IApplicationBuilder app, Action<ConnectionsRouteBuilder> configure) | ||
{ | ||
if (configure == null) | ||
{ | ||
throw new ArgumentNullException(nameof(configure)); | ||
} | ||
|
||
var dispatcher = app.ApplicationServices.GetRequiredService<HttpConnectionDispatcher>(); | ||
|
||
var routes = new RouteBuilder(app); | ||
|
||
configure(new ConnectionsRouteBuilder(routes, dispatcher)); | ||
|
||
app.UseWebSockets(); | ||
app.UseRouter(routes.Build()); | ||
app.UseRouting(); | ||
app.UseAuthorization(); | ||
app.UseEndpoints(endpoints => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @davidfowl And side-effect, I believe will allow apps that port to 3.0 but don't change to endpoints to use the service automagically without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This to me seems super spicy. Does it make sense to deprecate this API now that it's literally equivalent to something else? It's goodness if we can converge all of the code that we show in samples/docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be ok deprecating the old stuff There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm OK marking There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be obsoleting: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. |
||
{ | ||
configure(new ConnectionsRouteBuilder(endpoints)); | ||
}); | ||
return app; | ||
} | ||
} | ||
|
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.