syntax = "proto3";

package va;
option go_package = "github.com/letsencrypt/boulder/va/proto";

import "core/proto/core.proto";

service VA {
  rpc PerformValidation(PerformValidationRequest) returns (ValidationResult) {}
}

service CAA {
  rpc IsCAAValid(IsCAAValidRequest) returns (IsCAAValidResponse) {}
}

message IsCAAValidRequest {
  // NOTE: Domain may be a name with a wildcard prefix (e.g. `*.example.com`)
  string domain = 1;
  string validationMethod = 2;
  int64 accountURIID = 3;
}

// If CAA is valid for the requested domain, the problem will be empty
message IsCAAValidResponse {
  core.ProblemDetails problem = 1;
}

message PerformValidationRequest {
  string domain = 1;
  core.Challenge challenge = 2;
  AuthzMeta authz = 3;
}

message AuthzMeta {
  string id = 1;
  int64 regID = 2;
}

message ValidationResult {
  repeated core.ValidationRecord records = 1;
  core.ProblemDetails problems = 2;
}
