From e9fea2305c155de63c231539fdc59505c2f89995 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 06:35:07 +0000 Subject: [PATCH 1/2] Initial plan From fc557d5213ea1693a96f453b7ad9e3e58f9ea614 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 06:37:34 +0000 Subject: [PATCH 2/2] fix: clarify requestsPerHour precedence and add to DefaultConfig in rate limit schema Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> --- plugins/http/schemas.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/http/schemas.go b/plugins/http/schemas.go index ae4b0d0b..ef019ee8 100644 --- a/plugins/http/schemas.go +++ b/plugins/http/schemas.go @@ -159,11 +159,11 @@ func rateLimitMiddlewareSchema() *schema.ModuleSchema { Inputs: []schema.ServiceIODef{{Name: "request", Type: "http.Request", Description: "HTTP request to rate-limit"}}, Outputs: []schema.ServiceIODef{{Name: "limited", Type: "http.Request", Description: "HTTP request (passed through if within limit)"}}, ConfigFields: []schema.ConfigFieldDef{ - {Key: "requestsPerMinute", Label: "Requests Per Minute", Type: schema.FieldTypeNumber, DefaultValue: 60, Description: "Maximum number of requests per minute per client (mutually exclusive with requestsPerHour)"}, + {Key: "requestsPerMinute", Label: "Requests Per Minute", Type: schema.FieldTypeNumber, DefaultValue: 60, Description: "Maximum number of requests per minute per client; used when requestsPerHour is not set"}, {Key: "requestsPerHour", Label: "Requests Per Hour", Type: schema.FieldTypeNumber, DefaultValue: 0, Description: "Maximum number of requests per hour per client; takes precedence over requestsPerMinute when set"}, {Key: "burstSize", Label: "Burst Size", Type: schema.FieldTypeNumber, DefaultValue: 10, Description: "Maximum burst of requests allowed above the rate limit"}, }, - DefaultConfig: map[string]any{"requestsPerMinute": 60, "burstSize": 10}, + DefaultConfig: map[string]any{"requestsPerMinute": 60, "requestsPerHour": 0, "burstSize": 10}, } }