Skip to content

Commit

Permalink
chore: Update protos
Browse files Browse the repository at this point in the history
Signed-off-by: Oğuzhan Durgun <[email protected]>
  • Loading branch information
oguzhand95 committed Jul 12, 2023
1 parent ce2a116 commit 383868a
Show file tree
Hide file tree
Showing 13 changed files with 488 additions and 10 deletions.
12 changes: 6 additions & 6 deletions buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ deps:
- remote: buf.build
owner: cerbos
repository: cerbos-api
commit: 9930b65ea1d14cd7abdffdc4d7591344
digest: shake256:92c9aa8d21618f28a085b024f589811a30d9bca2d9094388e80e4294737ad39abcae5a205dd7e00610348d20998a7c033aa02d97a85b3beba3f01260034005aa
commit: 4abef86015ac4820ab27a18b6ee1ea09
digest: shake256:fa5fad499e01e49b7558d7892bf97128ed3602c6250265f74835d07e175cca110bf088632cd1adff46586cf548ddb321236db466501ff4a54b1325ebecebc9bb
- remote: buf.build
owner: envoyproxy
repository: protoc-gen-validate
Expand All @@ -14,10 +14,10 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 5ae7f88519b04fe1965da0f8a375a088
digest: shake256:27d9fcdc0e3eb957449dc3d17e2d24c7ce59c3c483ecf128818183c336dfd28595ecd13771fb3172247775caf7707c4076dd8e70c5ac2cbcac170df35e4d0028
commit: cc916c31859748a68fd229a3c8d7a2e8
digest: shake256:469b049d0eb04203d5272062636c078decefc96fec69739159c25d85349c50c34c7706918a8b216c5c27f76939df48452148cff8c5c3ae77fa6ba5c25c1b8bf8
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
commit: a1ecdc58eccd49aa8bea2a7a9022dc27
digest: shake256:efdd86fbdc42e8b7259fe461a49656827a03fb7cba0b3b9eb622ca10654ec6beccb9a051229c1553ccd89ed3e95d69ad4d7c799f1da3f3f1bd447b7947a4893e
commit: 11c9972ea0fd4c95a2c38d29bb1dc817
digest: shake256:9c7ce822dff52ad28714465396fbe98e879409677a61687b7dd9bb3d1484aa5d1704c013698b24f34c5d51023dbff47287ecd9676271953c25e646b42ebb76c5
31 changes: 30 additions & 1 deletion protos/cerbos/policy/v1/policy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ message Policy {
ResourcePolicy resource_policy = 5;
PrincipalPolicy principal_policy = 6;
DerivedRoles derived_roles = 7;
ExportVariables export_variables = 10;
}
map<string, string> variables = 8;
map<string, string> variables = 8 [deprecated = true];
string json_schema = 9 [json_name = "$schema"];
}

message Metadata {
Expand All @@ -53,6 +55,7 @@ message ResourcePolicy {
repeated ResourceRule rules = 4;
string scope = 5 [(validate.rules).string.pattern = "^([[:alnum:]][[:word:]\\-]*(\\.[[:word:]\\-]*)*)*$"];
Schemas schemas = 6;
Variables variables = 7;
}

message ResourceRule {
Expand Down Expand Up @@ -94,6 +97,7 @@ message PrincipalPolicy {
string version = 2 [(validate.rules).string.pattern = "^[[:word:]]+$"];
repeated PrincipalRule rules = 3;
string scope = 4 [(validate.rules).string.pattern = "^([[:alnum:]][[:word:]\\-]*(\\.[[:word:]\\-]*)*)*$"];
Variables variables = 5;
}

message PrincipalRule {
Expand All @@ -120,6 +124,7 @@ message DerivedRoles {
min_len: 1
}];
repeated RoleDef definitions = 2 [(validate.rules).repeated.min_items = 1];
Variables variables = 3;
}

message RoleDef {
Expand All @@ -134,6 +139,24 @@ message RoleDef {
Condition condition = 3;
}

message ExportVariables {
string name = 1 [(validate.rules).string = {
pattern: "^[[:word:]\\-\\.]+$",
min_len: 1
}];
map<string, string> definitions = 2;
}

message Variables {
repeated string import = 1 [(validate.rules).repeated = {
unique: true,
items {
string {pattern: "^[[:word:]\\-\\.]+$"}
}
}];
map<string, string> local = 2;
}

message Condition {
oneof condition {
option (validate.required) = true;
Expand Down Expand Up @@ -183,12 +206,17 @@ message Schemas {
message TestFixture {
message Principals {
map<string, cerbos.engine.v1.Principal> principals = 1;
string json_schema = 2 [json_name = "$schema"];
}

message Resources {
map<string, cerbos.engine.v1.Resource> resources = 1;
string json_schema = 2 [json_name = "$schema"];
}

message AuxData {
map<string, cerbos.engine.v1.AuxData> aux_data = 1;
string json_schema = 2 [json_name = "$schema"];
}
}

Expand All @@ -206,6 +234,7 @@ message TestSuite {
map<string, cerbos.engine.v1.Resource> resources = 7;
map<string, cerbos.engine.v1.AuxData> aux_data = 8;
TestOptions options = 9;
string json_schema = 10 [json_name = "$schema"];
}

message TestTable {
Expand Down
37 changes: 37 additions & 0 deletions src/Cerbos/Policy/V1/DerivedRoles.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions src/Cerbos/Policy/V1/ExportVariables.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 63 additions & 3 deletions src/Cerbos/Policy/V1/Policy.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 383868a

Please sign in to comment.