diff --git a/bundle/v1/client_test.go b/bundle/v1/client_test.go index 51516b9d..4f305002 100644 --- a/bundle/v1/client_test.go +++ b/bundle/v1/client_test.go @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 //go:build tests -// +build tests package v1_test diff --git a/bundle/v2/client_test.go b/bundle/v2/client_test.go index 7e0d0c3f..4e129a79 100644 --- a/bundle/v2/client_test.go +++ b/bundle/v2/client_test.go @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 //go:build tests -// +build tests package v2_test diff --git a/genpb/cerbos/cloud/epdp/v2/epdp.pb.go b/genpb/cerbos/cloud/epdp/v2/epdp.pb.go index a750ac6e..5f7858f9 100644 --- a/genpb/cerbos/cloud/epdp/v2/epdp.pb.go +++ b/genpb/cerbos/cloud/epdp/v2/epdp.pb.go @@ -559,6 +559,7 @@ type Config_Evaluator struct { Globals map[string]*structpb.Value `protobuf:"bytes,1,rep,name=globals,proto3" json:"globals,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` DefaultPolicyVersion string `protobuf:"bytes,2,opt,name=default_policy_version,json=defaultPolicyVersion,proto3" json:"default_policy_version,omitempty"` LenientScopeSearch bool `protobuf:"varint,3,opt,name=lenient_scope_search,json=lenientScopeSearch,proto3" json:"lenient_scope_search,omitempty"` + DefaultScope bool `protobuf:"varint,4,opt,name=default_scope,json=defaultScope,proto3" json:"default_scope,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -614,6 +615,13 @@ func (x *Config_Evaluator) GetLenientScopeSearch() bool { return false } +func (x *Config_Evaluator) GetDefaultScope() bool { + if x != nil { + return x.DefaultScope + } + return false +} + type Config_Schema struct { state protoimpl.MessageState `protogen:"open.v1"` Enforcement Config_Schema_Enforcement `protobuf:"varint,1,opt,name=enforcement,proto3,enum=cerbos.cloud.epdp.v2.Config_Schema_Enforcement" json:"enforcement,omitempty"` @@ -714,14 +722,15 @@ var File_cerbos_cloud_epdp_v2_epdp_proto protoreflect.FileDescriptor const file_cerbos_cloud_epdp_v2_epdp_proto_rawDesc = "" + "\n" + - "\x1fcerbos/cloud/epdp/v2/epdp.proto\x12\x14cerbos.cloud.epdp.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1bcerbos/audit/v1/audit.proto\x1a!cerbos/response/v1/response.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15google/rpc/code.proto\"\xf2\x04\n" + + "\x1fcerbos/cloud/epdp/v2/epdp.proto\x12\x14cerbos.cloud.epdp.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1bcerbos/audit/v1/audit.proto\x1a!cerbos/response/v1/response.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15google/rpc/code.proto\"\x97\x05\n" + "\x06Config\x12D\n" + "\tevaluator\x18\x01 \x01(\v2&.cerbos.cloud.epdp.v2.Config.EvaluatorR\tevaluator\x12;\n" + - "\x06schema\x18\x02 \x01(\v2#.cerbos.cloud.epdp.v2.Config.SchemaR\x06schema\x1a\x96\x02\n" + + "\x06schema\x18\x02 \x01(\v2#.cerbos.cloud.epdp.v2.Config.SchemaR\x06schema\x1a\xbb\x02\n" + "\tEvaluator\x12M\n" + "\aglobals\x18\x01 \x03(\v23.cerbos.cloud.epdp.v2.Config.Evaluator.GlobalsEntryR\aglobals\x124\n" + "\x16default_policy_version\x18\x02 \x01(\tR\x14defaultPolicyVersion\x120\n" + - "\x14lenient_scope_search\x18\x03 \x01(\bR\x12lenientScopeSearch\x1aR\n" + + "\x14lenient_scope_search\x18\x03 \x01(\bR\x12lenientScopeSearch\x12#\n" + + "\rdefault_scope\x18\x04 \x01(\bR\fdefaultScope\x1aR\n" + "\fGlobalsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12,\n" + "\x05value\x18\x02 \x01(\v2\x16.google.protobuf.ValueR\x05value:\x028\x01\x1a\xcb\x01\n" + diff --git a/genpb/cerbos/cloud/epdp/v2/epdp_vtproto.pb.go b/genpb/cerbos/cloud/epdp/v2/epdp_vtproto.pb.go index 7f448a16..257b64ea 100644 --- a/genpb/cerbos/cloud/epdp/v2/epdp_vtproto.pb.go +++ b/genpb/cerbos/cloud/epdp/v2/epdp_vtproto.pb.go @@ -58,6 +58,16 @@ func (m *Config_Evaluator) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.DefaultScope { + i-- + if m.DefaultScope { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if m.LenientScopeSearch { i-- if m.LenientScopeSearch { @@ -722,6 +732,9 @@ func (m *Config_Evaluator) SizeVT() (n int) { if m.LenientScopeSearch { n += 2 } + if m.DefaultScope { + n += 2 + } n += len(m.unknownFields) return n } @@ -1170,6 +1183,26 @@ func (m *Config_Evaluator) UnmarshalVT(dAtA []byte) error { } } m.LenientScopeSearch = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultScope", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DefaultScope = bool(v != 0) default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/genpb/cerbos/cloud/epdp/v2/hashpb_helpers.pb.go b/genpb/cerbos/cloud/epdp/v2/hashpb_helpers.pb.go index 414d96d0..eb328e0e 100644 --- a/genpb/cerbos/cloud/epdp/v2/hashpb_helpers.pb.go +++ b/genpb/cerbos/cloud/epdp/v2/hashpb_helpers.pb.go @@ -88,6 +88,9 @@ func cerbos_cloud_epdp_v2_Config_Evaluator_hashpb_sum(m *Config_Evaluator, hashe if _, ok := ignore["cerbos.cloud.epdp.v2.Config.Evaluator.lenient_scope_search"]; !ok { _, _ = hasher.Write(protowire.AppendVarint(nil, protowire.EncodeBool(m.GetLenientScopeSearch()))) } + if _, ok := ignore["cerbos.cloud.epdp.v2.Config.Evaluator.default_scope"]; !ok { + _, _ = hasher.Write(protowire.AppendVarint(nil, protowire.EncodeBool(m.GetDefaultScope()))) + } } func cerbos_cloud_epdp_v2_Config_Schema_hashpb_sum(m *Config_Schema, hasher hash.Hash, ignore map[string]struct{}) { diff --git a/logcap/client_test.go b/logcap/client_test.go index d1515e32..5750a551 100644 --- a/logcap/client_test.go +++ b/logcap/client_test.go @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 //go:build tests -// +build tests package logcap_test diff --git a/protos/cerbos/cloud/epdp/v2/epdp.proto b/protos/cerbos/cloud/epdp/v2/epdp.proto index 2210dc67..5a63b633 100644 --- a/protos/cerbos/cloud/epdp/v2/epdp.proto +++ b/protos/cerbos/cloud/epdp/v2/epdp.proto @@ -23,6 +23,7 @@ message Config { map globals = 1; string default_policy_version = 2; bool lenient_scope_search = 3; + bool default_scope = 4; } message Schema {