Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongable committed Nov 22, 2024
1 parent f9608a8 commit 49437f8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/bad-key-revoker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func (bkr *badKeyRevoker) invoke(ctx context.Context) (bool, error) {
}
}

serials := make([]string, 0, len(unrevokedCerts))
serials := make([]string, 0)
for _, cert := range unrevokedCerts {
serials = append(serials, cert.Serial)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/expiration-mailer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (lim *limiter) check(address string) error {

lim.maybeBumpDay()
if lim.counts[address] >= lim.limit {
return errors.New("daily mail limit exceeded")
return errors.New("daily mail limit exceeded for this email address")
}
return nil
}
Expand Down
4 changes: 3 additions & 1 deletion policy/pa.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ func ValidEmail(address string) error {
return berrors.InvalidEmailError("contact email has invalid domain: %s", err)
}
if forbiddenMailDomains[domain] {
return berrors.InvalidEmailError("contact email has forbidden domain")
// We're okay including the domain in the error message here because this
// case occurs only for a small block-list of domains listed above.
return berrors.InvalidEmailError("contact email has forbidden domain %q", domain)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion policy/pa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func TestValidEmailError(t *testing.T) {
test.AssertEquals(t, err.Error(), "unable to parse email address")

err = ValidEmail("[email protected]")
test.AssertEquals(t, err.Error(), "contact email has forbidden domain")
test.AssertEquals(t, err.Error(), "contact email has forbidden domain \"example.com\"")

err = ValidEmail("[email protected]")
test.AssertEquals(t, err.Error(), "contact email has invalid domain: Domain name contains an invalid character")
Expand Down
2 changes: 1 addition & 1 deletion test/integration/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestAccountEmailError(t *testing.T) {
name: "forbidden contact domain",
contacts: []string{"mailto:[email protected]", "mailto:[email protected]"},
expectedProbType: "urn:ietf:params:acme:error:invalidContact",
expectedProbDetail: "contact email has forbidden domain",
expectedProbDetail: "contact email has forbidden domain \"example.com\"",
},
{
name: "contact domain invalid TLD",
Expand Down

0 comments on commit 49437f8

Please sign in to comment.