-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove logging of contact email addresses (#7833)
Fixes #7801
- Loading branch information
1 parent
c394831
commit ded2e5e
Showing
7 changed files
with
37 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,13 +180,10 @@ func TestSendNags(t *testing.T) { | |
test.AssertErrorIs(t, err, errNoValidEmail) | ||
test.AssertEquals(t, len(mc.Messages), 0) | ||
|
||
sendLogs := log.GetAllMatching("INFO: attempting send JSON=.*") | ||
sendLogs := log.GetAllMatching("INFO: attempting send for JSON=.*") | ||
if len(sendLogs) != 2 { | ||
t.Errorf("expected 2 'attempting send' log line, got %d: %s", len(sendLogs), strings.Join(sendLogs, "\n")) | ||
} | ||
if !strings.Contains(sendLogs[0], `"Rcpt":["[email protected]"]`) { | ||
t.Errorf("expected first 'attempting send' log line to have one address, got %q", sendLogs[0]) | ||
} | ||
if !strings.Contains(sendLogs[0], `"TruncatedSerials":["000000000000000000000000000000000304"]`) { | ||
t.Errorf("expected first 'attempting send' log line to have one serial, got %q", sendLogs[0]) | ||
} | ||
|
@@ -196,6 +193,9 @@ func TestSendNags(t *testing.T) { | |
if !strings.Contains(sendLogs[0], `"TruncatedDNSNames":["example.com"]`) { | ||
t.Errorf("expected first 'attempting send' log line to have 1 domain, 'example.com', got %q", sendLogs[0]) | ||
} | ||
if strings.Contains(sendLogs[0], `"@gmail.com"`) { | ||
t.Errorf("log line should not contain email address, got %q", sendLogs[0]) | ||
} | ||
} | ||
|
||
func TestSendNagsAddressLimited(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -473,16 +473,16 @@ func TestMalformedExactBlocklist(t *testing.T) { | |
|
||
func TestValidEmailError(t *testing.T) { | ||
err := ValidEmail("(๑•́ ω •̀๑)") | ||
test.AssertEquals(t, err.Error(), "\"(๑•́ ω •̀๑)\" is not a valid e-mail address") | ||
test.AssertEquals(t, err.Error(), "unable to parse email address") | ||
|
||
err = ValidEmail("[email protected] #replace with real email") | ||
test.AssertEquals(t, err.Error(), "\"[email protected] #replace with real email\" is not a valid e-mail address") | ||
test.AssertEquals(t, err.Error(), "unable to parse email address") | ||
|
||
err = ValidEmail("[email protected]") | ||
test.AssertEquals(t, err.Error(), "invalid contact domain. Contact emails @example.com are forbidden") | ||
test.AssertEquals(t, err.Error(), "contact email has forbidden domain \"example.com\"") | ||
|
||
err = ValidEmail("[email protected]") | ||
test.AssertEquals(t, err.Error(), "contact email \"[email protected]\" has invalid domain : Domain name contains an invalid character") | ||
test.AssertEquals(t, err.Error(), "contact email has invalid domain: Domain name contains an invalid character") | ||
} | ||
|
||
func TestCheckAuthzChallenges(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,19 +66,19 @@ func TestAccountEmailError(t *testing.T) { | |
name: "empty proto", | ||
contacts: []string{"mailto:[email protected]", " "}, | ||
expectedProbType: "urn:ietf:params:acme:error:unsupportedContact", | ||
expectedProbDetail: `contact method "" is not supported`, | ||
expectedProbDetail: `only contact scheme 'mailto:' is supported`, | ||
}, | ||
{ | ||
name: "empty mailto", | ||
contacts: []string{"mailto:[email protected]", "mailto:"}, | ||
expectedProbType: "urn:ietf:params:acme:error:invalidContact", | ||
expectedProbDetail: `"" is not a valid e-mail address`, | ||
expectedProbDetail: `unable to parse email address`, | ||
}, | ||
{ | ||
name: "non-ascii mailto", | ||
contacts: []string{"mailto:[email protected]", "mailto:cpu@l̴etsencrypt.org"}, | ||
expectedProbType: "urn:ietf:params:acme:error:invalidContact", | ||
expectedProbDetail: `contact email ["mailto:cpu@l̴etsencrypt.org"] contains non-ASCII characters`, | ||
expectedProbDetail: `contact email contains non-ASCII characters`, | ||
}, | ||
{ | ||
name: "too many contacts", | ||
|
@@ -90,25 +90,25 @@ func TestAccountEmailError(t *testing.T) { | |
name: "invalid contact", | ||
contacts: []string{"mailto:[email protected]", "mailto:a@"}, | ||
expectedProbType: "urn:ietf:params:acme:error:invalidContact", | ||
expectedProbDetail: `"a@" is not a valid e-mail address`, | ||
expectedProbDetail: `unable to parse email address`, | ||
}, | ||
{ | ||
name: "forbidden contact domain", | ||
contacts: []string{"mailto:[email protected]", "mailto:[email protected]"}, | ||
expectedProbType: "urn:ietf:params:acme:error:invalidContact", | ||
expectedProbDetail: "invalid contact domain. Contact emails @example.com are forbidden", | ||
expectedProbDetail: "contact email has forbidden domain \"example.com\"", | ||
}, | ||
{ | ||
name: "contact domain invalid TLD", | ||
contacts: []string{"mailto:[email protected]", "mailto:[email protected]"}, | ||
expectedProbType: "urn:ietf:params:acme:error:invalidContact", | ||
expectedProbDetail: `contact email "[email protected]" has invalid domain : Domain name does not end with a valid public suffix (TLD)`, | ||
expectedProbDetail: `contact email has invalid domain: Domain name does not end with a valid public suffix (TLD)`, | ||
}, | ||
{ | ||
name: "contact domain invalid", | ||
contacts: []string{"mailto:[email protected]", "mailto:a@example./.com"}, | ||
expectedProbType: "urn:ietf:params:acme:error:invalidContact", | ||
expectedProbDetail: "contact email \"a@example./.com\" has invalid domain : Domain name contains an invalid character", | ||
expectedProbDetail: "contact email has invalid domain: Domain name contains an invalid character", | ||
}, | ||
{ | ||
name: "too long contact", | ||
|