Skip to content

Commit

Permalink
Drop signatures for public key fields where not needed. (#187)
Browse files Browse the repository at this point in the history
This is a breaking API change, but attempts to maintain wire-compatibility for EDP Requisition fulfillment.
  • Loading branch information
SanjayVas committed Nov 13, 2023
1 parent 1d0334f commit 5a7f1e8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
1 change: 1 addition & 0 deletions src/main/proto/wfa/measurement/api/v2alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ proto_library(
":protocol_config_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_protobuf//:any_proto",
],
)

Expand Down
26 changes: 8 additions & 18 deletions src/main/proto/wfa/measurement/api/v2alpha/event_group.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ message EventGroup {
plural: "eventGroups"
};

reserved 8;
reserved 3, 4, 8;

// Resource name.
//
Expand All @@ -53,23 +53,6 @@ message EventGroup {
(google.api.field_behavior) = IMMUTABLE
];

// Resource name of the `Certificate` belonging to `measurement_consumer`.
// Must be set if `measurement_consumer_public_key` is set.
string measurement_consumer_certificate = 3
[(google.api.resource_reference).type = "halo.wfanet.org/Certificate"];

// Pre-shared serialized `EncryptionPublicKey`, which can be verified using
// `measurement_consumer_certificate`. Must be set if `encrypted_metadata` is
// set.
//
// The version of the `EncryptionPublicKey` message must match the API version
// used to last update this resource.
//
// (-- TODO(@SanjayVas): Include the `message` directly rather than
// wrapping it in a `SignedMessage`. The signature is not needed here, as
// the `DataProvider` should have already verified it. --)
SignedMessage measurement_consumer_public_key = 4;

// ID referencing the `EventGroup` in an external system, provided by the
// `DataProvider`.
string event_group_reference_id = 5;
Expand Down Expand Up @@ -114,6 +97,13 @@ message EventGroup {
// to last update this resource.
EncryptedMessage encrypted_metadata = 10;

// Pre-shared packed `EncryptionPublicKey` Must be set if `encrypted_metadata`
// is set.
//
// The version of the `EncryptionPublicKey` message must match the API version
// used to last update this resource.
google.protobuf.Any measurement_consumer_public_key = 12;

// Possible states of Event Group.
enum State {
// The default value if state is omitted. Should not be used
Expand Down
17 changes: 9 additions & 8 deletions src/main/proto/wfa/measurement/api/v2alpha/measurement.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package wfa.measurement.api.v2alpha;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "wfa/measurement/api/v2alpha/crypto.proto";
import "wfa/measurement/api/v2alpha/direct_computation.proto";
Expand Down Expand Up @@ -68,24 +69,24 @@ message Measurement {

// Value of a map entry.
message Value {
reserved 3;
reserved 2, 3;

// Resource name of the `Certificate` belonging to `data_provider`.
//
// (--
// TODO(world-federation-of-advertisers/cross-media-measurement-api#188):
// Remove this once the certificate is always specified in
// `FulfillDirectRequisitionRequest`. --)
string data_provider_certificate = 1 [
(google.api.resource_reference).type = "halo.wfanet.org/Certificate",
(google.api.field_behavior) = REQUIRED
];

// Pre-shared serialized `EncryptionPublicKey`, which can be verified
// using `data_provider_certificate`.
// Pre-shared packed `EncryptionPublicKey`.
//
// The version of the `EncryptionPublicKey` message type must correspond
// to the API version that this resource was created in.
//
// (-- TODO(@SanjayVas): Include the `message` directly rather than
// wrapping it in a `SignedMessage`. The signature is not needed here, as
// the `MeasurementConsumer` should have already verified it. --)
SignedMessage data_provider_public_key = 2
google.protobuf.Any data_provider_public_key = 6
[(google.api.field_behavior) = REQUIRED];

// Encrypted `SignedMessage` containing the serialized `RequisitionSpec`
Expand Down
16 changes: 15 additions & 1 deletion src/main/proto/wfa/measurement/api/v2alpha/requisition.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package wfa.measurement.api.v2alpha;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/any.proto";
import "wfa/measurement/api/v2alpha/crypto.proto";
import "wfa/measurement/api/v2alpha/measurement.proto";
import "wfa/measurement/api/v2alpha/protocol_config.proto";
Expand Down Expand Up @@ -75,6 +76,11 @@ message Requisition {

// Denormalized `data_provider_certificate` field from the corresponding
// `DataProviderEntry` in `measurement`.
//
// (--
// TODO(world-federation-of-advertisers/cross-media-measurement-api#188):
// Remove this once the certificate is always specified in
// `FulfillDirectRequisitionRequest`. --)
string data_provider_certificate = 6 [
(google.api.resource_reference).type = "halo.wfanet.org/Certificate",
(google.api.field_behavior) = OUTPUT_ONLY,
Expand All @@ -83,11 +89,19 @@ message Requisition {

// Denormalized `data_provider_public_key` field from the corresponding
// `DataProviderEntry` in `measurement`.
SignedMessage data_provider_public_key = 7 [
google.protobuf.Any data_provider_public_key = 15 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.field_behavior) = IMMUTABLE
];

// Denormalized `data_provider_public_key` field with signature from the
// corresponding `DataProviderEntry` in `measurement`.
//
// Deprecated: The `Measurement` may not have signature for this key. Use
// `data_provider_public_key` instead.
SignedMessage signed_data_provider_public_key = 7
[(google.api.field_behavior) = OUTPUT_ONLY, deprecated = true];

// Denormalized `encrypted_requisition_spec` field from the corresponding
// `DataProviderEntry` in `measurement`.
EncryptedMessage encrypted_requisition_spec = 14 [
Expand Down

0 comments on commit 5a7f1e8

Please sign in to comment.