Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move db from internal to pkg #4814

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mk/gen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ oapi: ## generate openapi files
.PHONY: mock
mock: ## generate mocks
go generate ./...
mockgen -package mockdb -destination database/mock/store.go github.com/mindersec/minder/internal/db Store
mockgen -package mockdb -destination database/mock/store.go github.com/mindersec/minder/pkg/db Store
mockgen -package mock_github -destination internal/providers/github/mock/github.go -source pkg/providers/v1/providers.go GitHub
mockgen -package mockbundle -destination internal/marketplaces/bundles/mock/reader.go -source pkg/mindpak/reader/reader.go
mockgen -package mockbundle -destination internal/marketplaces/bundles/mock/source.go -source pkg/mindpak/sources/source.go
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/history/history_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (

"github.com/mindersec/minder/cmd/cli/app"
"github.com/mindersec/minder/cmd/cli/app/common"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/util"
"github.com/mindersec/minder/internal/util/cli"
"github.com/mindersec/minder/internal/util/cli/table"
"github.com/mindersec/minder/internal/util/cli/table/layouts"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

var listCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/provider/provider_enroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/structpb"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/providers"
"github.com/mindersec/minder/internal/util"
"github.com/mindersec/minder/internal/util/cli"
"github.com/mindersec/minder/internal/util/rand"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

// Response is the response from the OAuth callback server.
Expand Down
2 changes: 1 addition & 1 deletion cmd/dev/app/rule_type/rttst.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/spf13/viper"
"google.golang.org/protobuf/reflect/protoreflect"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/actions"
"github.com/mindersec/minder/internal/engine/entities"
"github.com/mindersec/minder/internal/engine/errors"
Expand All @@ -36,6 +35,7 @@ import (
"github.com/mindersec/minder/internal/util/jsonyaml"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
"github.com/mindersec/minder/pkg/engine/selectors"
"github.com/mindersec/minder/pkg/engine/v1/rtengine"
"github.com/mindersec/minder/pkg/profiles"
Expand Down
2 changes: 1 addition & 1 deletion cmd/dev/app/testserver/testserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
noopauth "github.com/mindersec/minder/internal/auth/jwt/noop"
mockauthz "github.com/mindersec/minder/internal/authz/mock"
"github.com/mindersec/minder/internal/controlplane/metrics"
"github.com/mindersec/minder/internal/db/embedded"
"github.com/mindersec/minder/internal/metrics/meters"
"github.com/mindersec/minder/internal/providers/ratecache"
provtelemetry "github.com/mindersec/minder/internal/providers/telemetry"
"github.com/mindersec/minder/internal/service"
"github.com/mindersec/minder/pkg/config"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db/embedded"
)

// CmdTestServer starts a test server for integration testing.
Expand Down
2 changes: 1 addition & 1 deletion cmd/reminder/app/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"github.com/spf13/viper"
"golang.org/x/sync/errgroup"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/reminder"
"github.com/mindersec/minder/pkg/config"
reminderconfig "github.com/mindersec/minder/pkg/config/reminder"
"github.com/mindersec/minder/pkg/db"
)

var startCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/app/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/rs/zerolog"
"github.com/spf13/cobra"

"github.com/mindersec/minder/internal/db"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
)

// This file contains logic shared between different commands.
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/app/encryption_purge_sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/pkg/config"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
)

// purgeCmd represents the `encryption purge-sessions` command
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/app/encryption_rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"github.com/spf13/viper"

"github.com/mindersec/minder/internal/crypto"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/pkg/config"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
)

// number of secrets to re-encrypt per batch
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/app/history_purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/pkg/config"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
)

// historyPurgeCmd represents the `history purge` command
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/app/history_purge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/mindersec/minder/internal/db"
dbf "github.com/mindersec/minder/internal/db/fixtures"
"github.com/mindersec/minder/pkg/db"
dbf "github.com/mindersec/minder/pkg/db/fixtures"
)

// This test ensures that the size of these records is kept upder
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/app/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (
"github.com/mindersec/minder/internal/auth/keycloak"
"github.com/mindersec/minder/internal/authz"
cpmetrics "github.com/mindersec/minder/internal/controlplane/metrics"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/logger"
"github.com/mindersec/minder/internal/metrics/meters"
"github.com/mindersec/minder/internal/providers/ratecache"
provtelemetry "github.com/mindersec/minder/internal/providers/telemetry"
"github.com/mindersec/minder/internal/service"
"github.com/mindersec/minder/pkg/config"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
)

var serveCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/app/webhook_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (

"github.com/mindersec/minder/internal/controlplane/metrics"
"github.com/mindersec/minder/internal/crypto"
"github.com/mindersec/minder/internal/db"
propssvc "github.com/mindersec/minder/internal/entities/properties/service"
"github.com/mindersec/minder/internal/providers"
ghprovider "github.com/mindersec/minder/internal/providers/github"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/mindersec/minder/internal/providers/telemetry"
"github.com/mindersec/minder/pkg/config"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
provifv1 "github.com/mindersec/minder/pkg/providers/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion database/mock/fixtures/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"go.uber.org/mock/gomock"

mockdb "github.com/mindersec/minder/database/mock"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/pkg/db"
)

type (
Expand Down
6 changes: 3 additions & 3 deletions database/mock/store.go

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

2 changes: 1 addition & 1 deletion internal/controlplane/handlers_artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/logger"
"github.com/mindersec/minder/internal/util"
"github.com/mindersec/minder/internal/util/ptr"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

// ListArtifacts lists all artifacts for a given project and provider
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (

"github.com/mindersec/minder/internal/auth/jwt"
"github.com/mindersec/minder/internal/authz"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/flags"
"github.com/mindersec/minder/internal/invites"
"github.com/mindersec/minder/internal/util"
minder "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

type rpcOptionsKey struct{}
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/mindersec/minder/internal/auth/jwt/noop"
"github.com/mindersec/minder/internal/authz"
"github.com/mindersec/minder/internal/authz/mock"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/flags"
mockinvites "github.com/mindersec/minder/internal/invites/mock"
Expand All @@ -42,6 +41,7 @@ import (
"github.com/mindersec/minder/internal/util"
minder "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
)

// Mock for HasProtoContext
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/protobuf/types/known/structpb"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/entities/properties"
"github.com/mindersec/minder/internal/logger"
"github.com/mindersec/minder/internal/providers"
"github.com/mindersec/minder/internal/reconcilers/messages"
"github.com/mindersec/minder/internal/util"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
"github.com/mindersec/minder/pkg/eventer/constants"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_entities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
mockgh "github.com/mindersec/minder/internal/providers/github/mock"
"github.com/mindersec/minder/internal/providers/manager"
mockmanager "github.com/mindersec/minder/internal/providers/manager/mock"
rf "github.com/mindersec/minder/internal/repositories/mock/fixtures"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
mockevents "github.com/mindersec/minder/pkg/eventer/interfaces/mock"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_evalstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
entmodels "github.com/mindersec/minder/internal/entities/models"
"github.com/mindersec/minder/internal/entities/properties"
Expand All @@ -26,6 +25,7 @@ import (
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"
"github.com/mindersec/minder/pkg/db"
"github.com/mindersec/minder/pkg/ruletypes"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_evalstatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/mindersec/minder/internal/db"
entmodels "github.com/mindersec/minder/internal/entities/models"
"github.com/mindersec/minder/internal/history"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

func TestBuildEvalResultAlertFromLRERow(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_invites_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
mockdb "github.com/mindersec/minder/database/mock"
"github.com/mindersec/minder/internal/auth"
mockidentity "github.com/mindersec/minder/internal/auth/mock"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/projects"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

func TestGetInviteDetails(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/mindersec/minder/internal/auth"
"github.com/mindersec/minder/internal/auth/jwt"
mcrypto "github.com/mindersec/minder/internal/crypto"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/flags"
"github.com/mindersec/minder/internal/logger"
Expand All @@ -38,6 +37,7 @@ import (
"github.com/mindersec/minder/internal/providers/manager"
"github.com/mindersec/minder/internal/util"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

// GetAuthorizationURL returns the URL to redirect the user to for authorization
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
mockjwt "github.com/mindersec/minder/internal/auth/jwt/mock"
"github.com/mindersec/minder/internal/controlplane/metrics"
"github.com/mindersec/minder/internal/crypto"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
mockprops "github.com/mindersec/minder/internal/entities/properties/service/mock"
"github.com/mindersec/minder/internal/providers"
Expand All @@ -50,6 +49,7 @@ import (
"github.com/mindersec/minder/internal/providers/session"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
serverconfig "github.com/mindersec/minder/pkg/config/server"
"github.com/mindersec/minder/pkg/db"
"github.com/mindersec/minder/pkg/eventer"
provinfv1 "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 @@ -17,7 +17,6 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/engine/entities"
entmodels "github.com/mindersec/minder/internal/entities/models"
Expand All @@ -27,6 +26,7 @@ import (
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"
"github.com/mindersec/minder/pkg/db"
prof "github.com/mindersec/minder/pkg/profiles"
"github.com/mindersec/minder/pkg/ruletypes"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/controlplane/handlers_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import (
"google.golang.org/protobuf/types/known/fieldmaskpb"
"google.golang.org/protobuf/types/known/structpb"

"github.com/mindersec/minder/internal/db"
"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/providers"
"github.com/mindersec/minder/internal/util"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
"github.com/mindersec/minder/pkg/db/embedded"
"github.com/mindersec/minder/pkg/engine/selectors"
"github.com/mindersec/minder/pkg/profiles"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/mindersec/minder/internal/auth/jwt"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/projects"
"github.com/mindersec/minder/internal/projects/features"
"github.com/mindersec/minder/internal/util"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

// ListProjects returns the list of projects for the current user
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
mockdb "github.com/mindersec/minder/database/mock"
"github.com/mindersec/minder/internal/auth/jwt"
"github.com/mindersec/minder/internal/authz/mock"
"github.com/mindersec/minder/internal/db"
minder "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/db"
)

func TestListProjects(t *testing.T) {
Expand Down
Loading
Loading