diff --git a/buf.lock b/buf.lock new file mode 100644 index 0000000..ba2c4fe --- /dev/null +++ b/buf.lock @@ -0,0 +1,15 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/bufbuild/protovalidate + commit: a6c49f84cc0f4e038680d390392e2ab0 + digest: b5:e968392e88ff7915adcbd1635d670b45bff8836ec2415d81fc559ca5470a695dbdc30030bad8bc5764647c731079e9e7bba0023ea25c4e4a1672a7d2561d4a19 + - name: buf.build/cerbos/cerbos-api + commit: 8169d486796b48a09b0d88c7e83201a3 + digest: b5:55bf735aaa912ebe95d8a74a44f8c6bdf1a8c9bc5cc478e2a95c3c701a64ef7e5e4360c98e861fe2e643348f3998427971365da093158291c38a9599670ed3c3 + - name: buf.build/googleapis/googleapis + commit: 2bbd25900cb34c79bae97d85c948d3cf + digest: b5:3a12d858b0efcf53739b0fe6b4f83ccef246a0a26d257dc50a7d0d0794be3b6df941cf7e1dbf92f81c25ae60806132bf37b1af76a9311be8905f5da52c6a5f66 + - name: buf.build/grpc-ecosystem/grpc-gateway + commit: 3f42134f4c564983838425bc43c7a65f + digest: b5:291b947d8ac09492517557e4e72e294788cb8201afc7d0df7bda80fa10931adb60d4d669208a7696bf24f1ecb2a33a16d4c1e766e6f31809248b00343119569b diff --git a/buf.work.yaml b/buf.work.yaml deleted file mode 100644 index 79de0e5..0000000 --- a/buf.work.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -version: v1 -directories: - - protos diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000..3e82a87 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,20 @@ +version: v2 +modules: + - path: protos + name: buf.build/cerbos/cloud-api +deps: + - buf.build/bufbuild/protovalidate + - buf.build/cerbos/cerbos-api + - buf.build/googleapis/googleapis +lint: + use: + - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - WIRE_JSON + except: + - FIELD_SAME_DEFAULT diff --git a/genpb/cerbos/cloud/store/v1/hashpb_helpers.pb.go b/genpb/cerbos/cloud/store/v1/hashpb_helpers.pb.go new file mode 100644 index 0000000..0a2cd5e --- /dev/null +++ b/genpb/cerbos/cloud/store/v1/hashpb_helpers.pb.go @@ -0,0 +1,830 @@ +// Code generated by protoc-gen-go-hashpb. Do not edit. +// protoc-gen-go-hashpb v0.3.1 + +package storev1 + +import ( + v1 "github.com/cerbos/cerbos/api/genpb/cerbos/policy/v1" + protowire "google.golang.org/protobuf/encoding/protowire" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + hash "hash" + math "math" + sort "sort" +) + +func cerbos_cloud_store_v1_GetPoliciesRequest_hashpb_sum(m *GetPoliciesRequest, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.GetPoliciesRequest.store"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetStore())) + + } + if _, ok := ignore["cerbos.cloud.store.v1.GetPoliciesRequest.policy_keys"]; !ok { + if len(m.PolicyKeys) > 0 { + for _, v := range m.PolicyKeys { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } +} + +func cerbos_cloud_store_v1_GetPoliciesResponse_hashpb_sum(m *GetPoliciesResponse, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.GetPoliciesResponse.store_version"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetStoreVersion()))) + + } + if _, ok := ignore["cerbos.cloud.store.v1.GetPoliciesResponse.policies"]; !ok { + if len(m.Policies) > 0 { + keys := make([]string, len(m.Policies)) + i := 0 + for k := range m.Policies { + keys[i] = k + i++ + } + + sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) + + for _, k := range keys { + if m.Policies[k] != nil { + cerbos_policy_v1_Policy_hashpb_sum(m.Policies[k], hasher, ignore) + } + + } + } + } +} + +func cerbos_cloud_store_v1_ListPoliciesRequest_hashpb_sum(m *ListPoliciesRequest, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesRequest.store"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetStore())) + + } + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesRequest.filter"]; !ok { + if m.GetFilter() != nil { + cerbos_cloud_store_v1_PolicyFilter_hashpb_sum(m.GetFilter(), hasher, ignore) + } + + } +} + +func cerbos_cloud_store_v1_ListPoliciesResponse_Policy_hashpb_sum(m *ListPoliciesResponse_Policy, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesResponse.Policy.key"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetKey())) + + } + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesResponse.Policy.kind"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetKind()))) + + } + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesResponse.Policy.name"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetName())) + + } + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesResponse.Policy.version"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetVersion())) + + } + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesResponse.Policy.scope"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetScope())) + + } + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesResponse.Policy.created_at"]; !ok { + if m.GetCreatedAt() != nil { + google_protobuf_Timestamp_hashpb_sum(m.GetCreatedAt(), hasher, ignore) + } + + } +} + +func cerbos_cloud_store_v1_ListPoliciesResponse_hashpb_sum(m *ListPoliciesResponse, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesResponse.store_version"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetStoreVersion()))) + + } + if _, ok := ignore["cerbos.cloud.store.v1.ListPoliciesResponse.policies"]; !ok { + if len(m.Policies) > 0 { + for _, v := range m.Policies { + if v != nil { + cerbos_cloud_store_v1_ListPoliciesResponse_Policy_hashpb_sum(v, hasher, ignore) + } + + } + } + } +} + +func cerbos_cloud_store_v1_ModifyPoliciesRequest_Condition_hashpb_sum(m *ModifyPoliciesRequest_Condition, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.ModifyPoliciesRequest.Condition.store_version_must_equal"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetStoreVersionMustEqual()))) + + } +} + +func cerbos_cloud_store_v1_ModifyPoliciesRequest_hashpb_sum(m *ModifyPoliciesRequest, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.ModifyPoliciesRequest.store"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetStore())) + + } + if _, ok := ignore["cerbos.cloud.store.v1.ModifyPoliciesRequest.condition"]; !ok { + if m.GetCondition() != nil { + cerbos_cloud_store_v1_ModifyPoliciesRequest_Condition_hashpb_sum(m.GetCondition(), hasher, ignore) + } + + } + if _, ok := ignore["cerbos.cloud.store.v1.ModifyPoliciesRequest.operations"]; !ok { + if len(m.Operations) > 0 { + for _, v := range m.Operations { + if v != nil { + cerbos_cloud_store_v1_PolicyOp_hashpb_sum(v, hasher, ignore) + } + + } + } + } +} + +func cerbos_cloud_store_v1_ModifyPoliciesResponse_hashpb_sum(m *ModifyPoliciesResponse, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.ModifyPoliciesResponse.new_store_version"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetNewStoreVersion()))) + + } +} + +func cerbos_cloud_store_v1_PolicyFilter_hashpb_sum(m *PolicyFilter, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.PolicyFilter.kinds"]; !ok { + if len(m.Kinds) > 0 { + for _, v := range m.Kinds { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(v))) + + } + } + } + if _, ok := ignore["cerbos.cloud.store.v1.PolicyFilter.name"]; !ok { + if m.GetName() != nil { + cerbos_cloud_store_v1_StringMatch_hashpb_sum(m.GetName(), hasher, ignore) + } + + } + if _, ok := ignore["cerbos.cloud.store.v1.PolicyFilter.version"]; !ok { + if m.GetVersion() != nil { + cerbos_cloud_store_v1_StringMatch_hashpb_sum(m.GetVersion(), hasher, ignore) + } + + } + if _, ok := ignore["cerbos.cloud.store.v1.PolicyFilter.scope"]; !ok { + if m.GetScope() != nil { + cerbos_cloud_store_v1_StringMatch_hashpb_sum(m.GetScope(), hasher, ignore) + } + + } +} + +func cerbos_cloud_store_v1_PolicyOp_hashpb_sum(m *PolicyOp, hasher hash.Hash, ignore map[string]struct{}) { + if m.Op != nil { + if _, ok := ignore["cerbos.cloud.store.v1.PolicyOp.op"]; !ok { + switch t := m.Op.(type) { + case *PolicyOp_AddOrUpdate: + if t.AddOrUpdate != nil { + cerbos_policy_v1_Policy_hashpb_sum(t.AddOrUpdate, hasher, ignore) + } + + case *PolicyOp_Delete: + _, _ = hasher.Write(protowire.AppendString(nil, t.Delete)) + + } + } + } +} + +func cerbos_cloud_store_v1_StringMatch_InList_hashpb_sum(m *StringMatch_InList, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.cloud.store.v1.StringMatch.InList.values"]; !ok { + if len(m.Values) > 0 { + for _, v := range m.Values { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } +} + +func cerbos_cloud_store_v1_StringMatch_hashpb_sum(m *StringMatch, hasher hash.Hash, ignore map[string]struct{}) { + if m.Match != nil { + if _, ok := ignore["cerbos.cloud.store.v1.StringMatch.match"]; !ok { + switch t := m.Match.(type) { + case *StringMatch_Equals: + _, _ = hasher.Write(protowire.AppendString(nil, t.Equals)) + + case *StringMatch_Like: + _, _ = hasher.Write(protowire.AppendString(nil, t.Like)) + + case *StringMatch_In: + if t.In != nil { + cerbos_cloud_store_v1_StringMatch_InList_hashpb_sum(t.In, hasher, ignore) + } + + } + } + } +} + +func cerbos_policy_v1_Condition_hashpb_sum(m *v1.Condition, hasher hash.Hash, ignore map[string]struct{}) { + if m.Condition != nil { + if _, ok := ignore["cerbos.policy.v1.Condition.condition"]; !ok { + switch t := m.Condition.(type) { + case *v1.Condition_Match: + if t.Match != nil { + cerbos_policy_v1_Match_hashpb_sum(t.Match, hasher, ignore) + } + + case *v1.Condition_Script: + _, _ = hasher.Write(protowire.AppendString(nil, t.Script)) + + } + } + } +} + +func cerbos_policy_v1_DerivedRoles_hashpb_sum(m *v1.DerivedRoles, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.DerivedRoles.name"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetName())) + + } + if _, ok := ignore["cerbos.policy.v1.DerivedRoles.definitions"]; !ok { + if len(m.Definitions) > 0 { + for _, v := range m.Definitions { + if v != nil { + cerbos_policy_v1_RoleDef_hashpb_sum(v, hasher, ignore) + } + + } + } + } + if _, ok := ignore["cerbos.policy.v1.DerivedRoles.variables"]; !ok { + if m.GetVariables() != nil { + cerbos_policy_v1_Variables_hashpb_sum(m.GetVariables(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_ExportVariables_hashpb_sum(m *v1.ExportVariables, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.ExportVariables.name"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetName())) + + } + if _, ok := ignore["cerbos.policy.v1.ExportVariables.definitions"]; !ok { + if len(m.Definitions) > 0 { + keys := make([]string, len(m.Definitions)) + i := 0 + for k := range m.Definitions { + keys[i] = k + i++ + } + + sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) + + for _, k := range keys { + _, _ = hasher.Write(protowire.AppendString(nil, m.Definitions[k])) + + } + } + } +} + +func cerbos_policy_v1_Match_ExprList_hashpb_sum(m *v1.Match_ExprList, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Match.ExprList.of"]; !ok { + if len(m.Of) > 0 { + for _, v := range m.Of { + if v != nil { + cerbos_policy_v1_Match_hashpb_sum(v, hasher, ignore) + } + + } + } + } +} + +func cerbos_policy_v1_Match_hashpb_sum(m *v1.Match, hasher hash.Hash, ignore map[string]struct{}) { + if m.Op != nil { + if _, ok := ignore["cerbos.policy.v1.Match.op"]; !ok { + switch t := m.Op.(type) { + case *v1.Match_All: + if t.All != nil { + cerbos_policy_v1_Match_ExprList_hashpb_sum(t.All, hasher, ignore) + } + + case *v1.Match_Any: + if t.Any != nil { + cerbos_policy_v1_Match_ExprList_hashpb_sum(t.Any, hasher, ignore) + } + + case *v1.Match_None: + if t.None != nil { + cerbos_policy_v1_Match_ExprList_hashpb_sum(t.None, hasher, ignore) + } + + case *v1.Match_Expr: + _, _ = hasher.Write(protowire.AppendString(nil, t.Expr)) + + } + } + } +} + +func cerbos_policy_v1_Metadata_hashpb_sum(m *v1.Metadata, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Metadata.source_file"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetSourceFile())) + + } + if _, ok := ignore["cerbos.policy.v1.Metadata.annotations"]; !ok { + if len(m.Annotations) > 0 { + keys := make([]string, len(m.Annotations)) + i := 0 + for k := range m.Annotations { + keys[i] = k + i++ + } + + sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) + + for _, k := range keys { + _, _ = hasher.Write(protowire.AppendString(nil, m.Annotations[k])) + + } + } + } + if _, ok := ignore["cerbos.policy.v1.Metadata.hash"]; !ok { + if m.GetHash() != nil { + google_protobuf_UInt64Value_hashpb_sum(m.GetHash(), hasher, ignore) + } + + } + if _, ok := ignore["cerbos.policy.v1.Metadata.store_identifer"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetStoreIdentifer())) + + } + if _, ok := ignore["cerbos.policy.v1.Metadata.store_identifier"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetStoreIdentifier())) + + } + if _, ok := ignore["cerbos.policy.v1.Metadata.source_attributes"]; !ok { + if m.GetSourceAttributes() != nil { + cerbos_policy_v1_SourceAttributes_hashpb_sum(m.GetSourceAttributes(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_Output_When_hashpb_sum(m *v1.Output_When, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Output.When.rule_activated"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetRuleActivated())) + + } + if _, ok := ignore["cerbos.policy.v1.Output.When.condition_not_met"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetConditionNotMet())) + + } +} + +func cerbos_policy_v1_Output_hashpb_sum(m *v1.Output, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Output.expr"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetExpr())) + + } + if _, ok := ignore["cerbos.policy.v1.Output.when"]; !ok { + if m.GetWhen() != nil { + cerbos_policy_v1_Output_When_hashpb_sum(m.GetWhen(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_Policy_hashpb_sum(m *v1.Policy, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Policy.api_version"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetApiVersion())) + + } + if _, ok := ignore["cerbos.policy.v1.Policy.disabled"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, protowire.EncodeBool(m.GetDisabled()))) + + } + if _, ok := ignore["cerbos.policy.v1.Policy.description"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetDescription())) + + } + if _, ok := ignore["cerbos.policy.v1.Policy.metadata"]; !ok { + if m.GetMetadata() != nil { + cerbos_policy_v1_Metadata_hashpb_sum(m.GetMetadata(), hasher, ignore) + } + + } + if m.PolicyType != nil { + if _, ok := ignore["cerbos.policy.v1.Policy.policy_type"]; !ok { + switch t := m.PolicyType.(type) { + case *v1.Policy_ResourcePolicy: + if t.ResourcePolicy != nil { + cerbos_policy_v1_ResourcePolicy_hashpb_sum(t.ResourcePolicy, hasher, ignore) + } + + case *v1.Policy_PrincipalPolicy: + if t.PrincipalPolicy != nil { + cerbos_policy_v1_PrincipalPolicy_hashpb_sum(t.PrincipalPolicy, hasher, ignore) + } + + case *v1.Policy_DerivedRoles: + if t.DerivedRoles != nil { + cerbos_policy_v1_DerivedRoles_hashpb_sum(t.DerivedRoles, hasher, ignore) + } + + case *v1.Policy_ExportVariables: + if t.ExportVariables != nil { + cerbos_policy_v1_ExportVariables_hashpb_sum(t.ExportVariables, hasher, ignore) + } + + } + } + } + if _, ok := ignore["cerbos.policy.v1.Policy.variables"]; !ok { + if len(m.Variables) > 0 { + keys := make([]string, len(m.Variables)) + i := 0 + for k := range m.Variables { + keys[i] = k + i++ + } + + sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) + + for _, k := range keys { + _, _ = hasher.Write(protowire.AppendString(nil, m.Variables[k])) + + } + } + } + if _, ok := ignore["cerbos.policy.v1.Policy.json_schema"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetJsonSchema())) + + } +} + +func cerbos_policy_v1_PrincipalPolicy_hashpb_sum(m *v1.PrincipalPolicy, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.PrincipalPolicy.principal"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetPrincipal())) + + } + if _, ok := ignore["cerbos.policy.v1.PrincipalPolicy.version"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetVersion())) + + } + if _, ok := ignore["cerbos.policy.v1.PrincipalPolicy.rules"]; !ok { + if len(m.Rules) > 0 { + for _, v := range m.Rules { + if v != nil { + cerbos_policy_v1_PrincipalRule_hashpb_sum(v, hasher, ignore) + } + + } + } + } + if _, ok := ignore["cerbos.policy.v1.PrincipalPolicy.scope"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetScope())) + + } + if _, ok := ignore["cerbos.policy.v1.PrincipalPolicy.variables"]; !ok { + if m.GetVariables() != nil { + cerbos_policy_v1_Variables_hashpb_sum(m.GetVariables(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_PrincipalRule_Action_hashpb_sum(m *v1.PrincipalRule_Action, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.PrincipalRule.Action.action"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetAction())) + + } + if _, ok := ignore["cerbos.policy.v1.PrincipalRule.Action.condition"]; !ok { + if m.GetCondition() != nil { + cerbos_policy_v1_Condition_hashpb_sum(m.GetCondition(), hasher, ignore) + } + + } + if _, ok := ignore["cerbos.policy.v1.PrincipalRule.Action.effect"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetEffect()))) + + } + if _, ok := ignore["cerbos.policy.v1.PrincipalRule.Action.name"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetName())) + + } + if _, ok := ignore["cerbos.policy.v1.PrincipalRule.Action.output"]; !ok { + if m.GetOutput() != nil { + cerbos_policy_v1_Output_hashpb_sum(m.GetOutput(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_PrincipalRule_hashpb_sum(m *v1.PrincipalRule, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.PrincipalRule.resource"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetResource())) + + } + if _, ok := ignore["cerbos.policy.v1.PrincipalRule.actions"]; !ok { + if len(m.Actions) > 0 { + for _, v := range m.Actions { + if v != nil { + cerbos_policy_v1_PrincipalRule_Action_hashpb_sum(v, hasher, ignore) + } + + } + } + } +} + +func cerbos_policy_v1_ResourcePolicy_hashpb_sum(m *v1.ResourcePolicy, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.ResourcePolicy.resource"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetResource())) + + } + if _, ok := ignore["cerbos.policy.v1.ResourcePolicy.version"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetVersion())) + + } + if _, ok := ignore["cerbos.policy.v1.ResourcePolicy.import_derived_roles"]; !ok { + if len(m.ImportDerivedRoles) > 0 { + for _, v := range m.ImportDerivedRoles { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } + if _, ok := ignore["cerbos.policy.v1.ResourcePolicy.rules"]; !ok { + if len(m.Rules) > 0 { + for _, v := range m.Rules { + if v != nil { + cerbos_policy_v1_ResourceRule_hashpb_sum(v, hasher, ignore) + } + + } + } + } + if _, ok := ignore["cerbos.policy.v1.ResourcePolicy.scope"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetScope())) + + } + if _, ok := ignore["cerbos.policy.v1.ResourcePolicy.schemas"]; !ok { + if m.GetSchemas() != nil { + cerbos_policy_v1_Schemas_hashpb_sum(m.GetSchemas(), hasher, ignore) + } + + } + if _, ok := ignore["cerbos.policy.v1.ResourcePolicy.variables"]; !ok { + if m.GetVariables() != nil { + cerbos_policy_v1_Variables_hashpb_sum(m.GetVariables(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_ResourceRule_hashpb_sum(m *v1.ResourceRule, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.ResourceRule.actions"]; !ok { + if len(m.Actions) > 0 { + for _, v := range m.Actions { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } + if _, ok := ignore["cerbos.policy.v1.ResourceRule.derived_roles"]; !ok { + if len(m.DerivedRoles) > 0 { + for _, v := range m.DerivedRoles { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } + if _, ok := ignore["cerbos.policy.v1.ResourceRule.roles"]; !ok { + if len(m.Roles) > 0 { + for _, v := range m.Roles { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } + if _, ok := ignore["cerbos.policy.v1.ResourceRule.condition"]; !ok { + if m.GetCondition() != nil { + cerbos_policy_v1_Condition_hashpb_sum(m.GetCondition(), hasher, ignore) + } + + } + if _, ok := ignore["cerbos.policy.v1.ResourceRule.effect"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetEffect()))) + + } + if _, ok := ignore["cerbos.policy.v1.ResourceRule.name"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetName())) + + } + if _, ok := ignore["cerbos.policy.v1.ResourceRule.output"]; !ok { + if m.GetOutput() != nil { + cerbos_policy_v1_Output_hashpb_sum(m.GetOutput(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_RoleDef_hashpb_sum(m *v1.RoleDef, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.RoleDef.name"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetName())) + + } + if _, ok := ignore["cerbos.policy.v1.RoleDef.parent_roles"]; !ok { + if len(m.ParentRoles) > 0 { + for _, v := range m.ParentRoles { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } + if _, ok := ignore["cerbos.policy.v1.RoleDef.condition"]; !ok { + if m.GetCondition() != nil { + cerbos_policy_v1_Condition_hashpb_sum(m.GetCondition(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_Schemas_IgnoreWhen_hashpb_sum(m *v1.Schemas_IgnoreWhen, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Schemas.IgnoreWhen.actions"]; !ok { + if len(m.Actions) > 0 { + for _, v := range m.Actions { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } +} + +func cerbos_policy_v1_Schemas_Schema_hashpb_sum(m *v1.Schemas_Schema, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Schemas.Schema.ref"]; !ok { + _, _ = hasher.Write(protowire.AppendString(nil, m.GetRef())) + + } + if _, ok := ignore["cerbos.policy.v1.Schemas.Schema.ignore_when"]; !ok { + if m.GetIgnoreWhen() != nil { + cerbos_policy_v1_Schemas_IgnoreWhen_hashpb_sum(m.GetIgnoreWhen(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_Schemas_hashpb_sum(m *v1.Schemas, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Schemas.principal_schema"]; !ok { + if m.GetPrincipalSchema() != nil { + cerbos_policy_v1_Schemas_Schema_hashpb_sum(m.GetPrincipalSchema(), hasher, ignore) + } + + } + if _, ok := ignore["cerbos.policy.v1.Schemas.resource_schema"]; !ok { + if m.GetResourceSchema() != nil { + cerbos_policy_v1_Schemas_Schema_hashpb_sum(m.GetResourceSchema(), hasher, ignore) + } + + } +} + +func cerbos_policy_v1_SourceAttributes_hashpb_sum(m *v1.SourceAttributes, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.SourceAttributes.attributes"]; !ok { + if len(m.Attributes) > 0 { + keys := make([]string, len(m.Attributes)) + i := 0 + for k := range m.Attributes { + keys[i] = k + i++ + } + + sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) + + for _, k := range keys { + if m.Attributes[k] != nil { + google_protobuf_Value_hashpb_sum(m.Attributes[k], hasher, ignore) + } + + } + } + } +} + +func cerbos_policy_v1_Variables_hashpb_sum(m *v1.Variables, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["cerbos.policy.v1.Variables.import"]; !ok { + if len(m.Import) > 0 { + for _, v := range m.Import { + _, _ = hasher.Write(protowire.AppendString(nil, v)) + + } + } + } + if _, ok := ignore["cerbos.policy.v1.Variables.local"]; !ok { + if len(m.Local) > 0 { + keys := make([]string, len(m.Local)) + i := 0 + for k := range m.Local { + keys[i] = k + i++ + } + + sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) + + for _, k := range keys { + _, _ = hasher.Write(protowire.AppendString(nil, m.Local[k])) + + } + } + } +} + +func google_protobuf_ListValue_hashpb_sum(m *structpb.ListValue, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["google.protobuf.ListValue.values"]; !ok { + if len(m.Values) > 0 { + for _, v := range m.Values { + if v != nil { + google_protobuf_Value_hashpb_sum(v, hasher, ignore) + } + + } + } + } +} + +func google_protobuf_Struct_hashpb_sum(m *structpb.Struct, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["google.protobuf.Struct.fields"]; !ok { + if len(m.Fields) > 0 { + keys := make([]string, len(m.Fields)) + i := 0 + for k := range m.Fields { + keys[i] = k + i++ + } + + sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) + + for _, k := range keys { + if m.Fields[k] != nil { + google_protobuf_Value_hashpb_sum(m.Fields[k], hasher, ignore) + } + + } + } + } +} + +func google_protobuf_Timestamp_hashpb_sum(m *timestamppb.Timestamp, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["google.protobuf.Timestamp.seconds"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetSeconds()))) + + } + if _, ok := ignore["google.protobuf.Timestamp.nanos"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(m.GetNanos()))) + + } +} + +func google_protobuf_UInt64Value_hashpb_sum(m *wrapperspb.UInt64Value, hasher hash.Hash, ignore map[string]struct{}) { + if _, ok := ignore["google.protobuf.UInt64Value.value"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, m.GetValue())) + + } +} + +func google_protobuf_Value_hashpb_sum(m *structpb.Value, hasher hash.Hash, ignore map[string]struct{}) { + if m.Kind != nil { + if _, ok := ignore["google.protobuf.Value.kind"]; !ok { + switch t := m.Kind.(type) { + case *structpb.Value_NullValue: + _, _ = hasher.Write(protowire.AppendVarint(nil, uint64(t.NullValue))) + + case *structpb.Value_NumberValue: + _, _ = hasher.Write(protowire.AppendFixed64(nil, math.Float64bits(t.NumberValue))) + + case *structpb.Value_StringValue: + _, _ = hasher.Write(protowire.AppendString(nil, t.StringValue)) + + case *structpb.Value_BoolValue: + _, _ = hasher.Write(protowire.AppendVarint(nil, protowire.EncodeBool(t.BoolValue))) + + case *structpb.Value_StructValue: + if t.StructValue != nil { + google_protobuf_Struct_hashpb_sum(t.StructValue, hasher, ignore) + } + + case *structpb.Value_ListValue: + if t.ListValue != nil { + google_protobuf_ListValue_hashpb_sum(t.ListValue, hasher, ignore) + } + + } + } + } +} diff --git a/genpb/cerbos/cloud/store/v1/store.pb.go b/genpb/cerbos/cloud/store/v1/store.pb.go new file mode 100644 index 0000000..b7bd199 --- /dev/null +++ b/genpb/cerbos/cloud/store/v1/store.pb.go @@ -0,0 +1,1183 @@ +// Copyright 2021-2024 Zenauth Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: cerbos/cloud/store/v1/store.proto + +package storev1 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + v1 "github.com/cerbos/cerbos/api/genpb/cerbos/policy/v1" + _ "google.golang.org/genproto/googleapis/api/annotations" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StringMatch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Match: + // + // *StringMatch_Equals + // *StringMatch_Like + // *StringMatch_In + Match isStringMatch_Match `protobuf_oneof:"match"` +} + +func (x *StringMatch) Reset() { + *x = StringMatch{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StringMatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringMatch) ProtoMessage() {} + +func (x *StringMatch) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StringMatch.ProtoReflect.Descriptor instead. +func (*StringMatch) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{0} +} + +func (m *StringMatch) GetMatch() isStringMatch_Match { + if m != nil { + return m.Match + } + return nil +} + +func (x *StringMatch) GetEquals() string { + if x, ok := x.GetMatch().(*StringMatch_Equals); ok { + return x.Equals + } + return "" +} + +func (x *StringMatch) GetLike() string { + if x, ok := x.GetMatch().(*StringMatch_Like); ok { + return x.Like + } + return "" +} + +func (x *StringMatch) GetIn() *StringMatch_InList { + if x, ok := x.GetMatch().(*StringMatch_In); ok { + return x.In + } + return nil +} + +type isStringMatch_Match interface { + isStringMatch_Match() +} + +type StringMatch_Equals struct { + Equals string `protobuf:"bytes,1,opt,name=equals,proto3,oneof"` +} + +type StringMatch_Like struct { + Like string `protobuf:"bytes,2,opt,name=like,proto3,oneof"` +} + +type StringMatch_In struct { + In *StringMatch_InList `protobuf:"bytes,3,opt,name=in,proto3,oneof"` +} + +func (*StringMatch_Equals) isStringMatch_Match() {} + +func (*StringMatch_Like) isStringMatch_Match() {} + +func (*StringMatch_In) isStringMatch_Match() {} + +type PolicyFilter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kinds []v1.Kind `protobuf:"varint,1,rep,packed,name=kinds,proto3,enum=cerbos.policy.v1.Kind" json:"kinds,omitempty"` + Name *StringMatch `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Version *StringMatch `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Scope *StringMatch `protobuf:"bytes,4,opt,name=scope,proto3" json:"scope,omitempty"` +} + +func (x *PolicyFilter) Reset() { + *x = PolicyFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyFilter) ProtoMessage() {} + +func (x *PolicyFilter) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PolicyFilter.ProtoReflect.Descriptor instead. +func (*PolicyFilter) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{1} +} + +func (x *PolicyFilter) GetKinds() []v1.Kind { + if x != nil { + return x.Kinds + } + return nil +} + +func (x *PolicyFilter) GetName() *StringMatch { + if x != nil { + return x.Name + } + return nil +} + +func (x *PolicyFilter) GetVersion() *StringMatch { + if x != nil { + return x.Version + } + return nil +} + +func (x *PolicyFilter) GetScope() *StringMatch { + if x != nil { + return x.Scope + } + return nil +} + +type ListPoliciesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` + Filter *PolicyFilter `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *ListPoliciesRequest) Reset() { + *x = ListPoliciesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPoliciesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPoliciesRequest) ProtoMessage() {} + +func (x *ListPoliciesRequest) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPoliciesRequest.ProtoReflect.Descriptor instead. +func (*ListPoliciesRequest) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{2} +} + +func (x *ListPoliciesRequest) GetStore() string { + if x != nil { + return x.Store + } + return "" +} + +func (x *ListPoliciesRequest) GetFilter() *PolicyFilter { + if x != nil { + return x.Filter + } + return nil +} + +type ListPoliciesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreVersion int64 `protobuf:"varint,1,opt,name=store_version,json=storeVersion,proto3" json:"store_version,omitempty"` + Policies []*ListPoliciesResponse_Policy `protobuf:"bytes,2,rep,name=policies,proto3" json:"policies,omitempty"` +} + +func (x *ListPoliciesResponse) Reset() { + *x = ListPoliciesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPoliciesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPoliciesResponse) ProtoMessage() {} + +func (x *ListPoliciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPoliciesResponse.ProtoReflect.Descriptor instead. +func (*ListPoliciesResponse) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{3} +} + +func (x *ListPoliciesResponse) GetStoreVersion() int64 { + if x != nil { + return x.StoreVersion + } + return 0 +} + +func (x *ListPoliciesResponse) GetPolicies() []*ListPoliciesResponse_Policy { + if x != nil { + return x.Policies + } + return nil +} + +type GetPoliciesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` + PolicyKeys []string `protobuf:"bytes,2,rep,name=policy_keys,json=policyKeys,proto3" json:"policy_keys,omitempty"` +} + +func (x *GetPoliciesRequest) Reset() { + *x = GetPoliciesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPoliciesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPoliciesRequest) ProtoMessage() {} + +func (x *GetPoliciesRequest) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPoliciesRequest.ProtoReflect.Descriptor instead. +func (*GetPoliciesRequest) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{4} +} + +func (x *GetPoliciesRequest) GetStore() string { + if x != nil { + return x.Store + } + return "" +} + +func (x *GetPoliciesRequest) GetPolicyKeys() []string { + if x != nil { + return x.PolicyKeys + } + return nil +} + +type GetPoliciesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreVersion int64 `protobuf:"varint,1,opt,name=store_version,json=storeVersion,proto3" json:"store_version,omitempty"` + Policies map[string]*v1.Policy `protobuf:"bytes,2,rep,name=policies,proto3" json:"policies,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *GetPoliciesResponse) Reset() { + *x = GetPoliciesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPoliciesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPoliciesResponse) ProtoMessage() {} + +func (x *GetPoliciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPoliciesResponse.ProtoReflect.Descriptor instead. +func (*GetPoliciesResponse) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{5} +} + +func (x *GetPoliciesResponse) GetStoreVersion() int64 { + if x != nil { + return x.StoreVersion + } + return 0 +} + +func (x *GetPoliciesResponse) GetPolicies() map[string]*v1.Policy { + if x != nil { + return x.Policies + } + return nil +} + +type PolicyOp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Op: + // + // *PolicyOp_AddOrUpdate + // *PolicyOp_Delete + Op isPolicyOp_Op `protobuf_oneof:"op"` +} + +func (x *PolicyOp) Reset() { + *x = PolicyOp{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyOp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyOp) ProtoMessage() {} + +func (x *PolicyOp) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PolicyOp.ProtoReflect.Descriptor instead. +func (*PolicyOp) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{6} +} + +func (m *PolicyOp) GetOp() isPolicyOp_Op { + if m != nil { + return m.Op + } + return nil +} + +func (x *PolicyOp) GetAddOrUpdate() *v1.Policy { + if x, ok := x.GetOp().(*PolicyOp_AddOrUpdate); ok { + return x.AddOrUpdate + } + return nil +} + +func (x *PolicyOp) GetDelete() string { + if x, ok := x.GetOp().(*PolicyOp_Delete); ok { + return x.Delete + } + return "" +} + +type isPolicyOp_Op interface { + isPolicyOp_Op() +} + +type PolicyOp_AddOrUpdate struct { + AddOrUpdate *v1.Policy `protobuf:"bytes,1,opt,name=add_or_update,json=addOrUpdate,proto3,oneof"` +} + +type PolicyOp_Delete struct { + Delete string `protobuf:"bytes,2,opt,name=delete,proto3,oneof"` +} + +func (*PolicyOp_AddOrUpdate) isPolicyOp_Op() {} + +func (*PolicyOp_Delete) isPolicyOp_Op() {} + +type ModifyPoliciesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` + Condition *ModifyPoliciesRequest_Condition `protobuf:"bytes,2,opt,name=condition,proto3" json:"condition,omitempty"` + Operations []*PolicyOp `protobuf:"bytes,3,rep,name=operations,proto3" json:"operations,omitempty"` +} + +func (x *ModifyPoliciesRequest) Reset() { + *x = ModifyPoliciesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModifyPoliciesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyPoliciesRequest) ProtoMessage() {} + +func (x *ModifyPoliciesRequest) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModifyPoliciesRequest.ProtoReflect.Descriptor instead. +func (*ModifyPoliciesRequest) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{7} +} + +func (x *ModifyPoliciesRequest) GetStore() string { + if x != nil { + return x.Store + } + return "" +} + +func (x *ModifyPoliciesRequest) GetCondition() *ModifyPoliciesRequest_Condition { + if x != nil { + return x.Condition + } + return nil +} + +func (x *ModifyPoliciesRequest) GetOperations() []*PolicyOp { + if x != nil { + return x.Operations + } + return nil +} + +type ModifyPoliciesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NewStoreVersion int64 `protobuf:"varint,1,opt,name=new_store_version,json=newStoreVersion,proto3" json:"new_store_version,omitempty"` +} + +func (x *ModifyPoliciesResponse) Reset() { + *x = ModifyPoliciesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModifyPoliciesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyPoliciesResponse) ProtoMessage() {} + +func (x *ModifyPoliciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModifyPoliciesResponse.ProtoReflect.Descriptor instead. +func (*ModifyPoliciesResponse) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{8} +} + +func (x *ModifyPoliciesResponse) GetNewStoreVersion() int64 { + if x != nil { + return x.NewStoreVersion + } + return 0 +} + +type StringMatch_InList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *StringMatch_InList) Reset() { + *x = StringMatch_InList{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StringMatch_InList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringMatch_InList) ProtoMessage() {} + +func (x *StringMatch_InList) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StringMatch_InList.ProtoReflect.Descriptor instead. +func (*StringMatch_InList) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *StringMatch_InList) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +type ListPoliciesResponse_Policy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Kind v1.Kind `protobuf:"varint,2,opt,name=kind,proto3,enum=cerbos.policy.v1.Kind" json:"kind,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + Scope string `protobuf:"bytes,5,opt,name=scope,proto3" json:"scope,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *ListPoliciesResponse_Policy) Reset() { + *x = ListPoliciesResponse_Policy{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPoliciesResponse_Policy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPoliciesResponse_Policy) ProtoMessage() {} + +func (x *ListPoliciesResponse_Policy) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPoliciesResponse_Policy.ProtoReflect.Descriptor instead. +func (*ListPoliciesResponse_Policy) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *ListPoliciesResponse_Policy) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ListPoliciesResponse_Policy) GetKind() v1.Kind { + if x != nil { + return x.Kind + } + return v1.Kind(0) +} + +func (x *ListPoliciesResponse_Policy) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ListPoliciesResponse_Policy) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ListPoliciesResponse_Policy) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +func (x *ListPoliciesResponse_Policy) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type ModifyPoliciesRequest_Condition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StoreVersionMustEqual int64 `protobuf:"varint,1,opt,name=store_version_must_equal,json=storeVersionMustEqual,proto3" json:"store_version_must_equal,omitempty"` +} + +func (x *ModifyPoliciesRequest_Condition) Reset() { + *x = ModifyPoliciesRequest_Condition{} + if protoimpl.UnsafeEnabled { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModifyPoliciesRequest_Condition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyPoliciesRequest_Condition) ProtoMessage() {} + +func (x *ModifyPoliciesRequest_Condition) ProtoReflect() protoreflect.Message { + mi := &file_cerbos_cloud_store_v1_store_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModifyPoliciesRequest_Condition.ProtoReflect.Descriptor instead. +func (*ModifyPoliciesRequest_Condition) Descriptor() ([]byte, []int) { + return file_cerbos_cloud_store_v1_store_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *ModifyPoliciesRequest_Condition) GetStoreVersionMustEqual() int64 { + if x != nil { + return x.StoreVersionMustEqual + } + return 0 +} + +var File_cerbos_cloud_store_v1_store_proto protoreflect.FileDescriptor + +var file_cerbos_cloud_store_v1_store_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x06, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x12, + 0x14, 0x0a, 0x04, 0x6c, 0x69, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x04, 0x6c, 0x69, 0x6b, 0x65, 0x12, 0x3b, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x49, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x02, + 0x69, 0x6e, 0x1a, 0x30, 0x0a, 0x06, 0x49, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x06, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0e, 0xba, 0x48, + 0x0b, 0x92, 0x01, 0x08, 0x10, 0x32, 0x22, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x05, 0xba, + 0x48, 0x02, 0x08, 0x01, 0x22, 0x92, 0x02, 0x0a, 0x0c, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x05, 0x6b, 0x69, 0x6e, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x42, 0x15, 0xe0, 0x41, + 0x01, 0xba, 0x48, 0x0f, 0x92, 0x01, 0x0c, 0x18, 0x01, 0x22, 0x08, 0x82, 0x01, 0x05, 0x10, 0x01, + 0x22, 0x01, 0x00, 0x52, 0x05, 0x6b, 0x69, 0x6e, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, + 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, + 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x05, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x65, 0x72, 0x62, + 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x22, 0x79, 0x0a, 0x13, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x20, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x01, 0x52, 0x05, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x22, 0xd3, 0x02, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x1a, 0xc5, 0x01, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x2a, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, + 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x67, 0x0a, 0x12, 0x47, 0x65, + 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x20, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x01, 0x52, 0x05, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x12, 0x2f, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0e, 0xba, 0x48, 0x0b, 0x92, 0x01, 0x08, 0x10, + 0x32, 0x22, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4b, + 0x65, 0x79, 0x73, 0x22, 0xe7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x54, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x1a, 0x55, 0x0a, 0x0d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, + 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x71, 0x0a, + 0x08, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x70, 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x64, 0x64, + 0x5f, 0x6f, 0x72, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x64, + 0x64, 0x4f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x06, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x42, 0x0b, 0x0a, 0x02, 0x6f, 0x70, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, + 0x22, 0xae, 0x02, 0x0a, 0x15, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x05, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, + 0x10, 0x01, 0x18, 0x80, 0x01, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x59, 0x0a, 0x09, + 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x36, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x63, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x65, + 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x70, 0x42, 0x08, 0xba, 0x48, + 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x1a, 0x4d, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x40, 0x0a, 0x18, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x75, 0x73, 0x74, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x07, 0xba, 0x48, 0x04, 0x22, 0x02, 0x28, 0x00, 0x52, 0x15, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x75, 0x73, 0x74, 0x45, 0x71, 0x75, 0x61, + 0x6c, 0x22, 0x44, 0x0a, 0x16, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6e, + 0x65, 0x77, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0xf4, 0x02, 0x0a, 0x12, 0x43, 0x65, 0x72, 0x62, + 0x6f, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6c, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2a, + 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x65, 0x72, + 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x69, 0x0a, 0x0b, + 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x65, + 0x72, 0x62, 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x6f, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x69, 0x66, + 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x65, 0x72, 0x62, + 0x6f, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x1a, 0x14, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0e, + 0x12, 0x0c, 0x45, 0x58, 0x50, 0x45, 0x52, 0x49, 0x4d, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x42, 0x41, + 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x72, + 0x62, 0x6f, 0x73, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, + 0x6e, 0x70, 0x62, 0x2f, 0x63, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cerbos_cloud_store_v1_store_proto_rawDescOnce sync.Once + file_cerbos_cloud_store_v1_store_proto_rawDescData = file_cerbos_cloud_store_v1_store_proto_rawDesc +) + +func file_cerbos_cloud_store_v1_store_proto_rawDescGZIP() []byte { + file_cerbos_cloud_store_v1_store_proto_rawDescOnce.Do(func() { + file_cerbos_cloud_store_v1_store_proto_rawDescData = protoimpl.X.CompressGZIP(file_cerbos_cloud_store_v1_store_proto_rawDescData) + }) + return file_cerbos_cloud_store_v1_store_proto_rawDescData +} + +var file_cerbos_cloud_store_v1_store_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_cerbos_cloud_store_v1_store_proto_goTypes = []any{ + (*StringMatch)(nil), // 0: cerbos.cloud.store.v1.StringMatch + (*PolicyFilter)(nil), // 1: cerbos.cloud.store.v1.PolicyFilter + (*ListPoliciesRequest)(nil), // 2: cerbos.cloud.store.v1.ListPoliciesRequest + (*ListPoliciesResponse)(nil), // 3: cerbos.cloud.store.v1.ListPoliciesResponse + (*GetPoliciesRequest)(nil), // 4: cerbos.cloud.store.v1.GetPoliciesRequest + (*GetPoliciesResponse)(nil), // 5: cerbos.cloud.store.v1.GetPoliciesResponse + (*PolicyOp)(nil), // 6: cerbos.cloud.store.v1.PolicyOp + (*ModifyPoliciesRequest)(nil), // 7: cerbos.cloud.store.v1.ModifyPoliciesRequest + (*ModifyPoliciesResponse)(nil), // 8: cerbos.cloud.store.v1.ModifyPoliciesResponse + (*StringMatch_InList)(nil), // 9: cerbos.cloud.store.v1.StringMatch.InList + (*ListPoliciesResponse_Policy)(nil), // 10: cerbos.cloud.store.v1.ListPoliciesResponse.Policy + nil, // 11: cerbos.cloud.store.v1.GetPoliciesResponse.PoliciesEntry + (*ModifyPoliciesRequest_Condition)(nil), // 12: cerbos.cloud.store.v1.ModifyPoliciesRequest.Condition + (v1.Kind)(0), // 13: cerbos.policy.v1.Kind + (*v1.Policy)(nil), // 14: cerbos.policy.v1.Policy + (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp +} +var file_cerbos_cloud_store_v1_store_proto_depIdxs = []int32{ + 9, // 0: cerbos.cloud.store.v1.StringMatch.in:type_name -> cerbos.cloud.store.v1.StringMatch.InList + 13, // 1: cerbos.cloud.store.v1.PolicyFilter.kinds:type_name -> cerbos.policy.v1.Kind + 0, // 2: cerbos.cloud.store.v1.PolicyFilter.name:type_name -> cerbos.cloud.store.v1.StringMatch + 0, // 3: cerbos.cloud.store.v1.PolicyFilter.version:type_name -> cerbos.cloud.store.v1.StringMatch + 0, // 4: cerbos.cloud.store.v1.PolicyFilter.scope:type_name -> cerbos.cloud.store.v1.StringMatch + 1, // 5: cerbos.cloud.store.v1.ListPoliciesRequest.filter:type_name -> cerbos.cloud.store.v1.PolicyFilter + 10, // 6: cerbos.cloud.store.v1.ListPoliciesResponse.policies:type_name -> cerbos.cloud.store.v1.ListPoliciesResponse.Policy + 11, // 7: cerbos.cloud.store.v1.GetPoliciesResponse.policies:type_name -> cerbos.cloud.store.v1.GetPoliciesResponse.PoliciesEntry + 14, // 8: cerbos.cloud.store.v1.PolicyOp.add_or_update:type_name -> cerbos.policy.v1.Policy + 12, // 9: cerbos.cloud.store.v1.ModifyPoliciesRequest.condition:type_name -> cerbos.cloud.store.v1.ModifyPoliciesRequest.Condition + 6, // 10: cerbos.cloud.store.v1.ModifyPoliciesRequest.operations:type_name -> cerbos.cloud.store.v1.PolicyOp + 13, // 11: cerbos.cloud.store.v1.ListPoliciesResponse.Policy.kind:type_name -> cerbos.policy.v1.Kind + 15, // 12: cerbos.cloud.store.v1.ListPoliciesResponse.Policy.created_at:type_name -> google.protobuf.Timestamp + 14, // 13: cerbos.cloud.store.v1.GetPoliciesResponse.PoliciesEntry.value:type_name -> cerbos.policy.v1.Policy + 2, // 14: cerbos.cloud.store.v1.CerbosStoreService.ListPolicies:input_type -> cerbos.cloud.store.v1.ListPoliciesRequest + 4, // 15: cerbos.cloud.store.v1.CerbosStoreService.GetPolicies:input_type -> cerbos.cloud.store.v1.GetPoliciesRequest + 7, // 16: cerbos.cloud.store.v1.CerbosStoreService.ModifyPolicies:input_type -> cerbos.cloud.store.v1.ModifyPoliciesRequest + 3, // 17: cerbos.cloud.store.v1.CerbosStoreService.ListPolicies:output_type -> cerbos.cloud.store.v1.ListPoliciesResponse + 5, // 18: cerbos.cloud.store.v1.CerbosStoreService.GetPolicies:output_type -> cerbos.cloud.store.v1.GetPoliciesResponse + 8, // 19: cerbos.cloud.store.v1.CerbosStoreService.ModifyPolicies:output_type -> cerbos.cloud.store.v1.ModifyPoliciesResponse + 17, // [17:20] is the sub-list for method output_type + 14, // [14:17] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_cerbos_cloud_store_v1_store_proto_init() } +func file_cerbos_cloud_store_v1_store_proto_init() { + if File_cerbos_cloud_store_v1_store_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cerbos_cloud_store_v1_store_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*StringMatch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*PolicyFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*ListPoliciesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*ListPoliciesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*GetPoliciesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*GetPoliciesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*PolicyOp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*ModifyPoliciesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*ModifyPoliciesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*StringMatch_InList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*ListPoliciesResponse_Policy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[12].Exporter = func(v any, i int) any { + switch v := v.(*ModifyPoliciesRequest_Condition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[0].OneofWrappers = []any{ + (*StringMatch_Equals)(nil), + (*StringMatch_Like)(nil), + (*StringMatch_In)(nil), + } + file_cerbos_cloud_store_v1_store_proto_msgTypes[6].OneofWrappers = []any{ + (*PolicyOp_AddOrUpdate)(nil), + (*PolicyOp_Delete)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cerbos_cloud_store_v1_store_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cerbos_cloud_store_v1_store_proto_goTypes, + DependencyIndexes: file_cerbos_cloud_store_v1_store_proto_depIdxs, + MessageInfos: file_cerbos_cloud_store_v1_store_proto_msgTypes, + }.Build() + File_cerbos_cloud_store_v1_store_proto = out.File + file_cerbos_cloud_store_v1_store_proto_rawDesc = nil + file_cerbos_cloud_store_v1_store_proto_goTypes = nil + file_cerbos_cloud_store_v1_store_proto_depIdxs = nil +} diff --git a/genpb/cerbos/cloud/store/v1/store_hashpb.pb.go b/genpb/cerbos/cloud/store/v1/store_hashpb.pb.go new file mode 100644 index 0000000..fe3c415 --- /dev/null +++ b/genpb/cerbos/cloud/store/v1/store_hashpb.pb.go @@ -0,0 +1,105 @@ +// Code generated by protoc-gen-go-hashpb. Do not edit. +// protoc-gen-go-hashpb v0.3.1 +// Source: cerbos/cloud/store/v1/store.proto + +package storev1 + +import ( + hash "hash" +) + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *StringMatch) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_StringMatch_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *StringMatch_InList) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_StringMatch_InList_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *PolicyFilter) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_PolicyFilter_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *ListPoliciesRequest) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_ListPoliciesRequest_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *ListPoliciesResponse) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_ListPoliciesResponse_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *ListPoliciesResponse_Policy) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_ListPoliciesResponse_Policy_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *GetPoliciesRequest) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_GetPoliciesRequest_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *GetPoliciesResponse) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_GetPoliciesResponse_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *PolicyOp) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_PolicyOp_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *ModifyPoliciesRequest) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_ModifyPoliciesRequest_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *ModifyPoliciesRequest_Condition) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_ModifyPoliciesRequest_Condition_hashpb_sum(m, hasher, ignore) + } +} + +// HashPB computes a hash of the message using the given hash function +// The ignore set must contain fully-qualified field names (pkg.msg.field) that should be ignored from the hash +func (m *ModifyPoliciesResponse) HashPB(hasher hash.Hash, ignore map[string]struct{}) { + if m != nil { + cerbos_cloud_store_v1_ModifyPoliciesResponse_hashpb_sum(m, hasher, ignore) + } +} diff --git a/genpb/cerbos/cloud/store/v1/store_vtproto.pb.go b/genpb/cerbos/cloud/store/v1/store_vtproto.pb.go new file mode 100644 index 0000000..1b7119a --- /dev/null +++ b/genpb/cerbos/cloud/store/v1/store_vtproto.pb.go @@ -0,0 +1,2743 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: cerbos/cloud/store/v1/store.proto + +package storev1 + +import ( + fmt "fmt" + v1 "github.com/cerbos/cerbos/api/genpb/cerbos/policy/v1" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + timestamppb "github.com/planetscale/vtprotobuf/types/known/timestamppb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb1 "google.golang.org/protobuf/types/known/timestamppb" + io "io" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *StringMatch_InList) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StringMatch_InList) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StringMatch_InList) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StringMatch) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StringMatch) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StringMatch) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Match.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *StringMatch_Equals) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StringMatch_Equals) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Equals) + copy(dAtA[i:], m.Equals) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Equals))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *StringMatch_Like) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StringMatch_Like) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Like) + copy(dAtA[i:], m.Like) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Like))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *StringMatch_In) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StringMatch_In) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.In != nil { + size, err := m.In.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *PolicyFilter) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PolicyFilter) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PolicyFilter) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Scope != nil { + size, err := m.Scope.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Version != nil { + size, err := m.Version.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Name != nil { + size, err := m.Name.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Kinds) > 0 { + var pksize2 int + for _, num := range m.Kinds { + pksize2 += protohelpers.SizeOfVarint(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range m.Kinds { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListPoliciesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListPoliciesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ListPoliciesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Filter != nil { + size, err := m.Filter.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Store) > 0 { + i -= len(m.Store) + copy(dAtA[i:], m.Store) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Store))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListPoliciesResponse_Policy) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListPoliciesResponse_Policy) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ListPoliciesResponse_Policy) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.CreatedAt != nil { + size, err := (*timestamppb.Timestamp)(m.CreatedAt).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if len(m.Scope) > 0 { + i -= len(m.Scope) + copy(dAtA[i:], m.Scope) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Scope))) + i-- + dAtA[i] = 0x2a + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if m.Kind != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Kind)) + i-- + dAtA[i] = 0x10 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListPoliciesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListPoliciesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ListPoliciesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Policies) > 0 { + for iNdEx := len(m.Policies) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Policies[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if m.StoreVersion != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreVersion)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetPoliciesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetPoliciesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetPoliciesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.PolicyKeys) > 0 { + for iNdEx := len(m.PolicyKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PolicyKeys[iNdEx]) + copy(dAtA[i:], m.PolicyKeys[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PolicyKeys[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Store) > 0 { + i -= len(m.Store) + copy(dAtA[i:], m.Store) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Store))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetPoliciesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetPoliciesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetPoliciesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Policies) > 0 { + for k := range m.Policies { + v := m.Policies[k] + baseI := i + if vtmsg, ok := interface{}(v).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(v) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.StoreVersion != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreVersion)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PolicyOp) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PolicyOp) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PolicyOp) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Op.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *PolicyOp_AddOrUpdate) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PolicyOp_AddOrUpdate) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.AddOrUpdate != nil { + if vtmsg, ok := interface{}(m.AddOrUpdate).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.AddOrUpdate) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *PolicyOp_Delete) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PolicyOp_Delete) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Delete) + copy(dAtA[i:], m.Delete) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Delete))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *ModifyPoliciesRequest_Condition) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyPoliciesRequest_Condition) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModifyPoliciesRequest_Condition) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.StoreVersionMustEqual != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreVersionMustEqual)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ModifyPoliciesRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyPoliciesRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModifyPoliciesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Operations) > 0 { + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Operations[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if m.Condition != nil { + size, err := m.Condition.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Store) > 0 { + i -= len(m.Store) + copy(dAtA[i:], m.Store) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Store))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ModifyPoliciesResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModifyPoliciesResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModifyPoliciesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.NewStoreVersion != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NewStoreVersion)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StringMatch_InList) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *StringMatch) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Match.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *StringMatch_Equals) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Equals) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *StringMatch_Like) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Like) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *StringMatch_In) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.In != nil { + l = m.In.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *PolicyFilter) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Kinds) > 0 { + l = 0 + for _, e := range m.Kinds { + l += protohelpers.SizeOfVarint(uint64(e)) + } + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + } + if m.Name != nil { + l = m.Name.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Version != nil { + l = m.Version.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Scope != nil { + l = m.Scope.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ListPoliciesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Store) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ListPoliciesResponse_Policy) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Kind != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Kind)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Scope) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.CreatedAt != nil { + l = (*timestamppb.Timestamp)(m.CreatedAt).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ListPoliciesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StoreVersion != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreVersion)) + } + if len(m.Policies) > 0 { + for _, e := range m.Policies { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *GetPoliciesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Store) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.PolicyKeys) > 0 { + for _, s := range m.PolicyKeys { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *GetPoliciesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StoreVersion != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreVersion)) + } + if len(m.Policies) > 0 { + for k, v := range m.Policies { + _ = k + _ = v + l = 0 + if v != nil { + if size, ok := interface{}(v).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(v) + } + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *PolicyOp) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Op.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *PolicyOp_AddOrUpdate) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddOrUpdate != nil { + if size, ok := interface{}(m.AddOrUpdate).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.AddOrUpdate) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *PolicyOp_Delete) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Delete) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *ModifyPoliciesRequest_Condition) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StoreVersionMustEqual != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreVersionMustEqual)) + } + n += len(m.unknownFields) + return n +} + +func (m *ModifyPoliciesRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Store) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Condition != nil { + l = m.Condition.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Operations) > 0 { + for _, e := range m.Operations { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *ModifyPoliciesResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NewStoreVersion != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.NewStoreVersion)) + } + n += len(m.unknownFields) + return n +} + +func (m *StringMatch_InList) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StringMatch_InList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StringMatch_InList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StringMatch) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StringMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StringMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Equals", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Match = &StringMatch_Equals{Equals: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Like", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Match = &StringMatch_Like{Like: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field In", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Match.(*StringMatch_In); ok { + if err := oneof.In.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &StringMatch_InList{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Match = &StringMatch_In{In: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PolicyFilter) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PolicyFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PolicyFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v v1.Kind + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= v1.Kind(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Kinds = append(m.Kinds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.Kinds) == 0 { + m.Kinds = make([]v1.Kind, 0, elementCount) + } + for iNdEx < postIndex { + var v v1.Kind + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= v1.Kind(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Kinds = append(m.Kinds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Kinds", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Name == nil { + m.Name = &StringMatch{} + } + if err := m.Name.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Version == nil { + m.Version = &StringMatch{} + } + if err := m.Version.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scope == nil { + m.Scope = &StringMatch{} + } + if err := m.Scope.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListPoliciesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListPoliciesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListPoliciesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Store = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &PolicyFilter{} + } + if err := m.Filter.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListPoliciesResponse_Policy) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListPoliciesResponse_Policy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListPoliciesResponse_Policy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + m.Kind = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Kind |= v1.Kind(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Scope = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = ×tamppb1.Timestamp{} + } + if err := (*timestamppb.Timestamp)(m.CreatedAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListPoliciesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListPoliciesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListPoliciesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreVersion", wireType) + } + m.StoreVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreVersion |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Policies", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Policies = append(m.Policies, &ListPoliciesResponse_Policy{}) + if err := m.Policies[len(m.Policies)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetPoliciesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetPoliciesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetPoliciesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Store = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyKeys = append(m.PolicyKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetPoliciesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetPoliciesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetPoliciesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreVersion", wireType) + } + m.StoreVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreVersion |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Policies", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Policies == nil { + m.Policies = make(map[string]*v1.Policy) + } + var mapkey string + var mapvalue *v1.Policy + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &v1.Policy{} + if unmarshal, ok := interface{}(mapvalue).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { + return err + } + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Policies[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PolicyOp) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PolicyOp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PolicyOp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddOrUpdate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Op.(*PolicyOp_AddOrUpdate); ok { + if unmarshal, ok := interface{}(oneof.AddOrUpdate).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], oneof.AddOrUpdate); err != nil { + return err + } + } + } else { + v := &v1.Policy{} + if unmarshal, ok := interface{}(v).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { + return err + } + } + m.Op = &PolicyOp_AddOrUpdate{AddOrUpdate: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Op = &PolicyOp_Delete{Delete: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModifyPoliciesRequest_Condition) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ModifyPoliciesRequest_Condition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModifyPoliciesRequest_Condition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreVersionMustEqual", wireType) + } + m.StoreVersionMustEqual = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreVersionMustEqual |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModifyPoliciesRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ModifyPoliciesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModifyPoliciesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Store = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Condition", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Condition == nil { + m.Condition = &ModifyPoliciesRequest_Condition{} + } + if err := m.Condition.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operations = append(m.Operations, &PolicyOp{}) + if err := m.Operations[len(m.Operations)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModifyPoliciesResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ModifyPoliciesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModifyPoliciesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewStoreVersion", wireType) + } + m.NewStoreVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NewStoreVersion |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/genpb/cerbos/cloud/store/v1/storev1connect/store.connect.go b/genpb/cerbos/cloud/store/v1/storev1connect/store.connect.go new file mode 100644 index 0000000..451a4e0 --- /dev/null +++ b/genpb/cerbos/cloud/store/v1/storev1connect/store.connect.go @@ -0,0 +1,181 @@ +// Copyright 2021-2024 Zenauth Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: cerbos/cloud/store/v1/store.proto + +package storev1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/cerbos/cloud-api/genpb/cerbos/cloud/store/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // CerbosStoreServiceName is the fully-qualified name of the CerbosStoreService service. + CerbosStoreServiceName = "cerbos.cloud.store.v1.CerbosStoreService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // CerbosStoreServiceListPoliciesProcedure is the fully-qualified name of the CerbosStoreService's + // ListPolicies RPC. + CerbosStoreServiceListPoliciesProcedure = "/cerbos.cloud.store.v1.CerbosStoreService/ListPolicies" + // CerbosStoreServiceGetPoliciesProcedure is the fully-qualified name of the CerbosStoreService's + // GetPolicies RPC. + CerbosStoreServiceGetPoliciesProcedure = "/cerbos.cloud.store.v1.CerbosStoreService/GetPolicies" + // CerbosStoreServiceModifyPoliciesProcedure is the fully-qualified name of the CerbosStoreService's + // ModifyPolicies RPC. + CerbosStoreServiceModifyPoliciesProcedure = "/cerbos.cloud.store.v1.CerbosStoreService/ModifyPolicies" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + cerbosStoreServiceServiceDescriptor = v1.File_cerbos_cloud_store_v1_store_proto.Services().ByName("CerbosStoreService") + cerbosStoreServiceListPoliciesMethodDescriptor = cerbosStoreServiceServiceDescriptor.Methods().ByName("ListPolicies") + cerbosStoreServiceGetPoliciesMethodDescriptor = cerbosStoreServiceServiceDescriptor.Methods().ByName("GetPolicies") + cerbosStoreServiceModifyPoliciesMethodDescriptor = cerbosStoreServiceServiceDescriptor.Methods().ByName("ModifyPolicies") +) + +// CerbosStoreServiceClient is a client for the cerbos.cloud.store.v1.CerbosStoreService service. +type CerbosStoreServiceClient interface { + ListPolicies(context.Context, *connect.Request[v1.ListPoliciesRequest]) (*connect.Response[v1.ListPoliciesResponse], error) + GetPolicies(context.Context, *connect.Request[v1.GetPoliciesRequest]) (*connect.Response[v1.GetPoliciesResponse], error) + ModifyPolicies(context.Context, *connect.Request[v1.ModifyPoliciesRequest]) (*connect.Response[v1.ModifyPoliciesResponse], error) +} + +// NewCerbosStoreServiceClient constructs a client for the cerbos.cloud.store.v1.CerbosStoreService +// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for +// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply +// the connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewCerbosStoreServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CerbosStoreServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &cerbosStoreServiceClient{ + listPolicies: connect.NewClient[v1.ListPoliciesRequest, v1.ListPoliciesResponse]( + httpClient, + baseURL+CerbosStoreServiceListPoliciesProcedure, + connect.WithSchema(cerbosStoreServiceListPoliciesMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + getPolicies: connect.NewClient[v1.GetPoliciesRequest, v1.GetPoliciesResponse]( + httpClient, + baseURL+CerbosStoreServiceGetPoliciesProcedure, + connect.WithSchema(cerbosStoreServiceGetPoliciesMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + modifyPolicies: connect.NewClient[v1.ModifyPoliciesRequest, v1.ModifyPoliciesResponse]( + httpClient, + baseURL+CerbosStoreServiceModifyPoliciesProcedure, + connect.WithSchema(cerbosStoreServiceModifyPoliciesMethodDescriptor), + connect.WithClientOptions(opts...), + ), + } +} + +// cerbosStoreServiceClient implements CerbosStoreServiceClient. +type cerbosStoreServiceClient struct { + listPolicies *connect.Client[v1.ListPoliciesRequest, v1.ListPoliciesResponse] + getPolicies *connect.Client[v1.GetPoliciesRequest, v1.GetPoliciesResponse] + modifyPolicies *connect.Client[v1.ModifyPoliciesRequest, v1.ModifyPoliciesResponse] +} + +// ListPolicies calls cerbos.cloud.store.v1.CerbosStoreService.ListPolicies. +func (c *cerbosStoreServiceClient) ListPolicies(ctx context.Context, req *connect.Request[v1.ListPoliciesRequest]) (*connect.Response[v1.ListPoliciesResponse], error) { + return c.listPolicies.CallUnary(ctx, req) +} + +// GetPolicies calls cerbos.cloud.store.v1.CerbosStoreService.GetPolicies. +func (c *cerbosStoreServiceClient) GetPolicies(ctx context.Context, req *connect.Request[v1.GetPoliciesRequest]) (*connect.Response[v1.GetPoliciesResponse], error) { + return c.getPolicies.CallUnary(ctx, req) +} + +// ModifyPolicies calls cerbos.cloud.store.v1.CerbosStoreService.ModifyPolicies. +func (c *cerbosStoreServiceClient) ModifyPolicies(ctx context.Context, req *connect.Request[v1.ModifyPoliciesRequest]) (*connect.Response[v1.ModifyPoliciesResponse], error) { + return c.modifyPolicies.CallUnary(ctx, req) +} + +// CerbosStoreServiceHandler is an implementation of the cerbos.cloud.store.v1.CerbosStoreService +// service. +type CerbosStoreServiceHandler interface { + ListPolicies(context.Context, *connect.Request[v1.ListPoliciesRequest]) (*connect.Response[v1.ListPoliciesResponse], error) + GetPolicies(context.Context, *connect.Request[v1.GetPoliciesRequest]) (*connect.Response[v1.GetPoliciesResponse], error) + ModifyPolicies(context.Context, *connect.Request[v1.ModifyPoliciesRequest]) (*connect.Response[v1.ModifyPoliciesResponse], error) +} + +// NewCerbosStoreServiceHandler builds an HTTP handler from the service implementation. It returns +// the path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewCerbosStoreServiceHandler(svc CerbosStoreServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + cerbosStoreServiceListPoliciesHandler := connect.NewUnaryHandler( + CerbosStoreServiceListPoliciesProcedure, + svc.ListPolicies, + connect.WithSchema(cerbosStoreServiceListPoliciesMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + cerbosStoreServiceGetPoliciesHandler := connect.NewUnaryHandler( + CerbosStoreServiceGetPoliciesProcedure, + svc.GetPolicies, + connect.WithSchema(cerbosStoreServiceGetPoliciesMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + cerbosStoreServiceModifyPoliciesHandler := connect.NewUnaryHandler( + CerbosStoreServiceModifyPoliciesProcedure, + svc.ModifyPolicies, + connect.WithSchema(cerbosStoreServiceModifyPoliciesMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + return "/cerbos.cloud.store.v1.CerbosStoreService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case CerbosStoreServiceListPoliciesProcedure: + cerbosStoreServiceListPoliciesHandler.ServeHTTP(w, r) + case CerbosStoreServiceGetPoliciesProcedure: + cerbosStoreServiceGetPoliciesHandler.ServeHTTP(w, r) + case CerbosStoreServiceModifyPoliciesProcedure: + cerbosStoreServiceModifyPoliciesHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedCerbosStoreServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedCerbosStoreServiceHandler struct{} + +func (UnimplementedCerbosStoreServiceHandler) ListPolicies(context.Context, *connect.Request[v1.ListPoliciesRequest]) (*connect.Response[v1.ListPoliciesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("cerbos.cloud.store.v1.CerbosStoreService.ListPolicies is not implemented")) +} + +func (UnimplementedCerbosStoreServiceHandler) GetPolicies(context.Context, *connect.Request[v1.GetPoliciesRequest]) (*connect.Response[v1.GetPoliciesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("cerbos.cloud.store.v1.CerbosStoreService.GetPolicies is not implemented")) +} + +func (UnimplementedCerbosStoreServiceHandler) ModifyPolicies(context.Context, *connect.Request[v1.ModifyPoliciesRequest]) (*connect.Response[v1.ModifyPoliciesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("cerbos.cloud.store.v1.CerbosStoreService.ModifyPolicies is not implemented")) +} diff --git a/go.mod b/go.mod index e173bb8..84dd26b 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( filippo.io/age v1.2.0 github.com/Shopify/toxiproxy/v2 v2.9.0 github.com/bufbuild/protovalidate-go v0.6.3 - github.com/cerbos/cerbos/api/genpb v0.37.0 + github.com/cerbos/cerbos/api/genpb v0.37.1-0.20240723092349-83b39d30c03d github.com/go-logr/logr v1.4.2 github.com/google/go-cmp v0.6.0 github.com/hashicorp/go-retryablehttp v0.7.7 @@ -29,29 +29,33 @@ require ( require ( github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/cel-go v0.20.1 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/klauspost/cpuid/v2 v2.2.3 // indirect + github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.19.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect - github.com/prometheus/procfs v0.13.0 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rs/xid v1.5.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stretchr/objx v0.5.2 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect golang.org/x/crypto v0.25.0 // indirect - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect + golang.org/x/exp v0.0.0-20240707233637-46b078467d37 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/go.sum b/go.sum index 501e183..f728822 100644 --- a/go.sum +++ b/go.sum @@ -20,16 +20,18 @@ github.com/bufbuild/protovalidate-go v0.6.3 h1:wxQyzW035zM16Binbaz/nWAzS12dRIXhZ github.com/bufbuild/protovalidate-go v0.6.3/go.mod h1:J4PtwP9Z2YAGgB0+o+tTWEDtLtXvz/gfhFZD8pbzM/U= github.com/cerbos/cerbos/api/genpb v0.37.0 h1:dTtlElLVx3utwYEWT0b3b1cff3GGg/Q8nXFTFbfIdFY= github.com/cerbos/cerbos/api/genpb v0.37.0/go.mod h1:/oEYro8MlnD3cUwoKwUWB136sVj3hlm2Yoyuiue56d0= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cerbos/cerbos/api/genpb v0.37.1-0.20240723092349-83b39d30c03d h1:NkvuxeSNzEQBHpVcvIc2ECAFALDX1jHBIQlCBKnvKuI= +github.com/cerbos/cerbos/api/genpb v0.37.1-0.20240723092349-83b39d30c03d/go.mod h1:6O0yFWL0OPqwygGVRVd0+c2WlUEd3jnHzw4e51cwVV0= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -40,6 +42,8 @@ github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= @@ -50,8 +54,8 @@ github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB1 github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= -github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= -github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= +github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -64,19 +68,21 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/planetscale/vtprotobuf v0.6.0 h1:nBeETjudeJ5ZgBHUz1fVHvbqUKnYOXNhsIEabROxmNA= github.com/planetscale/vtprotobuf v0.6.0/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= -github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= -github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= @@ -97,26 +103,26 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= -go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= -go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w= +golang.org/x/exp v0.0.0-20240707233637-46b078467d37/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= diff --git a/protos/buf.lock b/protos/buf.lock deleted file mode 100644 index d1461b7..0000000 --- a/protos/buf.lock +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: bufbuild - repository: protovalidate - commit: 3014d81c3a48461dbcc5b57536699f9e - digest: shake256:6b40454a0754bf624c8fc965f3576bd26bf72a480c554514672d2fac887f420c82d68cf50d40f5a77d8b6e96dda87e395aeedae84d513dde7c4bfd4d95f5657a - - remote: buf.build - owner: cerbos - repository: cerbos-api - commit: a452d54c80ed49ec979a85c8c3d4a496 - digest: shake256:7e9edc817614fc1eabecb267aad9e39eb873c5b15437c00da6911b010f38d3b36b83a1f216b1ffbdc252ad4a1205223b6e90492dc47c25b364eb60a1e95d753a - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 7e6f6e774e29406da95bd61cdcdbc8bc - digest: shake256:fe43dd2265ea0c07d76bd925eeba612667cf4c948d2ce53d6e367e1b4b3cb5fa69a51e6acb1a6a50d32f894f054a35e6c0406f6808a483f2752e10c866ffbf73 - - remote: buf.build - owner: grpc-ecosystem - repository: grpc-gateway - commit: 3f42134f4c564983838425bc43c7a65f - digest: shake256:3d11d4c0fe5e05fda0131afefbce233940e27f0c31c5d4e385686aea58ccd30f72053f61af432fa83f1fc11cda57f5f18ca3da26a29064f73c5a0d076bba8d92 diff --git a/protos/buf.yaml b/protos/buf.yaml deleted file mode 100644 index aa00f2c..0000000 --- a/protos/buf.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -version: v1 -name: buf.build/cerbos/cloud-api -deps: - - "buf.build/bufbuild/protovalidate" - - "buf.build/googleapis/googleapis" - - "buf.build/cerbos/cerbos-api" - -lint: - use: - - DEFAULT - -breaking: - use: - - WIRE_JSON diff --git a/protos/cerbos/cloud/store/v1/store.proto b/protos/cerbos/cloud/store/v1/store.proto new file mode 100644 index 0000000..3cbaf2b --- /dev/null +++ b/protos/cerbos/cloud/store/v1/store.proto @@ -0,0 +1,126 @@ +// Copyright 2021-2024 Zenauth Ltd. +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +package cerbos.cloud.store.v1; + +import "buf/validate/validate.proto"; +import "cerbos/policy/v1/policy.proto"; +import "google/api/field_behavior.proto"; +import "google/api/visibility.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cerbos/cloud-api/genpb/cerbos/cloud/store/v1;storev1"; + +message StringMatch { + message InList { + repeated string values = 1 [(buf.validate.field).repeated = { + max_items: 50 + items: { + string: {min_len: 1} + } + }]; + } + + oneof match { + option (buf.validate.oneof).required = true; + string equals = 1; + string like = 2; + InList in = 3; + } +} + +message PolicyFilter { + repeated cerbos.policy.v1.Kind kinds = 1 [ + (google.api.field_behavior) = OPTIONAL, + (buf.validate.field).repeated = { + unique: true + items: { + enum: { + not_in: [0] + defined_only: true + } + } + } + ]; + StringMatch name = 2 [(google.api.field_behavior) = OPTIONAL]; + StringMatch version = 3 [(google.api.field_behavior) = OPTIONAL]; + StringMatch scope = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +message ListPoliciesRequest { + string store = 1 [(buf.validate.field).string = { + min_len: 1 + max_len: 128 + }]; + PolicyFilter filter = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +message ListPoliciesResponse { + message Policy { + string key = 1; + cerbos.policy.v1.Kind kind = 2; + string name = 3; + string version = 4; + string scope = 5; + google.protobuf.Timestamp created_at = 6; + } + int64 store_version = 1; + repeated Policy policies = 2; +} + +message GetPoliciesRequest { + string store = 1 [(buf.validate.field).string = { + min_len: 1 + max_len: 128 + }]; + repeated string policy_keys = 2 [(buf.validate.field).repeated = { + max_items: 50 + items: { + string: {min_len: 1} + } + }]; +} + +message GetPoliciesResponse { + int64 store_version = 1; + map policies = 2; +} + +message PolicyOp { + oneof op { + option (buf.validate.oneof).required = true; + cerbos.policy.v1.Policy add_or_update = 1; + string delete = 2; + } +} + +message ModifyPoliciesRequest { + message Condition { + int64 store_version_must_equal = 1 [(buf.validate.field).int64.gte = 0]; + } + + string store = 1 [(buf.validate.field).string = { + min_len: 1 + max_len: 128 + }]; + Condition condition = 2 [(google.api.field_behavior) = OPTIONAL]; + repeated PolicyOp operations = 3 [(buf.validate.field).repeated.min_items = 1]; +} + +message ModifyPoliciesResponse { + int64 new_store_version = 1; +} + +service CerbosStoreService { + option (google.api.api_visibility).restriction = "EXPERIMENTAL"; + + rpc ListPolicies(ListPoliciesRequest) returns (ListPoliciesResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + rpc GetPolicies(GetPoliciesRequest) returns (GetPoliciesResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + rpc ModifyPolicies(ModifyPoliciesRequest) returns (ModifyPoliciesResponse) {} +}