Skip to content
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

[Epic]: Implement Rate Limiting Middleware in aspnetcore #37384

Closed
Tracked by #37380
rafikiassumani-msft opened this issue Oct 8, 2021 · 4 comments
Closed
Tracked by #37380

[Epic]: Implement Rate Limiting Middleware in aspnetcore #37384

rafikiassumani-msft opened this issue Oct 8, 2021 · 4 comments
Assignees
Labels
api-approved API was approved in API review, it can be implemented area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware feature-rate-limit Work related to use of rate limit primitives Priority:0 Work that we can't release without
Milestone

Comments

@rafikiassumani-msft
Copy link
Contributor

rafikiassumani-msft commented Oct 8, 2021

  • Review current implementation in aspnetlabs
  • Ensure the middleware will work for YARP
  • Release the middleware to get feedback

API Proposal:

namespace Microsoft.AspNetCore.RateLimiting
{
    public sealed class RateLimitingOptions
    {
        public PartitionedRateLimiter<HttpContext> Limiter { get; set; }
        public Func<HttpContext, RateLimitLease, Task> OnRejected { get; set; }
        public HttpStatusCode RejectionStatusCode { get; set; }
    }

    public static class RateLimitingExtensions
    {
        public static IApplicationBuilder UseRateLimiting(this IApplicationBuilder app)
    }

    public static class RateLimitingServicesExtensions
    {
        public static IServiceCollection ConfigureRateLimiting(this IServiceCollection services, Action<RateLimitingOptions> configureOptions)
    }
}
@rafikiassumani-msft rafikiassumani-msft added area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels feature-rate-limit Work related to use of rate limit primitives labels Oct 8, 2021
@rafikiassumani-msft rafikiassumani-msft added this to the .NET 7 Planning milestone Oct 8, 2021
@rafikiassumani-msft rafikiassumani-msft changed the title Implement RateLimiting Middleware in aspnetcore• Review current implementation in aspnetlabs Implement RateLimiting Middleware in aspnetcore Oct 8, 2021
@rafikiassumani-msft rafikiassumani-msft modified the milestones: .NET 7 Planning, .NET 7.0 Jan 6, 2022
@Tratcher Tratcher removed their assignment Jan 11, 2022
@rafikiassumani-msft rafikiassumani-msft added Cost:L Priority:0 Work that we can't release without labels Jan 13, 2022
@rafikiassumani-msft rafikiassumani-msft modified the milestones: .NET 7.0, .NET 7 Planning Jan 25, 2022
@ghost
Copy link

ghost commented Jan 25, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@rafikiassumani-msft rafikiassumani-msft changed the title Implement RateLimiting Middleware in aspnetcore Implement Rate Limiting Middleware in aspnetcore Feb 2, 2022
@wtgodbe wtgodbe modified the milestones: .NET 7 Planning, 7.0-preview3 Feb 14, 2022
@rafikiassumani-msft rafikiassumani-msft added the api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews label Apr 15, 2022
@ghost
Copy link

ghost commented Apr 15, 2022

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:

  • The PR contains changes to the reference-assembly that describe the API change. Or, you have included a snippet of reference-assembly-style code that illustrates the API change.
  • The PR describes the impact to users, both positive (useful new APIs) and negative (breaking changes).
  • Someone is assigned to "champion" this change in the meeting, and they understand the impact and design of the change.

@halter73
Copy link
Member

API Review:

  • In the future Limiter will be aggregated with default behavior
  • Remove IServiceCollection extension method for now
  • RateLimiting -> RateLimiter in method and class names
namespace Microsoft.AspNetCore.RateLimiting
{
    public sealed class RateLimiterOptions
    {
        public PartitionedRateLimiter<HttpContext> Limiter { get; set; }
        public Func<HttpContext, RateLimitLease, Task> OnRejected { get; set; }
        public int DefaultRejectionStatusCode { get; set; }
    }

    public static class RateLimitingApplicationBuilderExtensions
    {
        public static IApplicationBuilder UseRateLimiter(this IApplicationBuilder app);
        public static IApplicationBuilder UseRateLimiter(this IApplicationBuilder app, RateLimitingOptions options);
    }
}

@halter73 halter73 added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews labels Apr 18, 2022
@rafikiassumani-msft rafikiassumani-msft changed the title Implement Rate Limiting Middleware in aspnetcore [Epic]: Implement Rate Limiting Middleware in aspnetcore Apr 21, 2022
@wtgodbe wtgodbe modified the milestones: 7.0-preview6, 7.0-preview7 Jun 24, 2022
@BrennanConroy
Copy link
Member

Middleware is implemented.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 16, 2022
@amcasey amcasey added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware label Jun 2, 2023
@danmoseley danmoseley removed the area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jul 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-approved API was approved in API review, it can be implemented area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware feature-rate-limit Work related to use of rate limit primitives Priority:0 Work that we can't release without
Projects
None yet
Development

No branches or pull requests

7 participants