-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ControlPlane initial proto definitions. (#1843)
Co-authored-by: Marco Premier <[email protected]> Co-authored-by: marcopremier <[email protected]>
- Loading branch information
1 parent
b5c84f8
commit 80b8c44
Showing
6 changed files
with
215 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/proto/wfa/measurement/securecomputation/controlplane/v1alpha/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load( | ||
"@wfa_rules_kotlin_jvm//kotlin:defs.bzl", | ||
"kt_jvm_grpc_proto_library", | ||
"kt_jvm_proto_library", | ||
) | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
IMPORT_PREFIX = "/src/main/proto" | ||
|
||
#Resources and shared message types. | ||
|
||
proto_library( | ||
name = "queue_proto", | ||
srcs = ["queue.proto"], | ||
strip_import_prefix = IMPORT_PREFIX, | ||
deps = [ | ||
"@com_google_googleapis//google/api:field_behavior_proto", | ||
"@com_google_googleapis//google/api:resource_proto", | ||
], | ||
) | ||
|
||
kt_jvm_proto_library( | ||
name = "queue_kt_jvm_proto", | ||
deps = [":queue_proto"], | ||
) | ||
|
||
proto_library( | ||
name = "work_item_proto", | ||
srcs = ["work_item.proto"], | ||
strip_import_prefix = IMPORT_PREFIX, | ||
deps = [ | ||
"@com_google_googleapis//google/api:field_behavior_proto", | ||
"@com_google_googleapis//google/api:resource_proto", | ||
"@com_google_protobuf//:any_proto", | ||
], | ||
) | ||
|
||
kt_jvm_proto_library( | ||
name = "work_item_kt_jvm_proto", | ||
deps = [":work_item_proto"], | ||
) | ||
|
||
#Services. | ||
|
||
proto_library( | ||
name = "work_items_service_proto", | ||
srcs = ["work_items_service.proto"], | ||
strip_import_prefix = IMPORT_PREFIX, | ||
deps = [ | ||
":work_item_proto", | ||
"@com_google_googleapis//google/api:client_proto", | ||
"@com_google_googleapis//google/api:field_behavior_proto", | ||
], | ||
) | ||
|
||
kt_jvm_grpc_proto_library( | ||
name = "work_items_service_kt_jvm_grpc_proto", | ||
deps = [":work_items_service_proto"], | ||
) |
37 changes: 37 additions & 0 deletions
37
src/main/proto/wfa/measurement/securecomputation/controlplane/v1alpha/queue.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2024 The Cross-Media Measurement Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package wfa.measurement.securecomputation.controlplane.v1alpha; | ||
|
||
import "google/api/field_behavior.proto"; | ||
import "google/api/resource.proto"; | ||
|
||
option java_package = "org.wfanet.measurement.securecomputation.controlplane.v1alpha"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "QueueProto"; | ||
|
||
// Resource representing a queue. | ||
message Queue { | ||
option (google.api.resource) = { | ||
type: "control-plane.secure-computation.halo-cmm.org/Queue" | ||
pattern: "queues/{queue}" | ||
singular: "queue" | ||
plural: "queues" | ||
}; | ||
|
||
// Resource name. | ||
string name = 1 [(google.api.field_behavior) = IDENTIFIER]; | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/proto/wfa/measurement/securecomputation/controlplane/v1alpha/work_item.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2024 The Cross-Media Measurement Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package wfa.measurement.securecomputation.controlplane.v1alpha; | ||
|
||
import "google/protobuf/any.proto"; | ||
import "google/api/field_behavior.proto"; | ||
import "google/api/resource.proto"; | ||
|
||
option java_package = "org.wfanet.measurement.securecomputation.controlplane.v1alpha"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "WorkItemProto"; | ||
|
||
// Resource representing a work item. | ||
message WorkItem { | ||
option (google.api.resource) = { | ||
type: "control-plane.secure-computation.halo-cmm.org/WorkItem" | ||
pattern: "workItems/{work_item}" | ||
singular: "workItem" | ||
plural: "workItems" | ||
}; | ||
|
||
// Resource name. | ||
string name = 1 [(google.api.field_behavior) = IDENTIFIER]; | ||
|
||
// The queue into which this `WorkItem` must be enqueued. | ||
// Available queues are specified in a configuration file. | ||
string queue = 2 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = { | ||
type: "control-plane.secure-computation.halo-cmm.org/Queue" | ||
} | ||
]; | ||
// The parameters to be delivered to the TEE application. | ||
google.protobuf.Any work_item_params = 3 | ||
[(google.api.field_behavior) = IMMUTABLE]; | ||
} |
50 changes: 50 additions & 0 deletions
50
...ain/proto/wfa/measurement/securecomputation/controlplane/v1alpha/work_items_service.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2024 The Cross-Media Measurement Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package wfa.measurement.securecomputation.controlplane.v1alpha; | ||
|
||
import "google/api/client.proto"; | ||
import "google/api/field_behavior.proto"; | ||
import "wfa/measurement/securecomputation/controlplane/v1alpha/work_item.proto"; | ||
|
||
option java_package = "org.wfanet.measurement.securecomputation.controlplane.v1alpha"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "WorkItemsServiceProto"; | ||
|
||
// Service for interacting with `WorkItems` resources. | ||
service WorkItems { | ||
// Creates a `WorkItem`. | ||
// | ||
// Enqueues the `WorkItem` into the appropriate queue. | ||
// Results in PERMISSION_DENIED if the queue specified in the `WorkItem` | ||
// is not listed in the configuration file. | ||
rpc CreateWorkItem(CreateWorkItemRequest) returns (WorkItem) { | ||
option (google.api.method_signature) = "work_item,work_item_id"; | ||
} | ||
} | ||
|
||
// Request message for `CreateWorkItem` method. | ||
message CreateWorkItemRequest { | ||
// The ID to use for the `WorkItem`, which will become the final | ||
// component of the `WorkItem`s resource name. | ||
// | ||
// This must conform to RFC 1034, with the additional restriction that all | ||
// letters must be lower-case. | ||
string work_item_id = 1 [(google.api.field_behavior) = REQUIRED]; | ||
|
||
// The `WorkItem` to create. | ||
WorkItem work_item = 2 [(google.api.field_behavior) = REQUIRED]; | ||
} |