Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split CAA checking out to its own service #1647

Merged
merged 40 commits into from
Apr 13, 2016
Merged

Split CAA checking out to its own service #1647

merged 40 commits into from
Apr 13, 2016

Conversation

rolandshoemaker
Copy link
Contributor

Which uses gRPC to communicate. Issuer domain, DNS resolver to talk to, DNS timeout, and address to serve the service are all configurable via a YAML config file (although since there are so few maybe just CLI flags could work).

Also a small test client to call the gRPC server. (Still need to copy the tests from the VA that check the CAA loop stuff etc)

@letsencryptbot
Copy link

cmd/caa-checker/proto/caa_checker.pb.go:15:1: don't use an underscore in package name cmd/caa-checker/proto/caa_checker.pb.go:35:6: exported type Domain should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:39:1: exported method Domain.Reset should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:41:1: exported method Domain.ProtoMessage should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:42:1: exported method Domain.Descriptor should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:44:6: exported type Valid should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:48:1: exported method Valid.Reset should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:50:1: exported method Valid.ProtoMessage should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:51:1: exported method Valid.Descriptor should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:68:6: exported type CAACheckerClient should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:76:1: exported function NewCAACheckerClient should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:91:6: exported type CAACheckerServer should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:95:1: exported function RegisterCAACheckerServer should have comment or be unexported cmd/caa-checker/proto/caa_checker.pb.go:99:6: don't use underscores in Go names; func _CAAChecker_ValidForIssuance_Handler should be _CAACheckerValidForIssuanceHandler cmd/caa-checker/proto/caa_checker.pb.go:111:5: don't use underscores in Go names; var _CAAChecker_serviceDesc should be _CAACheckerServiceDesc

@letsencryptbot
Copy link

godep: Package (google.golang.org/grpc) not found

@riking
Copy link
Contributor

riking commented Mar 24, 2016

You didn't rewrite the imports in the protobuf file.

I think we should have a separate PR that just adds a single protobuf file and the godeps imports... #1651

@riking
Copy link
Contributor

riking commented Mar 24, 2016

@rolandshoemaker
Copy link
Contributor Author

?

import proto "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

import (
    context "github.com/letsencrypt/boulder/Godeps/_workspace/src/golang.org/x/net/context"
    grpc "github.com/letsencrypt/boulder/Godeps/_workspace/src/google.golang.org/grpc"
)

Also the end goal with splitting out this as it's own service is to create a new repo under the letsencrypt organization so other CAs can utilize our CAA checking logic, in that case it doesn't make sense to merge this protobuf definition with those for each Boulder service and have to split them back out again later.

@jsha
Copy link
Contributor

jsha commented Mar 31, 2016

First pass comments:

Instead of commenting out the lint test in test.sh, remove it.

Issuer domain should be an RPC parameter rather than a parameter configured into the CAA service at startup.

cAACheckerService is the wrong capitalization for Go, should be caaCheckerService.

Create a subdirectory, test/grpc-credentials for the certs and keys, since there will be many of them.

The stuff in CAAConfig in config.go should be an RPCConfig struct.

@jsha
Copy link
Contributor

jsha commented Apr 1, 2016

The stuff in CAAConfig in config.go should be an RPCConfig struct.

Also, the section of VA's main that initializes a credentials object based on that struct should be factored out somewhere common, probably a new grpc directory.

@rolandshoemaker
Copy link
Contributor Author

Ready for re-review.

string name = 1;
string issuerDomain = 2;
}

message Valid {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message Result ?

@riking
Copy link
Contributor

riking commented Apr 4, 2016

I see no unit tests with the grpc method?

@rolandshoemaker
Copy link
Contributor Author

Ready for re-review.

@jsha
Copy link
Contributor

jsha commented Apr 11, 2016

Please add a .go file to cmd/caa-checker/proto that just contains a go generate command to generate the .go file from the .proto file.

Otherwise this looks great.

@riking
Copy link
Contributor

riking commented Apr 11, 2016

didn't find any problems in the new changes, need to do another git diff check though

@rolandshoemaker
Copy link
Contributor Author

Ready for re-review.

After offline conversation I've added a cmd.DebugServer to caa-checker so that it exposes it's memory stats and gRPC trace data as a best effort for metrics since there is no merged support for instrumentation hooks, grpc/grpc-go#240, and the various other options, e.g. code generation or Boulder-level metrics collection, are not really satisfactory.

@jsha
Copy link
Contributor

jsha commented Apr 11, 2016

The go:generate line doesn't need to be wrapped in sh -c. Otherwise LGTM.

@rolandshoemaker
Copy link
Contributor Author

Fixed.

@jsha jsha added the r=jsha label Apr 11, 2016
@jsha
Copy link
Contributor

jsha commented Apr 11, 2016

LGTM

@riking
Copy link
Contributor

riking commented Apr 12, 2016

diff --git a/bdns/problem.go b/bdns/problem.go
index 5558340..1a3805a 100644
--- a/bdns/problem.go
+++ b/bdns/problem.go
@@ -14,7 +14,7 @@ import (
        "github.com/letsencrypt/boulder/probs"
 )

-type dnsError struct {
+type DNSError struct {
        recordType uint16

Missing comment on exported type.

@riking
Copy link
Contributor

riking commented Apr 12, 2016

b/cmd/caa-checker/server_test.go

I think the tests should declare a var ctx = context.Background() and use that.

@riking
Copy link
Contributor

riking commented Apr 12, 2016

The integration test starts the caa-checker server, but it doesn't run the test-client.

The test client should probably be in the test/ directory

@rolandshoemaker
Copy link
Contributor Author

The integration test starts the caa-checker server, but it doesn't run the test-client.
The test client should probably be in the test/ directory

In the integration tests the VA is essentially the test client as it is using the -next config file which defines the gRPC configuration instead of AMQP for the Publisher.

test-client mainly just exists as an example of the API for when we split this out into its own package.

@riking
Copy link
Contributor

riking commented Apr 12, 2016

grpc/bcodes.go

Error code 16 is already taken. Perhaps we should start at 1000?

CodeToProblem should probably define values for most of the predefined codes, like Internal and DataLoss.

@jsha
Copy link
Contributor

jsha commented Apr 13, 2016

@rolandshoemaker can you resolve the merge conflicts?

@rolandshoemaker
Copy link
Contributor Author

Resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants