Skip to content

Commit

Permalink
Move profiles from internal to pkg (#4811)
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslav Dimitrov <[email protected]>
  • Loading branch information
rdimitrov authored Oct 25, 2024
1 parent 2bd3726 commit 2f4770a
Show file tree
Hide file tree
Showing 44 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion cmd/cli/app/profile/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/quickstart/quickstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions cmd/dev/app/rule_type/rttst.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/actions/alert/noop/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ 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"
"github.com/mindersec/minder/internal/providers/github/properties"
"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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/actions/remediate/noop/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/actions/remediate/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/actions/remediate/rest/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ 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"
"github.com/mindersec/minder/internal/providers/ratecache"
"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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/eval_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions internal/engine/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/engine/interfaces/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion internal/logger/telemetry_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion internal/marketplaces/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/marketplaces/subscriptions/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/marketplaces/subscriptions/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/selectors/mock/selectors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/engine/selectors/selectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/selectors/selectors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/v1/rtengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/mindpak/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2f4770a

Please sign in to comment.