MCPcopy Index your code
hub / github.com/supabase/auth / performRateLimiting

Method performRateLimiting

internal/api/middleware.go:123–133  ·  view source on GitHub ↗
(lmt *limiter.Limiter, req *http.Request)

Source from the content-addressed store, hash-verified

121}
122
123func (a *API) performRateLimiting(lmt *limiter.Limiter, req *http.Request) error {
124 if sbffAddr, ok := sbff.GetIPAddress(req); ok {
125 if err := tollbooth.LimitByKeys(lmt, []string{sbffAddr}); err != nil {
126 return apierrors.NewTooManyRequestsError(apierrors.ErrorCodeOverRequestRateLimit, "Request rate limit reached")
127 }
128
129 return nil
130 }
131
132 return a.performRateLimitingWithHeader(lmt, req)
133}
134
135func (a *API) limitHandler(lmt *limiter.Limiter) middlewareHandler {
136 return func(w http.ResponseWriter, req *http.Request) (context.Context, error) {

Callers 4

limitHandlerMethod · 0.95
TokenMethod · 0.95

Calls 3

GetIPAddressFunction · 0.92
NewTooManyRequestsErrorFunction · 0.92