diff --git a/buf.lock b/buf.lock index eba5995..f382f01 100644 --- a/buf.lock +++ b/buf.lock @@ -9,8 +9,8 @@ deps: - remote: buf.build owner: cerbos repository: cerbos-api - commit: df180e07d6154eb8a2d7801459003b9f - digest: shake256:b2712ba97cdbf03c5111261ed409b5d77cf0c9aa2336cfb6a4f78a22f75598e3ff30efba74429cb91ef1edad3eed653f1a4a1f2741671d434846ef6db4faeb05 + commit: e27328ec963d4f538a5c970aeec688b8 + digest: shake256:71ab15742b3a474818482b0104f9b7377d7e722f2ad0a149db42abf257ed88c6043f9763ec651bfe6836b56f834bce54c52399c9f77ac77fe161d510d63e341b - remote: buf.build owner: googleapis repository: googleapis diff --git a/proto/cerbos/request/v1/request.proto b/proto/cerbos/request/v1/request.proto index d8f3d80..db591c8 100644 --- a/proto/cerbos/request/v1/request.proto +++ b/proto/cerbos/request/v1/request.proto @@ -445,14 +445,14 @@ message AddOrUpdatePolicyRequest { repeated cerbos.policy.v1.Policy policies = 1 [ (buf.validate.field).repeated = { min_items: 1, - max_items: 10 + max_items: 100 }, (buf.validate.field).required = true, (google.api.field_behavior) = REQUIRED, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "List of policies." min_items: 1 - max_items: 10 + max_items: 100 } ]; } @@ -554,6 +554,19 @@ message ListPoliciesRequest { (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Filter policies by version with regexp"} ]; + repeated string policy_id = 5 [ + (google.api.field_behavior) = OPTIONAL, + (buf.validate.field).repeated = { + max_items: 25, + items { + string {min_len: 1} + } + }, + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "For blob, disk, git stores use file name (.yaml). For mysql, postgres, sqlite3 use id (..) of the policy" + example: "\"principal.sarah.vdefault\"" + } + ]; } message GetPolicyRequest { @@ -565,12 +578,8 @@ message GetPolicyRequest { (buf.validate.field).repeated = { unique: true, min_items: 1, - max_items: 25, items { - string { - min_len: 1, - max_len: 1280 - } + string {min_len: 1} } }, (buf.validate.field).required = true, @@ -590,12 +599,8 @@ message DisablePolicyRequest { (buf.validate.field).repeated = { unique: true, min_items: 1, - max_items: 25, items { - string { - min_len: 1, - max_len: 1280 - } + string {min_len: 1} } }, (buf.validate.field).required = true, @@ -615,12 +620,8 @@ message EnablePolicyRequest { (buf.validate.field).repeated = { unique: true, min_items: 1, - max_items: 25, items { - string { - min_len: 1, - max_len: 1280 - } + string {min_len: 1} } }, (buf.validate.field).required = true, @@ -651,6 +652,19 @@ message InspectPoliciesRequest { (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Filter policies by version with regexp"} ]; + repeated string policy_id = 5 [ + (google.api.field_behavior) = OPTIONAL, + (buf.validate.field).repeated = { + max_items: 25, + items { + string {min_len: 1} + } + }, + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "For blob, disk, git stores use file name (.yaml). For mysql, postgres, sqlite3 use id (..) of the policy" + example: "\"principal.sarah.vdefault\"" + } + ]; } message AddOrUpdateSchemaRequest { @@ -662,13 +676,13 @@ message AddOrUpdateSchemaRequest { (google.api.field_behavior) = REQUIRED, (buf.validate.field).repeated = { min_items: 1, - max_items: 10 + max_items: 100 }, (buf.validate.field).required = true, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "List of schemas." min_items: 1 - max_items: 10 + max_items: 100 } ]; } @@ -688,7 +702,6 @@ message GetSchemaRequest { (buf.validate.field).repeated = { unique: true, min_items: 1, - max_items: 25, items { string { min_len: 1, @@ -713,7 +726,6 @@ message DeleteSchemaRequest { (buf.validate.field).repeated = { unique: true, min_items: 1, - max_items: 25, items { string { min_len: 1, diff --git a/proto/cerbos/response/v1/response.proto b/proto/cerbos/response/v1/response.proto index c4ef9cb..732750e 100644 --- a/proto/cerbos/response/v1/response.proto +++ b/proto/cerbos/response/v1/response.proto @@ -444,8 +444,27 @@ message InspectPoliciesResponse { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { json_schema: {description: "Inspect policies response"} }; + + message Variable { + enum Kind { + KIND_UNSPECIFIED = 0; + KIND_EXPORTED = 1; + KIND_IMPORTED = 2; + KIND_LOCAL = 3; + KIND_UNDEFINED = 4; + KIND_UNKNOWN = 5; + } + + string name = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Variable name defined in the policy."}]; + string value = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Raw value of the variable defined in the policy."}]; + Kind kind = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Kind of the variable defined in the policy."}]; + string source = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Source of the variable defined in the policy. Only exists if the kind is imported."}]; + bool used = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Whether the variable is used in a condition."}]; + } + message Result { - repeated string actions = 1; + repeated string actions = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Actions defined in the policy"}]; + repeated Variable variables = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Variables defined in the policy"}]; } map results = 1; diff --git a/src/Sdk.UnitTests/Sdk.UnitTests.csproj b/src/Sdk.UnitTests/Sdk.UnitTests.csproj index eb92606..91b354b 100644 --- a/src/Sdk.UnitTests/Sdk.UnitTests.csproj +++ b/src/Sdk.UnitTests/Sdk.UnitTests.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Sdk/Cerbos/Api/V1/Request/Request.g.cs b/src/Sdk/Cerbos/Api/V1/Request/Request.g.cs index bda60a3..fa7e462 100644 --- a/src/Sdk/Cerbos/Api/V1/Request/Request.g.cs +++ b/src/Sdk/Cerbos/Api/V1/Request/Request.g.cs @@ -190,8 +190,8 @@ static RequestReflection() { "a1Jlc291cmNlczofkkEcChoyGFBsYXlncm91bmQgcHJveHkgcmVxdWVzdEIW", "Cg1wc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5hbWUgd2l0aCByZWdleHDiQQEB", @@ -222,46 +222,56 @@ static RequestReflection() { "ZXIgcG9saWNpZXMgYnkgc2NvcGUgd2l0aCByZWdleHDiQQEBUgtzY29wZVJl", "Z2V4cBJWCg52ZXJzaW9uX3JlZ2V4cBgEIAEoCUIvkkEoMiZGaWx0ZXIgcG9s", "aWNpZXMgYnkgdmVyc2lvbiB3aXRoIHJlZ2V4cOJBAQFSDXZlcnNpb25SZWdl", - "eHA6HJJBGQoXMhVMaXN0IHBvbGljaWVzIHJlcXVlc3QihwIKEEdldFBvbGlj", - "eVJlcXVlc3QS1wEKAmlkGAEgAygJQsYBkkGmATKHAUZvciBibG9iLCBkaXNr", - "LCBnaXQgc3RvcmVzIHVzZSBmaWxlIG5hbWUgKDxmaWxlbmFtZT4ueWFtbCku", - "IEZvciBteXNxbCwgcG9zdGdyZXMsIHNxbGl0ZTMgdXNlIGlkICg8a2luZD4u", - "PG5hbWU+Ljx2ZXJzaW9uPikgb2YgdGhlIHBvbGljeUoaInByaW5jaXBhbC5z", - "YXJhaC52ZGVmYXVsdCLiQQECukgVyAEBkgEPCAEQGRgBIgdyBRABGIAKUgJp", - "ZDoZkkEWChQyEkdldCBwb2xpY3kgcmVxdWVzdCKkAQoURGlzYWJsZVBvbGlj", - "eVJlcXVlc3QSbQoCaWQYASADKAlCXZJBPjIgVW5pcXVlIGlkZW50aWZpZXIg", - "Zm9yIHRoZSBwb2xpY3lKGiJwcmluY2lwYWwuc2FyYWgudmRlZmF1bHQi4kEB", - "ArpIFcgBAZIBDwgBEBkYASIHcgUQARiAClICaWQ6HZJBGgoYMhZEaXNhYmxl", - "IHBvbGljeSByZXF1ZXN0IqIBChNFbmFibGVQb2xpY3lSZXF1ZXN0Em0KAmlk", - "GAEgAygJQl2SQT4yIFVuaXF1ZSBpZGVudGlmaWVyIGZvciB0aGUgcG9saWN5", - "ShoicHJpbmNpcGFsLnNhcmFoLnZkZWZhdWx0IuJBAQK6SBXIAQGSAQ8IARAZ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ZAQoTRGVsZXRlU2NoZW1hUmVxdWVzdBJhCgJpZBgBIAMo", + "CUJRkkE0MiBVbmlxdWUgaWRlbnRpZmllciBmb3IgdGhlIHNjaGVtYUoQInBy", + "aW5jaXBhbC5qc29uIuJBAQK6SBPIAQGSAQ0IARgBIgdyBRABGP8BUgJpZDof", + "kkEcChoyGERlbGV0ZSBzY2hlbWEocykgcmVxdWVzdCJ5ChJSZWxvYWRTdG9y", + "ZVJlcXVlc3QSRgoEd2FpdBgBIAEoCEIykkErMilXYWl0IHVudGlsIHRoZSBy", + "ZWxvYWRpbmcgcHJvY2VzcyBmaW5pc2hlc+JBAQFSBHdhaXQ6G5JBGAoWMhRS", + "ZWxvYWQgc3RvcmUgcmVxdWVzdEJzChlkZXYuY2VyYm9zLmFwaS52MS5yZXF1", + "ZXN0Wj5naXRodWIuY29tL2NlcmJvcy9jZXJib3MvYXBpL2dlbnBiL2NlcmJv", + "cy9yZXF1ZXN0L3YxO3JlcXVlc3R2MaoCFUNlcmJvcy5BcGkuVjEuUmVxdWVz", + "dGIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Buf.Validate.ValidateReflection.Descriptor, global::Cerbos.Api.V1.Engine.EngineReflection.Descriptor, global::Cerbos.Api.V1.Policy.PolicyReflection.Descriptor, global::Cerbos.Api.V1.Schema.SchemaReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Grpc.Gateway.ProtocGenOpenapiv2.Options.AnnotationsReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -280,11 +290,11 @@ static RequestReflection() { new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.AddOrUpdatePolicyRequest), global::Cerbos.Api.V1.Request.AddOrUpdatePolicyRequest.Parser, new[]{ "Policies" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.ListAuditLogEntriesRequest), global::Cerbos.Api.V1.Request.ListAuditLogEntriesRequest.Parser, new[]{ "Kind", "Tail", "Between", "Since", "Lookup" }, new[]{ "Filter" }, new[]{ typeof(global::Cerbos.Api.V1.Request.ListAuditLogEntriesRequest.Types.Kind) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.ListAuditLogEntriesRequest.Types.TimeRange), global::Cerbos.Api.V1.Request.ListAuditLogEntriesRequest.Types.TimeRange.Parser, new[]{ "Start", "End" }, null, null, null, null)}), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.ServerInfoRequest), global::Cerbos.Api.V1.Request.ServerInfoRequest.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.ListPoliciesRequest), global::Cerbos.Api.V1.Request.ListPoliciesRequest.Parser, new[]{ "IncludeDisabled", "NameRegexp", "ScopeRegexp", "VersionRegexp" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.ListPoliciesRequest), global::Cerbos.Api.V1.Request.ListPoliciesRequest.Parser, new[]{ "IncludeDisabled", "NameRegexp", "ScopeRegexp", "VersionRegexp", "PolicyId" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.GetPolicyRequest), global::Cerbos.Api.V1.Request.GetPolicyRequest.Parser, new[]{ "Id" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.DisablePolicyRequest), global::Cerbos.Api.V1.Request.DisablePolicyRequest.Parser, new[]{ "Id" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.EnablePolicyRequest), global::Cerbos.Api.V1.Request.EnablePolicyRequest.Parser, new[]{ "Id" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.InspectPoliciesRequest), global::Cerbos.Api.V1.Request.InspectPoliciesRequest.Parser, new[]{ "IncludeDisabled", "NameRegexp", "ScopeRegexp", "VersionRegexp" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.InspectPoliciesRequest), global::Cerbos.Api.V1.Request.InspectPoliciesRequest.Parser, new[]{ "IncludeDisabled", "NameRegexp", "ScopeRegexp", "VersionRegexp", "PolicyId" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.AddOrUpdateSchemaRequest), global::Cerbos.Api.V1.Request.AddOrUpdateSchemaRequest.Parser, new[]{ "Schemas" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.ListSchemasRequest), global::Cerbos.Api.V1.Request.ListSchemasRequest.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Request.GetSchemaRequest), global::Cerbos.Api.V1.Request.GetSchemaRequest.Parser, new[]{ "Id" }, null, null, null, null), @@ -5655,6 +5665,7 @@ public ListPoliciesRequest(ListPoliciesRequest other) : this() { nameRegexp_ = other.nameRegexp_; scopeRegexp_ = other.scopeRegexp_; versionRegexp_ = other.versionRegexp_; + policyId_ = other.policyId_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -5712,6 +5723,17 @@ public string VersionRegexp { } } + /// Field number for the "policy_id" field. + public const int PolicyIdFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_policyId_codec + = pb::FieldCodec.ForString(42); + private readonly pbc::RepeatedField policyId_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PolicyId { + get { return policyId_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -5731,6 +5753,7 @@ public bool Equals(ListPoliciesRequest other) { if (NameRegexp != other.NameRegexp) return false; if (ScopeRegexp != other.ScopeRegexp) return false; if (VersionRegexp != other.VersionRegexp) return false; + if(!policyId_.Equals(other.policyId_)) return false; return Equals(_unknownFields, other._unknownFields); } @@ -5742,6 +5765,7 @@ public override int GetHashCode() { if (NameRegexp.Length != 0) hash ^= NameRegexp.GetHashCode(); if (ScopeRegexp.Length != 0) hash ^= ScopeRegexp.GetHashCode(); if (VersionRegexp.Length != 0) hash ^= VersionRegexp.GetHashCode(); + hash ^= policyId_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -5776,6 +5800,7 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(34); output.WriteString(VersionRegexp); } + policyId_.WriteTo(output, _repeated_policyId_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -5802,6 +5827,7 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(34); output.WriteString(VersionRegexp); } + policyId_.WriteTo(ref output, _repeated_policyId_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -5824,6 +5850,7 @@ public int CalculateSize() { if (VersionRegexp.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(VersionRegexp); } + size += policyId_.CalculateSize(_repeated_policyId_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -5848,6 +5875,7 @@ public void MergeFrom(ListPoliciesRequest other) { if (other.VersionRegexp.Length != 0) { VersionRegexp = other.VersionRegexp; } + policyId_.Add(other.policyId_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -5879,6 +5907,10 @@ public void MergeFrom(pb::CodedInputStream input) { VersionRegexp = input.ReadString(); break; } + case 42: { + policyId_.AddEntriesFrom(input, _repeated_policyId_codec); + break; + } } } #endif @@ -5910,6 +5942,10 @@ public void MergeFrom(pb::CodedInputStream input) { VersionRegexp = input.ReadString(); break; } + case 42: { + policyId_.AddEntriesFrom(ref input, _repeated_policyId_codec); + break; + } } } } @@ -6489,6 +6525,7 @@ public InspectPoliciesRequest(InspectPoliciesRequest other) : this() { nameRegexp_ = other.nameRegexp_; scopeRegexp_ = other.scopeRegexp_; versionRegexp_ = other.versionRegexp_; + policyId_ = other.policyId_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -6546,6 +6583,17 @@ public string VersionRegexp { } } + /// Field number for the "policy_id" field. + public const int PolicyIdFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_policyId_codec + = pb::FieldCodec.ForString(42); + private readonly pbc::RepeatedField policyId_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField PolicyId { + get { return policyId_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -6565,6 +6613,7 @@ public bool Equals(InspectPoliciesRequest other) { if (NameRegexp != other.NameRegexp) return false; if (ScopeRegexp != other.ScopeRegexp) return false; if (VersionRegexp != other.VersionRegexp) return false; + if(!policyId_.Equals(other.policyId_)) return false; return Equals(_unknownFields, other._unknownFields); } @@ -6576,6 +6625,7 @@ public override int GetHashCode() { if (NameRegexp.Length != 0) hash ^= NameRegexp.GetHashCode(); if (ScopeRegexp.Length != 0) hash ^= ScopeRegexp.GetHashCode(); if (VersionRegexp.Length != 0) hash ^= VersionRegexp.GetHashCode(); + hash ^= policyId_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -6610,6 +6660,7 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(34); output.WriteString(VersionRegexp); } + policyId_.WriteTo(output, _repeated_policyId_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -6636,6 +6687,7 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawTag(34); output.WriteString(VersionRegexp); } + policyId_.WriteTo(ref output, _repeated_policyId_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -6658,6 +6710,7 @@ public int CalculateSize() { if (VersionRegexp.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(VersionRegexp); } + size += policyId_.CalculateSize(_repeated_policyId_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -6682,6 +6735,7 @@ public void MergeFrom(InspectPoliciesRequest other) { if (other.VersionRegexp.Length != 0) { VersionRegexp = other.VersionRegexp; } + policyId_.Add(other.policyId_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -6713,6 +6767,10 @@ public void MergeFrom(pb::CodedInputStream input) { VersionRegexp = input.ReadString(); break; } + case 42: { + policyId_.AddEntriesFrom(input, _repeated_policyId_codec); + break; + } } } #endif @@ -6744,6 +6802,10 @@ public void MergeFrom(pb::CodedInputStream input) { VersionRegexp = input.ReadString(); break; } + case 42: { + policyId_.AddEntriesFrom(ref input, _repeated_policyId_codec); + break; + } } } } diff --git a/src/Sdk/Cerbos/Api/V1/Response/Response.g.cs b/src/Sdk/Cerbos/Api/V1/Response/Response.g.cs index e13dea9..d7ec3de 100644 --- a/src/Sdk/Cerbos/Api/V1/Response/Response.g.cs +++ b/src/Sdk/Cerbos/Api/V1/Response/Response.g.cs @@ -272,26 +272,42 @@ static ResponseReflection() { "X3BvbGljaWVzGAEgASgNUhBkaXNhYmxlZFBvbGljaWVzOh6SQRsKGTIXRGlz", "YWJsZSBwb2xpY3kgcmVzcG9uc2UiYAoURW5hYmxlUG9saWN5UmVzcG9uc2US", "KQoQZW5hYmxlZF9wb2xpY2llcxgBIAEoDVIPZW5hYmxlZFBvbGljaWVzOh2S", - "QRoKGDIWRW5hYmxlIHBv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uY29tL2NlcmJvcy9jZXJi", + "b3MvYXBpL2dlbnBiL2NlcmJvcy9yZXNwb25zZS92MTtyZXNwb25zZXYxqgIW", + "Q2VyYm9zLkFwaS5WMS5SZXNwb25zZWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Cerbos.Api.V1.Audit.AuditReflection.Descriptor, global::Cerbos.Api.V1.Effect.EffectReflection.Descriptor, global::Cerbos.Api.V1.Engine.EngineReflection.Descriptor, global::Cerbos.Api.V1.Policy.PolicyReflection.Descriptor, global::Cerbos.Api.V1.Schema.SchemaReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Grpc.Gateway.ProtocGenOpenapiv2.Options.AnnotationsReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -320,7 +336,8 @@ static ResponseReflection() { new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.GetPolicyResponse), global::Cerbos.Api.V1.Response.GetPolicyResponse.Parser, new[]{ "Policies" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.DisablePolicyResponse), global::Cerbos.Api.V1.Response.DisablePolicyResponse.Parser, new[]{ "DisabledPolicies" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.EnablePolicyResponse), global::Cerbos.Api.V1.Response.EnablePolicyResponse.Parser, new[]{ "EnabledPolicies" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.InspectPoliciesResponse), global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Parser, new[]{ "Results" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Result), global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Result.Parser, new[]{ "Actions" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.InspectPoliciesResponse), global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Parser, new[]{ "Results" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable), global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Parser, new[]{ "Name", "Value", "Kind", "Source", "Used" }, null, new[]{ typeof(global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind) }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Result), global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Result.Parser, new[]{ "Actions", "Variables" }, null, null, null, null), null, }), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.AddOrUpdateSchemaResponse), global::Cerbos.Api.V1.Response.AddOrUpdateSchemaResponse.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Cerbos.Api.V1.Response.ListSchemasResponse), global::Cerbos.Api.V1.Response.ListSchemasResponse.Parser, new[]{ "SchemaIds" }, null, null, null, null), @@ -8525,6 +8542,360 @@ public void MergeFrom(pb::CodedInputStream input) { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { + public sealed partial class Variable : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Variable()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Variable() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Variable(Variable other) : this() { + name_ = other.name_; + value_ = other.value_; + kind_ = other.kind_; + source_ = other.source_; + used_ = other.used_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Variable Clone() { + return new Variable(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "value" field. + public const int ValueFieldNumber = 2; + private string value_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Value { + get { return value_; } + set { + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "kind" field. + public const int KindFieldNumber = 3; + private global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind kind_ = global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind.Unspecified; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind Kind { + get { return kind_; } + set { + kind_ = value; + } + } + + /// Field number for the "source" field. + public const int SourceFieldNumber = 4; + private string source_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Source { + get { return source_; } + set { + source_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "used" field. + public const int UsedFieldNumber = 5; + private bool used_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Used { + get { return used_; } + set { + used_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Variable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Variable other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (Value != other.Value) return false; + if (Kind != other.Kind) return false; + if (Source != other.Source) return false; + if (Used != other.Used) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (Value.Length != 0) hash ^= Value.GetHashCode(); + if (Kind != global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind.Unspecified) hash ^= Kind.GetHashCode(); + if (Source.Length != 0) hash ^= Source.GetHashCode(); + if (Used != false) hash ^= Used.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Value.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Value); + } + if (Kind != global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind.Unspecified) { + output.WriteRawTag(24); + output.WriteEnum((int) Kind); + } + if (Source.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Source); + } + if (Used != false) { + output.WriteRawTag(40); + output.WriteBool(Used); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Value.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Value); + } + if (Kind != global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind.Unspecified) { + output.WriteRawTag(24); + output.WriteEnum((int) Kind); + } + if (Source.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Source); + } + if (Used != false) { + output.WriteRawTag(40); + output.WriteBool(Used); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (Value.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); + } + if (Kind != global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind.Unspecified) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Kind); + } + if (Source.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Source); + } + if (Used != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Variable other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.Value.Length != 0) { + Value = other.Value; + } + if (other.Kind != global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind.Unspecified) { + Kind = other.Kind; + } + if (other.Source.Length != 0) { + Source = other.Source; + } + if (other.Used != false) { + Used = other.Used; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Value = input.ReadString(); + break; + } + case 24: { + Kind = (global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind) input.ReadEnum(); + break; + } + case 34: { + Source = input.ReadString(); + break; + } + case 40: { + Used = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Value = input.ReadString(); + break; + } + case 24: { + Kind = (global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Types.Kind) input.ReadEnum(); + break; + } + case 34: { + Source = input.ReadString(); + break; + } + case 40: { + Used = input.ReadBool(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the Variable message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum Kind { + [pbr::OriginalName("KIND_UNSPECIFIED")] Unspecified = 0, + [pbr::OriginalName("KIND_EXPORTED")] Exported = 1, + [pbr::OriginalName("KIND_IMPORTED")] Imported = 2, + [pbr::OriginalName("KIND_LOCAL")] Local = 3, + [pbr::OriginalName("KIND_UNDEFINED")] Undefined = 4, + [pbr::OriginalName("KIND_UNKNOWN")] Unknown = 5, + } + + } + #endregion + + } + public sealed partial class Result : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -8539,7 +8910,7 @@ public sealed partial class Result : pb::IMessage [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Descriptor.NestedTypes[0]; } + get { return global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -8560,6 +8931,7 @@ public Result() { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Result(Result other) : this() { actions_ = other.actions_.Clone(); + variables_ = other.variables_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -8580,6 +8952,17 @@ public Result Clone() { get { return actions_; } } + /// Field number for the "variables" field. + public const int VariablesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_variables_codec + = pb::FieldCodec.ForMessage(18, global::Cerbos.Api.V1.Response.InspectPoliciesResponse.Types.Variable.Parser); + private readonly pbc::RepeatedField variables_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Variables { + get { return variables_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -8596,6 +8979,7 @@ public bool Equals(Result other) { return true; } if(!actions_.Equals(other.actions_)) return false; + if(!variables_.Equals(other.variables_)) return false; return Equals(_unknownFields, other._unknownFields); } @@ -8604,6 +8988,7 @@ public bool Equals(Result other) { public override int GetHashCode() { int hash = 1; hash ^= actions_.GetHashCode(); + hash ^= variables_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -8623,6 +9008,7 @@ public void WriteTo(pb::CodedOutputStream output) { output.WriteRawMessage(this); #else actions_.WriteTo(output, _repeated_actions_codec); + variables_.WriteTo(output, _repeated_variables_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -8634,6 +9020,7 @@ public void WriteTo(pb::CodedOutputStream output) { [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { actions_.WriteTo(ref output, _repeated_actions_codec); + variables_.WriteTo(ref output, _repeated_variables_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -8645,6 +9032,7 @@ public void WriteTo(pb::CodedOutputStream output) { public int CalculateSize() { int size = 0; size += actions_.CalculateSize(_repeated_actions_codec); + size += variables_.CalculateSize(_repeated_variables_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -8658,6 +9046,7 @@ public void MergeFrom(Result other) { return; } actions_.Add(other.actions_); + variables_.Add(other.variables_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -8677,6 +9066,10 @@ public void MergeFrom(pb::CodedInputStream input) { actions_.AddEntriesFrom(input, _repeated_actions_codec); break; } + case 18: { + variables_.AddEntriesFrom(input, _repeated_variables_codec); + break; + } } } #endif @@ -8696,6 +9089,10 @@ public void MergeFrom(pb::CodedInputStream input) { actions_.AddEntriesFrom(ref input, _repeated_actions_codec); break; } + case 18: { + variables_.AddEntriesFrom(ref input, _repeated_variables_codec); + break; + } } } } diff --git a/src/Sdk/sdk.csproj b/src/Sdk/sdk.csproj index efe0fce..7aa1b1a 100644 --- a/src/Sdk/sdk.csproj +++ b/src/Sdk/sdk.csproj @@ -16,8 +16,8 @@ - + - +