Add buf lint/breaking targets and fix proto naming violations
- Add buf.yaml with STANDARD lint rules and FILE-level breaking change detection - Add proto-lint Makefile target (buf lint + buf breaking --against master) - Add lint Makefile target (golangci-lint) and include it in all - Fix proto target: use module= option so protoc writes to gen/ not proto/ - engine.proto: rename rpc Request→Execute and message types accordingly - acme.proto: drop redundant ACME prefix from SetConfig/ListAccounts/ListOrders messages - policy.proto: add CreatePolicyResponse/GetPolicyResponse wrappers instead of returning PolicyRule directly from multiple RPCs - Update grpcserver and webserver/client.go to match renamed types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,7 @@ func (as *acmeServer) CreateEAB(ctx context.Context, req *pb.CreateEABRequest) (
|
||||
return &pb.CreateEABResponse{Kid: cred.KID, HmacKey: cred.HMACKey}, nil
|
||||
}
|
||||
|
||||
func (as *acmeServer) SetConfig(ctx context.Context, req *pb.SetACMEConfigRequest) (*pb.SetACMEConfigResponse, error) {
|
||||
func (as *acmeServer) SetConfig(ctx context.Context, req *pb.SetConfigRequest) (*pb.SetConfigResponse, error) {
|
||||
if req.DefaultIssuer == "" {
|
||||
return nil, status.Error(codes.InvalidArgument, "default_issuer is required")
|
||||
}
|
||||
@@ -46,10 +46,10 @@ func (as *acmeServer) SetConfig(ctx context.Context, req *pb.SetACMEConfigReques
|
||||
as.s.logger.Error("grpc: acme set config", "error", err)
|
||||
return nil, status.Error(codes.Internal, "failed to save config")
|
||||
}
|
||||
return &pb.SetACMEConfigResponse{Ok: true}, nil
|
||||
return &pb.SetConfigResponse{Ok: true}, nil
|
||||
}
|
||||
|
||||
func (as *acmeServer) ListAccounts(ctx context.Context, req *pb.ListACMEAccountsRequest) (*pb.ListACMEAccountsResponse, error) {
|
||||
func (as *acmeServer) ListAccounts(ctx context.Context, req *pb.ListAccountsRequest) (*pb.ListAccountsResponse, error) {
|
||||
h, err := as.getOrCreateHandler(req.Mount)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.NotFound, "mount not found")
|
||||
@@ -71,10 +71,10 @@ func (as *acmeServer) ListAccounts(ctx context.Context, req *pb.ListACMEAccounts
|
||||
CreatedAt: a.CreatedAt.String(),
|
||||
})
|
||||
}
|
||||
return &pb.ListACMEAccountsResponse{Accounts: pbAccounts}, nil
|
||||
return &pb.ListAccountsResponse{Accounts: pbAccounts}, nil
|
||||
}
|
||||
|
||||
func (as *acmeServer) ListOrders(ctx context.Context, req *pb.ListACMEOrdersRequest) (*pb.ListACMEOrdersResponse, error) {
|
||||
func (as *acmeServer) ListOrders(ctx context.Context, req *pb.ListOrdersRequest) (*pb.ListOrdersResponse, error) {
|
||||
h, err := as.getOrCreateHandler(req.Mount)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.NotFound, "mount not found")
|
||||
@@ -99,7 +99,7 @@ func (as *acmeServer) ListOrders(ctx context.Context, req *pb.ListACMEOrdersRequ
|
||||
ExpiresAt: o.ExpiresAt.String(),
|
||||
})
|
||||
}
|
||||
return &pb.ListACMEOrdersResponse{Orders: pbOrders}, nil
|
||||
return &pb.ListOrdersResponse{Orders: pbOrders}, nil
|
||||
}
|
||||
|
||||
func (as *acmeServer) getOrCreateHandler(mountName string) (*internacme.Handler, error) {
|
||||
|
||||
Reference in New Issue
Block a user