Skip to content

Commit b317afe

Browse files
akoserwalgithub-actions[bot]
authored andcommitted
Sync updated proto files
1 parent a400efb commit b317afe

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

src/main/proto/kessel/inventory/v1beta1/relationships/k8spolicy_ispropagatedto_k8scluster.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ option java_outer_classname = "K8SPolicyIsPropagatedToK8SClusterProto";
1515
message K8SPolicyIsPropagatedToK8SCluster {
1616

1717
// Metadata about this resource
18-
Metadata metadata = 1 [ (buf.validate.field) = {required: false, ignore: IGNORE_ALWAYS} ];
18+
Metadata metadata = 1 [ (buf.validate.field) = {ignore: IGNORE_ALWAYS} ];
1919

2020
// Write only reporter specific data
2121
ReporterData reporter_data = 245278793 [ json_name = "reporter_data", (buf.validate.field).required = true ];

src/main/proto/kessel/inventory/v1beta2/report_resource_request.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ message ReportResourceRequest {
2323
// Used to:
2424
// - Select the appropriate schema to validate the *Reporter Representation*
2525
// - Identify a *Reporter's Representation* uniquely in Kessel Inventory
26-
string type = 2 [(buf.validate.field).string = {min_len: 1}];
26+
string type = 2 [(buf.validate.field).string = {min_len: 1}, (buf.validate.field).string.pattern = "^[A-Za-z0-9_-]+$"];
2727
// The type of the *Reporter* (e.g., "hbi", "acm", "acs", "notifications").
2828
//
2929
// Must be a previously agreed-upon value between the *Reporter* and Kessel Inventory.
3030
// Must be consistent across all *Reporter Representations* reported by a given *Reporter*.
3131
// Used to:
3232
// - Select the appropriate schema to validate the *Reporter Representation*
3333
// - Identify a *Reporter's Representation* uniquely in Kessel Inventory
34-
string reporter_type = 3 [(buf.validate.field).string = {min_len: 1}];
34+
string reporter_type = 3 [(buf.validate.field).string = {min_len: 1}, (buf.validate.field).string.pattern = "^[A-Za-z0-9_-]+$"];
3535
// Identifier for the specific instance of the *Reporter*.
3636
// This may not be applicable to all Reporters
3737
//

src/main/proto/kessel/inventory/v1beta2/reporter_reference.proto

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ option java_multiple_files = true;
99
option java_package = "org.project_kessel.api.inventory.v1beta2";
1010

1111
message ReporterReference {
12-
string type = 1 [(buf.validate.field).string.min_len = 1];
13-
optional string instance_id = 2;
12+
string type = 1 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.pattern = "^[A-Za-z0-9_]+$"];
13+
optional string instance_id = 2 [
14+
(buf.validate.field).string.pattern =
15+
"(?i)^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$|^[A-Za-z][A-Za-z0-9._-]{0,255}$"
16+
];
1417
}

src/main/proto/kessel/inventory/v1beta2/representation_type.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ option java_multiple_files = true;
99
option java_package = "org.project_kessel.api.inventory.v1beta2";
1010

1111
message RepresentationType {
12-
string resource_type = 1 [(buf.validate.field).string.min_len = 1];
13-
optional string reporter_type = 2;
12+
string resource_type = 1 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.pattern = "^[A-Za-z0-9_]+$"];
13+
optional string reporter_type = 2 [(buf.validate.field).string.pattern = "^[A-Za-z0-9_]+$"];
1414
}

src/main/proto/kessel/inventory/v1beta2/resource_reference.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ option java_multiple_files = true;
1111
option java_package = "org.project_kessel.api.inventory.v1beta2";// A reference to a Subject or, if a `relation` is provided, a Subject Set.
1212

1313
message ResourceReference {
14-
string resource_type = 1 [(buf.validate.field).required = true];
14+
string resource_type = 1 [(buf.validate.field).string.min_len = 1, (buf.validate.field).string.pattern = "^[A-Za-z0-9_]+$"];
1515
string resource_id = 2 [(buf.validate.field).string.min_len = 1];
1616
optional ReporterReference reporter = 3;
1717
}

0 commit comments

Comments
 (0)