Fix logging of hostname in VA. (#3149)

The pbToAuthzMeta method in rpc/pb-marshalling.go only propagates ID and
registrationID, not hostname. So log the "domain" parameter instead.
This commit is contained in:
Jacob Hoffman-Andrews 2017-10-06 11:10:02 -07:00 committed by Roland Bracewell Shoemaker
parent 84eaf49352
commit 51991cd264
2 changed files with 9 additions and 2 deletions

View File

@ -868,7 +868,7 @@ func (va *ValidationAuthorityImpl) PerformValidation(ctx context.Context, domain
logEvent := verificationRequestEvent{
ID: authz.ID,
Requester: authz.RegistrationID,
Hostname: authz.Identifier.Value,
Hostname: domain,
RequestTime: va.clk.Now(),
}
vStart := va.clk.Now()

View File

@ -824,7 +824,7 @@ func TestDNSValidationEmpty(t *testing.T) {
}
func TestPerformValidationValid(t *testing.T) {
va, _ := setup(nil, 0)
va, mockLog := setup(nil, 0)
// create a challenge with well known token
chalDNS := core.DNSChallenge01()
@ -840,6 +840,13 @@ func TestPerformValidationValid(t *testing.T) {
if samples != 1 {
t.Errorf("Wrong number of samples for successful validation. Expected 1, got %d", samples)
}
resultLog := mockLog.GetAllMatching(`Validation result`)
if len(resultLog) != 1 {
t.Fatalf("Wrong number of matching lines for 'Validation result'")
}
if !strings.Contains(resultLog[0], `"Hostname":"good-dns01.com"`) {
t.Errorf("PerformValidation didn't log validation hostname.")
}
}
func TestDNSValidationFailure(t *testing.T) {