Skip to content

Commit 64ae659

Browse files
cstocktonChris Stockton
andauthored
chore: make it more clear which rate limiters use the OTP limit (#2090)
In the supabase dashboard the rate limits are declared as: - `RATE_LIMIT_OTP` Rate limit for sign ups and sign ins Number of sign up and sign-in requests that can be made in a 5 minute interval per IP address - `RATE_LIMIT_VERIFY` Rate limit for token verifications Number of OTP/Magic link verifications that can be made in a 5 minute interval per IP address This does not exactly translate to the rate limit usage in the auth server. But it isn't something we may change, so for now I'm just making this usage more clear and documenting it. --------- Co-authored-by: Chris Stockton <[email protected]>
1 parent ecc97e0 commit 64ae659

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

internal/api/options.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ func NewLimiterOptions(gc *conf.GlobalConfiguration) *LimiterOptions {
5757
DefaultExpirationTTL: time.Hour,
5858
}).SetBurst(30)
5959

60-
o.User = tollbooth.NewLimiter(gc.RateLimitOtp/(60*5),
61-
&limiter.ExpirableOptions{
62-
DefaultExpirationTTL: time.Hour,
63-
}).SetBurst(30)
64-
6560
o.FactorVerify = tollbooth.NewLimiter(gc.MFA.RateLimitChallengeAndVerify/60,
6661
&limiter.ExpirableOptions{
6762
DefaultExpirationTTL: time.Minute,
@@ -82,11 +77,6 @@ func NewLimiterOptions(gc *conf.GlobalConfiguration) *LimiterOptions {
8277
DefaultExpirationTTL: time.Hour,
8378
}).SetBurst(30)
8479

85-
o.Signups = tollbooth.NewLimiter(gc.RateLimitOtp/(60*5),
86-
&limiter.ExpirableOptions{
87-
DefaultExpirationTTL: time.Hour,
88-
}).SetBurst(30)
89-
9080
o.Web3 = tollbooth.NewLimiter(gc.RateLimitWeb3/(60*5),
9181
&limiter.ExpirableOptions{
9282
DefaultExpirationTTL: time.Hour,
@@ -97,7 +87,8 @@ func NewLimiterOptions(gc *conf.GlobalConfiguration) *LimiterOptions {
9787
o.Resend = newLimiterPer5mOver1h(gc.RateLimitOtp)
9888
o.MagicLink = newLimiterPer5mOver1h(gc.RateLimitOtp)
9989
o.Otp = newLimiterPer5mOver1h(gc.RateLimitOtp)
100-
90+
o.User = newLimiterPer5mOver1h(gc.RateLimitOtp)
91+
o.Signups = newLimiterPer5mOver1h(gc.RateLimitOtp)
10192
o.OAuthClientRegister = newLimiterPer5mOver1h(gc.RateLimitOAuthDynamicClientRegister)
10293

10394
return o

0 commit comments

Comments
 (0)