diff --git a/cmd/dev/app/rule_type/rttst.go b/cmd/dev/app/rule_type/rttst.go index 2978963ce6..4c29ed1e57 100644 --- a/cmd/dev/app/rule_type/rttst.go +++ b/cmd/dev/app/rule_type/rttst.go @@ -24,7 +24,6 @@ import ( "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/eval/rego" engif "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/engine/selectors" entModels "github.com/mindersec/minder/internal/entities/models" entProps "github.com/mindersec/minder/internal/entities/properties" "github.com/mindersec/minder/internal/logger" @@ -40,6 +39,7 @@ import ( "github.com/mindersec/minder/internal/providers/telemetry" "github.com/mindersec/minder/internal/util/jsonyaml" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/engine/selectors" "github.com/mindersec/minder/pkg/engine/v1/rtengine" provifv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/controlplane/handlers_profile_test.go b/internal/controlplane/handlers_profile_test.go index b18b2c71fb..38c4afcc8b 100644 --- a/internal/controlplane/handlers_profile_test.go +++ b/internal/controlplane/handlers_profile_test.go @@ -20,12 +20,12 @@ import ( "github.com/mindersec/minder/internal/db" "github.com/mindersec/minder/internal/db/embedded" "github.com/mindersec/minder/internal/engine/engcontext" - "github.com/mindersec/minder/internal/engine/selectors" stubeventer "github.com/mindersec/minder/internal/events/stubs" "github.com/mindersec/minder/internal/profiles" "github.com/mindersec/minder/internal/providers" "github.com/mindersec/minder/internal/util" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/engine/selectors" ) //nolint:gocyclo diff --git a/internal/engine/executor.go b/internal/engine/executor.go index a58212995f..6949f436b8 100644 --- a/internal/engine/executor.go +++ b/internal/engine/executor.go @@ -22,7 +22,6 @@ import ( engif "github.com/mindersec/minder/internal/engine/interfaces" eoptions "github.com/mindersec/minder/internal/engine/options" "github.com/mindersec/minder/internal/engine/rtengine" - "github.com/mindersec/minder/internal/engine/selectors" "github.com/mindersec/minder/internal/entities/properties/service" "github.com/mindersec/minder/internal/history" minderlogger "github.com/mindersec/minder/internal/logger" @@ -31,6 +30,7 @@ import ( "github.com/mindersec/minder/internal/providers/manager" provsel "github.com/mindersec/minder/internal/providers/selectors" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/engine/selectors" provinfv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/executor_test.go b/internal/engine/executor_test.go index 8d634585f5..51b06bb77d 100644 --- a/internal/engine/executor_test.go +++ b/internal/engine/executor_test.go @@ -29,8 +29,6 @@ import ( "github.com/mindersec/minder/internal/engine/actions/alert" "github.com/mindersec/minder/internal/engine/actions/remediate" "github.com/mindersec/minder/internal/engine/entities" - "github.com/mindersec/minder/internal/engine/selectors" - mock_selectors "github.com/mindersec/minder/internal/engine/selectors/mock" "github.com/mindersec/minder/internal/entities/models" mockprops "github.com/mindersec/minder/internal/entities/properties/service/mock" "github.com/mindersec/minder/internal/flags" @@ -46,6 +44,8 @@ import ( "github.com/mindersec/minder/internal/providers/ratecache" "github.com/mindersec/minder/internal/providers/telemetry" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/engine/selectors" + mock_selectors "github.com/mindersec/minder/pkg/engine/selectors/mock" provinfv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/profiles/service.go b/internal/profiles/service.go index e2c59e7c79..e2770fa011 100644 --- a/internal/profiles/service.go +++ b/internal/profiles/service.go @@ -22,7 +22,6 @@ import ( "github.com/mindersec/minder/internal/db" "github.com/mindersec/minder/internal/engine/entities" - "github.com/mindersec/minder/internal/engine/selectors" "github.com/mindersec/minder/internal/events" "github.com/mindersec/minder/internal/logger" "github.com/mindersec/minder/internal/marketplaces/namespaces" @@ -30,6 +29,7 @@ import ( "github.com/mindersec/minder/internal/util" "github.com/mindersec/minder/internal/util/ptr" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/engine/selectors" ) //go:generate go run go.uber.org/mock/mockgen -package mock_$GOPACKAGE -destination=./mock/$GOFILE -source=./$GOFILE diff --git a/internal/profiles/validator.go b/internal/profiles/validator.go index ebc305734e..a6f268245b 100644 --- a/internal/profiles/validator.go +++ b/internal/profiles/validator.go @@ -17,10 +17,10 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "github.com/mindersec/minder/internal/db" - "github.com/mindersec/minder/internal/engine/selectors" "github.com/mindersec/minder/internal/ruletypes" "github.com/mindersec/minder/internal/util" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/engine/selectors" ) // Validator encapsulates the logic for validating profiles diff --git a/internal/service/service.go b/internal/service/service.go index d33505a147..01277890d1 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -24,7 +24,6 @@ import ( "github.com/mindersec/minder/internal/email/awsses" "github.com/mindersec/minder/internal/email/noop" "github.com/mindersec/minder/internal/engine" - "github.com/mindersec/minder/internal/engine/selectors" "github.com/mindersec/minder/internal/entities/handlers" propService "github.com/mindersec/minder/internal/entities/properties/service" "github.com/mindersec/minder/internal/events" @@ -52,6 +51,7 @@ import ( "github.com/mindersec/minder/internal/repositories" "github.com/mindersec/minder/internal/roles" "github.com/mindersec/minder/internal/ruletypes" + "github.com/mindersec/minder/pkg/engine/selectors" ) // AllInOneServerService is a helper function that starts the gRPC and HTTP servers, diff --git a/internal/engine/selectors/mock/selectors.go b/pkg/engine/selectors/mock/selectors.go similarity index 98% rename from internal/engine/selectors/mock/selectors.go rename to pkg/engine/selectors/mock/selectors.go index da7b26ca95..b3cd56f5f4 100644 --- a/internal/engine/selectors/mock/selectors.go +++ b/pkg/engine/selectors/mock/selectors.go @@ -12,10 +12,10 @@ package mock_selectors import ( reflect "reflect" - selectors "github.com/mindersec/minder/internal/engine/selectors" models "github.com/mindersec/minder/internal/profiles/models" proto "github.com/mindersec/minder/internal/proto" v1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + selectors "github.com/mindersec/minder/pkg/engine/selectors" gomock "go.uber.org/mock/gomock" ) diff --git a/internal/engine/selectors/selectors.go b/pkg/engine/selectors/selectors.go similarity index 100% rename from internal/engine/selectors/selectors.go rename to pkg/engine/selectors/selectors.go diff --git a/internal/engine/selectors/selectors_test.go b/pkg/engine/selectors/selectors_test.go similarity index 100% rename from internal/engine/selectors/selectors_test.go rename to pkg/engine/selectors/selectors_test.go