Skip to content

Commit ca5fdd1

Browse files
Comment grammar and removing a renaming
1 parent 19b0acf commit ca5fdd1

File tree

4 files changed

+44
-41
lines changed

4 files changed

+44
-41
lines changed

va/proto/va.proto

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@ option go_package = "github.com/letsencrypt/boulder/va/proto";
55

66
import "core/proto/core.proto";
77

8+
// PerformValidation performs a local Domain Control Validation (DCV) and CAA
9+
// check for the provided challenge and dnsName. If called on the primary VA and
10+
// local validation passes, it will also perform DCV and CAA checks using the
11+
// configured remote VAs. It returns a validation result and an error if the
12+
// validation failed. The returned result will always contain a list of
13+
// validation records, even when it also contains a problem. This method is not
14+
// MPIC-compliant.
15+
//
16+
// DoDCV performs a local Domain Control Validation (DCV) for the provided
17+
// challenge. If called on the primary VA and local validation passes, it will
18+
// also perform an MPIC-compliant DCV using the configured remote VAs. It
19+
// returns a validation result and an error if the validation failed. The
20+
// returned result will always contain a list of validation records, even when
21+
// it also contains a problem. This method does not check CAA records and should
22+
// not be used as a replacement for VA.PerformValidation.
823
service VA {
9-
// PerformValidation performs a local Domain Control Validation (DCV) and CAA
10-
// check for the provided challenge and dnsName. If called on the primary VA
11-
// and local validation passes, it will also perform DCV and CAA checks using
12-
// the configured remote VAs. The returned result will always contain a list
13-
// of validation records, even when it also contains a problem. This method is
14-
// not MPIC-compliant.
1524
rpc PerformValidation(PerformValidationRequest) returns (ValidationResult) {}
16-
// DoDCV performs a local Domain Control Validation (DCV) for the provided
17-
// challenge. If called on the primary VA and local validation passes, it will
18-
// also perform an MPIC-compliant DCV using the configured remote VAs. The
19-
// method returns the validation result and an error if the validation failed.
20-
// The returned result will always contain a list of validation records, even
21-
// when it also contains a problem. This method does not check CAA records and
22-
// should not be used as a replacement for VA.PerformValidation.
2325
rpc DoDCV(DCVRequest) returns (ValidationResult) {}
2426
}
2527

va/va.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ func (va *ValidationAuthorityImpl) performLocalValidation(
657657
// PerformValidation performs a local Domain Control Validation (DCV) and CAA
658658
// check for the provided challenge and dnsName. If called on the primary VA and
659659
// local validation passes, it will also perform DCV and CAA checks using the
660-
// configured remote VAs. The returned result will always contain a list of
660+
// configured remote VAs. It returns a validation result and an error if the
661+
// validation failed. The returned result will always contain a list of
661662
// validation records, even when it also contains a problem. This method is not
662663
// MPIC-compliant.
663664
func (va *ValidationAuthorityImpl) PerformValidation(ctx context.Context, req *vapb.PerformValidationRequest) (*vapb.ValidationResult, error) {

va/va_test.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,19 @@ func httpMultiSrv(t *testing.T, token string, allowedUAs map[string]bool) *multi
197197
return ms
198198
}
199199

200-
// canceledVA is a mock that always returns context.Canceled for
200+
// cancelledVA is a mock that always returns context.Canceled for
201201
// PerformValidation calls
202-
type canceledVA struct{}
202+
type cancelledVA struct{}
203203

204-
func (v canceledVA) PerformValidation(_ context.Context, _ *vapb.PerformValidationRequest, _ ...grpc.CallOption) (*vapb.ValidationResult, error) {
204+
func (v cancelledVA) PerformValidation(_ context.Context, _ *vapb.PerformValidationRequest, _ ...grpc.CallOption) (*vapb.ValidationResult, error) {
205205
return nil, context.Canceled
206206
}
207207

208-
func (v canceledVA) IsCAAValid(_ context.Context, _ *vapb.IsCAAValidRequest, _ ...grpc.CallOption) (*vapb.IsCAAValidResponse, error) {
208+
func (v cancelledVA) IsCAAValid(_ context.Context, _ *vapb.IsCAAValidRequest, _ ...grpc.CallOption) (*vapb.IsCAAValidResponse, error) {
209209
return nil, context.Canceled
210210
}
211211

212-
func (v canceledVA) DoDCV(_ context.Context, _ *vapb.DCVRequest, _ ...grpc.CallOption) (*vapb.ValidationResult, error) {
212+
func (v cancelledVA) DoDCV(_ context.Context, _ *vapb.DCVRequest, _ ...grpc.CallOption) (*vapb.ValidationResult, error) {
213213
return nil, context.Canceled
214214
}
215215

@@ -396,8 +396,8 @@ func TestMultiVA(t *testing.T) {
396396
CAAClient: brokenRemoteVA{},
397397
}
398398
cancelledVA := RemoteClients{
399-
VAClient: canceledVA{},
400-
CAAClient: canceledVA{},
399+
VAClient: cancelledVA{},
400+
CAAClient: cancelledVA{},
401401
}
402402

403403
unauthorized := probs.Unauthorized(fmt.Sprintf(
@@ -822,7 +822,7 @@ func setupRVAs(confs []rvaConf, mockDNSClient bdns.Client, srv *httptest.Server)
822822
return remoteVAs
823823
}
824824

825-
func createValidationRequest(domain string, challengeType core.AcmeChallenge) *vapb.DCVRequest {
825+
func createDoDCVRequest(domain string, challengeType core.AcmeChallenge) *vapb.DCVRequest {
826826
return &vapb.DCVRequest{
827827
Identifier: &corepb.Identifier{
828828
Type: string(identifier.TypeDNS),
@@ -843,7 +843,7 @@ func TestDoDCVInvalid(t *testing.T) {
843843
rvas := setupRVAs([]rvaConf{{rir: "ARIN"}, {rir: "RIPE"}, {rir: "APNIC"}}, nil, nil)
844844
va, mockLog := setupVA(nil, "", rvas, nil)
845845

846-
req := createValidationRequest("foo.com", core.ChallengeTypeDNS01)
846+
req := createDoDCVRequest("foo.com", core.ChallengeTypeDNS01)
847847

848848
res, err := va.DoDCV(context.Background(), req)
849849
test.AssertNotError(t, err, "DoDCV failed, expected success")
@@ -867,7 +867,7 @@ func TestDoDCVInternalErrorLogged(t *testing.T) {
867867
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Millisecond)
868868
defer cancel()
869869

870-
req := createValidationRequest("nonexistent.com", core.ChallengeTypeHTTP01)
870+
req := createDoDCVRequest("nonexistent.com", core.ChallengeTypeHTTP01)
871871

872872
_, err := va.DoDCV(ctx, req)
873873
test.AssertNotError(t, err, "Failed validation should be a prob but not an error")
@@ -887,7 +887,7 @@ func TestDoDCVValid(t *testing.T) {
887887
rvas := setupRVAs([]rvaConf{{rir: "ARIN"}, {rir: "RIPE"}, {rir: "APNIC"}}, nil, nil)
888888
va, mockLog := setupVA(nil, "", rvas, nil)
889889

890-
req := createValidationRequest("good-dns01.com", core.ChallengeTypeDNS01)
890+
req := createDoDCVRequest("good-dns01.com", core.ChallengeTypeDNS01)
891891

892892
res, err := va.DoDCV(context.Background(), req)
893893
test.AssertNotError(t, err, "validating challenge resulted in unexpected error")
@@ -910,7 +910,7 @@ func TestDoDCVWildcard(t *testing.T) {
910910
rvas := setupRVAs([]rvaConf{{rir: "ARIN"}, {rir: "RIPE"}, {rir: "APNIC"}}, nil, nil)
911911
va, mockLog := setupVA(nil, "", rvas, nil)
912912

913-
req := createValidationRequest("*.good-dns01.com", core.ChallengeTypeDNS01)
913+
req := createDoDCVRequest("*.good-dns01.com", core.ChallengeTypeDNS01)
914914

915915
res, _ := va.DoDCV(context.Background(), req)
916916
test.Assert(t, res.Problems == nil, fmt.Sprintf("validation failed: %#v", res.Problems))
@@ -937,7 +937,7 @@ func TestDoDCVValidWithBrokenRVA(t *testing.T) {
937937
rvas = append(rvas, RemoteVA{brokenRVA, "broken"})
938938
va, _ := setupVA(nil, "", rvas, nil)
939939

940-
req := createValidationRequest("good-dns01.com", core.ChallengeTypeDNS01)
940+
req := createDoDCVRequest("good-dns01.com", core.ChallengeTypeDNS01)
941941

942942
res, err := va.DoDCV(context.Background(), req)
943943
test.AssertNotError(t, err, "validating challenge resulted in unexpected error")
@@ -946,11 +946,11 @@ func TestDoDCVValidWithBrokenRVA(t *testing.T) {
946946

947947
func TestDoDCVValidWithCancelledRVA(t *testing.T) {
948948
rvas := setupRVAs([]rvaConf{{rir: "ARIN"}, {rir: "RIPE"}}, nil, nil)
949-
cancelledRVA := RemoteClients{VAClient: canceledVA{}, CAAClient: canceledVA{}}
949+
cancelledRVA := RemoteClients{VAClient: cancelledVA{}, CAAClient: cancelledVA{}}
950950
rvas = append(rvas, RemoteVA{cancelledRVA, "cancelled"})
951951
va, _ := setupVA(nil, "", rvas, nil)
952952

953-
req := createValidationRequest("good-dns01.com", core.ChallengeTypeDNS01)
953+
req := createDoDCVRequest("good-dns01.com", core.ChallengeTypeDNS01)
954954

955955
res, err := va.DoDCV(context.Background(), req)
956956
test.AssertNotError(t, err, "validating challenge resulted in unexpected error")
@@ -963,7 +963,7 @@ func TestDoDCVFailsWithTooManyBrokenRVAs(t *testing.T) {
963963
rvas = append(rvas, RemoteVA{brokenRVA, "broken"}, RemoteVA{brokenRVA, "broken"})
964964
va, _ := setupVA(nil, "", rvas, nil)
965965

966-
req := createValidationRequest("good-dns01.com", core.ChallengeTypeDNS01)
966+
req := createDoDCVRequest("good-dns01.com", core.ChallengeTypeDNS01)
967967

968968
res, err := va.DoDCV(context.Background(), req)
969969
test.AssertNotError(t, err, "Failed validation should be a prob but not an error")
@@ -979,11 +979,11 @@ func TestDoDCVFailsWithTooManyBrokenRVAs(t *testing.T) {
979979

980980
func TestDoDCVFailsWithTooManyCanceledRVAs(t *testing.T) {
981981
rvas := setupRVAs([]rvaConf{{rir: "ARIN"}}, nil, nil)
982-
canceledRVA := RemoteClients{VAClient: canceledVA{}, CAAClient: canceledVA{}}
983-
rvas = append(rvas, RemoteVA{canceledRVA, "canceled"}, RemoteVA{canceledRVA, "canceled"})
982+
canceledRVA := RemoteClients{VAClient: cancelledVA{}, CAAClient: cancelledVA{}}
983+
rvas = append(rvas, RemoteVA{canceledRVA, "cancelled"}, RemoteVA{canceledRVA, "cancelled"})
984984
va, _ := setupVA(nil, "", rvas, nil)
985985

986-
req := createValidationRequest("good-dns01.com", core.ChallengeTypeDNS01)
986+
req := createDoDCVRequest("good-dns01.com", core.ChallengeTypeDNS01)
987987

988988
res, err := va.DoDCV(context.Background(), req)
989989
test.AssertNotError(t, err, "Failed validation should be a prob but not an error")
@@ -1019,7 +1019,7 @@ func parseMPICSummary(t *testing.T, log []string) mpicSummary {
10191019
}
10201020

10211021
func TestDoDCVMPIC(t *testing.T) {
1022-
req := createValidationRequest("localhost", core.ChallengeTypeHTTP01)
1022+
req := createDoDCVRequest("localhost", core.ChallengeTypeHTTP01)
10231023

10241024
// srv is used for the Primary VA and the Remote VAs. The srv.Server
10251025
// produced will be used to mock the challenge recipient. When a VA (primary

va/vampic.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ func (va *ValidationAuthorityImpl) isPrimaryVA() bool {
5252
return va.perspective == PrimaryPerspective
5353
}
5454

55-
// mpicSummary is returned by remoteValidateChallenge and contains a summary of
56-
// the validation results for logging purposes. Use prepareSummary() to create a
55+
// mpicSummary is returned by remoteDoDCV and contains a summary of the
56+
// validation results for logging purposes. Use prepareSummary() to create a
5757
// final summary to avoid "null" in JSON output.
5858
type mpicSummary struct {
5959
// Passed are the distinct perspectives that Passed validation.
@@ -237,11 +237,11 @@ func (va *ValidationAuthorityImpl) remoteDoDCV(ctx context.Context, req *vapb.DC
237237

238238
// DoDCV performs a local Domain Control Validation (DCV) for the provided
239239
// challenge. If called on the primary VA and local validation passes, it will
240-
// also perform an MPIC-compliant DCV using the configured remote VAs. The
241-
// method returns the validation result and an error if the validation failed.
242-
// The returned result will always contain a list of validation records, even
243-
// when it also contains a problem. This method does not check CAA records and
244-
// should not be used as a replacement for VA.PerformValidation.
240+
// also perform an MPIC-compliant DCV using the configured remote VAs. It
241+
// returns a validation result and an error if the validation failed. The
242+
// returned result will always contain a list of validation records, even when
243+
// it also contains a problem. This method does not check CAA records and should
244+
// not be used as a replacement for VA.PerformValidation.
245245
//
246246
// Note: When called on the primary VA, this method will also call itself over
247247
// gRPC on each remote VA.

0 commit comments

Comments
 (0)