From 2f4770ad50c015b2123637e9cacb287d285b35c6 Mon Sep 17 00:00:00 2001 From: Radoslav Dimitrov Date: Fri, 25 Oct 2024 09:54:11 +0200 Subject: [PATCH] Move profiles from internal to pkg (#4811) Signed-off-by: Radoslav Dimitrov --- cmd/cli/app/profile/common.go | 2 +- cmd/cli/app/quickstart/quickstart.go | 2 +- cmd/dev/app/rule_type/rttst.go | 4 ++-- internal/controlplane/handlers_profile.go | 2 +- internal/controlplane/handlers_profile_test.go | 2 +- internal/controlplane/server.go | 2 +- internal/engine/actions/actions.go | 2 +- internal/engine/actions/alert/noop/noop.go | 2 +- .../actions/alert/security_advisory/security_advisory.go | 2 +- .../actions/alert/security_advisory/security_advisory_test.go | 2 +- .../actions/remediate/gh_branch_protect/gh_branch_protect.go | 2 +- .../remediate/gh_branch_protect/gh_branch_protect_test.go | 2 +- internal/engine/actions/remediate/noop/noop.go | 2 +- .../engine/actions/remediate/pull_request/pull_request.go | 2 +- .../actions/remediate/pull_request/pull_request_test.go | 2 +- internal/engine/actions/remediate/rest/rest.go | 2 +- internal/engine/actions/remediate/rest/rest_test.go | 2 +- internal/engine/eval_status.go | 2 +- internal/engine/executor.go | 4 ++-- internal/engine/executor_test.go | 2 +- internal/engine/interfaces/interface.go | 2 +- internal/logger/telemetry_store_test.go | 2 +- internal/marketplaces/factory.go | 2 +- internal/marketplaces/subscriptions/service.go | 2 +- internal/marketplaces/subscriptions/service_test.go | 4 ++-- internal/service/service.go | 2 +- pkg/engine/selectors/mock/selectors.go | 2 +- pkg/engine/selectors/selectors.go | 2 +- pkg/engine/selectors/selectors_test.go | 2 +- pkg/engine/v1/rtengine/engine.go | 2 +- pkg/mindpak/reader/reader.go | 2 +- {internal => pkg}/profiles/mock/fixtures/service.go | 2 +- {internal => pkg}/profiles/mock/service.go | 0 {internal => pkg}/profiles/models/models.go | 0 {internal => pkg}/profiles/rule_names.go | 0 {internal => pkg}/profiles/rule_validator.go | 0 {internal => pkg}/profiles/rule_validator_test.go | 2 +- {internal => pkg}/profiles/service.go | 0 {internal => pkg}/profiles/store.go | 2 +- {internal => pkg}/profiles/types.go | 0 {internal => pkg}/profiles/util.go | 0 {internal => pkg}/profiles/util_test.go | 2 +- {internal => pkg}/profiles/validator.go | 0 {internal => pkg}/profiles/validator_test.go | 2 +- 44 files changed, 39 insertions(+), 39 deletions(-) rename {internal => pkg}/profiles/mock/fixtures/service.go (96%) rename {internal => pkg}/profiles/mock/service.go (100%) rename {internal => pkg}/profiles/models/models.go (100%) rename {internal => pkg}/profiles/rule_names.go (100%) rename {internal => pkg}/profiles/rule_validator.go (100%) rename {internal => pkg}/profiles/rule_validator_test.go (97%) rename {internal => pkg}/profiles/service.go (100%) rename {internal => pkg}/profiles/store.go (98%) rename {internal => pkg}/profiles/types.go (100%) rename {internal => pkg}/profiles/util.go (100%) rename {internal => pkg}/profiles/util_test.go (99%) rename {internal => pkg}/profiles/validator.go (100%) rename {internal => pkg}/profiles/validator_test.go (99%) diff --git a/cmd/cli/app/profile/common.go b/cmd/cli/app/profile/common.go index 6fa3d5cab0..78378379fa 100644 --- a/cmd/cli/app/profile/common.go +++ b/cmd/cli/app/profile/common.go @@ -10,11 +10,11 @@ import ( "github.com/spf13/viper" - "github.com/mindersec/minder/internal/profiles" "github.com/mindersec/minder/internal/util" "github.com/mindersec/minder/internal/util/cli" "github.com/mindersec/minder/internal/util/cli/table" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles" ) // ExecOnOneProfile is a helper function to execute a function on a single profile diff --git a/cmd/cli/app/quickstart/quickstart.go b/cmd/cli/app/quickstart/quickstart.go index 01590dfc90..9f2ef5c5d5 100644 --- a/cmd/cli/app/quickstart/quickstart.go +++ b/cmd/cli/app/quickstart/quickstart.go @@ -23,10 +23,10 @@ import ( "github.com/mindersec/minder/cmd/cli/app/profile" minderprov "github.com/mindersec/minder/cmd/cli/app/provider" "github.com/mindersec/minder/cmd/cli/app/repo" - "github.com/mindersec/minder/internal/profiles" ghclient "github.com/mindersec/minder/internal/providers/github/clients" "github.com/mindersec/minder/internal/util/cli" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles" ) const ( diff --git a/cmd/dev/app/rule_type/rttst.go b/cmd/dev/app/rule_type/rttst.go index 51cf4cf815..794ab2347a 100644 --- a/cmd/dev/app/rule_type/rttst.go +++ b/cmd/dev/app/rule_type/rttst.go @@ -25,8 +25,6 @@ import ( engif "github.com/mindersec/minder/internal/engine/interfaces" entModels "github.com/mindersec/minder/internal/entities/models" entProps "github.com/mindersec/minder/internal/entities/properties" - "github.com/mindersec/minder/internal/profiles" - "github.com/mindersec/minder/internal/profiles/models" "github.com/mindersec/minder/internal/providers/credentials" "github.com/mindersec/minder/internal/providers/dockerhub" "github.com/mindersec/minder/internal/providers/github/clients" @@ -40,6 +38,8 @@ import ( serverconfig "github.com/mindersec/minder/pkg/config/server" "github.com/mindersec/minder/pkg/engine/selectors" "github.com/mindersec/minder/pkg/engine/v1/rtengine" + "github.com/mindersec/minder/pkg/profiles" + "github.com/mindersec/minder/pkg/profiles/models" provifv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/controlplane/handlers_profile.go b/internal/controlplane/handlers_profile.go index e4f41af75f..07fdabed08 100644 --- a/internal/controlplane/handlers_profile.go +++ b/internal/controlplane/handlers_profile.go @@ -24,10 +24,10 @@ import ( "github.com/mindersec/minder/internal/entities/properties" propSvc "github.com/mindersec/minder/internal/entities/properties/service" "github.com/mindersec/minder/internal/logger" - prof "github.com/mindersec/minder/internal/profiles" ghprop "github.com/mindersec/minder/internal/providers/github/properties" "github.com/mindersec/minder/internal/util" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + prof "github.com/mindersec/minder/pkg/profiles" "github.com/mindersec/minder/pkg/ruletypes" ) diff --git a/internal/controlplane/handlers_profile_test.go b/internal/controlplane/handlers_profile_test.go index 38c4afcc8b..6859b055aa 100644 --- a/internal/controlplane/handlers_profile_test.go +++ b/internal/controlplane/handlers_profile_test.go @@ -21,11 +21,11 @@ import ( "github.com/mindersec/minder/internal/db/embedded" "github.com/mindersec/minder/internal/engine/engcontext" 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" + "github.com/mindersec/minder/pkg/profiles" ) //nolint:gocyclo diff --git a/internal/controlplane/server.go b/internal/controlplane/server.go index e74e78c607..a9fceea316 100644 --- a/internal/controlplane/server.go +++ b/internal/controlplane/server.go @@ -51,7 +51,6 @@ import ( "github.com/mindersec/minder/internal/history" "github.com/mindersec/minder/internal/invites" "github.com/mindersec/minder/internal/logger" - "github.com/mindersec/minder/internal/profiles" "github.com/mindersec/minder/internal/projects" "github.com/mindersec/minder/internal/providers" ghprov "github.com/mindersec/minder/internal/providers/github" @@ -64,6 +63,7 @@ import ( "github.com/mindersec/minder/internal/util" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" serverconfig "github.com/mindersec/minder/pkg/config/server" + "github.com/mindersec/minder/pkg/profiles" "github.com/mindersec/minder/pkg/ruletypes" ) diff --git a/internal/engine/actions/actions.go b/internal/engine/actions/actions.go index c68edabfce..83422889be 100644 --- a/internal/engine/actions/actions.go +++ b/internal/engine/actions/actions.go @@ -21,8 +21,8 @@ import ( "github.com/mindersec/minder/internal/engine/actions/remediate/pull_request" enginerr "github.com/mindersec/minder/internal/engine/errors" engif "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles/models" provinfv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/actions/alert/noop/noop.go b/internal/engine/actions/alert/noop/noop.go index 63b7b8f49e..cf7ff9c236 100644 --- a/internal/engine/actions/alert/noop/noop.go +++ b/internal/engine/actions/alert/noop/noop.go @@ -14,7 +14,7 @@ import ( enginerr "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" + "github.com/mindersec/minder/pkg/profiles/models" ) // Alert is the structure backing the noop alert diff --git a/internal/engine/actions/alert/security_advisory/security_advisory.go b/internal/engine/actions/alert/security_advisory/security_advisory.go index 2c0d94b77b..40d7cc7f7c 100644 --- a/internal/engine/actions/alert/security_advisory/security_advisory.go +++ b/internal/engine/actions/alert/security_advisory/security_advisory.go @@ -18,7 +18,7 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "github.com/mindersec/minder/internal/db" - "github.com/mindersec/minder/internal/profiles/models" + "github.com/mindersec/minder/pkg/profiles/models" enginerr "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/interfaces" diff --git a/internal/engine/actions/alert/security_advisory/security_advisory_test.go b/internal/engine/actions/alert/security_advisory/security_advisory_test.go index d253175630..ae7c0a0d5e 100644 --- a/internal/engine/actions/alert/security_advisory/security_advisory_test.go +++ b/internal/engine/actions/alert/security_advisory/security_advisory_test.go @@ -18,9 +18,9 @@ import ( "github.com/mindersec/minder/internal/db" enginerr "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" mockghclient "github.com/mindersec/minder/internal/providers/github/mock" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles/models" ) var TestActionTypeValid interfaces.ActionType = "alert-test" diff --git a/internal/engine/actions/remediate/gh_branch_protect/gh_branch_protect.go b/internal/engine/actions/remediate/gh_branch_protect/gh_branch_protect.go index 50d8f4a4d0..ca127c5a8c 100644 --- a/internal/engine/actions/remediate/gh_branch_protect/gh_branch_protect.go +++ b/internal/engine/actions/remediate/gh_branch_protect/gh_branch_protect.go @@ -20,10 +20,10 @@ import ( engerrors "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" mindergh "github.com/mindersec/minder/internal/providers/github" "github.com/mindersec/minder/internal/util" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles/models" provifv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/actions/remediate/gh_branch_protect/gh_branch_protect_test.go b/internal/engine/actions/remediate/gh_branch_protect/gh_branch_protect_test.go index 888a90044d..47e50b1ca8 100644 --- a/internal/engine/actions/remediate/gh_branch_protect/gh_branch_protect_test.go +++ b/internal/engine/actions/remediate/gh_branch_protect/gh_branch_protect_test.go @@ -16,7 +16,6 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" "github.com/mindersec/minder/internal/providers/credentials" "github.com/mindersec/minder/internal/providers/github/clients" mock_ghclient "github.com/mindersec/minder/internal/providers/github/mock" @@ -24,6 +23,7 @@ import ( "github.com/mindersec/minder/internal/providers/ratecache" "github.com/mindersec/minder/internal/providers/telemetry" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles/models" provifv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/actions/remediate/noop/noop.go b/internal/engine/actions/remediate/noop/noop.go index 82d09bc818..7d7f413a0e 100644 --- a/internal/engine/actions/remediate/noop/noop.go +++ b/internal/engine/actions/remediate/noop/noop.go @@ -14,7 +14,7 @@ import ( enginerr "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" + "github.com/mindersec/minder/pkg/profiles/models" ) // Remediator is the structure backing the noop remediator diff --git a/internal/engine/actions/remediate/pull_request/pull_request.go b/internal/engine/actions/remediate/pull_request/pull_request.go index 9af941562d..fd72ed006c 100644 --- a/internal/engine/actions/remediate/pull_request/pull_request.go +++ b/internal/engine/actions/remediate/pull_request/pull_request.go @@ -26,10 +26,10 @@ import ( "github.com/mindersec/minder/internal/db" enginerr "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" "github.com/mindersec/minder/internal/util" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" engifv1 "github.com/mindersec/minder/pkg/engine/v1/interfaces" + "github.com/mindersec/minder/pkg/profiles/models" provifv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/actions/remediate/pull_request/pull_request_test.go b/internal/engine/actions/remediate/pull_request/pull_request_test.go index 58b4e4a505..19c65a80d4 100644 --- a/internal/engine/actions/remediate/pull_request/pull_request_test.go +++ b/internal/engine/actions/remediate/pull_request/pull_request_test.go @@ -29,7 +29,6 @@ import ( "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" "github.com/mindersec/minder/internal/providers/credentials" "github.com/mindersec/minder/internal/providers/github/clients" mockghclient "github.com/mindersec/minder/internal/providers/github/mock" @@ -38,6 +37,7 @@ import ( "github.com/mindersec/minder/internal/providers/telemetry" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" interfaces2 "github.com/mindersec/minder/pkg/engine/v1/interfaces" + "github.com/mindersec/minder/pkg/profiles/models" provifv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/actions/remediate/rest/rest.go b/internal/engine/actions/remediate/rest/rest.go index ec690c367f..1c13a32c9d 100644 --- a/internal/engine/actions/remediate/rest/rest.go +++ b/internal/engine/actions/remediate/rest/rest.go @@ -19,9 +19,9 @@ import ( engerrors "github.com/mindersec/minder/internal/engine/errors" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" "github.com/mindersec/minder/internal/util" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles/models" provifv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/actions/remediate/rest/rest_test.go b/internal/engine/actions/remediate/rest/rest_test.go index 0e5fef3019..9a47ece365 100644 --- a/internal/engine/actions/remediate/rest/rest_test.go +++ b/internal/engine/actions/remediate/rest/rest_test.go @@ -19,7 +19,6 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" "github.com/mindersec/minder/internal/providers/credentials" "github.com/mindersec/minder/internal/providers/github/clients" "github.com/mindersec/minder/internal/providers/github/properties" @@ -27,6 +26,7 @@ import ( "github.com/mindersec/minder/internal/providers/telemetry" "github.com/mindersec/minder/internal/providers/testproviders" pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles/models" provifv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/eval_status.go b/internal/engine/eval_status.go index f88d184b8b..165a0bc554 100644 --- a/internal/engine/eval_status.go +++ b/internal/engine/eval_status.go @@ -16,7 +16,7 @@ import ( "github.com/mindersec/minder/internal/engine/entities" evalerrors "github.com/mindersec/minder/internal/engine/errors" engif "github.com/mindersec/minder/internal/engine/interfaces" - "github.com/mindersec/minder/internal/profiles/models" + "github.com/mindersec/minder/pkg/profiles/models" ) func (e *executor) createEvalStatusParams( diff --git a/internal/engine/executor.go b/internal/engine/executor.go index b4b467b341..d2b8d68c4e 100644 --- a/internal/engine/executor.go +++ b/internal/engine/executor.go @@ -25,12 +25,12 @@ import ( "github.com/mindersec/minder/internal/entities/properties/service" "github.com/mindersec/minder/internal/history" minderlogger "github.com/mindersec/minder/internal/logger" - "github.com/mindersec/minder/internal/profiles" - "github.com/mindersec/minder/internal/profiles/models" "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" + "github.com/mindersec/minder/pkg/profiles" + "github.com/mindersec/minder/pkg/profiles/models" provinfv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/executor_test.go b/internal/engine/executor_test.go index 174b55ec51..4f0f361be6 100644 --- a/internal/engine/executor_test.go +++ b/internal/engine/executor_test.go @@ -34,7 +34,6 @@ import ( mockhistory "github.com/mindersec/minder/internal/history/mock" "github.com/mindersec/minder/internal/logger" "github.com/mindersec/minder/internal/metrics/meters" - "github.com/mindersec/minder/internal/profiles" "github.com/mindersec/minder/internal/providers" "github.com/mindersec/minder/internal/providers/github/clients" ghmanager "github.com/mindersec/minder/internal/providers/github/manager" @@ -46,6 +45,7 @@ import ( serverconfig "github.com/mindersec/minder/pkg/config/server" "github.com/mindersec/minder/pkg/engine/selectors" mock_selectors "github.com/mindersec/minder/pkg/engine/selectors/mock" + "github.com/mindersec/minder/pkg/profiles" provinfv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/internal/engine/interfaces/interface.go b/internal/engine/interfaces/interface.go index ed4a08df43..7ec48402c9 100644 --- a/internal/engine/interfaces/interface.go +++ b/internal/engine/interfaces/interface.go @@ -15,8 +15,8 @@ import ( "github.com/mindersec/minder/internal/db" evalerrors "github.com/mindersec/minder/internal/engine/errors" - "github.com/mindersec/minder/internal/profiles/models" "github.com/mindersec/minder/pkg/engine/v1/interfaces" + "github.com/mindersec/minder/pkg/profiles/models" ) // ActionType represents the type of action, i.e., remediate, alert, etc. diff --git a/internal/logger/telemetry_store_test.go b/internal/logger/telemetry_store_test.go index e2174e6422..0e7b59f433 100644 --- a/internal/logger/telemetry_store_test.go +++ b/internal/logger/telemetry_store_test.go @@ -18,7 +18,7 @@ import ( enginerr "github.com/mindersec/minder/internal/engine/errors" engif "github.com/mindersec/minder/internal/engine/interfaces" "github.com/mindersec/minder/internal/logger" - "github.com/mindersec/minder/internal/profiles/models" + "github.com/mindersec/minder/pkg/profiles/models" ) func TestTelemetryStore_Record(t *testing.T) { diff --git a/internal/marketplaces/factory.go b/internal/marketplaces/factory.go index aa2e33b723..1233a2cac6 100644 --- a/internal/marketplaces/factory.go +++ b/internal/marketplaces/factory.go @@ -9,10 +9,10 @@ import ( "path/filepath" sub "github.com/mindersec/minder/internal/marketplaces/subscriptions" - "github.com/mindersec/minder/internal/profiles" "github.com/mindersec/minder/pkg/config/server" "github.com/mindersec/minder/pkg/mindpak" src "github.com/mindersec/minder/pkg/mindpak/sources" + "github.com/mindersec/minder/pkg/profiles" "github.com/mindersec/minder/pkg/ruletypes" ) diff --git a/internal/marketplaces/subscriptions/service.go b/internal/marketplaces/subscriptions/service.go index 87592826a2..2d8a156d05 100644 --- a/internal/marketplaces/subscriptions/service.go +++ b/internal/marketplaces/subscriptions/service.go @@ -15,10 +15,10 @@ import ( "github.com/google/uuid" "github.com/mindersec/minder/internal/db" - profsvc "github.com/mindersec/minder/internal/profiles" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" "github.com/mindersec/minder/pkg/mindpak" "github.com/mindersec/minder/pkg/mindpak/reader" + profsvc "github.com/mindersec/minder/pkg/profiles" "github.com/mindersec/minder/pkg/ruletypes" ) diff --git a/internal/marketplaces/subscriptions/service_test.go b/internal/marketplaces/subscriptions/service_test.go index ddf733730b..8703776f08 100644 --- a/internal/marketplaces/subscriptions/service_test.go +++ b/internal/marketplaces/subscriptions/service_test.go @@ -17,9 +17,9 @@ import ( dbf "github.com/mindersec/minder/internal/db/fixtures" brf "github.com/mindersec/minder/internal/marketplaces/bundles/mock/fixtures" "github.com/mindersec/minder/internal/marketplaces/subscriptions" - "github.com/mindersec/minder/internal/profiles" - psf "github.com/mindersec/minder/internal/profiles/mock/fixtures" "github.com/mindersec/minder/pkg/mindpak/reader" + "github.com/mindersec/minder/pkg/profiles" + psf "github.com/mindersec/minder/pkg/profiles/mock/fixtures" "github.com/mindersec/minder/pkg/ruletypes" rsf "github.com/mindersec/minder/pkg/ruletypes/mock/fixtures" ) diff --git a/internal/service/service.go b/internal/service/service.go index 2cd62d3379..62b0da47a4 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -31,7 +31,6 @@ import ( "github.com/mindersec/minder/internal/invites" "github.com/mindersec/minder/internal/marketplaces" "github.com/mindersec/minder/internal/metrics/meters" - "github.com/mindersec/minder/internal/profiles" "github.com/mindersec/minder/internal/projects" "github.com/mindersec/minder/internal/providers" "github.com/mindersec/minder/internal/providers/dockerhub" @@ -51,6 +50,7 @@ import ( "github.com/mindersec/minder/internal/roles" serverconfig "github.com/mindersec/minder/pkg/config/server" "github.com/mindersec/minder/pkg/engine/selectors" + "github.com/mindersec/minder/pkg/profiles" "github.com/mindersec/minder/pkg/ruletypes" ) diff --git a/pkg/engine/selectors/mock/selectors.go b/pkg/engine/selectors/mock/selectors.go index b3cd56f5f4..75a3893fa8 100644 --- a/pkg/engine/selectors/mock/selectors.go +++ b/pkg/engine/selectors/mock/selectors.go @@ -12,10 +12,10 @@ package mock_selectors import ( reflect "reflect" - 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" + models "github.com/mindersec/minder/pkg/profiles/models" gomock "go.uber.org/mock/gomock" ) diff --git a/pkg/engine/selectors/selectors.go b/pkg/engine/selectors/selectors.go index 0612f76626..c2708a2946 100644 --- a/pkg/engine/selectors/selectors.go +++ b/pkg/engine/selectors/selectors.go @@ -19,9 +19,9 @@ import ( "github.com/google/cel-go/common/types/ref" "github.com/google/cel-go/interpreter" - "github.com/mindersec/minder/internal/profiles/models" internalpb "github.com/mindersec/minder/internal/proto" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles/models" ) var ( diff --git a/pkg/engine/selectors/selectors_test.go b/pkg/engine/selectors/selectors_test.go index 1eb5462f6b..77daf046de 100644 --- a/pkg/engine/selectors/selectors_test.go +++ b/pkg/engine/selectors/selectors_test.go @@ -12,9 +12,9 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/types/known/structpb" - "github.com/mindersec/minder/internal/profiles/models" internalpb "github.com/mindersec/minder/internal/proto" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles/models" ) func TestNewSelectorEngine(t *testing.T) { diff --git a/pkg/engine/v1/rtengine/engine.go b/pkg/engine/v1/rtengine/engine.go index 39ac6aa355..d72fa698b4 100644 --- a/pkg/engine/v1/rtengine/engine.go +++ b/pkg/engine/v1/rtengine/engine.go @@ -18,9 +18,9 @@ import ( "github.com/mindersec/minder/internal/engine/ingestcache" "github.com/mindersec/minder/internal/engine/ingester" eoptions "github.com/mindersec/minder/internal/engine/options" - "github.com/mindersec/minder/internal/profiles" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" "github.com/mindersec/minder/pkg/engine/v1/interfaces" + "github.com/mindersec/minder/pkg/profiles" provinfv1 "github.com/mindersec/minder/pkg/providers/v1" ) diff --git a/pkg/mindpak/reader/reader.go b/pkg/mindpak/reader/reader.go index 14edb20545..ecfa49fd06 100644 --- a/pkg/mindpak/reader/reader.go +++ b/pkg/mindpak/reader/reader.go @@ -9,9 +9,9 @@ import ( "io/fs" "strings" - "github.com/mindersec/minder/internal/profiles" v1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" "github.com/mindersec/minder/pkg/mindpak" + "github.com/mindersec/minder/pkg/profiles" ) // BundleReader provides a high-level interface for accessing the contents of diff --git a/internal/profiles/mock/fixtures/service.go b/pkg/profiles/mock/fixtures/service.go similarity index 96% rename from internal/profiles/mock/fixtures/service.go rename to pkg/profiles/mock/fixtures/service.go index 157de7fbaa..3fe05ff01d 100644 --- a/internal/profiles/mock/fixtures/service.go +++ b/pkg/profiles/mock/fixtures/service.go @@ -10,8 +10,8 @@ package fixtures import ( "errors" - mockprofsvc "github.com/mindersec/minder/internal/profiles/mock" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + mockprofsvc "github.com/mindersec/minder/pkg/profiles/mock" "go.uber.org/mock/gomock" ) diff --git a/internal/profiles/mock/service.go b/pkg/profiles/mock/service.go similarity index 100% rename from internal/profiles/mock/service.go rename to pkg/profiles/mock/service.go diff --git a/internal/profiles/models/models.go b/pkg/profiles/models/models.go similarity index 100% rename from internal/profiles/models/models.go rename to pkg/profiles/models/models.go diff --git a/internal/profiles/rule_names.go b/pkg/profiles/rule_names.go similarity index 100% rename from internal/profiles/rule_names.go rename to pkg/profiles/rule_names.go diff --git a/internal/profiles/rule_validator.go b/pkg/profiles/rule_validator.go similarity index 100% rename from internal/profiles/rule_validator.go rename to pkg/profiles/rule_validator.go diff --git a/internal/profiles/rule_validator_test.go b/pkg/profiles/rule_validator_test.go similarity index 97% rename from internal/profiles/rule_validator_test.go rename to pkg/profiles/rule_validator_test.go index d3c248483c..6e9dde9782 100644 --- a/internal/profiles/rule_validator_test.go +++ b/pkg/profiles/rule_validator_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/mindersec/minder/internal/profiles" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles" ) func TestExampleRulesAreValidatedCorrectly(t *testing.T) { diff --git a/internal/profiles/service.go b/pkg/profiles/service.go similarity index 100% rename from internal/profiles/service.go rename to pkg/profiles/service.go diff --git a/internal/profiles/store.go b/pkg/profiles/store.go similarity index 98% rename from internal/profiles/store.go rename to pkg/profiles/store.go index 5d0abab12a..407c8e0263 100644 --- a/internal/profiles/store.go +++ b/pkg/profiles/store.go @@ -11,7 +11,7 @@ import ( "golang.org/x/exp/maps" "github.com/mindersec/minder/internal/db" - "github.com/mindersec/minder/internal/profiles/models" + "github.com/mindersec/minder/pkg/profiles/models" ) // ProfileStore encapsulates operations for fetching ProfileAggregates diff --git a/internal/profiles/types.go b/pkg/profiles/types.go similarity index 100% rename from internal/profiles/types.go rename to pkg/profiles/types.go diff --git a/internal/profiles/util.go b/pkg/profiles/util.go similarity index 100% rename from internal/profiles/util.go rename to pkg/profiles/util.go diff --git a/internal/profiles/util_test.go b/pkg/profiles/util_test.go similarity index 99% rename from internal/profiles/util_test.go rename to pkg/profiles/util_test.go index 0d7b941fba..38ad863050 100644 --- a/internal/profiles/util_test.go +++ b/pkg/profiles/util_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/types/known/structpb" - "github.com/mindersec/minder/internal/profiles" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles" ) var ( diff --git a/internal/profiles/validator.go b/pkg/profiles/validator.go similarity index 100% rename from internal/profiles/validator.go rename to pkg/profiles/validator.go diff --git a/internal/profiles/validator_test.go b/pkg/profiles/validator_test.go similarity index 99% rename from internal/profiles/validator_test.go rename to pkg/profiles/validator_test.go index 4caa60193a..e53e80c756 100644 --- a/internal/profiles/validator_test.go +++ b/pkg/profiles/validator_test.go @@ -17,9 +17,9 @@ import ( mockdb "github.com/mindersec/minder/database/mock" "github.com/mindersec/minder/internal/db" - "github.com/mindersec/minder/internal/profiles" "github.com/mindersec/minder/internal/util" minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" + "github.com/mindersec/minder/pkg/profiles" ) func TestValidatorScenarios(t *testing.T) {