Skip to content

Commit

Permalink
ratelimits: Fetch correct limit when building transaction (#7330)
Browse files Browse the repository at this point in the history
Fix copy-paste that lead to the wrong rate limit retrieved for some
transactions.
  • Loading branch information
beautifulentropy authored Feb 16, 2024
1 parent 6c9d41f commit 4eb5e3c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ratelimits/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 4eb5e3c

Please sign in to comment.