From 4eb5e3caa228650f44605b998bf4e6c3129ea477 Mon Sep 17 00:00:00 2001 From: Samantha Date: Fri, 16 Feb 2024 15:01:01 -0500 Subject: [PATCH] ratelimits: Fetch correct limit when building transaction (#7330) Fix copy-paste that lead to the wrong rate limit retrieved for some transactions. --- ratelimits/bucket.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ratelimits/bucket.go b/ratelimits/bucket.go index deda7ca4276..b382ca536a2 100644 --- a/ratelimits/bucket.go +++ b/ratelimits/bucket.go @@ -208,7 +208,7 @@ func (builder *TransactionBuilder) RegistrationsPerIPv6RangeTransaction(ip net.I if err != nil { return Transaction{}, err } - limit, err := builder.getLimit(NewRegistrationsPerIPAddress, bucketKey) + limit, err := builder.getLimit(NewRegistrationsPerIPv6Range, bucketKey) if err != nil { if errors.Is(err, errLimitDisabled) { return newAllowOnlyTransaction() @@ -225,7 +225,7 @@ func (builder *TransactionBuilder) OrdersPerAccountTransaction(regId int64) (Tra if err != nil { return Transaction{}, err } - limit, err := builder.getLimit(NewRegistrationsPerIPAddress, bucketKey) + limit, err := builder.getLimit(NewOrdersPerAccount, bucketKey) if err != nil { if errors.Is(err, errLimitDisabled) { return newAllowOnlyTransaction() @@ -243,7 +243,7 @@ func (builder *TransactionBuilder) FailedAuthorizationsPerAccountCheckOnlyTransa if err != nil { return Transaction{}, err } - limit, err := builder.getLimit(NewRegistrationsPerIPAddress, bucketKey) + limit, err := builder.getLimit(FailedAuthorizationsPerAccount, bucketKey) if err != nil { if errors.Is(err, errLimitDisabled) { return newAllowOnlyTransaction() @@ -260,7 +260,7 @@ func (builder *TransactionBuilder) FailedAuthorizationsPerAccountTransaction(reg if err != nil { return Transaction{}, err } - limit, err := builder.getLimit(NewRegistrationsPerIPAddress, bucketKey) + limit, err := builder.getLimit(FailedAuthorizationsPerAccount, bucketKey) if err != nil { if errors.Is(err, errLimitDisabled) { return newAllowOnlyTransaction() @@ -359,7 +359,7 @@ func (builder *TransactionBuilder) CertificatesPerFQDNSetTransaction(orderNames if err != nil { return Transaction{}, err } - limit, err := builder.getLimit(NewRegistrationsPerIPAddress, bucketKey) + limit, err := builder.getLimit(CertificatesPerFQDNSet, bucketKey) if err != nil { if errors.Is(err, errLimitDisabled) { return newAllowOnlyTransaction()