From 0218be8c46351a9eada6924586db6c3bc8c0a7f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 04:40:01 +0000 Subject: [PATCH 01/30] chore(deps): bump google.golang.org/grpc from 1.68.0 to 1.68.1 (#2947) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.68.0 to 1.68.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.68.0...v1.68.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d8bfd6274..284eeb31f 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( golang.org/x/mod v0.22.0 golang.org/x/oauth2 v0.24.0 golang.org/x/term v0.26.0 - google.golang.org/grpc v1.68.0 + google.golang.org/grpc v1.68.1 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.0 ) diff --git a/go.sum b/go.sum index 28de4b7ef..f5fc4ac40 100644 --- a/go.sum +++ b/go.sum @@ -1481,8 +1481,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 1f05988ec2fdf66347fc57bc39bcb55e86e45e1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:36:06 +0800 Subject: [PATCH 02/30] chore(deps): bump golang.org/x/term from 0.26.0 to 0.27.0 (#2946) Bumps [golang.org/x/term](https://github.com/golang/term) from 0.26.0 to 0.27.0. - [Commits](https://github.com/golang/term/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: golang.org/x/term dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 284eeb31f..5bf03b3dc 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( go.opentelemetry.io/otel v1.32.0 golang.org/x/mod v0.22.0 golang.org/x/oauth2 v0.24.0 - golang.org/x/term v0.26.0 + golang.org/x/term v0.27.0 google.golang.org/grpc v1.68.1 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.0 @@ -337,7 +337,7 @@ require ( golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/net v0.31.0 // indirect golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.20.0 // indirect golang.org/x/tools v0.27.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect diff --git a/go.sum b/go.sum index f5fc4ac40..d043fab57 100644 --- a/go.sum +++ b/go.sum @@ -1295,8 +1295,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1311,8 +1311,8 @@ golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 6bef0d202b81b5a1122608ca91d3386a6cbd9b80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:36:38 +0800 Subject: [PATCH 03/30] chore(deps): bump github.com/getsentry/sentry-go from 0.29.1 to 0.30.0 (#2941) Bumps [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) from 0.29.1 to 0.30.0. - [Release notes](https://github.com/getsentry/sentry-go/releases) - [Changelog](https://github.com/getsentry/sentry-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-go/compare/v0.29.1...v0.30.0) --- updated-dependencies: - dependency-name: github.com/getsentry/sentry-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5bf03b3dc..1c55174b8 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/docker/docker v27.3.1+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 - github.com/getsentry/sentry-go v0.29.1 + github.com/getsentry/sentry-go v0.30.0 github.com/gin-gonic/gin v1.10.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.12.0 diff --git a/go.sum b/go.sum index d043fab57..9313587d7 100644 --- a/go.sum +++ b/go.sum @@ -291,8 +291,8 @@ github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uq github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= -github.com/getsentry/sentry-go v0.29.1 h1:DyZuChN8Hz3ARxGVV8ePaNXh1dQ7d76AiB117xcREwA= -github.com/getsentry/sentry-go v0.29.1/go.mod h1:x3AtIzN01d6SiWkderzaH28Tm0lgkafpJ5Bm3li39O0= +github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= +github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= github.com/ghostiam/protogetter v0.3.8 h1:LYcXbYvybUyTIxN2Mj9h6rHrDZBDwZloPoKctWrFyJY= github.com/ghostiam/protogetter v0.3.8/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= From c1363893030d197903e8ad9949b73758544206ff Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 5 Dec 2024 13:54:48 +0800 Subject: [PATCH 04/30] chore: update config comments (#2944) --- pkg/config/templates/config.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index 12decc3f4..f59dab08b 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -9,15 +9,16 @@ enabled = true # Port to use for the API URL. port = 54321 # Schemas to expose in your API. Tables, views and stored procedures in this schema will get API -# endpoints. `public` is always included. +# endpoints. `public` and `graphql_public` schemas are included by default. schemas = ["public", "graphql_public"] -# Extra schemas to add to the search_path of every request. `public` is always included. +# Extra schemas to add to the search_path of every request. extra_search_path = ["public", "extensions"] # The maximum number of rows returns from a view, table, or stored procedure. Limits payload size # for accidental or malicious requests. max_rows = 1000 [api.tls] +# Enable HTTPS endpoints locally using a self-signed certificate. enabled = false [db] @@ -45,8 +46,7 @@ max_client_conn = 100 # If enabled, seeds the database after migrations during a db reset. enabled = true # Specifies an ordered list of seed files to load during db reset. -# Supports glob patterns relative to supabase directory. For example: -# sql_paths = ['./seeds/*.sql', '../project-src/seeds/*-load-testing.sql'] +# Supports glob patterns relative to supabase directory: './seeds/*.sql' sql_paths = ['./seed.sql'] [realtime] From bc1facc7795e8244ec8f3957a712c6aa89f3d612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=83=A5=EB=83=90=EC=B1=A0?= Date: Thu, 5 Dec 2024 14:54:59 +0900 Subject: [PATCH 05/30] fix: bump edge-runtime to 1.65.4 (#2940) --- pkg/config/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/constants.go b/pkg/config/constants.go index 23f60f25f..6754dcb75 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -12,7 +12,7 @@ const ( pgmetaImage = "supabase/postgres-meta:v0.84.2" studioImage = "supabase/studio:20241202-71e5240" imageProxyImage = "darthsim/imgproxy:v3.8.0" - edgeRuntimeImage = "supabase/edge-runtime:v1.65.3" + edgeRuntimeImage = "supabase/edge-runtime:v1.65.4" vectorImage = "timberio/vector:0.28.1-alpine" supavisorImage = "supabase/supavisor:1.1.56" gotrueImage = "supabase/gotrue:v2.164.0" From 9324c89aef4feb4fec25f52bea85c763ce420b43 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 6 Dec 2024 20:00:37 +0800 Subject: [PATCH 06/30] fix: bump default postgres for pgmq support (#2948) --- pkg/config/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/constants.go b/pkg/config/constants.go index 6754dcb75..44b61997e 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -3,7 +3,7 @@ package config const ( pg13Image = "supabase/postgres:13.3.0" pg14Image = "supabase/postgres:14.1.0.89" - Pg15Image = "supabase/postgres:15.6.1.139" + Pg15Image = "supabase/postgres:15.6.1.143" // Append to ServiceImages when adding new dependencies below // TODO: try https://github.com/axllent/mailpit kongImage = "library/kong:2.8.1" From a3fd06a87238b013cb6eb4b970071ad743c54ec7 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sat, 7 Dec 2024 14:25:22 +0800 Subject: [PATCH 07/30] fix: optional project ref flag for snippets command --- cmd/snippets.go | 2 ++ internal/snippets/list/list.go | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/snippets.go b/cmd/snippets.go index 86f439c67..f69b232af 100644 --- a/cmd/snippets.go +++ b/cmd/snippets.go @@ -5,6 +5,7 @@ import ( "github.com/spf13/cobra" "github.com/supabase/cli/internal/snippets/download" "github.com/supabase/cli/internal/snippets/list" + "github.com/supabase/cli/internal/utils/flags" ) var ( @@ -35,6 +36,7 @@ var ( ) func init() { + snippetsCmd.PersistentFlags().StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.") snippetsCmd.AddCommand(snippetsListCmd) snippetsCmd.AddCommand(snippetsDownloadCmd) rootCmd.AddCommand(snippetsCmd) diff --git a/internal/snippets/list/list.go b/internal/snippets/list/list.go index 1bd47060f..f54325eaa 100644 --- a/internal/snippets/list/list.go +++ b/internal/snippets/list/list.go @@ -14,11 +14,8 @@ import ( ) func Run(ctx context.Context, fsys afero.Fs) error { - ref, err := flags.LoadProjectRef(fsys) - if err != nil { - return err - } - resp, err := utils.GetSupabase().V1ListAllSnippetsWithResponse(ctx, &api.V1ListAllSnippetsParams{ProjectRef: &ref}) + opts := api.V1ListAllSnippetsParams{ProjectRef: &flags.ProjectRef} + resp, err := utils.GetSupabase().V1ListAllSnippetsWithResponse(ctx, &opts) if err != nil { return errors.Errorf("failed to list snippets: %w", err) } From bfa2c42c7eded5476e4c49728304748b864fbaa3 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sat, 7 Dec 2024 16:03:01 +0800 Subject: [PATCH 08/30] chore: reuse services command for version check --- cmd/root.go | 3 +- internal/services/services.go | 73 +++++++++++++++++++++-------------- internal/start/start.go | 26 +------------ pkg/config/config.go | 15 +++++++ 4 files changed, 63 insertions(+), 54 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index d3ef3fce9..35540a897 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,7 +15,6 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/internal/services" "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/internal/utils/flags" "golang.org/x/mod/semver" @@ -250,7 +249,7 @@ func GetRootCmd() *cobra.Command { } func addSentryScope(scope *sentry.Scope) { - serviceImages := services.GetServiceImages() + serviceImages := utils.Config.GetServiceImages() imageToVersion := make(map[string]interface{}, len(serviceImages)) for _, image := range serviceImages { parts := strings.Split(image, ":") diff --git a/internal/services/services.go b/internal/services/services.go index 1e6dc531d..b9bfae6e6 100644 --- a/internal/services/services.go +++ b/internal/services/services.go @@ -2,7 +2,9 @@ package services import ( "context" + "errors" "fmt" + "os" "strings" "sync" @@ -13,50 +15,56 @@ import ( "github.com/supabase/cli/internal/utils/tenant" ) -var suggestLinkCommand = fmt.Sprintf("Run %s to sync your local image versions with the linked project.", utils.Aqua("supabase link")) - func Run(ctx context.Context, fsys afero.Fs) error { - _ = utils.LoadConfigFS(fsys) - serviceImages := GetServiceImages() - - var linked map[string]string - if projectRef, err := flags.LoadProjectRef(fsys); err == nil { - linked = GetRemoteImages(ctx, projectRef) + if _, err := flags.LoadProjectRef(fsys); err != nil && !errors.Is(err, utils.ErrNotLinked) { + fmt.Fprintln(os.Stderr, err) + } + if err := utils.Config.Load("", utils.NewRootFS(fsys)); err != nil && !errors.Is(err, os.ErrNotExist) { + fmt.Fprintln(os.Stderr, err) } + serviceImages := CheckVersions(ctx, fsys) table := `|SERVICE IMAGE|LOCAL|LINKED| |-|-|-| ` for _, image := range serviceImages { - parts := strings.Split(image, ":") - version, ok := linked[image] - if !ok { - version = "-" - } else if parts[1] != version && image != utils.Config.Db.Image { - utils.CmdSuggestion = suggestLinkCommand + remote := image.Remote + if len(remote) == 0 { + remote = "-" } - table += fmt.Sprintf("|`%s`|`%s`|`%s`|\n", parts[0], parts[1], version) + table += fmt.Sprintf("|`%s`|`%s`|`%s`|\n", image.Name, image.Local, remote) } return list.RenderTable(table) } -func GetServiceImages() []string { - return []string{ - utils.Config.Db.Image, - utils.Config.Auth.Image, - utils.Config.Api.Image, - utils.Config.Realtime.Image, - utils.Config.Storage.Image, - utils.Config.EdgeRuntime.Image, - utils.Config.Studio.Image, - utils.Config.Studio.PgmetaImage, - utils.Config.Analytics.Image, - utils.Config.Db.Pooler.Image, +type imageVersion struct { + Name string `json:"name"` + Local string `json:"local"` + Remote string `json:"remote"` +} + +func CheckVersions(ctx context.Context, fsys afero.Fs) []imageVersion { + var remote map[string]string + if _, err := utils.LoadAccessTokenFS(fsys); err == nil && len(flags.ProjectRef) > 0 { + remote = listRemoteImages(ctx, flags.ProjectRef) } + var result []imageVersion + for _, image := range utils.Config.GetServiceImages() { + parts := strings.Split(image, ":") + v := imageVersion{Name: parts[0], Local: parts[1]} + if v.Remote = remote[image]; v.Remote == v.Local { + delete(remote, image) + } + result = append(result, v) + } + if len(remote) > 0 { + fmt.Fprintln(os.Stderr, suggestUpdateCmd(remote)) + } + return result } -func GetRemoteImages(ctx context.Context, projectRef string) map[string]string { +func listRemoteImages(ctx context.Context, projectRef string) map[string]string { linked := make(map[string]string, 4) var wg sync.WaitGroup wg.Add(1) @@ -94,3 +102,12 @@ func GetRemoteImages(ctx context.Context, projectRef string) map[string]string { wg.Wait() return linked } + +func suggestUpdateCmd(serviceImages map[string]string) string { + cmd := fmt.Sprintln(utils.Yellow("WARNING:"), "You are running different service versions locally than your linked project:") + for k, v := range serviceImages { + cmd += fmt.Sprintf("%s => %s\n", k, v) + } + cmd += fmt.Sprintf("Run %s to update them.", utils.Aqua("supabase link")) + return cmd +} diff --git a/internal/start/start.go b/internal/start/start.go index 5521161f8..5877b47e4 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -34,18 +34,10 @@ import ( "golang.org/x/mod/semver" ) -func suggestUpdateCmd(serviceImages map[string]string) string { - cmd := fmt.Sprintln(utils.Yellow("WARNING:"), "You are running different service versions locally than your linked project:") - for k, v := range serviceImages { - cmd += fmt.Sprintf("%s => %s\n", k, v) - } - cmd += fmt.Sprintf("Run %s to update them.", utils.Aqua("supabase link")) - return cmd -} - func Run(ctx context.Context, fsys afero.Fs, excludedContainers []string, ignoreHealthCheck bool) error { // Sanity checks. { + _, _ = flags.LoadProjectRef(fsys) if err := utils.LoadConfigFS(fsys); err != nil { return err } @@ -56,21 +48,7 @@ func Run(ctx context.Context, fsys afero.Fs, excludedContainers []string, ignore } else if !errors.Is(err, utils.ErrNotRunning) { return err } - if _, err := utils.LoadAccessTokenFS(fsys); err == nil { - if ref, err := flags.LoadProjectRef(fsys); err == nil { - local := services.GetServiceImages() - remote := services.GetRemoteImages(ctx, ref) - for _, image := range local { - parts := strings.Split(image, ":") - if version, ok := remote[image]; ok && version == parts[1] { - delete(remote, image) - } - } - if len(remote) > 0 { - fmt.Fprintln(os.Stderr, suggestUpdateCmd(remote)) - } - } - } + _ = services.CheckVersions(ctx, fsys) } if err := utils.RunProgram(ctx, func(p utils.Program, ctx context.Context) error { diff --git a/pkg/config/config.go b/pkg/config/config.go index f5a56dfc0..938016e83 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -1234,6 +1234,21 @@ func (a *auth) ResolveJWKS(ctx context.Context) (string, error) { return string(jwksEncoded), nil } +func (c *baseConfig) GetServiceImages() []string { + return []string{ + c.Db.Image, + c.Auth.Image, + c.Api.Image, + c.Realtime.Image, + c.Storage.Image, + c.EdgeRuntime.Image, + c.Studio.Image, + c.Studio.PgmetaImage, + c.Analytics.Image, + c.Db.Pooler.Image, + } +} + // Retrieve the final base config to use taking into account the remotes override func (c *config) GetRemoteByProjectRef(projectRef string) (baseConfig, error) { var result []string From 9becfabec03674e7e06e199e8f7c31d49d6b29b7 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sat, 7 Dec 2024 16:35:32 +0800 Subject: [PATCH 09/30] chore: skip loading project ref if flag is set --- internal/projects/list/list.go | 5 ++--- internal/services/services.go | 2 +- internal/start/start.go | 5 +++-- internal/utils/flags/db_url.go | 16 +++++-------- internal/utils/flags/project_ref.go | 35 +++++++++++++---------------- 5 files changed, 28 insertions(+), 35 deletions(-) diff --git a/internal/projects/list/list.go b/internal/projects/list/list.go index d211f71e9..ef356dfcf 100644 --- a/internal/projects/list/list.go +++ b/internal/projects/list/list.go @@ -29,8 +29,7 @@ func Run(ctx context.Context, fsys afero.Fs) error { return errors.New("Unexpected error retrieving projects: " + string(resp.Body)) } - projectRef, err := flags.LoadProjectRef(fsys) - if err != nil && err != utils.ErrNotLinked { + if err := flags.LoadProjectRef(fsys); err != nil && err != utils.ErrNotLinked { fmt.Fprintln(os.Stderr, err) } @@ -38,7 +37,7 @@ func Run(ctx context.Context, fsys afero.Fs) error { for _, project := range *resp.JSON200 { projects = append(projects, linkedProject{ V1ProjectWithDatabaseResponse: project, - Linked: project.Id == projectRef, + Linked: project.Id == flags.ProjectRef, }) } diff --git a/internal/services/services.go b/internal/services/services.go index b9bfae6e6..ebc08efca 100644 --- a/internal/services/services.go +++ b/internal/services/services.go @@ -16,7 +16,7 @@ import ( ) func Run(ctx context.Context, fsys afero.Fs) error { - if _, err := flags.LoadProjectRef(fsys); err != nil && !errors.Is(err, utils.ErrNotLinked) { + if err := flags.LoadProjectRef(fsys); err != nil && !errors.Is(err, utils.ErrNotLinked) { fmt.Fprintln(os.Stderr, err) } if err := utils.Config.Load("", utils.NewRootFS(fsys)); err != nil && !errors.Is(err, os.ErrNotExist) { diff --git a/internal/start/start.go b/internal/start/start.go index 5877b47e4..4315d31b7 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -37,7 +37,6 @@ import ( func Run(ctx context.Context, fsys afero.Fs, excludedContainers []string, ignoreHealthCheck bool) error { // Sanity checks. { - _, _ = flags.LoadProjectRef(fsys) if err := utils.LoadConfigFS(fsys); err != nil { return err } @@ -48,7 +47,9 @@ func Run(ctx context.Context, fsys afero.Fs, excludedContainers []string, ignore } else if !errors.Is(err, utils.ErrNotRunning) { return err } - _ = services.CheckVersions(ctx, fsys) + if err := flags.LoadProjectRef(fsys); err == nil { + _ = services.CheckVersions(ctx, fsys) + } } if err := utils.RunProgram(ctx, func(p utils.Program, ctx context.Context) error { diff --git a/internal/utils/flags/db_url.go b/internal/utils/flags/db_url.go index d089f2d13..013453b86 100644 --- a/internal/utils/flags/db_url.go +++ b/internal/utils/flags/db_url.go @@ -50,10 +50,8 @@ func ParseDatabaseConfig(flagSet *pflag.FlagSet, fsys afero.Fs) error { // Update connection config switch connType { case direct: - if err := utils.Config.Load("", utils.NewRootFS(fsys)); err != nil { - if !errors.Is(err, os.ErrNotExist) { - return err - } + if err := utils.Config.Load("", utils.NewRootFS(fsys)); err != nil && !errors.Is(err, os.ErrNotExist) { + return err } if flag := flagSet.Lookup("db-url"); flag != nil { config, err := pgconn.ParseConfig(flag.Value.String()) @@ -76,25 +74,23 @@ func ParseDatabaseConfig(flagSet *pflag.FlagSet, fsys afero.Fs) error { if err := utils.LoadConfigFS(fsys); err != nil { return err } - projectRef, err := LoadProjectRef(fsys) - if err != nil { + if err := LoadProjectRef(fsys); err != nil { return err } - DbConfig = NewDbConfigWithPassword(projectRef) + DbConfig = NewDbConfigWithPassword(ProjectRef) case proxy: token, err := utils.LoadAccessTokenFS(fsys) if err != nil { return err } - projectRef, err := LoadProjectRef(fsys) - if err != nil { + if err := LoadProjectRef(fsys); err != nil { return err } DbConfig.Host = utils.GetSupabaseAPIHost() DbConfig.Port = 443 DbConfig.User = "postgres" DbConfig.Password = token - DbConfig.Database = projectRef + DbConfig.Database = ProjectRef } return nil } diff --git a/internal/utils/flags/project_ref.go b/internal/utils/flags/project_ref.go index 437bbb668..73df72353 100644 --- a/internal/utils/flags/project_ref.go +++ b/internal/utils/flags/project_ref.go @@ -16,12 +16,7 @@ import ( var ProjectRef string func ParseProjectRef(ctx context.Context, fsys afero.Fs) error { - // Flag takes highest precedence - if len(ProjectRef) > 0 { - return utils.AssertProjectRefIsValid(ProjectRef) - } - // Followed by linked ref file - if _, err := LoadProjectRef(fsys); !errors.Is(err, utils.ErrNotLinked) { + if err := LoadProjectRef(fsys); !errors.Is(err, utils.ErrNotLinked) { return err } // Prompt as the last resort @@ -55,20 +50,22 @@ func PromptProjectRef(ctx context.Context, title string) error { return nil } -func LoadProjectRef(fsys afero.Fs) (string, error) { +func LoadProjectRef(fsys afero.Fs) error { + // Flag takes highest precedence + if len(ProjectRef) > 0 { + return utils.AssertProjectRefIsValid(ProjectRef) + } // Env var takes precedence over ref file - ProjectRef = viper.GetString("PROJECT_ID") - if len(ProjectRef) == 0 { - projectRefBytes, err := afero.ReadFile(fsys, utils.ProjectRefPath) - if errors.Is(err, os.ErrNotExist) { - return "", errors.New(utils.ErrNotLinked) - } else if err != nil { - return "", errors.Errorf("failed to load project ref: %w", err) - } - ProjectRef = string(bytes.TrimSpace(projectRefBytes)) + if ProjectRef = viper.GetString("PROJECT_ID"); len(ProjectRef) > 0 { + return utils.AssertProjectRefIsValid(ProjectRef) } - if err := utils.AssertProjectRefIsValid(ProjectRef); err != nil { - return "", err + // Load from local file last + projectRefBytes, err := afero.ReadFile(fsys, utils.ProjectRefPath) + if errors.Is(err, os.ErrNotExist) { + return errors.New(utils.ErrNotLinked) + } else if err != nil { + return errors.Errorf("failed to load project ref: %w", err) } - return ProjectRef, nil + ProjectRef = string(bytes.TrimSpace(projectRefBytes)) + return utils.AssertProjectRefIsValid(ProjectRef) } From 0eac017b1271b76b0e223cde3e0d3b077c57ad7b Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sat, 7 Dec 2024 18:32:52 +0800 Subject: [PATCH 10/30] fix: account for remote config when pushing --- internal/db/reset/reset.go | 23 ++++++++++++++++++++++- internal/functions/deploy/deploy.go | 7 +++++-- internal/gen/types/types.go | 3 ++- internal/seed/buckets/buckets.go | 5 +++-- internal/storage/cp/cp.go | 3 ++- 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/internal/db/reset/reset.go b/internal/db/reset/reset.go index a475ca80d..3830a019d 100644 --- a/internal/db/reset/reset.go +++ b/internal/db/reset/reset.go @@ -23,9 +23,11 @@ import ( "github.com/supabase/cli/internal/db/start" "github.com/supabase/cli/internal/gen/keys" "github.com/supabase/cli/internal/migration/apply" + "github.com/supabase/cli/internal/migration/list" "github.com/supabase/cli/internal/migration/repair" "github.com/supabase/cli/internal/seed/buckets" "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" "github.com/supabase/cli/pkg/migration" ) @@ -241,7 +243,26 @@ func resetRemote(ctx context.Context, version string, config pgconn.Config, fsys if err := migration.DropUserSchemas(ctx, conn); err != nil { return err } - return apply.MigrateAndSeed(ctx, version, conn, fsys) + migrations, err := list.LoadPartialMigrations(version, fsys) + if err != nil { + return err + } + if err := migration.ApplyMigrations(ctx, migrations, conn, afero.NewIOFS(fsys)); err != nil { + return err + } + remote, _ := utils.Config.GetRemoteByProjectRef(flags.ProjectRef) + if !remote.Db.Seed.Enabled { + fmt.Fprintln(os.Stderr, "Skipping seed because it is disabled in config.toml for project:", remote.ProjectId) + return nil + } else if !utils.Config.Db.Seed.Enabled { + // Skip because --no-seed flag is set + return nil + } + seeds, err := migration.GetPendingSeeds(ctx, remote.Db.Seed.SqlPaths, conn, afero.NewIOFS(fsys)) + if err != nil { + return err + } + return migration.SeedData(ctx, seeds, conn, afero.NewIOFS(fsys)) } func LikeEscapeSchema(schemas []string) (result []string) { diff --git a/internal/functions/deploy/deploy.go b/internal/functions/deploy/deploy.go index 6713d47d3..529b78976 100644 --- a/internal/functions/deploy/deploy.go +++ b/internal/functions/deploy/deploy.go @@ -10,6 +10,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/config" "github.com/supabase/cli/pkg/function" @@ -59,7 +60,8 @@ func GetFunctionSlugs(fsys afero.Fs) (slugs []string, err error) { } } // Add all function slugs declared in config file - for slug := range utils.Config.Functions { + remote, _ := utils.Config.GetRemoteByProjectRef(flags.ProjectRef) + for slug := range remote.Functions { slugs = append(slugs, slug) } return slugs, nil @@ -78,9 +80,10 @@ func GetFunctionConfig(slugs []string, importMapPath string, noVerifyJWT *bool, if len(importMapPath) > 0 && !filepath.IsAbs(importMapPath) { importMapPath = filepath.Join(utils.CurrentDirAbs, importMapPath) } + remote, _ := utils.Config.GetRemoteByProjectRef(flags.ProjectRef) functionConfig := make(config.FunctionConfig, len(slugs)) for _, name := range slugs { - function := utils.Config.Functions[name] + function := remote.Functions[name] // Precedence order: flag > config > fallback functionDir := filepath.Join(utils.FunctionsDir, name) if len(function.Entrypoint) == 0 { diff --git a/internal/gen/types/types.go b/internal/gen/types/types.go index 9ffc7dc72..b399cfb5c 100644 --- a/internal/gen/types/types.go +++ b/internal/gen/types/types.go @@ -31,7 +31,8 @@ func Run(ctx context.Context, projectId string, dbConfig pgconn.Config, lang str originalURL := utils.ToPostgresURL(dbConfig) // Add default schemas if --schema flag is not specified if len(schemas) == 0 { - schemas = utils.RemoveDuplicates(append([]string{"public"}, utils.Config.Api.Schemas...)) + remote, _ := utils.Config.GetRemoteByProjectRef(projectId) + schemas = utils.RemoveDuplicates(append([]string{"public"}, remote.Api.Schemas...)) } included := strings.Join(schemas, ",") diff --git a/internal/seed/buckets/buckets.go b/internal/seed/buckets/buckets.go index 365c3a395..b460fdc79 100644 --- a/internal/seed/buckets/buckets.go +++ b/internal/seed/buckets/buckets.go @@ -26,8 +26,9 @@ func Run(ctx context.Context, projectRef string, interactive bool, fsys afero.Fs } return shouldOverwrite } - if err := api.UpsertBuckets(ctx, utils.Config.Storage.Buckets, filter); err != nil { + remote, _ := utils.Config.GetRemoteByProjectRef(projectRef) + if err := api.UpsertBuckets(ctx, remote.Storage.Buckets, filter); err != nil { return err } - return api.UpsertObjects(ctx, utils.Config.Storage.Buckets, utils.NewRootFS(fsys)) + return api.UpsertObjects(ctx, remote.Storage.Buckets, utils.NewRootFS(fsys)) } diff --git a/internal/storage/cp/cp.go b/internal/storage/cp/cp.go index 8aed7a6fa..e55120a1c 100644 --- a/internal/storage/cp/cp.go +++ b/internal/storage/cp/cp.go @@ -115,6 +115,7 @@ func UploadStorageObjectAll(ctx context.Context, api storage.StorageAPI, remoteP return err } } + remote, _ := utils.Config.GetRemoteByProjectRef(flags.ProjectRef) // Overwrites existing object when using --recursive flag opts = append(opts, func(fo *storage.FileOptions) { fo.Overwrite = true @@ -153,7 +154,7 @@ func UploadStorageObjectAll(ctx context.Context, api storage.StorageAPI, remoteP // Retry after creating bucket if bucket, prefix := client.SplitBucketPrefix(dstPath); len(prefix) > 0 { body := storage.CreateBucketRequest{Name: bucket} - if config, ok := utils.Config.Storage.Buckets[bucket]; ok { + if config, ok := remote.Storage.Buckets[bucket]; ok { body.Public = config.Public body.FileSizeLimit = int64(config.FileSizeLimit) body.AllowedMimeTypes = config.AllowedMimeTypes From 4a7e73ec5d12f86119fd2712f3dc9539a3d1c352 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sat, 7 Dec 2024 19:18:19 +0800 Subject: [PATCH 11/30] fix: allow mapstructure override for site url --- pkg/config/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 10611c23b..5cb551cd1 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -48,7 +48,7 @@ type ( Enabled bool `toml:"enabled"` Image string `toml:"-"` - SiteUrl string `toml:"site_url"` + SiteUrl string `toml:"site_url" mapstructure:"site_url"` AdditionalRedirectUrls []string `toml:"additional_redirect_urls"` JwtExpiry uint `toml:"jwt_expiry"` EnableRefreshTokenRotation bool `toml:"enable_refresh_token_rotation"` From b40c676531582a99efd63a626e151fbad57c2fb5 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sat, 7 Dec 2024 22:05:44 +0800 Subject: [PATCH 12/30] chore: remove unmaintained tests --- test/branch_test.go | 38 --------- test/db_test.go | 144 --------------------------------- test/init_test.go | 50 ------------ test/link_test.go | 105 ------------------------ test/login_test.go | 110 ------------------------- test/main_test.go | 103 ----------------------- test/migration_test.go | 56 ------------- test/mocks/docker/httputils.go | 67 --------------- test/mocks/docker/server.go | 99 ----------------------- test/mocks/supabase/server.go | 74 ----------------- test/secrets_test.go | 121 --------------------------- test/status_test.go | 108 ------------------------- 12 files changed, 1075 deletions(-) delete mode 100644 test/branch_test.go delete mode 100644 test/db_test.go delete mode 100644 test/init_test.go delete mode 100644 test/link_test.go delete mode 100644 test/login_test.go delete mode 100644 test/main_test.go delete mode 100644 test/migration_test.go delete mode 100644 test/mocks/docker/httputils.go delete mode 100644 test/mocks/docker/server.go delete mode 100644 test/mocks/supabase/server.go delete mode 100644 test/secrets_test.go delete mode 100644 test/status_test.go diff --git a/test/branch_test.go b/test/branch_test.go deleted file mode 100644 index 07d3608d2..000000000 --- a/test/branch_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package integration - -import ( - "context" - "encoding/json" - "os" - - "github.com/docker/docker/api/types/container" - "github.com/stretchr/testify/require" -) - -// this is the part of Database test suite - DBTestSuite -// test functions -func (suite *DBTestSuite) TestBranchCreate() { - suite.T().Skip("Local branching is deprecated") - // create branch - branch := "test-branch" - create, args, err := suite.cmd.Traverse([]string{"db", "branch", "create", branch}) - require.NoError(suite.T(), err) - create.SetContext(context.Background()) - err = create.RunE(create, args) - require.NoError(suite.T(), err) - - // check if branch dir exists - _, err = os.Stat("supabase/.branches/" + branch) - require.NoError(suite.T(), err) - - // check if all exec calls were made to docker api - ids := suite.constructParams() - require.ElementsMatch(suite.T(), suite.params, ids) - - // check commands in exec calls - require.Equal(suite.T(), 2, len(suite.bodies)) - var execBody container.ExecOptions - require.NoError(suite.T(), json.Unmarshal([]byte(suite.bodies[0]), &execBody)) - var startBody container.ExecStartOptions - require.NoError(suite.T(), json.Unmarshal([]byte(suite.bodies[1]), &startBody)) -} diff --git a/test/db_test.go b/test/db_test.go deleted file mode 100644 index 45de0ef2d..000000000 --- a/test/db_test.go +++ /dev/null @@ -1,144 +0,0 @@ -package integration - -// Basic imports -import ( - "context" - "io" - "net/http" - "os" - "path/filepath" - "sync" - "testing" - - "github.com/gin-gonic/gin" - gonanoid "github.com/matoous/go-nanoid/v2" - "github.com/spf13/cobra" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - clicmd "github.com/supabase/cli/cmd" - "github.com/supabase/cli/test/mocks/docker" -) - -type DBTestSuite struct { - suite.Suite - cmd *cobra.Command - tempDir string - ids []string - bodies []string - params []gin.Params - mtx sync.RWMutex -} - -// test functions -// add tests here <- - -// hooks -func (suite *DBTestSuite) SetupTest() { - suite.tempDir = NewTempDir(Logger, TempDir) - suite.mtx.Lock() - suite.ids = []string{} - suite.bodies = []string{} - suite.params = []gin.Params{} - suite.mtx.Unlock() - - // add docker mock handlers - DockerMock.ExecCreateHandler = func(c *gin.Context) { - suite.addParams(c.Copy()) - body, err := io.ReadAll(c.Request.Body) - if err != nil { - c.JSON(http.StatusBadRequest, gin.H{ - "message": "error reading body", - }) - return - } - suite.addBody(body) - - id := gonanoid.MustGenerate(docker.IDAlphabet, docker.IDLength) - c.JSON(http.StatusCreated, gin.H{ - "Id": id, - }) - suite.addID(id) - } - - DockerMock.ExecStartHandler = func(c *gin.Context) { - suite.addParams(c.Copy()) - body, err := io.ReadAll(c.Request.Body) - if err != nil { - c.JSON(http.StatusBadRequest, gin.H{ - "message": "error reading body", - }) - return - } - suite.addBody(body) - - docker.HijackedResponse(c, "0") - } - - DockerMock.ContainerInspectHandler = func(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) - } - - // create supabase dir - suite.cmd = clicmd.GetRootCmd() - init, _, err := suite.cmd.Find([]string{"init"}) - require.NoError(suite.T(), err) - init.SetContext(context.Background()) - err = init.RunE(init, []string{}) - require.NoError(suite.T(), err) - - err = os.Mkdir("supabase/.branches", os.FileMode(0755)) - require.NoError(suite.T(), err) -} - -func (suite *DBTestSuite) TeardownTest() { - require.NoError(suite.T(), os.Chdir(TempDir)) -} - -// In order for 'go test' to run this suite, we need to create -// a normal test function and pass our suite to suite.Run -func TestDBTestSuite(t *testing.T) { - suite.Run(t, new(DBTestSuite)) -} - -// helper functions -func (suite *DBTestSuite) addParams(c *gin.Context) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.params = append(suite.params, c.Params) -} - -func (suite *DBTestSuite) addBody(body []byte) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.bodies = append(suite.bodies, string(body)) -} - -func (suite *DBTestSuite) addID(id string) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.ids = append(suite.ids, id) -} - -func (suite *DBTestSuite) constructParams() []gin.Params { - ids := []gin.Params{} - // for each exec docker call we have to calls to docker api: - // one to create exec, one to start exec - for _, id := range suite.ids { - // this one represents call to create exec - ids = append(ids, gin.Params{ - gin.Param{ - Key: "id", - Value: "supabase_db_" + filepath.Base(suite.tempDir), - }, - }) - - // this one represents call to start exec - ids = append(ids, gin.Params{ - gin.Param{ - Key: "id", - Value: id, - }, - }) - } - return ids -} diff --git a/test/init_test.go b/test/init_test.go deleted file mode 100644 index bdc8b7b7d..000000000 --- a/test/init_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package integration - -// Basic imports -import ( - "context" - "os" - "testing" - - "github.com/spf13/cobra" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - clicmd "github.com/supabase/cli/cmd" - "github.com/supabase/cli/internal/utils" -) - -type InitTestSuite struct { - suite.Suite - tempDir string - cmd *cobra.Command -} - -// test functions -func (suite *InitTestSuite) TestInit() { - // init supabase - init, _, err := suite.cmd.Find([]string{"init"}) - require.NoError(suite.T(), err) - init.SetContext(context.Background()) - require.NoError(suite.T(), init.RunE(init, []string{})) - - // check if init dir exists - _, err = os.Stat(utils.ConfigPath) - require.NoError(suite.T(), err) -} - -// hooks -func (suite *InitTestSuite) SetupTest() { - // init cli - suite.cmd = clicmd.GetRootCmd() - suite.tempDir = NewTempDir(Logger, TempDir) -} - -func (suite *InitTestSuite) TeardownTest() { - require.NoError(suite.T(), os.Chdir(TempDir)) -} - -// In order for 'go test' to run this suite, we need to create -// a normal test function and pass our suite to suite.Run -func TestInitTestSuite(t *testing.T) { - suite.Run(t, new(InitTestSuite)) -} diff --git a/test/link_test.go b/test/link_test.go deleted file mode 100644 index afef6c6f8..000000000 --- a/test/link_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package integration - -// Basic imports -import ( - "context" - "fmt" - "net/http" - "os" - "sync" - "testing" - - "github.com/gin-gonic/gin" - gonanoid "github.com/matoous/go-nanoid/v2" - "github.com/spf13/cobra" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - clicmd "github.com/supabase/cli/cmd" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/test/mocks/supabase" -) - -type LinkTestSuite struct { - suite.Suite - tempDir string - cmd *cobra.Command - - ids []string - headers []http.Header - - mtx sync.RWMutex -} - -// test functions -func (suite *LinkTestSuite) TestLink() { - // run command - link, _, err := suite.cmd.Find([]string{"link"}) - link.SetContext(context.Background()) - require.NoError(suite.T(), err) - - id := gonanoid.MustGenerate(supabase.IDAlphabet, supabase.IDLength) - require.NoError(suite.T(), link.Flags().Set("project-ref", id)) - require.NoError(suite.T(), link.Flags().Set("password", "postgres")) - - require.NoError(suite.T(), link.RunE(link, []string{})) - - // check request details - suite.mtx.RLock() - defer suite.mtx.RUnlock() - require.Contains(suite.T(), suite.ids, id) - require.Contains(suite.T(), suite.headers, http.Header{ - "Authorization": []string{fmt.Sprintf("Bearer %s", supabase.AccessToken)}, - "Accept-Encoding": []string{"gzip"}, - "User-Agent": []string{"Go-http-client/1.1"}, - }) - _, err = os.Stat(utils.ProjectRefPath) - require.NoError(suite.T(), err) - ref, err := os.ReadFile(utils.ProjectRefPath) - require.NoError(suite.T(), err) - require.Equal(suite.T(), id, string(ref)) -} - -// hooks -func (suite *LinkTestSuite) SetupTest() { - // init cli - suite.cmd = clicmd.GetRootCmd() - suite.tempDir = NewTempDir(Logger, TempDir) - - // init supabase - init, _, err := suite.cmd.Find([]string{"init"}) - init.SetContext(context.Background()) - require.NoError(suite.T(), err) - require.NoError(suite.T(), init.RunE(init, []string{})) - - // implement mocks - SupaMock.FunctionsHandler = func(c *gin.Context) { - suite.addHeaders(c.Request.Header) - suite.addID(c.Params.ByName("id")) - - c.JSON(http.StatusOK, []api.FunctionResponse{}) - } -} - -func (suite *LinkTestSuite) TeardownTest() { - require.NoError(suite.T(), os.Chdir(TempDir)) -} - -// In order for 'go test' to run this suite, we need to create -// a normal test function and pass our suite to suite.Run -func TestLinkTestSuite(t *testing.T) { - // suite.Run(t, new(LinkTestSuite)) -} - -// helper functions -func (suite *LinkTestSuite) addID(id string) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.ids = append(suite.ids, id) -} - -func (suite *LinkTestSuite) addHeaders(headers http.Header) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.headers = append(suite.headers, headers) -} diff --git a/test/login_test.go b/test/login_test.go deleted file mode 100644 index 2f1e018fb..000000000 --- a/test/login_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package integration - -// Basic imports -import ( - "context" - "net/http" - "os" - "sync" - "testing" - - "github.com/gin-gonic/gin" - gonanoid "github.com/matoous/go-nanoid/v2" - "github.com/spf13/cobra" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - clicmd "github.com/supabase/cli/cmd" - "github.com/supabase/cli/test/mocks/supabase" -) - -type LoginTestSuite struct { - suite.Suite - tempDir string - cmd *cobra.Command - - ids []string - headers []http.Header - - mtx sync.RWMutex -} - -// test functions -func (suite *LoginTestSuite) TestLink() { - // run command - login, _, err := suite.cmd.Find([]string{"login"}) - require.NoError(suite.T(), err) - login.SetContext(context.Background()) - key := "sbp_" + gonanoid.MustGenerate(supabase.KeyAlphabet, supabase.KeyLength) - - // change stdin to read from a file - content := []byte(key) - tmpfile, err := os.CreateTemp(suite.tempDir, "key") - require.NoError(suite.T(), err) - defer os.Remove(tmpfile.Name()) // clean up - - _, err = tmpfile.Write(content) - require.NoError(suite.T(), err) - _, err = tmpfile.Seek(0, 0) - require.NoError(suite.T(), err) - - oldStdin := os.Stdin - defer func() { os.Stdin = oldStdin }() - os.Stdin = tmpfile - - err = login.Flags().Set("token", key) - require.NoError(suite.T(), err) - require.NoError(suite.T(), login.RunE(login, []string{})) - - // check token is saved - // home, err := os.UserHomeDir() - // require.NoError(suite.T(), err) - // _, err = os.Stat(filepath.Join(home, ".supabase/access-token")) - // require.NoError(suite.T(), err) - // token, err := os.ReadFile(filepath.Join(home, ".supabase/access-token")) - // require.NoError(suite.T(), err) - // require.Equal(suite.T(), key, string(token)) -} - -// hooks -func (suite *LoginTestSuite) SetupTest() { - // init cli - suite.cmd = clicmd.GetRootCmd() - suite.tempDir = NewTempDir(Logger, TempDir) - - // init supabase - init, _, err := suite.cmd.Find([]string{"init"}) - require.NoError(suite.T(), err) - init.SetContext(context.Background()) - require.NoError(suite.T(), init.RunE(init, []string{})) - - // implement mocks - SupaMock.FunctionsHandler = func(c *gin.Context) { - suite.addHeaders(c.Request.Header) - suite.addID(c.Params.ByName("id")) - - c.JSON(http.StatusOK, gin.H{}) - } -} - -func (suite *LoginTestSuite) TeardownTest() { - require.NoError(suite.T(), os.Chdir(TempDir)) -} - -// In order for 'go test' to run this suite, we need to create -// a normal test function and pass our suite to suite.Run -func TestLoginTestSuite(t *testing.T) { - suite.Run(t, new(LoginTestSuite)) -} - -// helper functions -func (suite *LoginTestSuite) addID(id string) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.ids = append(suite.ids, id) -} - -func (suite *LoginTestSuite) addHeaders(headers http.Header) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.headers = append(suite.headers, headers) -} diff --git a/test/main_test.go b/test/main_test.go deleted file mode 100644 index 6d694e709..000000000 --- a/test/main_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package integration - -import ( - "log" - "os" - "testing" - - "github.com/docker/docker/client" - "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/test/mocks/docker" - "github.com/supabase/cli/test/mocks/supabase" -) - -const ( - DockerPort = ":2375" - SupabasePort = ":2376" -) - -var ( - TempDir string -) - -var ( - Logger *log.Logger - DockerMock *docker.Server - SupaMock *supabase.Server -) - -func TestMain(m *testing.M) { - Logger := log.New(os.Stdout, "", 0) - - Logger.Println("Global tests setup") - - DockerMock = newDockerMock(Logger) - SupaMock = newSupabaseMock(Logger) - TempDir = NewTempDir(Logger, "") - - // redirect clients to mock servers - os.Setenv("DOCKER_HOST", "tcp://127.0.0.1"+DockerPort) - utils.Docker = utils.NewDocker() - if err := client.WithVersion(docker.APIVersion)(utils.Docker); err != nil { - Logger.Fatal(err) - } - viper.Set("INTERNAL_API_HOST", "http://127.0.0.1"+SupabasePort) - os.Setenv("SUPABASE_ACCESS_TOKEN", supabase.AccessToken) - os.Setenv("HOME", TempDir) - - // run tests - exitVal := m.Run() - - Logger.Println("Global teardown") - os.RemoveAll(TempDir) - - // exit process with tests exit code - os.Exit(exitVal) -} - -func newDockerMock(Logger *log.Logger) *docker.Server { - dockerMock := docker.NewServer() - dockerRouter := dockerMock.NewRouter() - go func() { - err := dockerRouter.Run(DockerPort) - if err != nil { - Logger.Fatal(err) - } - }() - - return dockerMock -} - -func newSupabaseMock(Logger *log.Logger) *supabase.Server { - supaMock := supabase.NewServer() - supaRouter := supaMock.NewRouter() - go func() { - err := supaRouter.Run(SupabasePort) - if err != nil { - Logger.Fatal(err) - } - }() - - return supaMock -} - -func NewTempDir(Logger *log.Logger, baseDir string) string { - wd := baseDir - var err error - if baseDir == "" { - wd, err = os.Getwd() - } - if err != nil { - Logger.Fatal(err) - } - tempDir, err := os.MkdirTemp(wd, "cli-test-") - if err != nil { - Logger.Fatal(err) - } - err = os.Chdir(tempDir) - if err != nil { - Logger.Fatal(err) - } - return tempDir -} diff --git a/test/migration_test.go b/test/migration_test.go deleted file mode 100644 index 2321735d0..000000000 --- a/test/migration_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package integration - -// Basic imports -import ( - "os" - "testing" - - gonanoid "github.com/matoous/go-nanoid/v2" - "github.com/spf13/cobra" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - clicmd "github.com/supabase/cli/cmd" - "github.com/supabase/cli/test/mocks/supabase" -) - -type MigrationTestSuite struct { - suite.Suite - tempDir string - cmd *cobra.Command -} - -// test functions -func (suite *MigrationTestSuite) TestNewMigration() { - // run command - migration, _, err := suite.cmd.Find([]string{"migration", "new"}) - require.NoError(suite.T(), err) - name := gonanoid.MustGenerate(supabase.IDAlphabet, 10) - require.NoError(suite.T(), migration.RunE(migration, []string{name})) - - // check migrations file created - subs, err := os.ReadDir("supabase/migrations") - require.NoError(suite.T(), err) - require.Regexp(suite.T(), `[0-9]{14}_`+name+".sql", subs[0].Name()) -} - -// hooks -func (suite *MigrationTestSuite) SetupTest() { - // init cli - suite.cmd = clicmd.GetRootCmd() - suite.tempDir = NewTempDir(Logger, TempDir) - - // init supabase - init, _, err := suite.cmd.Find([]string{"init"}) - require.NoError(suite.T(), err) - require.NoError(suite.T(), init.RunE(init, []string{})) -} - -func (suite *MigrationTestSuite) TeardownTest() { - require.NoError(suite.T(), os.Chdir(TempDir)) -} - -// In order for 'go test' to run this suite, we need to create -// a normal test function and pass our suite to suite.Run -func TestMigrationTestSuite(t *testing.T) { - suite.Run(t, new(MigrationTestSuite)) -} diff --git a/test/mocks/docker/httputils.go b/test/mocks/docker/httputils.go deleted file mode 100644 index c8a4496aa..000000000 --- a/test/mocks/docker/httputils.go +++ /dev/null @@ -1,67 +0,0 @@ -package docker - -import ( - "fmt" - "io" - "net/http" - - "github.com/docker/docker/pkg/ioutils" - "github.com/docker/docker/pkg/stdcopy" - "github.com/gin-gonic/gin" -) - -func CloseStreams(streams ...interface{}) { - for _, stream := range streams { - if tcpc, ok := stream.(interface { - CloseWrite() error - }); ok { - _ = tcpc.CloseWrite() - } else if closer, ok := stream.(io.Closer); ok { - _ = closer.Close() - } - } -} - -func HijackedResponse(c *gin.Context, exitCode string, output ...string) { - // hijack the connection - hijacker, ok := c.Writer.(http.Hijacker) - if !ok { - c.JSON(http.StatusBadRequest, gin.H{ - "message": "error hijacking connection", - }) - return - } - conn, _, err := hijacker.Hijack() - if err != nil { - c.JSON(http.StatusBadRequest, gin.H{ - "message": "error hijacking connection", - }) - return - } - _, err = conn.Write([]byte{}) - if err != nil { - c.JSON(http.StatusBadRequest, gin.H{ - "message": "error hijacking connection", - }) - return - } - - // write success code signalizing that the connection is established and ready to stream data - fmt.Fprintf(conn, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n") - - // setup closer - closer := func() error { - CloseStreams(conn) - return nil - } - - // write some output if command suppose to write to stdout - outStream := stdcopy.NewStdWriter(conn, stdcopy.Stdout) - if len(output) > 0 { - fmt.Fprint(outStream, output) - } - // finish with exit code and close stream and connection as the command is done - fmt.Fprintf(outStream, "exit code %s", exitCode) - rc := ioutils.NewReadCloserWrapper(conn, closer) - rc.Close() -} diff --git a/test/mocks/docker/server.go b/test/mocks/docker/server.go deleted file mode 100644 index 705c7b4e1..000000000 --- a/test/mocks/docker/server.go +++ /dev/null @@ -1,99 +0,0 @@ -package docker - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -const ( - APIVersion = "1.44" - IDAlphabet = "abcdef0123456789" - IDLength = 12 -) - -// Server struct with route handlers -type Server struct { - PingHandler func(c *gin.Context) - ContainerInspectHandler func(c *gin.Context) - ExecCreateHandler func(c *gin.Context) - ExecStartHandler func(c *gin.Context) -} - -var defaultHandler = func(c *gin.Context) { - c.JSON(http.StatusNotImplemented, gin.H{ - "message": "Not implemented", - }) -} - -// NewServer creates a new server with default handlers -func NewServer() *Server { - s := Server{ - ExecCreateHandler: defaultHandler, - ExecStartHandler: defaultHandler, - ContainerInspectHandler: defaultHandler, - } - return &s -} - -// NewRouter creating a new router and setting the routes for the server. -func (s *Server) NewRouter() *gin.Engine { - root := gin.Default() - root.HEAD("/_ping", s.ping) - root.GET("/_ping", s.ping) - - router := root.Group("/v" + APIVersion) - - containers := router.Group("/containers") - containers.GET("/:id/json", s.inspectContainer) - containers.POST("/:id/exec", s.createExec) - - exec := router.Group("/exec") - exec.POST("/:id/start", s.startExec) - exec.GET("/:id/json", s.inspectContainer) - - return root -} - -// ping -func (s *Server) ping(c *gin.Context) { - if s.PingHandler == nil { - c.Header("API-Version", APIVersion) - c.Header("OSType", "linux") - c.Status(http.StatusOK) - } else { - s.PingHandler(c) - } -} - -// container -func (s *Server) inspectContainer(c *gin.Context) { - if s.ContainerInspectHandler == nil { - c.JSON(http.StatusInternalServerError, gin.H{ - "message": "handler is nil", - }) - } else { - s.ContainerInspectHandler(c) - } -} - -// exec -func (s *Server) createExec(c *gin.Context) { - if s.ExecCreateHandler == nil { - c.JSON(http.StatusInternalServerError, gin.H{ - "message": "handler is nil", - }) - } else { - s.ExecCreateHandler(c) - } -} - -func (s *Server) startExec(c *gin.Context) { - if s.ExecStartHandler == nil { - c.JSON(http.StatusInternalServerError, gin.H{ - "message": "handler is nil", - }) - } else { - s.ExecStartHandler(c) - } -} diff --git a/test/mocks/supabase/server.go b/test/mocks/supabase/server.go deleted file mode 100644 index 41eb8c542..000000000 --- a/test/mocks/supabase/server.go +++ /dev/null @@ -1,74 +0,0 @@ -package supabase - -import ( - "net/http" - - "github.com/gin-gonic/gin" - gonanoid "github.com/matoous/go-nanoid/v2" -) - -const ( - IDAlphabet = "abcdefghijklmnopqrstuvwxyz" - IDLength = 20 - KeyAlphabet = "abcdef0123456789" - KeyLength = 40 -) - -var AccessToken = "sbp_" + gonanoid.MustGenerate(KeyAlphabet, KeyLength) - -// Server struct with route handlers -type Server struct { - FunctionsHandler func(c *gin.Context) - SecretsHandler func(c *gin.Context) -} - -var defaultHandler = func(c *gin.Context) { - c.JSON(http.StatusNotImplemented, gin.H{ - "message": "Not implemented", - }) -} - -// NewServer creates a new server with default handlers -func NewServer() *Server { - s := Server{ - FunctionsHandler: defaultHandler, - SecretsHandler: defaultHandler, - } - return &s -} - -// NewRouter creating a new router and setting the routes for the server. -func (s *Server) NewRouter() *gin.Engine { - root := gin.Default() - router := root.Group("/v1") - - projects := router.Group("/projects") - projects.GET("/:id/functions", s.functions) - projects.GET("/:id/secrets", s.secrets) - projects.GET("/:id/api-keys", func(c *gin.Context) { - c.JSON(http.StatusOK, []gin.H{}) - }) - - return root -} - -// project routes -func (s *Server) functions(c *gin.Context) { - if s.FunctionsHandler == nil { - c.JSON(http.StatusInternalServerError, gin.H{ - "message": "handler is nil", - }) - } else { - s.FunctionsHandler(c) - } -} - -func (s *Server) secrets(c *gin.Context) { - if s.SecretsHandler == nil { - c.JSON(http.StatusInternalServerError, gin.H{ - "message": "handler is nil", - }) - } else { - s.SecretsHandler(c) - } -} diff --git a/test/secrets_test.go b/test/secrets_test.go deleted file mode 100644 index b195e23ea..000000000 --- a/test/secrets_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package integration - -// Basic imports -import ( - "context" - "fmt" - "net/http" - "os" - "sync" - "testing" - - "github.com/gin-gonic/gin" - gonanoid "github.com/matoous/go-nanoid/v2" - "github.com/spf13/cobra" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - clicmd "github.com/supabase/cli/cmd" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/test/mocks/supabase" -) - -type SecretsTestSuite struct { - suite.Suite - tempDir string - cmd *cobra.Command - - ids []string - headers []http.Header - - mtx sync.RWMutex -} - -// test functions -func (suite *SecretsTestSuite) TestList() { - // run command - list, _, err := suite.cmd.Find([]string{"secrets", "list"}) - list.SetContext(context.Background()) - require.NoError(suite.T(), err) - - // set stdout to write into file so we can capture cmd output - tmpfile, err := os.CreateTemp(suite.tempDir, "output") - require.NoError(suite.T(), err) - defer os.Remove(tmpfile.Name()) // clean up - oldStdout := os.Stdout - defer func() { os.Stdout = oldStdout }() - os.Stdout = tmpfile - - flags.ProjectRef = gonanoid.MustGenerate(supabase.IDAlphabet, supabase.IDLength) - require.NoError(suite.T(), list.RunE(list, []string{})) - - // check request details - suite.mtx.RLock() - defer suite.mtx.RUnlock() - require.Contains(suite.T(), suite.ids, flags.ProjectRef) - require.Contains(suite.T(), suite.headers, http.Header{ - "Authorization": []string{fmt.Sprintf("Bearer %s", supabase.AccessToken)}, - "Accept-Encoding": []string{"gzip"}, - "User-Agent": []string{"SupabaseCLI/"}, - }) - - contents, err := os.ReadFile(tmpfile.Name()) - require.NoError(suite.T(), err) - require.Contains(suite.T(), string(contents), "some-key") - require.Contains(suite.T(), string(contents), "another") -} - -// hooks -func (suite *SecretsTestSuite) SetupTest() { - // init cli - suite.cmd = clicmd.GetRootCmd() - suite.tempDir = NewTempDir(Logger, TempDir) - - // init supabase - init, _, err := suite.cmd.Find([]string{"init"}) - require.NoError(suite.T(), err) - init.SetContext(context.Background()) - require.NoError(suite.T(), init.RunE(init, []string{})) - - // add `link` dir - require.NoError(suite.T(), os.MkdirAll("supabase/.temp", os.FileMode(0755))) - - // implement mocks - SupaMock.SecretsHandler = func(c *gin.Context) { - suite.addHeaders(c.Request.Header) - suite.addID(c.Params.ByName("id")) - - c.JSON(http.StatusOK, []gin.H{ - { - "Name": "some-key", - "Value": gonanoid.Must(), - }, - { - "Name": "another", - "Value": gonanoid.Must(), - }, - }) - } -} - -func (suite *SecretsTestSuite) TeardownTest() { - require.NoError(suite.T(), os.Chdir(TempDir)) -} - -// In order for 'go test' to run this suite, we need to create -// a normal test function and pass our suite to suite.Run -func TestSecretsTestSuite(t *testing.T) { - suite.Run(t, new(SecretsTestSuite)) -} - -// helper functions -func (suite *SecretsTestSuite) addID(id string) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.ids = append(suite.ids, id) -} - -func (suite *SecretsTestSuite) addHeaders(headers http.Header) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.headers = append(suite.headers, headers) -} diff --git a/test/status_test.go b/test/status_test.go deleted file mode 100644 index 509345d18..000000000 --- a/test/status_test.go +++ /dev/null @@ -1,108 +0,0 @@ -package integration - -// Basic imports -import ( - "context" - "net/http" - "os" - "path/filepath" - "sync" - "testing" - - "github.com/docker/docker/api/types" - "github.com/gin-gonic/gin" - "github.com/spf13/cobra" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - clicmd "github.com/supabase/cli/cmd" -) - -type StatusTestSuite struct { - suite.Suite - tempDir string - cmd *cobra.Command - - params []gin.Params - mtx sync.RWMutex -} - -// test functions -func (suite *StatusTestSuite) TestStatus() { - suite.T().Skip("Status command is no longer mocked") - // run command - status, _, err := suite.cmd.Find([]string{"status"}) - status.SetContext(context.Background()) - require.NoError(suite.T(), err) - - // set stdout to write into file so we can capture cmd output - tmpfile, err := os.CreateTemp(suite.tempDir, "output") - require.NoError(suite.T(), err) - defer os.Remove(tmpfile.Name()) // clean up - oldStdout := os.Stdout - defer func() { os.Stdout = oldStdout }() - os.Stdout = tmpfile - - // run command - require.NoError(suite.T(), status.RunE(status, []string{})) - - // check request details - suite.mtx.RLock() - defer suite.mtx.RUnlock() - require.Contains(suite.T(), suite.params, gin.Params{ - gin.Param{ - Key: "id", - Value: "supabase_db_" + filepath.Base(suite.tempDir), - }, - }) - - contents, err := os.ReadFile(tmpfile.Name()) - require.NoError(suite.T(), err) - require.Contains(suite.T(), string(contents), "API URL: http://127.0.0.1:54321") - require.Contains(suite.T(), string(contents), "GraphQL URL: http://127.0.0.1:54321/graphql/v1") - require.Contains(suite.T(), string(contents), "DB URL: postgresql://postgres:postgres@127.0.0.1:54322/postgres") - require.Contains(suite.T(), string(contents), "Studio URL: http://127.0.0.1:54323") - require.Contains(suite.T(), string(contents), "Inbucket URL: http://127.0.0.1:54324") - require.Contains(suite.T(), string(contents), "JWT secret: super-secret-jwt-token-with-at-least-32-characters-long") - require.Contains(suite.T(), string(contents), "anon key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9") - require.Contains(suite.T(), string(contents), "service_role key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9") -} - -// hooks -func (suite *StatusTestSuite) SetupTest() { - // init cli - suite.cmd = clicmd.GetRootCmd() - suite.tempDir = NewTempDir(Logger, TempDir) - - // init supabase - init, _, err := suite.cmd.Find([]string{"init"}) - require.NoError(suite.T(), err) - init.SetContext(context.Background()) - require.NoError(suite.T(), init.RunE(init, []string{})) - - // implement mocks - DockerMock.ContainerInspectHandler = func(c *gin.Context) { - suite.addParams(c.Copy()) - c.JSON(http.StatusOK, types.ContainerJSON{ - ContainerJSONBase: &types.ContainerJSONBase{ - State: &types.ContainerState{Running: true}, - }, - }) - } -} - -func (suite *StatusTestSuite) TeardownTest() { - require.NoError(suite.T(), os.Chdir(TempDir)) -} - -// In order for 'go test' to run this suite, we need to create -// a normal test function and pass our suite to suite.Run -func TestStatusTestSuite(t *testing.T) { - suite.Run(t, new(StatusTestSuite)) -} - -// helper functions -func (suite *StatusTestSuite) addParams(c *gin.Context) { - suite.mtx.Lock() - defer suite.mtx.Unlock() - suite.params = append(suite.params, c.Params) -} From e4c39e6ab3401bce21b9b6fd53ceedc29f5c993a Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sat, 7 Dec 2024 22:07:04 +0800 Subject: [PATCH 13/30] chore: bump cli module to v2 --- cmd/bans.go | 6 +-- cmd/bootstrap.go | 4 +- cmd/branches.go | 20 ++++---- cmd/config.go | 4 +- cmd/db.go | 32 ++++++------- cmd/domains.go | 12 ++--- cmd/encryption.go | 6 +-- cmd/functions.go | 18 ++++---- cmd/gen.go | 8 ++-- cmd/init.go | 4 +- cmd/inspect.go | 46 +++++++++---------- cmd/link.go | 6 +-- cmd/login.go | 4 +- cmd/logout.go | 2 +- cmd/migration.go | 16 +++---- cmd/orgs.go | 4 +- cmd/postgres.go | 6 +-- cmd/projects.go | 14 +++--- cmd/restrictions.go | 6 +-- cmd/root.go | 4 +- cmd/secrets.go | 8 ++-- cmd/seed.go | 6 +-- cmd/services.go | 2 +- cmd/snippets.go | 6 +-- cmd/sslEnforcement.go | 6 +-- cmd/sso.go | 16 +++---- cmd/start.go | 4 +- cmd/status.go | 4 +- cmd/stop.go | 2 +- cmd/storage.go | 12 ++--- cmd/test.go | 4 +- cmd/unlink.go | 2 +- cmd/vanitySubdomains.go | 10 ++-- docs/main.go | 4 +- examples/functions-deploy/main.go | 6 +-- examples/migrations-up/main.go | 4 +- examples/seed-buckets/main.go | 6 +-- go.mod | 21 +-------- go.sum | 42 ----------------- internal/bans/get/get.go | 2 +- internal/bans/update/update.go | 4 +- internal/bootstrap/bootstrap.go | 24 +++++----- internal/bootstrap/bootstrap_test.go | 4 +- internal/branches/create/create.go | 8 ++-- internal/branches/create/create_test.go | 10 ++-- internal/branches/delete/delete.go | 2 +- internal/branches/disable/disable.go | 4 +- internal/branches/get/get.go | 4 +- internal/branches/list/list.go | 6 +-- internal/branches/update/update.go | 4 +- internal/config/push/push.go | 4 +- internal/db/branch/create/create.go | 2 +- internal/db/branch/create/create_test.go | 4 +- internal/db/branch/delete/delete.go | 2 +- internal/db/branch/delete/delete_test.go | 4 +- internal/db/branch/list/list.go | 2 +- internal/db/branch/list/list_test.go | 2 +- internal/db/branch/switch_/switch_.go | 4 +- internal/db/branch/switch_/switch__test.go | 8 ++-- internal/db/diff/diff.go | 10 ++-- internal/db/diff/diff_test.go | 16 +++---- internal/db/diff/migra.go | 4 +- internal/db/diff/pgadmin.go | 8 ++-- internal/db/dump/dump.go | 4 +- internal/db/dump/dump_test.go | 4 +- internal/db/lint/lint.go | 4 +- internal/db/lint/lint_test.go | 6 +-- internal/db/pull/pull.go | 14 +++--- internal/db/pull/pull_test.go | 10 ++-- internal/db/push/push.go | 8 ++-- internal/db/push/push_test.go | 10 ++-- internal/db/remote/changes/changes.go | 6 +-- internal/db/remote/commit/commit.go | 12 ++--- internal/db/reset/reset.go | 18 ++++---- internal/db/reset/reset_test.go | 16 +++---- internal/db/start/start.go | 8 ++-- internal/db/start/start_test.go | 10 ++-- internal/db/test/test.go | 4 +- internal/db/test/test_test.go | 8 ++-- internal/debug/postgres_test.go | 2 +- internal/encryption/get/get.go | 2 +- internal/encryption/get/get_test.go | 6 +-- internal/encryption/update/update.go | 6 +-- internal/encryption/update/update_test.go | 6 +-- internal/functions/delete/delete.go | 2 +- internal/functions/delete/delete_test.go | 4 +- internal/functions/deploy/bundle.go | 4 +- internal/functions/deploy/bundle_test.go | 4 +- internal/functions/deploy/deploy.go | 10 ++-- internal/functions/deploy/deploy_test.go | 10 ++-- internal/functions/download/download.go | 4 +- internal/functions/download/download_test.go | 6 +-- internal/functions/list/list.go | 4 +- internal/functions/list/list_test.go | 6 +-- internal/functions/new/new.go | 2 +- internal/functions/new/new_test.go | 2 +- internal/functions/serve/serve.go | 6 +-- internal/functions/serve/serve_test.go | 6 +-- internal/gen/keys/keys.go | 4 +- internal/gen/types/types.go | 4 +- internal/gen/types/types_test.go | 8 ++-- internal/hostnames/activate/activate.go | 4 +- internal/hostnames/common.go | 4 +- internal/hostnames/create/create.go | 6 +-- internal/hostnames/delete/delete.go | 2 +- internal/hostnames/get/get.go | 2 +- internal/hostnames/reverify/reverify.go | 4 +- internal/init/init.go | 2 +- internal/init/init_test.go | 6 +-- internal/inspect/bloat/bloat.go | 8 ++-- internal/inspect/bloat/bloat_test.go | 6 +-- internal/inspect/blocking/blocking.go | 6 +-- internal/inspect/blocking/blocking_test.go | 2 +- internal/inspect/cache/cache.go | 6 +-- internal/inspect/cache/cache_test.go | 2 +- internal/inspect/calls/calls.go | 6 +-- internal/inspect/calls/calls_test.go | 2 +- internal/inspect/index_sizes/index_sizes.go | 8 ++-- .../inspect/index_sizes/index_sizes_test.go | 6 +-- internal/inspect/index_usage/index_usage.go | 8 ++-- .../inspect/index_usage/index_usage_test.go | 6 +-- internal/inspect/locks/locks.go | 6 +-- internal/inspect/locks/locks_test.go | 2 +- .../long_running_queries.go | 6 +-- .../long_running_queries_test.go | 2 +- internal/inspect/outliers/outliers.go | 6 +-- internal/inspect/outliers/outliers_test.go | 2 +- .../replication_slots/replication_slots.go | 6 +-- .../replication_slots_test.go | 2 +- internal/inspect/report.go | 4 +- internal/inspect/report_test.go | 42 ++++++++--------- internal/inspect/role_configs/role_configs.go | 6 +-- .../inspect/role_configs/role_configs_test.go | 2 +- .../role_connections/role_connections.go | 6 +-- .../role_connections/role_connections_test.go | 2 +- internal/inspect/seq_scans/seq_scans.go | 8 ++-- internal/inspect/seq_scans/seq_scans_test.go | 6 +-- .../table_index_sizes/table_index_sizes.go | 8 ++-- .../table_index_sizes_test.go | 6 +-- .../table_record_counts.go | 8 ++-- .../table_record_counts_test.go | 6 +-- internal/inspect/table_sizes/table_sizes.go | 8 ++-- .../inspect/table_sizes/table_sizes_test.go | 6 +-- .../total_index_size/total_index_size.go | 8 ++-- .../total_index_size/total_index_size_test.go | 6 +-- .../total_table_sizes/total_table_sizes.go | 8 ++-- .../total_table_sizes_test.go | 6 +-- .../inspect/unused_indexes/unused_indexes.go | 8 ++-- .../unused_indexes/unused_indexes_test.go | 6 +-- internal/inspect/vacuum_stats/vacuum_stats.go | 8 ++-- .../inspect/vacuum_stats/vacuum_stats_test.go | 6 +-- internal/link/link.go | 18 ++++---- internal/link/link_test.go | 16 +++---- internal/login/login.go | 6 +-- internal/login/login_test.go | 6 +-- internal/logout/logout.go | 4 +- internal/logout/logout_test.go | 8 ++-- internal/migration/apply/apply.go | 6 +-- internal/migration/apply/apply_test.go | 10 ++-- internal/migration/fetch/fetch.go | 4 +- internal/migration/list/list.go | 4 +- internal/migration/list/list_test.go | 8 ++-- internal/migration/new/new.go | 2 +- internal/migration/new/new_test.go | 2 +- internal/migration/repair/repair.go | 6 +-- internal/migration/repair/repair_test.go | 10 ++-- internal/migration/squash/squash.go | 14 +++--- internal/migration/squash/squash_test.go | 16 +++---- internal/migration/up/up.go | 4 +- internal/migration/up/up_test.go | 8 ++-- internal/orgs/create/create.go | 4 +- internal/orgs/create/create_test.go | 6 +-- internal/orgs/list/list.go | 4 +- internal/orgs/list/list_test.go | 6 +-- internal/postgresConfig/get/get.go | 4 +- internal/postgresConfig/update/update.go | 4 +- internal/projects/apiKeys/api_keys.go | 6 +-- internal/projects/apiKeys/api_keys_test.go | 6 +-- internal/projects/create/create.go | 8 ++-- internal/projects/create/create_test.go | 6 +-- internal/projects/delete/delete.go | 6 +-- internal/projects/delete/delete_test.go | 6 +-- internal/projects/list/list.go | 8 ++-- internal/projects/list/list_test.go | 6 +-- internal/restrictions/get/get.go | 2 +- internal/restrictions/update/update.go | 4 +- internal/restrictions/update/update_test.go | 6 +-- internal/secrets/list/list.go | 6 +-- internal/secrets/list/list_test.go | 6 +-- internal/secrets/set/set.go | 4 +- internal/secrets/set/set_test.go | 6 +-- internal/secrets/unset/unset.go | 4 +- internal/secrets/unset/unset_test.go | 6 +-- internal/seed/buckets/buckets.go | 4 +- internal/seed/buckets/buckets_test.go | 6 +-- internal/services/services.go | 8 ++-- internal/snippets/download/download.go | 2 +- internal/snippets/list/list.go | 8 ++-- internal/ssl_enforcement/get/get.go | 2 +- internal/ssl_enforcement/update/update.go | 4 +- internal/sso/create/create.go | 8 ++-- internal/sso/get/get.go | 6 +-- internal/sso/get/get_test.go | 4 +- internal/sso/info/info.go | 4 +- internal/sso/internal/render/render.go | 6 +-- internal/sso/internal/saml/files.go | 4 +- internal/sso/list/list.go | 4 +- internal/sso/list/list_test.go | 4 +- internal/sso/remove/remove.go | 6 +-- internal/sso/remove/remove_test.go | 4 +- internal/sso/update/update.go | 8 ++-- internal/sso/update/update_test.go | 6 +-- internal/start/start.go | 16 +++---- internal/start/start_test.go | 10 ++-- internal/status/status.go | 4 +- internal/status/status_test.go | 4 +- internal/stop/stop.go | 2 +- internal/stop/stop_test.go | 4 +- internal/storage/client/api.go | 10 ++-- internal/storage/cp/cp.go | 12 ++--- internal/storage/cp/cp_test.go | 14 +++--- internal/storage/ls/ls.go | 6 +-- internal/storage/ls/ls_test.go | 16 +++---- internal/storage/mv/mv.go | 8 ++-- internal/storage/mv/mv_test.go | 14 +++--- internal/storage/rm/rm.go | 12 ++--- internal/storage/rm/rm_test.go | 16 +++---- internal/test/new/new.go | 2 +- internal/test/new/new_test.go | 2 +- internal/testing/helper/history.go | 4 +- internal/unlink/unlink.go | 4 +- internal/unlink/unlink_test.go | 6 +-- internal/utils/access_token.go | 2 +- internal/utils/access_token_test.go | 6 +-- internal/utils/api.go | 6 +-- internal/utils/api_test.go | 4 +- internal/utils/cloudflare/api.go | 2 +- internal/utils/cloudflare/dns.go | 2 +- internal/utils/config.go | 2 +- internal/utils/connect.go | 4 +- internal/utils/connect_test.go | 6 +-- internal/utils/console.go | 2 +- internal/utils/console_test.go | 2 +- internal/utils/docker_test.go | 2 +- internal/utils/flags/db_url.go | 6 +-- internal/utils/flags/project_ref.go | 2 +- internal/utils/flags/project_ref_test.go | 8 ++-- internal/utils/release_test.go | 4 +- internal/utils/tenant/client.go | 6 +-- internal/utils/tenant/database.go | 2 +- internal/utils/tenant/gotrue.go | 2 +- internal/utils/tenant/gotrue_test.go | 2 +- internal/utils/tenant/postgrest.go | 2 +- .../vanity_subdomains/activate/activate.go | 4 +- internal/vanity_subdomains/check/check.go | 4 +- internal/vanity_subdomains/delete/delete.go | 2 +- internal/vanity_subdomains/get/get.go | 2 +- main.go | 2 +- pkg/config/api.go | 6 +-- pkg/config/api_test.go | 2 +- pkg/config/auth.go | 6 +-- pkg/config/auth_test.go | 4 +- pkg/config/config.go | 4 +- pkg/config/db.go | 6 +-- pkg/config/db_test.go | 4 +- pkg/config/storage.go | 6 +-- pkg/config/updater.go | 2 +- pkg/config/updater_test.go | 4 +- pkg/function/api.go | 2 +- pkg/function/batch.go | 4 +- pkg/function/batch_test.go | 4 +- pkg/migration/apply_test.go | 2 +- pkg/migration/drop.go | 2 +- pkg/migration/drop_test.go | 2 +- pkg/migration/file.go | 2 +- pkg/migration/file_test.go | 4 +- pkg/migration/history.go | 2 +- pkg/migration/list.go | 2 +- pkg/migration/list_test.go | 2 +- pkg/migration/seed_test.go | 2 +- pkg/parser/token.go | 2 +- pkg/pgtest/mock.go | 2 +- pkg/storage/api.go | 2 +- pkg/storage/batch.go | 4 +- pkg/storage/buckets.go | 2 +- pkg/storage/objects.go | 2 +- tools/bumpdoc/main.go | 4 +- tools/changelog/main.go | 2 +- tools/listdep/main.go | 2 +- tools/publish/main.go | 6 +-- tools/selfhost/main.go | 6 +-- 291 files changed, 878 insertions(+), 939 deletions(-) diff --git a/cmd/bans.go b/cmd/bans.go index 603e2dd4d..6f930c042 100644 --- a/cmd/bans.go +++ b/cmd/bans.go @@ -3,9 +3,9 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/bans/get" - "github.com/supabase/cli/internal/bans/update" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/bans/get" + "github.com/supabase/cli/v2/internal/bans/update" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/bootstrap.go b/cmd/bootstrap.go index fd9f74912..21d24fb1f 100644 --- a/cmd/bootstrap.go +++ b/cmd/bootstrap.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/internal/bootstrap" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/bootstrap" + "github.com/supabase/cli/v2/internal/utils" ) var ( diff --git a/cmd/branches.go b/cmd/branches.go index 0248e7f31..dd0897d9f 100644 --- a/cmd/branches.go +++ b/cmd/branches.go @@ -8,16 +8,16 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/branches/create" - "github.com/supabase/cli/internal/branches/delete" - "github.com/supabase/cli/internal/branches/disable" - "github.com/supabase/cli/internal/branches/get" - "github.com/supabase/cli/internal/branches/list" - "github.com/supabase/cli/internal/branches/update" - "github.com/supabase/cli/internal/gen/keys" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/branches/create" + "github.com/supabase/cli/v2/internal/branches/delete" + "github.com/supabase/cli/v2/internal/branches/disable" + "github.com/supabase/cli/v2/internal/branches/get" + "github.com/supabase/cli/v2/internal/branches/list" + "github.com/supabase/cli/v2/internal/branches/update" + "github.com/supabase/cli/v2/internal/gen/keys" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" ) var ( diff --git a/cmd/config.go b/cmd/config.go index 1d0f60733..0b0657506 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -3,8 +3,8 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/config/push" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/config/push" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/db.go b/cmd/db.go index 2d64edd74..6737f543e 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -8,22 +8,22 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/internal/db/branch/create" - "github.com/supabase/cli/internal/db/branch/delete" - "github.com/supabase/cli/internal/db/branch/list" - "github.com/supabase/cli/internal/db/branch/switch_" - "github.com/supabase/cli/internal/db/diff" - "github.com/supabase/cli/internal/db/dump" - "github.com/supabase/cli/internal/db/lint" - "github.com/supabase/cli/internal/db/pull" - "github.com/supabase/cli/internal/db/push" - "github.com/supabase/cli/internal/db/remote/changes" - "github.com/supabase/cli/internal/db/remote/commit" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/db/test" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/db/branch/create" + "github.com/supabase/cli/v2/internal/db/branch/delete" + "github.com/supabase/cli/v2/internal/db/branch/list" + "github.com/supabase/cli/v2/internal/db/branch/switch_" + "github.com/supabase/cli/v2/internal/db/diff" + "github.com/supabase/cli/v2/internal/db/dump" + "github.com/supabase/cli/v2/internal/db/lint" + "github.com/supabase/cli/v2/internal/db/pull" + "github.com/supabase/cli/v2/internal/db/push" + "github.com/supabase/cli/v2/internal/db/remote/changes" + "github.com/supabase/cli/v2/internal/db/remote/commit" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/db/test" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/domains.go b/cmd/domains.go index 9ec4a097d..cbc9ecb6e 100644 --- a/cmd/domains.go +++ b/cmd/domains.go @@ -3,12 +3,12 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/hostnames/activate" - "github.com/supabase/cli/internal/hostnames/create" - "github.com/supabase/cli/internal/hostnames/delete" - "github.com/supabase/cli/internal/hostnames/get" - "github.com/supabase/cli/internal/hostnames/reverify" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/hostnames/activate" + "github.com/supabase/cli/v2/internal/hostnames/create" + "github.com/supabase/cli/v2/internal/hostnames/delete" + "github.com/supabase/cli/v2/internal/hostnames/get" + "github.com/supabase/cli/v2/internal/hostnames/reverify" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/encryption.go b/cmd/encryption.go index d3b654afc..5e93d432a 100644 --- a/cmd/encryption.go +++ b/cmd/encryption.go @@ -4,9 +4,9 @@ import ( "os" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/encryption/get" - "github.com/supabase/cli/internal/encryption/update" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/encryption/get" + "github.com/supabase/cli/v2/internal/encryption/update" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/functions.go b/cmd/functions.go index 36dc47f94..b765a41ed 100644 --- a/cmd/functions.go +++ b/cmd/functions.go @@ -5,15 +5,15 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/functions/delete" - "github.com/supabase/cli/internal/functions/deploy" - "github.com/supabase/cli/internal/functions/download" - "github.com/supabase/cli/internal/functions/list" - new_ "github.com/supabase/cli/internal/functions/new" - "github.com/supabase/cli/internal/functions/serve" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/v2/internal/functions/delete" + "github.com/supabase/cli/v2/internal/functions/deploy" + "github.com/supabase/cli/v2/internal/functions/download" + "github.com/supabase/cli/v2/internal/functions/list" + new_ "github.com/supabase/cli/v2/internal/functions/new" + "github.com/supabase/cli/v2/internal/functions/serve" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/cast" ) var ( diff --git a/cmd/gen.go b/cmd/gen.go index 1789e29ca..9c6e66129 100644 --- a/cmd/gen.go +++ b/cmd/gen.go @@ -8,10 +8,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/gen/keys" - "github.com/supabase/cli/internal/gen/types" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/gen/keys" + "github.com/supabase/cli/v2/internal/gen/types" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/init.go b/cmd/init.go index a9d2d90a8..ed9684c23 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -8,8 +8,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - _init "github.com/supabase/cli/internal/init" - "github.com/supabase/cli/internal/utils" + _init "github.com/supabase/cli/v2/internal/init" + "github.com/supabase/cli/v2/internal/utils" ) var ( diff --git a/cmd/inspect.go b/cmd/inspect.go index 2b55c3876..29b69795a 100644 --- a/cmd/inspect.go +++ b/cmd/inspect.go @@ -8,30 +8,30 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/inspect/bloat" - "github.com/supabase/cli/internal/inspect/blocking" - "github.com/supabase/cli/internal/inspect/cache" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/inspect/bloat" + "github.com/supabase/cli/v2/internal/inspect/blocking" + "github.com/supabase/cli/v2/internal/inspect/cache" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/internal/inspect" - "github.com/supabase/cli/internal/inspect/calls" - "github.com/supabase/cli/internal/inspect/index_sizes" - "github.com/supabase/cli/internal/inspect/index_usage" - "github.com/supabase/cli/internal/inspect/locks" - "github.com/supabase/cli/internal/inspect/long_running_queries" - "github.com/supabase/cli/internal/inspect/outliers" - "github.com/supabase/cli/internal/inspect/replication_slots" - "github.com/supabase/cli/internal/inspect/role_configs" - "github.com/supabase/cli/internal/inspect/role_connections" - "github.com/supabase/cli/internal/inspect/seq_scans" - "github.com/supabase/cli/internal/inspect/table_index_sizes" - "github.com/supabase/cli/internal/inspect/table_record_counts" - "github.com/supabase/cli/internal/inspect/table_sizes" - "github.com/supabase/cli/internal/inspect/total_index_size" - "github.com/supabase/cli/internal/inspect/total_table_sizes" - "github.com/supabase/cli/internal/inspect/unused_indexes" - "github.com/supabase/cli/internal/inspect/vacuum_stats" + "github.com/supabase/cli/v2/internal/inspect" + "github.com/supabase/cli/v2/internal/inspect/calls" + "github.com/supabase/cli/v2/internal/inspect/index_sizes" + "github.com/supabase/cli/v2/internal/inspect/index_usage" + "github.com/supabase/cli/v2/internal/inspect/locks" + "github.com/supabase/cli/v2/internal/inspect/long_running_queries" + "github.com/supabase/cli/v2/internal/inspect/outliers" + "github.com/supabase/cli/v2/internal/inspect/replication_slots" + "github.com/supabase/cli/v2/internal/inspect/role_configs" + "github.com/supabase/cli/v2/internal/inspect/role_connections" + "github.com/supabase/cli/v2/internal/inspect/seq_scans" + "github.com/supabase/cli/v2/internal/inspect/table_index_sizes" + "github.com/supabase/cli/v2/internal/inspect/table_record_counts" + "github.com/supabase/cli/v2/internal/inspect/table_sizes" + "github.com/supabase/cli/v2/internal/inspect/total_index_size" + "github.com/supabase/cli/v2/internal/inspect/total_table_sizes" + "github.com/supabase/cli/v2/internal/inspect/unused_indexes" + "github.com/supabase/cli/v2/internal/inspect/vacuum_stats" ) var ( diff --git a/cmd/link.go b/cmd/link.go index b1aec1d7a..ee947c060 100644 --- a/cmd/link.go +++ b/cmd/link.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/internal/link" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/link" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" "golang.org/x/term" ) diff --git a/cmd/login.go b/cmd/login.go index ca9aea666..e186d0d04 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/login" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/login" + "github.com/supabase/cli/v2/internal/utils" "golang.org/x/term" ) diff --git a/cmd/logout.go b/cmd/logout.go index dda3dd4cc..52559d204 100644 --- a/cmd/logout.go +++ b/cmd/logout.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/logout" + "github.com/supabase/cli/v2/internal/logout" ) var ( diff --git a/cmd/migration.go b/cmd/migration.go index 30b7716ac..1224c6659 100644 --- a/cmd/migration.go +++ b/cmd/migration.go @@ -8,14 +8,14 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/internal/migration/fetch" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/migration/new" - "github.com/supabase/cli/internal/migration/repair" - "github.com/supabase/cli/internal/migration/squash" - "github.com/supabase/cli/internal/migration/up" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/migration/fetch" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/migration/new" + "github.com/supabase/cli/v2/internal/migration/repair" + "github.com/supabase/cli/v2/internal/migration/squash" + "github.com/supabase/cli/v2/internal/migration/up" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/orgs.go b/cmd/orgs.go index 5d0750dbb..ace1cd960 100644 --- a/cmd/orgs.go +++ b/cmd/orgs.go @@ -2,8 +2,8 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/supabase/cli/internal/orgs/create" - "github.com/supabase/cli/internal/orgs/list" + "github.com/supabase/cli/v2/internal/orgs/create" + "github.com/supabase/cli/v2/internal/orgs/list" ) var ( diff --git a/cmd/postgres.go b/cmd/postgres.go index 1c2e0e127..c1e84ca72 100644 --- a/cmd/postgres.go +++ b/cmd/postgres.go @@ -3,9 +3,9 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/postgresConfig/get" - "github.com/supabase/cli/internal/postgresConfig/update" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/postgresConfig/get" + "github.com/supabase/cli/v2/internal/postgresConfig/update" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/projects.go b/cmd/projects.go index c119e7171..4b214c517 100644 --- a/cmd/projects.go +++ b/cmd/projects.go @@ -7,13 +7,13 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/internal/projects/apiKeys" - "github.com/supabase/cli/internal/projects/create" - "github.com/supabase/cli/internal/projects/delete" - "github.com/supabase/cli/internal/projects/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/projects/apiKeys" + "github.com/supabase/cli/v2/internal/projects/create" + "github.com/supabase/cli/v2/internal/projects/delete" + "github.com/supabase/cli/v2/internal/projects/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" "golang.org/x/term" ) diff --git a/cmd/restrictions.go b/cmd/restrictions.go index 4358d6132..beb1bbf7d 100644 --- a/cmd/restrictions.go +++ b/cmd/restrictions.go @@ -2,9 +2,9 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/supabase/cli/internal/restrictions/get" - "github.com/supabase/cli/internal/restrictions/update" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/restrictions/get" + "github.com/supabase/cli/v2/internal/restrictions/update" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/root.go b/cmd/root.go index 35540a897..8906ef32e 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,8 +15,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" "golang.org/x/mod/semver" ) diff --git a/cmd/secrets.go b/cmd/secrets.go index df4084e46..f4ee8d09e 100644 --- a/cmd/secrets.go +++ b/cmd/secrets.go @@ -3,10 +3,10 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/secrets/list" - "github.com/supabase/cli/internal/secrets/set" - "github.com/supabase/cli/internal/secrets/unset" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/secrets/list" + "github.com/supabase/cli/v2/internal/secrets/set" + "github.com/supabase/cli/v2/internal/secrets/unset" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/seed.go b/cmd/seed.go index c36b70741..7cac7c325 100644 --- a/cmd/seed.go +++ b/cmd/seed.go @@ -6,9 +6,9 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/seed/buckets" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/seed/buckets" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/services.go b/cmd/services.go index fe298cb43..2fc80e6b0 100644 --- a/cmd/services.go +++ b/cmd/services.go @@ -3,7 +3,7 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/services" + "github.com/supabase/cli/v2/internal/services" ) var ( diff --git a/cmd/snippets.go b/cmd/snippets.go index f69b232af..848e9b7d9 100644 --- a/cmd/snippets.go +++ b/cmd/snippets.go @@ -3,9 +3,9 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/snippets/download" - "github.com/supabase/cli/internal/snippets/list" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/snippets/download" + "github.com/supabase/cli/v2/internal/snippets/list" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/sslEnforcement.go b/cmd/sslEnforcement.go index 7b44d6ddb..3a7351484 100644 --- a/cmd/sslEnforcement.go +++ b/cmd/sslEnforcement.go @@ -4,9 +4,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/ssl_enforcement/get" - "github.com/supabase/cli/internal/ssl_enforcement/update" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/ssl_enforcement/get" + "github.com/supabase/cli/v2/internal/ssl_enforcement/update" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/sso.go b/cmd/sso.go index a9b4db7d3..8c7f3109f 100644 --- a/cmd/sso.go +++ b/cmd/sso.go @@ -4,14 +4,14 @@ import ( "github.com/go-errors/errors" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/sso/create" - "github.com/supabase/cli/internal/sso/get" - "github.com/supabase/cli/internal/sso/info" - "github.com/supabase/cli/internal/sso/list" - "github.com/supabase/cli/internal/sso/remove" - "github.com/supabase/cli/internal/sso/update" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/sso/create" + "github.com/supabase/cli/v2/internal/sso/get" + "github.com/supabase/cli/v2/internal/sso/info" + "github.com/supabase/cli/v2/internal/sso/list" + "github.com/supabase/cli/v2/internal/sso/remove" + "github.com/supabase/cli/v2/internal/sso/update" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" ) var ( diff --git a/cmd/start.go b/cmd/start.go index a7af80e0c..bbdf54d0f 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -8,8 +8,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/start" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/start" + "github.com/supabase/cli/v2/internal/utils" ) func validateExcludedContainers(excludedContainers []string) { diff --git a/cmd/status.go b/cmd/status.go index 13540bfb1..f082a432e 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -7,8 +7,8 @@ import ( env "github.com/Netflix/go-env" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/status" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/status" + "github.com/supabase/cli/v2/internal/utils" ) var ( diff --git a/cmd/stop.go b/cmd/stop.go index 6a6f4aa55..797651107 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/stop" + "github.com/supabase/cli/v2/internal/stop" ) var ( diff --git a/cmd/storage.go b/cmd/storage.go index 3e6eb8fea..8269baac0 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -3,12 +3,12 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/storage/client" - "github.com/supabase/cli/internal/storage/cp" - "github.com/supabase/cli/internal/storage/ls" - "github.com/supabase/cli/internal/storage/mv" - "github.com/supabase/cli/internal/storage/rm" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/storage/client" + "github.com/supabase/cli/v2/internal/storage/cp" + "github.com/supabase/cli/v2/internal/storage/ls" + "github.com/supabase/cli/v2/internal/storage/mv" + "github.com/supabase/cli/v2/internal/storage/rm" + "github.com/supabase/cli/v2/pkg/storage" ) var ( diff --git a/cmd/test.go b/cmd/test.go index 06fb77730..91ac6def8 100644 --- a/cmd/test.go +++ b/cmd/test.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/test/new" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/test/new" + "github.com/supabase/cli/v2/internal/utils" ) var ( diff --git a/cmd/unlink.go b/cmd/unlink.go index e017e75ed..8b0f726f7 100644 --- a/cmd/unlink.go +++ b/cmd/unlink.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/unlink" + "github.com/supabase/cli/v2/internal/unlink" ) var ( diff --git a/cmd/vanitySubdomains.go b/cmd/vanitySubdomains.go index dd3608c53..47f3de7b7 100644 --- a/cmd/vanitySubdomains.go +++ b/cmd/vanitySubdomains.go @@ -3,11 +3,11 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/internal/vanity_subdomains/activate" - "github.com/supabase/cli/internal/vanity_subdomains/check" - "github.com/supabase/cli/internal/vanity_subdomains/delete" - "github.com/supabase/cli/internal/vanity_subdomains/get" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/internal/vanity_subdomains/activate" + "github.com/supabase/cli/v2/internal/vanity_subdomains/check" + "github.com/supabase/cli/v2/internal/vanity_subdomains/delete" + "github.com/supabase/cli/v2/internal/vanity_subdomains/get" ) var ( diff --git a/docs/main.go b/docs/main.go index bfacba311..c7cacc82b 100644 --- a/docs/main.go +++ b/docs/main.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - cli "github.com/supabase/cli/cmd" - "github.com/supabase/cli/internal/utils" + cli "github.com/supabase/cli/v2/cmd" + "github.com/supabase/cli/v2/internal/utils" "gopkg.in/yaml.v3" ) diff --git a/examples/functions-deploy/main.go b/examples/functions-deploy/main.go index 716ef1462..e3f7b0469 100644 --- a/examples/functions-deploy/main.go +++ b/examples/functions-deploy/main.go @@ -8,9 +8,9 @@ import ( "os" "time" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/pkg/function" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/pkg/function" ) func main() { diff --git a/examples/migrations-up/main.go b/examples/migrations-up/main.go index 3ef03242b..4ff759e95 100644 --- a/examples/migrations-up/main.go +++ b/examples/migrations-up/main.go @@ -6,8 +6,8 @@ import ( "log" "os" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgxv5" ) func main() { diff --git a/examples/seed-buckets/main.go b/examples/seed-buckets/main.go index 2c62b1084..8cd8f69e1 100644 --- a/examples/seed-buckets/main.go +++ b/examples/seed-buckets/main.go @@ -8,9 +8,9 @@ import ( "os" "time" - "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/pkg/fetcher" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/storage" ) func main() { diff --git a/go.mod b/go.mod index 1c55174b8..c33559c93 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/supabase/cli +module github.com/supabase/cli/v2 go 1.23.2 @@ -18,7 +18,6 @@ require ( github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/getsentry/sentry-go v0.30.0 - github.com/gin-gonic/gin v1.10.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.12.0 github.com/go-xmlfmt/xmlfmt v1.1.3 @@ -35,7 +34,6 @@ require ( github.com/jackc/pgtype v1.14.4 github.com/jackc/pgx/v4 v4.18.3 github.com/joho/godotenv v1.5.1 - github.com/matoous/go-nanoid/v2 v2.1.0 github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/runtime v1.1.1 @@ -95,8 +93,6 @@ require ( github.com/breml/errchkjson v0.4.0 // indirect github.com/butuzov/ireturn v0.3.0 // indirect github.com/butuzov/mirror v1.2.0 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -106,8 +102,6 @@ require ( github.com/chavacava/garif v0.1.0 // indirect github.com/ckaznocha/intrange v0.2.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/cloudwego/base64x v0.1.4 // indirect - github.com/cloudwego/iasm v0.2.0 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containers/storage v1.56.0 // indirect @@ -133,10 +127,8 @@ require ( github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/getkin/kin-openapi v0.124.0 // indirect github.com/ghostiam/protogetter v0.3.8 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-critic/go-critic v0.11.5 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect @@ -144,9 +136,6 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.20.0 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.2.0 // indirect @@ -156,7 +145,6 @@ require ( github.com/go-toolsmith/typep v1.1.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -196,13 +184,11 @@ require ( github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jjti/go-spancheck v0.6.2 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/julz/importas v0.1.0 // indirect github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kisielk/errcheck v1.8.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kulti/thelper v0.6.3 // indirect @@ -211,7 +197,6 @@ require ( github.com/lasiar/canonicalheader v1.1.2 // indirect github.com/ldez/gomoddirectives v0.2.4 // indirect github.com/ldez/tagliatelle v0.5.0 // indirect - github.com/leodido/go-urn v1.4.0 // indirect github.com/leonklingele/grouper v1.1.2 // indirect github.com/lib/pq v1.10.9 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect @@ -234,8 +219,6 @@ require ( github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/term v0.5.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/moricho/tparallel v0.3.2 // indirect github.com/morikuni/aec v1.0.0 // indirect @@ -298,7 +281,6 @@ require ( github.com/timonwong/loggercheck v0.10.1 // indirect github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.1.1 // indirect @@ -331,7 +313,6 @@ require ( go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.9.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/arch v0.8.0 // indirect golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect diff --git a/go.sum b/go.sum index 9313587d7..29f788f41 100644 --- a/go.sum +++ b/go.sum @@ -147,10 +147,6 @@ github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= -github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= @@ -189,10 +185,6 @@ github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= -github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= -github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= -github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= @@ -287,18 +279,12 @@ github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQ github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= github.com/ghostiam/protogetter v0.3.8 h1:LYcXbYvybUyTIxN2Mj9h6rHrDZBDwZloPoKctWrFyJY= github.com/ghostiam/protogetter v0.3.8/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= -github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-critic/go-critic v0.11.5 h1:TkDTOn5v7EEngMxu8KbuFqFR43USaaH8XRJLz1jhVYA= @@ -331,14 +317,6 @@ github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1 github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= -github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -375,8 +353,6 @@ github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUW github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= @@ -602,7 +578,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -622,10 +597,6 @@ github.com/kisielk/errcheck v1.8.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -652,8 +623,6 @@ github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJ github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= -github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= -github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/lib/pq v0.0.0-20150723085316-0dad96c0b94f/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -676,8 +645,6 @@ github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= -github.com/matoous/go-nanoid/v2 v2.1.0 h1:P64+dmq21hhWdtvZfEAofnvJULaRR1Yib0+PnU669bE= -github.com/matoous/go-nanoid/v2 v2.1.0/go.mod h1:KlbGNQ+FhrUNIHUxZdL63t7tl4LaPkZNpUULS8H4uVM= github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2srm/LN17lpybq15AryXIRcWYLE= github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= @@ -724,11 +691,9 @@ github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiT github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= @@ -971,8 +936,6 @@ github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+ github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= @@ -1074,9 +1037,6 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= -golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1548,8 +1508,6 @@ mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/internal/bans/get/get.go b/internal/bans/get/get.go index a9e52901d..f6f63c401 100644 --- a/internal/bans/get/get.go +++ b/internal/bans/get/get.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/bans/update/update.go b/internal/bans/update/update.go index dfb31d8cf..496f187ed 100644 --- a/internal/bans/update/update.go +++ b/internal/bans/update/update.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func validateIps(ips []string) error { diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index 677ef1530..aecbdd6e1 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -19,18 +19,18 @@ import ( "github.com/joho/godotenv" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/internal/db/push" - initBlank "github.com/supabase/cli/internal/init" - "github.com/supabase/cli/internal/link" - "github.com/supabase/cli/internal/login" - "github.com/supabase/cli/internal/projects/apiKeys" - "github.com/supabase/cli/internal/projects/create" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/internal/utils/tenant" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/fetcher" - "github.com/supabase/cli/pkg/queue" + "github.com/supabase/cli/v2/internal/db/push" + initBlank "github.com/supabase/cli/v2/internal/init" + "github.com/supabase/cli/v2/internal/link" + "github.com/supabase/cli/v2/internal/login" + "github.com/supabase/cli/v2/internal/projects/apiKeys" + "github.com/supabase/cli/v2/internal/projects/create" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/internal/utils/tenant" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/queue" "golang.org/x/term" ) diff --git a/internal/bootstrap/bootstrap_test.go b/internal/bootstrap/bootstrap_test.go index 6cf6eb6e4..8dd89d46d 100644 --- a/internal/bootstrap/bootstrap_test.go +++ b/internal/bootstrap/bootstrap_test.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" ) func TestSuggestAppStart(t *testing.T) { diff --git a/internal/branches/create/create.go b/internal/branches/create/create.go index bf2931b68..63dbaad6f 100644 --- a/internal/branches/create/create.go +++ b/internal/branches/create/create.go @@ -6,10 +6,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/gen/keys" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/gen/keys" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, body api.CreateBranchBody, fsys afero.Fs) error { diff --git a/internal/branches/create/create_test.go b/internal/branches/create/create_test.go index e07e10387..d58ed55ad 100644 --- a/internal/branches/create/create_test.go +++ b/internal/branches/create/create_test.go @@ -10,11 +10,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" ) func TestCreateCommand(t *testing.T) { diff --git a/internal/branches/delete/delete.go b/internal/branches/delete/delete.go index b7fdd6671..568fd56c0 100644 --- a/internal/branches/delete/delete.go +++ b/internal/branches/delete/delete.go @@ -6,7 +6,7 @@ import ( "net/http" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, branchId string) error { diff --git a/internal/branches/disable/disable.go b/internal/branches/disable/disable.go index d94c1e6c5..b7d54f293 100644 --- a/internal/branches/disable/disable.go +++ b/internal/branches/disable/disable.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" ) func Run(ctx context.Context, fsys afero.Fs) error { diff --git a/internal/branches/get/get.go b/internal/branches/get/get.go index ee5bc332c..19f04a58e 100644 --- a/internal/branches/get/get.go +++ b/internal/branches/get/get.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, branchId string) error { diff --git a/internal/branches/list/list.go b/internal/branches/list/list.go index 7a153138f..d40b3824a 100644 --- a/internal/branches/list/list.go +++ b/internal/branches/list/list.go @@ -7,9 +7,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" ) func Run(ctx context.Context, fsys afero.Fs) error { diff --git a/internal/branches/update/update.go b/internal/branches/update/update.go index 6c0f5fc4a..2ddb03f19 100644 --- a/internal/branches/update/update.go +++ b/internal/branches/update/update.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, branchId string, body api.UpdateBranchBody, fsys afero.Fs) error { diff --git a/internal/config/push/push.go b/internal/config/push/push.go index a4c901473..5ddc9070c 100644 --- a/internal/config/push/push.go +++ b/internal/config/push/push.go @@ -6,8 +6,8 @@ import ( "os" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/config" ) func Run(ctx context.Context, ref string, fsys afero.Fs) error { diff --git a/internal/db/branch/create/create.go b/internal/db/branch/create/create.go index 085e10f9d..66635bad1 100644 --- a/internal/db/branch/create/create.go +++ b/internal/db/branch/create/create.go @@ -13,7 +13,7 @@ import ( "github.com/docker/docker/pkg/stdcopy" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) var ( diff --git a/internal/db/branch/create/create_test.go b/internal/db/branch/create/create_test.go index 8e3842345..20bfd4ac3 100644 --- a/internal/db/branch/create/create_test.go +++ b/internal/db/branch/create/create_test.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestBranchValidation(t *testing.T) { diff --git a/internal/db/branch/delete/delete.go b/internal/db/branch/delete/delete.go index f59f5e51c..9655cd793 100644 --- a/internal/db/branch/delete/delete.go +++ b/internal/db/branch/delete/delete.go @@ -11,7 +11,7 @@ import ( "github.com/docker/docker/pkg/stdcopy" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(branch string, fsys afero.Fs) error { diff --git a/internal/db/branch/delete/delete_test.go b/internal/db/branch/delete/delete_test.go index 76957e246..709a3a520 100644 --- a/internal/db/branch/delete/delete_test.go +++ b/internal/db/branch/delete/delete_test.go @@ -9,8 +9,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestBranchDir(t *testing.T) { diff --git a/internal/db/branch/list/list.go b/internal/db/branch/list/list.go index b1037ac1b..f88104229 100644 --- a/internal/db/branch/list/list.go +++ b/internal/db/branch/list/list.go @@ -8,7 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(fsys afero.Fs, out io.Writer) error { diff --git a/internal/db/branch/list/list_test.go b/internal/db/branch/list/list_test.go index 24e34d5e5..fa16586a5 100644 --- a/internal/db/branch/list/list_test.go +++ b/internal/db/branch/list/list_test.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func TestListCommand(t *testing.T) { diff --git a/internal/db/branch/switch_/switch_.go b/internal/db/branch/switch_/switch_.go index 462b26c69..b1255ea63 100644 --- a/internal/db/branch/switch_/switch_.go +++ b/internal/db/branch/switch_/switch_.go @@ -10,8 +10,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, target string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/db/branch/switch_/switch__test.go b/internal/db/branch/switch_/switch__test.go index 7c70959ce..8f22f3214 100644 --- a/internal/db/branch/switch_/switch__test.go +++ b/internal/db/branch/switch_/switch__test.go @@ -13,10 +13,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestSwitchCommand(t *testing.T) { diff --git a/internal/db/diff/diff.go b/internal/db/diff/diff.go index 6c5faa892..05da60459 100644 --- a/internal/db/diff/diff.go +++ b/internal/db/diff/diff.go @@ -21,11 +21,11 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/gen/keys" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/parser" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/gen/keys" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/parser" ) type DiffFunc func(context.Context, string, string, []string) (string, error) diff --git a/internal/db/diff/diff_test.go b/internal/db/diff/diff_test.go index 6ada103c7..3db4d954a 100644 --- a/internal/db/diff/diff_test.go +++ b/internal/db/diff/diff_test.go @@ -17,14 +17,14 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/testing/helper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/testing/helper" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/diff/migra.go b/internal/db/diff/migra.go index 4e7842693..47f8ba1bf 100644 --- a/internal/db/diff/migra.go +++ b/internal/db/diff/migra.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/config" ) //go:embed templates/migra.sh diff --git a/internal/db/diff/pgadmin.go b/internal/db/diff/pgadmin.go index 298023580..baa984849 100644 --- a/internal/db/diff/pgadmin.go +++ b/internal/db/diff/pgadmin.go @@ -8,10 +8,10 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/migration/new" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/migration/new" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/config" ) var warnDiff = `WARNING: The diff tool is not foolproof, so you may need to manually rearrange and modify the generated migration. diff --git a/internal/db/dump/dump.go b/internal/db/dump/dump.go index 94e2ba7af..bef685fe9 100644 --- a/internal/db/dump/dump.go +++ b/internal/db/dump/dump.go @@ -13,8 +13,8 @@ import ( "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - cliConfig "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/internal/utils" + cliConfig "github.com/supabase/cli/v2/pkg/config" ) var ( diff --git a/internal/db/dump/dump_test.go b/internal/db/dump/dump_test.go index 3a7c3cc65..62c1240a3 100644 --- a/internal/db/dump/dump_test.go +++ b/internal/db/dump/dump_test.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/lint/lint.go b/internal/db/lint/lint.go index 5701d89be..5fe21d182 100644 --- a/internal/db/lint/lint.go +++ b/internal/db/lint/lint.go @@ -13,8 +13,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) const ENABLE_PGSQL_CHECK = "CREATE EXTENSION IF NOT EXISTS plpgsql_check" diff --git a/internal/db/lint/lint_test.go b/internal/db/lint/lint_test.go index 8d7abef8f..807540a44 100644 --- a/internal/db/lint/lint_test.go +++ b/internal/db/lint/lint_test.go @@ -14,9 +14,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/pull/pull.go b/internal/db/pull/pull.go index f6a235e11..ad5e07103 100644 --- a/internal/db/pull/pull.go +++ b/internal/db/pull/pull.go @@ -12,13 +12,13 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/diff" - "github.com/supabase/cli/internal/db/dump" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/migration/new" - "github.com/supabase/cli/internal/migration/repair" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/db/diff" + "github.com/supabase/cli/v2/internal/db/dump" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/migration/new" + "github.com/supabase/cli/v2/internal/migration/repair" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) var ( diff --git a/internal/db/pull/pull_test.go b/internal/db/pull/pull_test.go index 2e55fcfed..f6248fe9d 100644 --- a/internal/db/pull/pull_test.go +++ b/internal/db/pull/pull_test.go @@ -13,11 +13,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/push/push.go b/internal/db/push/push.go index 2141255ae..29555b5be 100644 --- a/internal/db/push/push.go +++ b/internal/db/push/push.go @@ -10,10 +10,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/up" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/migration/up" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/migration" ) func Run(ctx context.Context, dryRun, ignoreVersionMismatch bool, includeRoles, includeSeed bool, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/db/push/push_test.go b/internal/db/push/push_test.go index 3a3ff3cda..dad8f2e49 100644 --- a/internal/db/push/push_test.go +++ b/internal/db/push/push_test.go @@ -13,11 +13,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/testing/helper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/testing/helper" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/remote/changes/changes.go b/internal/db/remote/changes/changes.go index c735b5984..c711470c8 100644 --- a/internal/db/remote/changes/changes.go +++ b/internal/db/remote/changes/changes.go @@ -6,9 +6,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/diff" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/db/diff" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) var output string diff --git a/internal/db/remote/commit/commit.go b/internal/db/remote/commit/commit.go index f9062d492..75b9232d8 100644 --- a/internal/db/remote/commit/commit.go +++ b/internal/db/remote/commit/commit.go @@ -10,12 +10,12 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/diff" - "github.com/supabase/cli/internal/db/dump" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/migration/repair" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/db/diff" + "github.com/supabase/cli/v2/internal/db/dump" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/migration/repair" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) func Run(ctx context.Context, schema []string, config pgconn.Config, fsys afero.Fs) error { diff --git a/internal/db/reset/reset.go b/internal/db/reset/reset.go index 3830a019d..81b8e1457 100644 --- a/internal/db/reset/reset.go +++ b/internal/db/reset/reset.go @@ -20,15 +20,15 @@ import ( "github.com/jackc/pgerrcode" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/gen/keys" - "github.com/supabase/cli/internal/migration/apply" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/migration/repair" - "github.com/supabase/cli/internal/seed/buckets" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/gen/keys" + "github.com/supabase/cli/v2/internal/migration/apply" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/migration/repair" + "github.com/supabase/cli/v2/internal/seed/buckets" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/migration" ) func Run(ctx context.Context, version string, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/db/reset/reset_test.go b/internal/db/reset/reset_test.go index 4e3558be3..3693ac8b5 100644 --- a/internal/db/reset/reset_test.go +++ b/internal/db/reset/reset_test.go @@ -16,14 +16,14 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/testing/helper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/testing/helper" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/storage" ) func TestResetCommand(t *testing.T) { diff --git a/internal/db/start/start.go b/internal/db/start/start.go index c4722f22f..f286b1fcb 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -19,10 +19,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/apply" - "github.com/supabase/cli/internal/status" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/migration/apply" + "github.com/supabase/cli/v2/internal/status" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) var ( diff --git a/internal/db/start/start_test.go b/internal/db/start/start_test.go index 475562f2f..e52ecbbbd 100644 --- a/internal/db/start/start_test.go +++ b/internal/db/start/start_test.go @@ -14,11 +14,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestInitBranch(t *testing.T) { diff --git a/internal/db/test/test.go b/internal/db/test/test.go index 263305736..4374e7c98 100644 --- a/internal/db/test/test.go +++ b/internal/db/test/test.go @@ -15,8 +15,8 @@ import ( "github.com/jackc/pgx/v4" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils" - cliConfig "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/internal/utils" + cliConfig "github.com/supabase/cli/v2/pkg/config" ) const ( diff --git a/internal/db/test/test_test.go b/internal/db/test/test_test.go index 7c9310991..30f781fdf 100644 --- a/internal/db/test/test_test.go +++ b/internal/db/test/test_test.go @@ -11,10 +11,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/debug/postgres_test.go b/internal/debug/postgres_test.go index 9f46fd6b8..4d836ce7d 100644 --- a/internal/debug/postgres_test.go +++ b/internal/debug/postgres_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgx/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestPostgresProxy(t *testing.T) { diff --git a/internal/encryption/get/get.go b/internal/encryption/get/get.go index 93c698635..22b827860 100644 --- a/internal/encryption/get/get.go +++ b/internal/encryption/get/get.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string) error { diff --git a/internal/encryption/get/get_test.go b/internal/encryption/get/get_test.go index 8f280189b..a3656dc0b 100644 --- a/internal/encryption/get/get_test.go +++ b/internal/encryption/get/get_test.go @@ -7,9 +7,9 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestGetRootKey(t *testing.T) { diff --git a/internal/encryption/update/update.go b/internal/encryption/update/update.go index ed576823f..172c6429e 100644 --- a/internal/encryption/update/update.go +++ b/internal/encryption/update/update.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef string, stdin *os.File) error { diff --git a/internal/encryption/update/update_test.go b/internal/encryption/update/update_test.go index 8a6f60930..5e8bf3434 100644 --- a/internal/encryption/update/update_test.go +++ b/internal/encryption/update/update_test.go @@ -9,9 +9,9 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestUpdateRootKey(t *testing.T) { diff --git a/internal/functions/delete/delete.go b/internal/functions/delete/delete.go index 47d5957ef..0242d5a7a 100644 --- a/internal/functions/delete/delete.go +++ b/internal/functions/delete/delete.go @@ -7,7 +7,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, slug string, projectRef string, fsys afero.Fs) error { diff --git a/internal/functions/delete/delete_test.go b/internal/functions/delete/delete_test.go index 110208ea9..ac39d5ce2 100644 --- a/internal/functions/delete/delete_test.go +++ b/internal/functions/delete/delete_test.go @@ -9,8 +9,8 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestDeleteCommand(t *testing.T) { diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index 0119a559c..4a75e82e4 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -13,8 +13,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/function" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/function" ) type dockerBundler struct { diff --git a/internal/functions/deploy/bundle_test.go b/internal/functions/deploy/bundle_test.go index f8a68f439..bb286cc21 100644 --- a/internal/functions/deploy/bundle_test.go +++ b/internal/functions/deploy/bundle_test.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestDockerBundle(t *testing.T) { diff --git a/internal/functions/deploy/deploy.go b/internal/functions/deploy/deploy.go index 529b78976..2c97931c8 100644 --- a/internal/functions/deploy/deploy.go +++ b/internal/functions/deploy/deploy.go @@ -9,11 +9,11 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/pkg/function" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/pkg/function" ) func Run(ctx context.Context, slugs []string, projectRef string, noVerifyJWT *bool, importMapPath string, fsys afero.Fs) error { diff --git a/internal/functions/deploy/deploy_test.go b/internal/functions/deploy/deploy_test.go index 558a33f32..542094f1a 100644 --- a/internal/functions/deploy/deploy_test.go +++ b/internal/functions/deploy/deploy_test.go @@ -12,11 +12,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/config" ) func TestDeployCommand(t *testing.T) { diff --git a/internal/functions/download/download.go b/internal/functions/download/download.go index e3b68cae9..169df9d8b 100644 --- a/internal/functions/download/download.go +++ b/internal/functions/download/download.go @@ -15,8 +15,8 @@ import ( "github.com/docker/docker/api/types/network" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) var ( diff --git a/internal/functions/download/download_test.go b/internal/functions/download/download_test.go index b727f95c3..73c8afd80 100644 --- a/internal/functions/download/download_test.go +++ b/internal/functions/download/download_test.go @@ -13,9 +13,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestMain(m *testing.M) { diff --git a/internal/functions/list/list.go b/internal/functions/list/list.go index d0d2d9ecc..603de90aa 100644 --- a/internal/functions/list/list.go +++ b/internal/functions/list/list.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/functions/list/list_test.go b/internal/functions/list/list_test.go index e9c7f26b7..8f9d26174 100644 --- a/internal/functions/list/list_test.go +++ b/internal/functions/list/list_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestFunctionsListCommand(t *testing.T) { diff --git a/internal/functions/new/new.go b/internal/functions/new/new.go index 3656e9b5f..d876a9916 100644 --- a/internal/functions/new/new.go +++ b/internal/functions/new/new.go @@ -10,7 +10,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) var ( diff --git a/internal/functions/new/new_test.go b/internal/functions/new/new_test.go index d5e9c2fc8..fbb5f5e2d 100644 --- a/internal/functions/new/new_test.go +++ b/internal/functions/new/new_test.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func TestNewCommand(t *testing.T) { diff --git a/internal/functions/serve/serve.go b/internal/functions/serve/serve.go index 62811d769..1d9b28258 100644 --- a/internal/functions/serve/serve.go +++ b/internal/functions/serve/serve.go @@ -16,9 +16,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/internal/functions/deploy" - "github.com/supabase/cli/internal/secrets/set" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/functions/deploy" + "github.com/supabase/cli/v2/internal/secrets/set" + "github.com/supabase/cli/v2/internal/utils" ) type InspectMode string diff --git a/internal/functions/serve/serve_test.go b/internal/functions/serve/serve_test.go index 570c4b927..dbc14852a 100644 --- a/internal/functions/serve/serve_test.go +++ b/internal/functions/serve/serve_test.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/cast" ) func TestServeCommand(t *testing.T) { diff --git a/internal/gen/keys/keys.go b/internal/gen/keys/keys.go index 81ed52988..a1079e627 100644 --- a/internal/gen/keys/keys.go +++ b/internal/gen/keys/keys.go @@ -11,8 +11,8 @@ import ( "github.com/go-errors/errors" "github.com/go-git/go-git/v5" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/config" ) type CustomName struct { diff --git a/internal/gen/types/types.go b/internal/gen/types/types.go index b399cfb5c..1e158dd10 100644 --- a/internal/gen/types/types.go +++ b/internal/gen/types/types.go @@ -12,8 +12,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) const ( diff --git a/internal/gen/types/types_test.go b/internal/gen/types/types_test.go index 811ae061d..07ed9e02f 100644 --- a/internal/gen/types/types_test.go +++ b/internal/gen/types/types_test.go @@ -12,10 +12,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestGenLocalCommand(t *testing.T) { diff --git a/internal/hostnames/activate/activate.go b/internal/hostnames/activate/activate.go index 3cc01c206..1b951085e 100644 --- a/internal/hostnames/activate/activate.go +++ b/internal/hostnames/activate/activate.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/hostnames" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/hostnames" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, includeRawOutput bool, fsys afero.Fs) error { diff --git a/internal/hostnames/common.go b/internal/hostnames/common.go index c01e6a0da..b1f55e241 100644 --- a/internal/hostnames/common.go +++ b/internal/hostnames/common.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func GetCustomHostnameConfig(ctx context.Context, projectRef string) (*api.V1GetHostnameConfigResponse, error) { diff --git a/internal/hostnames/create/create.go b/internal/hostnames/create/create.go index 563b524bc..4f3e7c3e0 100644 --- a/internal/hostnames/create/create.go +++ b/internal/hostnames/create/create.go @@ -7,9 +7,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/hostnames" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/hostnames" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef string, customHostname string, includeRawOutput bool, fsys afero.Fs) error { diff --git a/internal/hostnames/delete/delete.go b/internal/hostnames/delete/delete.go index 3b9f3653c..6e472bc6c 100644 --- a/internal/hostnames/delete/delete.go +++ b/internal/hostnames/delete/delete.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/hostnames/get/get.go b/internal/hostnames/get/get.go index 9e17c19f2..def0af734 100644 --- a/internal/hostnames/get/get.go +++ b/internal/hostnames/get/get.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/spf13/afero" - "github.com/supabase/cli/internal/hostnames" + "github.com/supabase/cli/v2/internal/hostnames" ) func Run(ctx context.Context, projectRef string, includeRawOutput bool, fsys afero.Fs) error { diff --git a/internal/hostnames/reverify/reverify.go b/internal/hostnames/reverify/reverify.go index 7f4329903..c7abe8217 100644 --- a/internal/hostnames/reverify/reverify.go +++ b/internal/hostnames/reverify/reverify.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/hostnames" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/hostnames" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, includeRawOutput bool, fsys afero.Fs) error { diff --git a/internal/init/init.go b/internal/init/init.go index f4e470b02..ed99ecb9c 100644 --- a/internal/init/init.go +++ b/internal/init/init.go @@ -11,7 +11,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) var ( diff --git a/internal/init/init_test.go b/internal/init/init_test.go index 99a96dce5..b47c2f0f4 100644 --- a/internal/init/init_test.go +++ b/internal/init/init_test.go @@ -9,9 +9,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/cast" ) func TestInitCommand(t *testing.T) { diff --git a/internal/inspect/bloat/bloat.go b/internal/inspect/bloat/bloat.go index 6a97e41c8..ed680d005 100644 --- a/internal/inspect/bloat/bloat.go +++ b/internal/inspect/bloat/bloat.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed bloat.sql diff --git a/internal/inspect/bloat/bloat_test.go b/internal/inspect/bloat/bloat_test.go index 8646565ce..e5b75d799 100644 --- a/internal/inspect/bloat/bloat_test.go +++ b/internal/inspect/bloat/bloat_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/blocking/blocking.go b/internal/inspect/blocking/blocking.go index 37baed1f9..9aa6baba2 100644 --- a/internal/inspect/blocking/blocking.go +++ b/internal/inspect/blocking/blocking.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed blocking.sql diff --git a/internal/inspect/blocking/blocking_test.go b/internal/inspect/blocking/blocking_test.go index 46b63441f..15bd69712 100644 --- a/internal/inspect/blocking/blocking_test.go +++ b/internal/inspect/blocking/blocking_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/cache/cache.go b/internal/inspect/cache/cache.go index ce30c1f4a..c36339a66 100644 --- a/internal/inspect/cache/cache.go +++ b/internal/inspect/cache/cache.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed cache.sql diff --git a/internal/inspect/cache/cache_test.go b/internal/inspect/cache/cache_test.go index 28fa1cb73..cc332c857 100644 --- a/internal/inspect/cache/cache_test.go +++ b/internal/inspect/cache/cache_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/calls/calls.go b/internal/inspect/calls/calls.go index 2fd0c8df8..a1fe4d9e2 100644 --- a/internal/inspect/calls/calls.go +++ b/internal/inspect/calls/calls.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed calls.sql diff --git a/internal/inspect/calls/calls_test.go b/internal/inspect/calls/calls_test.go index ded271009..3d5a8408b 100644 --- a/internal/inspect/calls/calls_test.go +++ b/internal/inspect/calls/calls_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/index_sizes/index_sizes.go b/internal/inspect/index_sizes/index_sizes.go index 2cfc06e8d..56467f381 100644 --- a/internal/inspect/index_sizes/index_sizes.go +++ b/internal/inspect/index_sizes/index_sizes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed index_sizes.sql diff --git a/internal/inspect/index_sizes/index_sizes_test.go b/internal/inspect/index_sizes/index_sizes_test.go index 9071c5710..fe3cf71ed 100644 --- a/internal/inspect/index_sizes/index_sizes_test.go +++ b/internal/inspect/index_sizes/index_sizes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/index_usage/index_usage.go b/internal/inspect/index_usage/index_usage.go index cd8875f79..76019e5cf 100644 --- a/internal/inspect/index_usage/index_usage.go +++ b/internal/inspect/index_usage/index_usage.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed index_usage.sql diff --git a/internal/inspect/index_usage/index_usage_test.go b/internal/inspect/index_usage/index_usage_test.go index 5b735bb60..be965bf39 100644 --- a/internal/inspect/index_usage/index_usage_test.go +++ b/internal/inspect/index_usage/index_usage_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/locks/locks.go b/internal/inspect/locks/locks.go index 0b2db71c6..57aa8ed67 100644 --- a/internal/inspect/locks/locks.go +++ b/internal/inspect/locks/locks.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed locks.sql diff --git a/internal/inspect/locks/locks_test.go b/internal/inspect/locks/locks_test.go index e4c55c6bd..398c9dce9 100644 --- a/internal/inspect/locks/locks_test.go +++ b/internal/inspect/locks/locks_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/long_running_queries/long_running_queries.go b/internal/inspect/long_running_queries/long_running_queries.go index acf4be456..31b0095a0 100644 --- a/internal/inspect/long_running_queries/long_running_queries.go +++ b/internal/inspect/long_running_queries/long_running_queries.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed long_running_queries.sql diff --git a/internal/inspect/long_running_queries/long_running_queries_test.go b/internal/inspect/long_running_queries/long_running_queries_test.go index d936c61a3..afb2e249f 100644 --- a/internal/inspect/long_running_queries/long_running_queries_test.go +++ b/internal/inspect/long_running_queries/long_running_queries_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/outliers/outliers.go b/internal/inspect/outliers/outliers.go index 06f015c18..2e5c849d8 100644 --- a/internal/inspect/outliers/outliers.go +++ b/internal/inspect/outliers/outliers.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed outliers.sql diff --git a/internal/inspect/outliers/outliers_test.go b/internal/inspect/outliers/outliers_test.go index e5d46432a..f6f83cf34 100644 --- a/internal/inspect/outliers/outliers_test.go +++ b/internal/inspect/outliers/outliers_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/replication_slots/replication_slots.go b/internal/inspect/replication_slots/replication_slots.go index 927ad052a..e0ef52ee2 100644 --- a/internal/inspect/replication_slots/replication_slots.go +++ b/internal/inspect/replication_slots/replication_slots.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed replication_slots.sql diff --git a/internal/inspect/replication_slots/replication_slots_test.go b/internal/inspect/replication_slots/replication_slots_test.go index d9e9b3225..a7891b4c8 100644 --- a/internal/inspect/replication_slots/replication_slots_test.go +++ b/internal/inspect/replication_slots/replication_slots_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/report.go b/internal/inspect/report.go index de721d954..718ea5344 100644 --- a/internal/inspect/report.go +++ b/internal/inspect/report.go @@ -14,8 +14,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" ) //go:embed **/*.sql diff --git a/internal/inspect/report_test.go b/internal/inspect/report_test.go index 6b4220451..898734c69 100644 --- a/internal/inspect/report_test.go +++ b/internal/inspect/report_test.go @@ -8,27 +8,27 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/inspect/bloat" - "github.com/supabase/cli/internal/inspect/blocking" - "github.com/supabase/cli/internal/inspect/cache" - "github.com/supabase/cli/internal/inspect/calls" - "github.com/supabase/cli/internal/inspect/index_sizes" - "github.com/supabase/cli/internal/inspect/index_usage" - "github.com/supabase/cli/internal/inspect/locks" - "github.com/supabase/cli/internal/inspect/long_running_queries" - "github.com/supabase/cli/internal/inspect/outliers" - "github.com/supabase/cli/internal/inspect/replication_slots" - "github.com/supabase/cli/internal/inspect/role_configs" - "github.com/supabase/cli/internal/inspect/role_connections" - "github.com/supabase/cli/internal/inspect/seq_scans" - "github.com/supabase/cli/internal/inspect/table_index_sizes" - "github.com/supabase/cli/internal/inspect/table_record_counts" - "github.com/supabase/cli/internal/inspect/table_sizes" - "github.com/supabase/cli/internal/inspect/total_index_size" - "github.com/supabase/cli/internal/inspect/total_table_sizes" - "github.com/supabase/cli/internal/inspect/unused_indexes" - "github.com/supabase/cli/internal/inspect/vacuum_stats" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/inspect/bloat" + "github.com/supabase/cli/v2/internal/inspect/blocking" + "github.com/supabase/cli/v2/internal/inspect/cache" + "github.com/supabase/cli/v2/internal/inspect/calls" + "github.com/supabase/cli/v2/internal/inspect/index_sizes" + "github.com/supabase/cli/v2/internal/inspect/index_usage" + "github.com/supabase/cli/v2/internal/inspect/locks" + "github.com/supabase/cli/v2/internal/inspect/long_running_queries" + "github.com/supabase/cli/v2/internal/inspect/outliers" + "github.com/supabase/cli/v2/internal/inspect/replication_slots" + "github.com/supabase/cli/v2/internal/inspect/role_configs" + "github.com/supabase/cli/v2/internal/inspect/role_connections" + "github.com/supabase/cli/v2/internal/inspect/seq_scans" + "github.com/supabase/cli/v2/internal/inspect/table_index_sizes" + "github.com/supabase/cli/v2/internal/inspect/table_record_counts" + "github.com/supabase/cli/v2/internal/inspect/table_sizes" + "github.com/supabase/cli/v2/internal/inspect/total_index_size" + "github.com/supabase/cli/v2/internal/inspect/total_table_sizes" + "github.com/supabase/cli/v2/internal/inspect/unused_indexes" + "github.com/supabase/cli/v2/internal/inspect/vacuum_stats" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/role_configs/role_configs.go b/internal/inspect/role_configs/role_configs.go index f4fb79382..9f605419f 100644 --- a/internal/inspect/role_configs/role_configs.go +++ b/internal/inspect/role_configs/role_configs.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed role_configs.sql diff --git a/internal/inspect/role_configs/role_configs_test.go b/internal/inspect/role_configs/role_configs_test.go index 554a12526..67d734301 100644 --- a/internal/inspect/role_configs/role_configs_test.go +++ b/internal/inspect/role_configs/role_configs_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/role_connections/role_connections.go b/internal/inspect/role_connections/role_connections.go index 5b0a56539..e5bec0934 100644 --- a/internal/inspect/role_connections/role_connections.go +++ b/internal/inspect/role_connections/role_connections.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed role_connections.sql diff --git a/internal/inspect/role_connections/role_connections_test.go b/internal/inspect/role_connections/role_connections_test.go index 32ecab768..b7d1ec884 100644 --- a/internal/inspect/role_connections/role_connections_test.go +++ b/internal/inspect/role_connections/role_connections_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/seq_scans/seq_scans.go b/internal/inspect/seq_scans/seq_scans.go index 6b52538ee..240112d5b 100644 --- a/internal/inspect/seq_scans/seq_scans.go +++ b/internal/inspect/seq_scans/seq_scans.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed seq_scans.sql diff --git a/internal/inspect/seq_scans/seq_scans_test.go b/internal/inspect/seq_scans/seq_scans_test.go index 3db6caee5..0e2bdfb42 100644 --- a/internal/inspect/seq_scans/seq_scans_test.go +++ b/internal/inspect/seq_scans/seq_scans_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/table_index_sizes/table_index_sizes.go b/internal/inspect/table_index_sizes/table_index_sizes.go index e61f23361..8a5b3a096 100644 --- a/internal/inspect/table_index_sizes/table_index_sizes.go +++ b/internal/inspect/table_index_sizes/table_index_sizes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed table_index_sizes.sql diff --git a/internal/inspect/table_index_sizes/table_index_sizes_test.go b/internal/inspect/table_index_sizes/table_index_sizes_test.go index 20ad80fc9..92e58ef56 100644 --- a/internal/inspect/table_index_sizes/table_index_sizes_test.go +++ b/internal/inspect/table_index_sizes/table_index_sizes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/table_record_counts/table_record_counts.go b/internal/inspect/table_record_counts/table_record_counts.go index e0b394374..19e32a5b3 100644 --- a/internal/inspect/table_record_counts/table_record_counts.go +++ b/internal/inspect/table_record_counts/table_record_counts.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed table_record_counts.sql diff --git a/internal/inspect/table_record_counts/table_record_counts_test.go b/internal/inspect/table_record_counts/table_record_counts_test.go index a03714d97..753074e77 100644 --- a/internal/inspect/table_record_counts/table_record_counts_test.go +++ b/internal/inspect/table_record_counts/table_record_counts_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/table_sizes/table_sizes.go b/internal/inspect/table_sizes/table_sizes.go index 7741f0119..7ce49e225 100644 --- a/internal/inspect/table_sizes/table_sizes.go +++ b/internal/inspect/table_sizes/table_sizes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed table_sizes.sql diff --git a/internal/inspect/table_sizes/table_sizes_test.go b/internal/inspect/table_sizes/table_sizes_test.go index 5cc6426ad..057f32d14 100644 --- a/internal/inspect/table_sizes/table_sizes_test.go +++ b/internal/inspect/table_sizes/table_sizes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/total_index_size/total_index_size.go b/internal/inspect/total_index_size/total_index_size.go index fbc66b259..bd6a13fd9 100644 --- a/internal/inspect/total_index_size/total_index_size.go +++ b/internal/inspect/total_index_size/total_index_size.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed total_index_size.sql diff --git a/internal/inspect/total_index_size/total_index_size_test.go b/internal/inspect/total_index_size/total_index_size_test.go index 8eb0e0aa9..c59401469 100644 --- a/internal/inspect/total_index_size/total_index_size_test.go +++ b/internal/inspect/total_index_size/total_index_size_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/total_table_sizes/total_table_sizes.go b/internal/inspect/total_table_sizes/total_table_sizes.go index 80b1c89a8..3b96dcadd 100644 --- a/internal/inspect/total_table_sizes/total_table_sizes.go +++ b/internal/inspect/total_table_sizes/total_table_sizes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed total_table_sizes.sql diff --git a/internal/inspect/total_table_sizes/total_table_sizes_test.go b/internal/inspect/total_table_sizes/total_table_sizes_test.go index bc548af60..3419fc762 100644 --- a/internal/inspect/total_table_sizes/total_table_sizes_test.go +++ b/internal/inspect/total_table_sizes/total_table_sizes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/unused_indexes/unused_indexes.go b/internal/inspect/unused_indexes/unused_indexes.go index 2a30a46d7..d7589888d 100644 --- a/internal/inspect/unused_indexes/unused_indexes.go +++ b/internal/inspect/unused_indexes/unused_indexes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed unused_indexes.sql diff --git a/internal/inspect/unused_indexes/unused_indexes_test.go b/internal/inspect/unused_indexes/unused_indexes_test.go index ee4182094..af3936166 100644 --- a/internal/inspect/unused_indexes/unused_indexes_test.go +++ b/internal/inspect/unused_indexes/unused_indexes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/vacuum_stats/vacuum_stats.go b/internal/inspect/vacuum_stats/vacuum_stats.go index dc9326d79..950956503 100644 --- a/internal/inspect/vacuum_stats/vacuum_stats.go +++ b/internal/inspect/vacuum_stats/vacuum_stats.go @@ -10,10 +10,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgxv5" ) //go:embed vacuum_stats.sql diff --git a/internal/inspect/vacuum_stats/vacuum_stats_test.go b/internal/inspect/vacuum_stats/vacuum_stats_test.go index 0d3cbec10..fba1e9a47 100644 --- a/internal/inspect/vacuum_stats/vacuum_stats_test.go +++ b/internal/inspect/vacuum_stats/vacuum_stats_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/db/reset" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/reset" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/link/link.go b/internal/link/link.go index e791271b8..5f156b11b 100644 --- a/internal/link/link.go +++ b/internal/link/link.go @@ -13,15 +13,15 @@ import ( "github.com/jackc/pgx/v4" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/internal/utils/tenant" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - cliConfig "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/pkg/diff" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/internal/utils/tenant" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + cliConfig "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/pkg/diff" + "github.com/supabase/cli/v2/pkg/migration" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/link/link_test.go b/internal/link/link_test.go index 18c090ad3..4f05a296e 100644 --- a/internal/link/link_test.go +++ b/internal/link/link_test.go @@ -12,14 +12,14 @@ import ( "github.com/jackc/pgx/v4" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/testing/helper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/tenant" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/testing/helper" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/tenant" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" "github.com/zalando/go-keyring" ) diff --git a/internal/login/login.go b/internal/login/login.go index 6239b500a..be1265bec 100644 --- a/internal/login/login.go +++ b/internal/login/login.go @@ -20,9 +20,9 @@ import ( "github.com/go-errors/errors" "github.com/google/uuid" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/new" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/internal/migration/new" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/fetcher" ) type RunParams struct { diff --git a/internal/login/login_test.go b/internal/login/login_test.go index 758fbc5c4..8dd02deab 100644 --- a/internal/login/login_test.go +++ b/internal/login/login_test.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/logout/logout.go b/internal/logout/logout.go index abbd191b8..ae71bf00b 100644 --- a/internal/logout/logout.go +++ b/internal/logout/logout.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" ) func Run(ctx context.Context, stdout *os.File, fsys afero.Fs) error { diff --git a/internal/logout/logout_test.go b/internal/logout/logout_test.go index 42f9f8ead..5a7835824 100644 --- a/internal/logout/logout_test.go +++ b/internal/logout/logout_test.go @@ -8,10 +8,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/migration/apply/apply.go b/internal/migration/apply/apply.go index 224b342f7..ea7f6cb8b 100644 --- a/internal/migration/apply/apply.go +++ b/internal/migration/apply/apply.go @@ -5,9 +5,9 @@ import ( "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) func MigrateAndSeed(ctx context.Context, version string, conn *pgx.Conn, fsys afero.Fs) error { diff --git a/internal/migration/apply/apply_test.go b/internal/migration/apply/apply_test.go index 286093743..49165f275 100644 --- a/internal/migration/apply/apply_test.go +++ b/internal/migration/apply/apply_test.go @@ -9,11 +9,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/testing/helper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/testing/helper" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestMigrateDatabase(t *testing.T) { diff --git a/internal/migration/fetch/fetch.go b/internal/migration/fetch/fetch.go index cb78c70d8..fac525787 100644 --- a/internal/migration/fetch/fetch.go +++ b/internal/migration/fetch/fetch.go @@ -10,8 +10,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/migration/list/list.go b/internal/migration/list/list.go index 3107d4ec6..d1202d068 100644 --- a/internal/migration/list/list.go +++ b/internal/migration/list/list.go @@ -11,8 +11,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/migration/list/list_test.go b/internal/migration/list/list_test.go index b23fa4a2d..c68ade375 100644 --- a/internal/migration/list/list_test.go +++ b/internal/migration/list/list_test.go @@ -12,10 +12,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/migration/new/new.go b/internal/migration/new/new.go index be232b591..026c54c7b 100644 --- a/internal/migration/new/new.go +++ b/internal/migration/new/new.go @@ -8,7 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(migrationName string, stdin afero.File, fsys afero.Fs) error { diff --git a/internal/migration/new/new_test.go b/internal/migration/new/new_test.go index 39e2fe115..232623cb1 100644 --- a/internal/migration/new/new_test.go +++ b/internal/migration/new/new_test.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func TestNewCommand(t *testing.T) { diff --git a/internal/migration/repair/repair.go b/internal/migration/repair/repair.go index c0670000a..b43779aa6 100644 --- a/internal/migration/repair/repair.go +++ b/internal/migration/repair/repair.go @@ -11,9 +11,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) const ( diff --git a/internal/migration/repair/repair_test.go b/internal/migration/repair/repair_test.go index 4dea63279..cb035c489 100644 --- a/internal/migration/repair/repair_test.go +++ b/internal/migration/repair/repair_test.go @@ -12,11 +12,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/testing/helper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/testing/helper" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/migration/squash/squash.go b/internal/migration/squash/squash.go index 2ed9e6252..64429d260 100644 --- a/internal/migration/squash/squash.go +++ b/internal/migration/squash/squash.go @@ -14,13 +14,13 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/diff" - "github.com/supabase/cli/internal/db/dump" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/migration/repair" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/db/diff" + "github.com/supabase/cli/v2/internal/db/dump" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/migration/repair" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) var ErrMissingVersion = errors.New("version not found") diff --git a/internal/migration/squash/squash_test.go b/internal/migration/squash/squash_test.go index cc0461f3b..1cbd85849 100644 --- a/internal/migration/squash/squash_test.go +++ b/internal/migration/squash/squash_test.go @@ -21,14 +21,14 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/migration/repair" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/testing/helper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/migration/repair" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/testing/helper" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/migration/up/up.go b/internal/migration/up/up.go index d33117f33..8229fd6ed 100644 --- a/internal/migration/up/up.go +++ b/internal/migration/up/up.go @@ -9,8 +9,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" ) func Run(ctx context.Context, includeAll bool, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/migration/up/up_test.go b/internal/migration/up/up_test.go index ea41680bc..69e9c5ecd 100644 --- a/internal/migration/up/up_test.go +++ b/internal/migration/up/up_test.go @@ -9,10 +9,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestPendingMigrations(t *testing.T) { diff --git a/internal/orgs/create/create.go b/internal/orgs/create/create.go index ed6008ab3..df7c1eec5 100644 --- a/internal/orgs/create/create.go +++ b/internal/orgs/create/create.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, name string) error { diff --git a/internal/orgs/create/create_test.go b/internal/orgs/create/create_test.go index f491bdc31..8792188f6 100644 --- a/internal/orgs/create/create_test.go +++ b/internal/orgs/create/create_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestOrganizationCreateCommand(t *testing.T) { diff --git a/internal/orgs/list/list.go b/internal/orgs/list/list.go index abd6c08df..4eb7487f0 100644 --- a/internal/orgs/list/list.go +++ b/internal/orgs/list/list.go @@ -6,8 +6,8 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context) error { diff --git a/internal/orgs/list/list_test.go b/internal/orgs/list/list_test.go index 00030dbd2..d538f5fea 100644 --- a/internal/orgs/list/list_test.go +++ b/internal/orgs/list/list_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestOrganizationListCommand(t *testing.T) { diff --git a/internal/postgresConfig/get/get.go b/internal/postgresConfig/get/get.go index ad311b396..535f0f171 100644 --- a/internal/postgresConfig/get/get.go +++ b/internal/postgresConfig/get/get.go @@ -9,8 +9,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/postgresConfig/update/update.go b/internal/postgresConfig/update/update.go index 94632d486..9c8bec823 100644 --- a/internal/postgresConfig/update/update.go +++ b/internal/postgresConfig/update/update.go @@ -9,8 +9,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/postgresConfig/get" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/postgresConfig/get" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, values []string, replaceOverrides, noRestart bool, fsys afero.Fs) error { diff --git a/internal/projects/apiKeys/api_keys.go b/internal/projects/apiKeys/api_keys.go index 7daddce21..be5035a5b 100644 --- a/internal/projects/apiKeys/api_keys.go +++ b/internal/projects/apiKeys/api_keys.go @@ -8,9 +8,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/projects/apiKeys/api_keys_test.go b/internal/projects/apiKeys/api_keys_test.go index 57130f158..e94a999ce 100644 --- a/internal/projects/apiKeys/api_keys_test.go +++ b/internal/projects/apiKeys/api_keys_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestProjectApiKeysCommand(t *testing.T) { diff --git a/internal/projects/create/create.go b/internal/projects/create/create.go index ddbd46b47..671020f1f 100644 --- a/internal/projects/create/create.go +++ b/internal/projects/create/create.go @@ -9,10 +9,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, params api.V1CreateProjectBodyDto, fsys afero.Fs) error { diff --git a/internal/projects/create/create_test.go b/internal/projects/create/create_test.go index 879421d72..8db8ef3da 100644 --- a/internal/projects/create/create_test.go +++ b/internal/projects/create/create_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestProjectCreateCommand(t *testing.T) { diff --git a/internal/projects/delete/delete.go b/internal/projects/delete/delete.go index f042f62e1..dda1dd297 100644 --- a/internal/projects/delete/delete.go +++ b/internal/projects/delete/delete.go @@ -8,9 +8,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/unlink" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/unlink" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/projects/delete/delete_test.go b/internal/projects/delete/delete_test.go index b83d4cf8c..aaa441229 100644 --- a/internal/projects/delete/delete_test.go +++ b/internal/projects/delete/delete_test.go @@ -10,9 +10,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" "github.com/zalando/go-keyring" ) diff --git a/internal/projects/list/list.go b/internal/projects/list/list.go index ef356dfcf..23dae8f07 100644 --- a/internal/projects/list/list.go +++ b/internal/projects/list/list.go @@ -8,10 +8,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" ) type linkedProject struct { diff --git a/internal/projects/list/list_test.go b/internal/projects/list/list_test.go index d5450bfb4..31a1bc716 100644 --- a/internal/projects/list/list_test.go +++ b/internal/projects/list/list_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestProjectListCommand(t *testing.T) { diff --git a/internal/restrictions/get/get.go b/internal/restrictions/get/get.go index f8e27342d..ffd4d8fb0 100644 --- a/internal/restrictions/get/get.go +++ b/internal/restrictions/get/get.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string) error { diff --git a/internal/restrictions/update/update.go b/internal/restrictions/update/update.go index 98a70da98..8b5718a76 100644 --- a/internal/restrictions/update/update.go +++ b/internal/restrictions/update/update.go @@ -6,8 +6,8 @@ import ( "net" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef string, dbCidrsToAllow []string, bypassCidrChecks bool) error { diff --git a/internal/restrictions/update/update_test.go b/internal/restrictions/update/update_test.go index 5a6583ea8..e23a3101e 100644 --- a/internal/restrictions/update/update_test.go +++ b/internal/restrictions/update/update_test.go @@ -8,9 +8,9 @@ import ( "github.com/go-errors/errors" "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestUpdateRestrictionsCommand(t *testing.T) { diff --git a/internal/secrets/list/list.go b/internal/secrets/list/list.go index e5b4d4538..9cf4efa6a 100644 --- a/internal/secrets/list/list.go +++ b/internal/secrets/list/list.go @@ -8,9 +8,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/secrets/list/list_test.go b/internal/secrets/list/list_test.go index 4e0da98b6..4e831d38c 100644 --- a/internal/secrets/list/list_test.go +++ b/internal/secrets/list/list_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestSecretListCommand(t *testing.T) { diff --git a/internal/secrets/set/set.go b/internal/secrets/set/set.go index d2877c314..14e715c7a 100644 --- a/internal/secrets/set/set.go +++ b/internal/secrets/set/set.go @@ -12,8 +12,8 @@ import ( "github.com/go-errors/errors" "github.com/joho/godotenv" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef, envFilePath string, args []string, fsys afero.Fs) error { diff --git a/internal/secrets/set/set_test.go b/internal/secrets/set/set_test.go index 6021804c1..beb15c7fd 100644 --- a/internal/secrets/set/set_test.go +++ b/internal/secrets/set/set_test.go @@ -10,9 +10,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestSecretSetCommand(t *testing.T) { diff --git a/internal/secrets/unset/unset.go b/internal/secrets/unset/unset.go index f6bbca8cf..e9f680d14 100644 --- a/internal/secrets/unset/unset.go +++ b/internal/secrets/unset/unset.go @@ -9,8 +9,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/secrets/list" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/secrets/list" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, args []string, fsys afero.Fs) error { diff --git a/internal/secrets/unset/unset_test.go b/internal/secrets/unset/unset_test.go index 3207f8df7..e3f6d9dff 100644 --- a/internal/secrets/unset/unset_test.go +++ b/internal/secrets/unset/unset_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestSecretUnsetCommand(t *testing.T) { diff --git a/internal/seed/buckets/buckets.go b/internal/seed/buckets/buckets.go index b460fdc79..f68344828 100644 --- a/internal/seed/buckets/buckets.go +++ b/internal/seed/buckets/buckets.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/spf13/afero" - "github.com/supabase/cli/internal/storage/client" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/storage/client" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, interactive bool, fsys afero.Fs) error { diff --git a/internal/seed/buckets/buckets_test.go b/internal/seed/buckets/buckets_test.go index e14a40e74..9e9c7b1a5 100644 --- a/internal/seed/buckets/buckets_test.go +++ b/internal/seed/buckets/buckets_test.go @@ -11,9 +11,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/storage" ) func TestSeedBuckets(t *testing.T) { diff --git a/internal/services/services.go b/internal/services/services.go index ebc08efca..e32a3ad57 100644 --- a/internal/services/services.go +++ b/internal/services/services.go @@ -9,10 +9,10 @@ import ( "sync" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/internal/utils/tenant" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/internal/utils/tenant" ) func Run(ctx context.Context, fsys afero.Fs) error { diff --git a/internal/snippets/download/download.go b/internal/snippets/download/download.go index 7f1f3a463..f983d2101 100644 --- a/internal/snippets/download/download.go +++ b/internal/snippets/download/download.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, snippetId string, fsys afero.Fs) error { diff --git a/internal/snippets/list/list.go b/internal/snippets/list/list.go index f54325eaa..c3c651f7b 100644 --- a/internal/snippets/list/list.go +++ b/internal/snippets/list/list.go @@ -7,10 +7,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, fsys afero.Fs) error { diff --git a/internal/ssl_enforcement/get/get.go b/internal/ssl_enforcement/get/get.go index e6d58693e..50673d9c9 100644 --- a/internal/ssl_enforcement/get/get.go +++ b/internal/ssl_enforcement/get/get.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/ssl_enforcement/update/update.go b/internal/ssl_enforcement/update/update.go index 51b0b6725..f5805d108 100644 --- a/internal/ssl_enforcement/update/update.go +++ b/internal/ssl_enforcement/update/update.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef string, enforceDbSsl bool, fsys afero.Fs) error { diff --git a/internal/sso/create/create.go b/internal/sso/create/create.go index a33b6e7e7..1b24e12a9 100644 --- a/internal/sso/create/create.go +++ b/internal/sso/create/create.go @@ -7,10 +7,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/sso/internal/render" - "github.com/supabase/cli/internal/sso/internal/saml" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/sso/internal/render" + "github.com/supabase/cli/v2/internal/sso/internal/saml" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) var Fs = afero.NewOsFs() diff --git a/internal/sso/get/get.go b/internal/sso/get/get.go index 34370523e..43a8e206e 100644 --- a/internal/sso/get/get.go +++ b/internal/sso/get/get.go @@ -7,9 +7,9 @@ import ( "os" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/sso/internal/render" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/sso/internal/render" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, ref, providerId, format string) error { diff --git a/internal/sso/get/get_test.go b/internal/sso/get/get_test.go index bd6fd0ef3..3c506ce78 100644 --- a/internal/sso/get/get_test.go +++ b/internal/sso/get/get_test.go @@ -7,8 +7,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestSSOProvidersShowCommand(t *testing.T) { diff --git a/internal/sso/info/info.go b/internal/sso/info/info.go index c8a25805f..ffe51b8b0 100644 --- a/internal/sso/info/info.go +++ b/internal/sso/info/info.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/supabase/cli/internal/sso/internal/render" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/sso/internal/render" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, ref string, format string) error { diff --git a/internal/sso/internal/render/render.go b/internal/sso/internal/render/render.go index 3f3a03db1..3e45b2e01 100644 --- a/internal/sso/internal/render/render.go +++ b/internal/sso/internal/render/render.go @@ -7,9 +7,9 @@ import ( "github.com/go-errors/errors" "github.com/go-xmlfmt/xmlfmt" - "github.com/supabase/cli/internal/migration/list" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/migration/list" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func formatProtocol(provider api.Provider) string { diff --git a/internal/sso/internal/saml/files.go b/internal/sso/internal/saml/files.go index 62e0846e3..3b47dbe9d 100644 --- a/internal/sso/internal/saml/files.go +++ b/internal/sso/internal/saml/files.go @@ -12,8 +12,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/fetcher" ) var DefaultClient = http.DefaultClient diff --git a/internal/sso/list/list.go b/internal/sso/list/list.go index efacb1a04..181a86aff 100644 --- a/internal/sso/list/list.go +++ b/internal/sso/list/list.go @@ -6,8 +6,8 @@ import ( "os" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/sso/internal/render" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/sso/internal/render" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, ref, format string) error { diff --git a/internal/sso/list/list_test.go b/internal/sso/list/list_test.go index 333ffd4a3..50ab8d745 100644 --- a/internal/sso/list/list_test.go +++ b/internal/sso/list/list_test.go @@ -6,8 +6,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestSSOProvidersListCommand(t *testing.T) { diff --git a/internal/sso/remove/remove.go b/internal/sso/remove/remove.go index 1514314da..a8b5b1ccf 100644 --- a/internal/sso/remove/remove.go +++ b/internal/sso/remove/remove.go @@ -6,9 +6,9 @@ import ( "os" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/sso/internal/render" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/sso/internal/render" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, ref, providerId, format string) error { diff --git a/internal/sso/remove/remove_test.go b/internal/sso/remove/remove_test.go index f284f7e06..c606c8628 100644 --- a/internal/sso/remove/remove_test.go +++ b/internal/sso/remove/remove_test.go @@ -7,8 +7,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestSSOProvidersRemoveCommand(t *testing.T) { diff --git a/internal/sso/update/update.go b/internal/sso/update/update.go index e8a745dc3..5a412fed7 100644 --- a/internal/sso/update/update.go +++ b/internal/sso/update/update.go @@ -7,10 +7,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/sso/internal/render" - "github.com/supabase/cli/internal/sso/internal/saml" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/sso/internal/render" + "github.com/supabase/cli/v2/internal/sso/internal/saml" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) var Fs = afero.NewOsFs() diff --git a/internal/sso/update/update_test.go b/internal/sso/update/update_test.go index 6754fd487..dd423dadd 100644 --- a/internal/sso/update/update_test.go +++ b/internal/sso/update/update_test.go @@ -10,9 +10,9 @@ import ( "github.com/google/uuid" "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func response(providerId string, domains []string) map[string]any { diff --git a/internal/start/start.go b/internal/start/start.go index 4315d31b7..c74f6287f 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -23,14 +23,14 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/internal/db/start" - "github.com/supabase/cli/internal/functions/serve" - "github.com/supabase/cli/internal/seed/buckets" - "github.com/supabase/cli/internal/services" - "github.com/supabase/cli/internal/status" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/internal/db/start" + "github.com/supabase/cli/v2/internal/functions/serve" + "github.com/supabase/cli/v2/internal/seed/buckets" + "github.com/supabase/cli/v2/internal/services" + "github.com/supabase/cli/v2/internal/status" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/config" "golang.org/x/mod/semver" ) diff --git a/internal/start/start_test.go b/internal/start/start_test.go index 079eb3c79..93af236d9 100644 --- a/internal/start/start_test.go +++ b/internal/start/start_test.go @@ -17,11 +17,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/pkg/pgtest" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/storage" ) func TestStartCommand(t *testing.T) { diff --git a/internal/status/status.go b/internal/status/status.go index 1b9d02f90..bcd8ff8bf 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -18,8 +18,8 @@ import ( "github.com/docker/docker/api/types/container" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/fetcher" ) type CustomName struct { diff --git a/internal/status/status_test.go b/internal/status/status_test.go index 391a8c998..792b99c65 100644 --- a/internal/status/status_test.go +++ b/internal/status/status_test.go @@ -13,8 +13,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestStatusCommand(t *testing.T) { diff --git a/internal/stop/stop.go b/internal/stop/stop.go index 39c5e00e5..fc9dfebd5 100644 --- a/internal/stop/stop.go +++ b/internal/stop/stop.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/volume" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, backup bool, projectId string, all bool, fsys afero.Fs) error { diff --git a/internal/stop/stop_test.go b/internal/stop/stop_test.go index b607d87d7..cc287cb9e 100644 --- a/internal/stop/stop_test.go +++ b/internal/stop/stop_test.go @@ -18,8 +18,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" ) func TestStopCommand(t *testing.T) { diff --git a/internal/storage/client/api.go b/internal/storage/client/api.go index c8c2a02ef..ea44f3c7b 100644 --- a/internal/storage/client/api.go +++ b/internal/storage/client/api.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/spf13/viper" - "github.com/supabase/cli/internal/status" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/tenant" - "github.com/supabase/cli/pkg/fetcher" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/status" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/tenant" + "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/storage" ) func NewStorageAPI(ctx context.Context, projectRef string) (storage.StorageAPI, error) { diff --git a/internal/storage/cp/cp.go b/internal/storage/cp/cp.go index e55120a1c..6c5df9f31 100644 --- a/internal/storage/cp/cp.go +++ b/internal/storage/cp/cp.go @@ -12,12 +12,12 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/storage/client" - "github.com/supabase/cli/internal/storage/ls" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/queue" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/storage/client" + "github.com/supabase/cli/v2/internal/storage/ls" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/queue" + "github.com/supabase/cli/v2/pkg/storage" ) var errUnsupportedOperation = errors.New("Unsupported operation") diff --git a/internal/storage/cp/cp_test.go b/internal/storage/cp/cp_test.go index 75a0cf3cd..83e787692 100644 --- a/internal/storage/cp/cp_test.go +++ b/internal/storage/cp/cp_test.go @@ -10,13 +10,13 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/fetcher" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/storage" ) var mockFile = storage.ObjectResponse{ diff --git a/internal/storage/ls/ls.go b/internal/storage/ls/ls.go index 396dc9b7c..0f521ce97 100644 --- a/internal/storage/ls/ls.go +++ b/internal/storage/ls/ls.go @@ -8,9 +8,9 @@ import ( "strings" "github.com/spf13/afero" - "github.com/supabase/cli/internal/storage/client" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/storage/client" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/storage" ) func Run(ctx context.Context, objectPath string, recursive bool, fsys afero.Fs) error { diff --git a/internal/storage/ls/ls_test.go b/internal/storage/ls/ls_test.go index e0e2cd207..bef37987d 100644 --- a/internal/storage/ls/ls_test.go +++ b/internal/storage/ls/ls_test.go @@ -9,14 +9,14 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/storage/client" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/fetcher" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/storage/client" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/storage" ) var mockFile = storage.ObjectResponse{ diff --git a/internal/storage/mv/mv.go b/internal/storage/mv/mv.go index a6dc8773c..91f0ef3b2 100644 --- a/internal/storage/mv/mv.go +++ b/internal/storage/mv/mv.go @@ -9,10 +9,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/storage/client" - "github.com/supabase/cli/internal/storage/ls" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/storage/client" + "github.com/supabase/cli/v2/internal/storage/ls" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/storage" ) var ( diff --git a/internal/storage/mv/mv_test.go b/internal/storage/mv/mv_test.go index fd8ecfbcc..65164cc46 100644 --- a/internal/storage/mv/mv_test.go +++ b/internal/storage/mv/mv_test.go @@ -8,13 +8,13 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/fetcher" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/storage" ) var mockFile = storage.ObjectResponse{ diff --git a/internal/storage/rm/rm.go b/internal/storage/rm/rm.go index 720bbce02..8734cc8ca 100644 --- a/internal/storage/rm/rm.go +++ b/internal/storage/rm/rm.go @@ -8,12 +8,12 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/storage/client" - "github.com/supabase/cli/internal/storage/cp" - "github.com/supabase/cli/internal/storage/ls" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/storage/client" + "github.com/supabase/cli/v2/internal/storage/cp" + "github.com/supabase/cli/v2/internal/storage/ls" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/storage" ) var ( diff --git a/internal/storage/rm/rm_test.go b/internal/storage/rm/rm_test.go index 46d204cf0..c04a79a6a 100644 --- a/internal/storage/rm/rm_test.go +++ b/internal/storage/rm/rm_test.go @@ -8,14 +8,14 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/fetcher" - "github.com/supabase/cli/pkg/storage" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/storage" ) var mockFile = storage.ObjectResponse{ diff --git a/internal/test/new/new.go b/internal/test/new/new.go index 506a9e02e..babe62194 100644 --- a/internal/test/new/new.go +++ b/internal/test/new/new.go @@ -8,7 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) const ( diff --git a/internal/test/new/new_test.go b/internal/test/new/new_test.go index d3f980157..a03e63dbf 100644 --- a/internal/test/new/new_test.go +++ b/internal/test/new/new_test.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func TestCreatePgTAP(t *testing.T) { diff --git a/internal/testing/helper/history.go b/internal/testing/helper/history.go index 95c846b7a..7c5436dc4 100644 --- a/internal/testing/helper/history.go +++ b/internal/testing/helper/history.go @@ -1,8 +1,8 @@ package helper import ( - "github.com/supabase/cli/pkg/migration" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/v2/pkg/pgtest" ) func MockMigrationHistory(conn *pgtest.MockConn) *pgtest.MockConn { diff --git a/internal/unlink/unlink.go b/internal/unlink/unlink.go index b59f4d1f0..5750f647d 100644 --- a/internal/unlink/unlink.go +++ b/internal/unlink/unlink.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/unlink/unlink_test.go b/internal/unlink/unlink_test.go index 9b526e109..e5967005a 100644 --- a/internal/unlink/unlink_test.go +++ b/internal/unlink/unlink_test.go @@ -8,9 +8,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/utils/access_token.go b/internal/utils/access_token.go index f7ef90a01..bd48823cb 100644 --- a/internal/utils/access_token.go +++ b/internal/utils/access_token.go @@ -7,7 +7,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/utils/access_token_test.go b/internal/utils/access_token_test.go index f31988876..d05e5f3cd 100644 --- a/internal/utils/access_token_test.go +++ b/internal/utils/access_token_test.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/utils/api.go b/internal/utils/api.go index 32b199b69..271d8cebf 100644 --- a/internal/utils/api.go +++ b/internal/utils/api.go @@ -14,9 +14,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils/cloudflare" - supabase "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/v2/internal/utils/cloudflare" + supabase "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" ) const ( diff --git a/internal/utils/api_test.go b/internal/utils/api_test.go index 09365897d..8a858441e 100644 --- a/internal/utils/api_test.go +++ b/internal/utils/api_test.go @@ -10,8 +10,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils/cloudflare" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils/cloudflare" ) const host = "api.supabase.io" diff --git a/internal/utils/cloudflare/api.go b/internal/utils/cloudflare/api.go index 7c7cf10a2..eeadef033 100644 --- a/internal/utils/cloudflare/api.go +++ b/internal/utils/cloudflare/api.go @@ -4,7 +4,7 @@ import ( "net/http" "time" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/fetcher" ) type CloudflareAPI struct { diff --git a/internal/utils/cloudflare/dns.go b/internal/utils/cloudflare/dns.go index f8a06367c..739968ef9 100644 --- a/internal/utils/cloudflare/dns.go +++ b/internal/utils/cloudflare/dns.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/google/go-querystring/query" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/fetcher" ) type DNSType uint16 diff --git a/internal/utils/config.go b/internal/utils/config.go index 3f89dc75c..13af5cd34 100644 --- a/internal/utils/config.go +++ b/internal/utils/config.go @@ -12,7 +12,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/pkg/config" ) var ( diff --git a/internal/utils/connect.go b/internal/utils/connect.go index 9479d4e4f..c4f20df56 100644 --- a/internal/utils/connect.go +++ b/internal/utils/connect.go @@ -13,8 +13,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/viper" - "github.com/supabase/cli/internal/debug" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/internal/debug" + "github.com/supabase/cli/v2/pkg/pgxv5" ) func ToPostgresURL(config pgconn.Config) string { diff --git a/internal/utils/connect_test.go b/internal/utils/connect_test.go index 4ea76c126..f66b66659 100644 --- a/internal/utils/connect_test.go +++ b/internal/utils/connect_test.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/utils/cloudflare" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/utils/cloudflare" + "github.com/supabase/cli/v2/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/utils/console.go b/internal/utils/console.go index 85bebdc1e..54c36b968 100644 --- a/internal/utils/console.go +++ b/internal/utils/console.go @@ -10,7 +10,7 @@ import ( "time" "github.com/go-errors/errors" - "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/v2/pkg/cast" "golang.org/x/term" ) diff --git a/internal/utils/console_test.go b/internal/utils/console_test.go index 19857ee11..5fbd53db5 100644 --- a/internal/utils/console_test.go +++ b/internal/utils/console_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/testing/fstest" ) func TestPromptYesNo(t *testing.T) { diff --git a/internal/utils/docker_test.go b/internal/utils/docker_test.go index 6a0cdf034..ef166611b 100644 --- a/internal/utils/docker_test.go +++ b/internal/utils/docker_test.go @@ -16,7 +16,7 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/apitest" ) const ( diff --git a/internal/utils/flags/db_url.go b/internal/utils/flags/db_url.go index 013453b86..a08c6f0ba 100644 --- a/internal/utils/flags/db_url.go +++ b/internal/utils/flags/db_url.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/afero" "github.com/spf13/pflag" "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/internal/utils/credentials" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/v2/pkg/api" ) type connection int diff --git a/internal/utils/flags/project_ref.go b/internal/utils/flags/project_ref.go index 73df72353..e8f675a16 100644 --- a/internal/utils/flags/project_ref.go +++ b/internal/utils/flags/project_ref.go @@ -9,7 +9,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" "golang.org/x/term" ) diff --git a/internal/utils/flags/project_ref_test.go b/internal/utils/flags/project_ref_test.go index 9932d6176..ca910e23d 100644 --- a/internal/utils/flags/project_ref_test.go +++ b/internal/utils/flags/project_ref_test.go @@ -11,10 +11,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/internal/testing/fstest" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func TestProjectRef(t *testing.T) { diff --git a/internal/utils/release_test.go b/internal/utils/release_test.go index 25aa920e8..c5f413274 100644 --- a/internal/utils/release_test.go +++ b/internal/utils/release_test.go @@ -9,8 +9,8 @@ import ( "github.com/google/go-github/v62/github" "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" - "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/v2/pkg/cast" ) func TestLatestRelease(t *testing.T) { diff --git a/internal/utils/tenant/client.go b/internal/utils/tenant/client.go index ad0ef6aa7..f932a5310 100644 --- a/internal/utils/tenant/client.go +++ b/internal/utils/tenant/client.go @@ -6,9 +6,9 @@ import ( "time" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/fetcher" ) var ( diff --git a/internal/utils/tenant/database.go b/internal/utils/tenant/database.go index 1ae1ee6a7..4f733e29c 100644 --- a/internal/utils/tenant/database.go +++ b/internal/utils/tenant/database.go @@ -4,7 +4,7 @@ import ( "context" "github.com/go-errors/errors" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) var errDatabaseVersion = errors.New("Database version not found.") diff --git a/internal/utils/tenant/gotrue.go b/internal/utils/tenant/gotrue.go index 507a63af5..64269b276 100644 --- a/internal/utils/tenant/gotrue.go +++ b/internal/utils/tenant/gotrue.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/go-errors/errors" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/fetcher" ) var errGotrueVersion = errors.New("GoTrue version not found.") diff --git a/internal/utils/tenant/gotrue_test.go b/internal/utils/tenant/gotrue_test.go index fcc646e0d..8c08d486f 100644 --- a/internal/utils/tenant/gotrue_test.go +++ b/internal/utils/tenant/gotrue_test.go @@ -8,7 +8,7 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/fetcher" ) var mockApi = TenantAPI{Fetcher: fetcher.NewFetcher( diff --git a/internal/utils/tenant/postgrest.go b/internal/utils/tenant/postgrest.go index cb8c96d28..00293b4cf 100644 --- a/internal/utils/tenant/postgrest.go +++ b/internal/utils/tenant/postgrest.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/fetcher" ) var errPostgrestVersion = errors.New("PostgREST version not found.") diff --git a/internal/vanity_subdomains/activate/activate.go b/internal/vanity_subdomains/activate/activate.go index 133ec7edd..2a968d88c 100644 --- a/internal/vanity_subdomains/activate/activate.go +++ b/internal/vanity_subdomains/activate/activate.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef string, desiredSubdomain string, fsys afero.Fs) error { diff --git a/internal/vanity_subdomains/check/check.go b/internal/vanity_subdomains/check/check.go index 390122707..6a8bf9ddd 100644 --- a/internal/vanity_subdomains/check/check.go +++ b/internal/vanity_subdomains/check/check.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/api" ) func Run(ctx context.Context, projectRef string, desiredSubdomain string, fsys afero.Fs) error { diff --git a/internal/vanity_subdomains/delete/delete.go b/internal/vanity_subdomains/delete/delete.go index 3ee24d473..592e2880f 100644 --- a/internal/vanity_subdomains/delete/delete.go +++ b/internal/vanity_subdomains/delete/delete.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/vanity_subdomains/get/get.go b/internal/vanity_subdomains/get/get.go index b466f1895..450b54f4b 100644 --- a/internal/vanity_subdomains/get/get.go +++ b/internal/vanity_subdomains/get/get.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/main.go b/main.go index 9b54f5ec4..be8d4dc88 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/supabase/cli/cmd" + "github.com/supabase/cli/v2/cmd" ) //go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=pkg/api/types.cfg.yaml api/beta.yaml diff --git a/pkg/config/api.go b/pkg/config/api.go index ec7c4f86d..509e61e56 100644 --- a/pkg/config/api.go +++ b/pkg/config/api.go @@ -3,9 +3,9 @@ package config import ( "strings" - v1API "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/diff" + v1API "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/diff" ) type ( diff --git a/pkg/config/api_test.go b/pkg/config/api_test.go index 92859c671..951ea3c7c 100644 --- a/pkg/config/api_test.go +++ b/pkg/config/api_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - v1API "github.com/supabase/cli/pkg/api" + v1API "github.com/supabase/cli/v2/pkg/api" ) func TestApiToUpdatePostgrestConfigBody(t *testing.T) { diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 5cb551cd1..c02923df7 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -5,9 +5,9 @@ import ( "strings" "time" - v1API "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/diff" + v1API "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/diff" ) type PasswordRequirements string diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index 057c5ccdd..428a6d055 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -8,8 +8,8 @@ import ( "github.com/go-errors/errors" "github.com/stretchr/testify/assert" - v1API "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" + v1API "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" ) func newWithDefaults() auth { diff --git a/pkg/config/config.go b/pkg/config/config.go index 938016e83..425e02c12 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -30,8 +30,8 @@ import ( "github.com/joho/godotenv" "github.com/mitchellh/mapstructure" "github.com/spf13/viper" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/fetcher" "golang.org/x/mod/semver" ) diff --git a/pkg/config/db.go b/pkg/config/db.go index 2a1d31cad..e08176587 100644 --- a/pkg/config/db.go +++ b/pkg/config/db.go @@ -3,9 +3,9 @@ package config import ( "bytes" - v1API "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/diff" + v1API "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/diff" ) type PoolMode string diff --git a/pkg/config/db_test.go b/pkg/config/db_test.go index 575fd202d..8e7006d14 100644 --- a/pkg/config/db_test.go +++ b/pkg/config/db_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - v1API "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" + v1API "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" ) func TestDbSettingsToUpdatePostgresConfigBody(t *testing.T) { diff --git a/pkg/config/storage.go b/pkg/config/storage.go index b11b28a10..b56907895 100644 --- a/pkg/config/storage.go +++ b/pkg/config/storage.go @@ -1,9 +1,9 @@ package config import ( - v1API "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" - "github.com/supabase/cli/pkg/diff" + v1API "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/v2/pkg/diff" ) type ( diff --git a/pkg/config/updater.go b/pkg/config/updater.go index 445000d0b..7a6d08d08 100644 --- a/pkg/config/updater.go +++ b/pkg/config/updater.go @@ -6,7 +6,7 @@ import ( "os" "github.com/go-errors/errors" - v1API "github.com/supabase/cli/pkg/api" + v1API "github.com/supabase/cli/v2/pkg/api" ) type ConfigUpdater struct { diff --git a/pkg/config/updater_test.go b/pkg/config/updater_test.go index 471e84963..d595d60b6 100644 --- a/pkg/config/updater_test.go +++ b/pkg/config/updater_test.go @@ -8,8 +8,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - v1API "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/cast" + v1API "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/cast" ) func TestUpdateApi(t *testing.T) { diff --git a/pkg/function/api.go b/pkg/function/api.go index e3f641dee..622786dc4 100644 --- a/pkg/function/api.go +++ b/pkg/function/api.go @@ -4,7 +4,7 @@ import ( "context" "io" - "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/v2/pkg/api" ) type EdgeRuntimeAPI struct { diff --git a/pkg/function/batch.go b/pkg/function/batch.go index 43f837fc4..0b61375c9 100644 --- a/pkg/function/batch.go +++ b/pkg/function/batch.go @@ -12,8 +12,8 @@ import ( "github.com/cenkalti/backoff/v4" "github.com/docker/go-units" "github.com/go-errors/errors" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/config" ) const ( diff --git a/pkg/function/batch_test.go b/pkg/function/batch_test.go index 1489cd329..dfba2f4af 100644 --- a/pkg/function/batch_test.go +++ b/pkg/function/batch_test.go @@ -10,8 +10,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/pkg/api" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/v2/pkg/config" ) type MockBundler struct { diff --git a/pkg/migration/apply_test.go b/pkg/migration/apply_test.go index 65a75028a..060702f11 100644 --- a/pkg/migration/apply_test.go +++ b/pkg/migration/apply_test.go @@ -9,7 +9,7 @@ import ( "github.com/jackc/pgerrcode" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestPendingMigrations(t *testing.T) { diff --git a/pkg/migration/drop.go b/pkg/migration/drop.go index 362f2a9d2..68677ac26 100644 --- a/pkg/migration/drop.go +++ b/pkg/migration/drop.go @@ -7,7 +7,7 @@ import ( "github.com/go-errors/errors" "github.com/jackc/pgx/v4" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/pkg/pgxv5" ) var ( diff --git a/pkg/migration/drop_test.go b/pkg/migration/drop_test.go index d2c25ed56..a218d883f 100644 --- a/pkg/migration/drop_test.go +++ b/pkg/migration/drop_test.go @@ -6,7 +6,7 @@ import ( "github.com/jackc/pgerrcode" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) var escapedSchemas = append(ManagedSchemas, "extensions", "public") diff --git a/pkg/migration/file.go b/pkg/migration/file.go index 79da1c86a..d0bed5ad7 100644 --- a/pkg/migration/file.go +++ b/pkg/migration/file.go @@ -14,7 +14,7 @@ import ( "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" "github.com/spf13/viper" - "github.com/supabase/cli/pkg/parser" + "github.com/supabase/cli/v2/pkg/parser" ) type MigrationFile struct { diff --git a/pkg/migration/file_test.go b/pkg/migration/file_test.go index a38238f8d..3b2877c52 100644 --- a/pkg/migration/file_test.go +++ b/pkg/migration/file_test.go @@ -10,8 +10,8 @@ import ( "github.com/jackc/pgerrcode" "github.com/spf13/viper" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/parser" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/parser" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestMigrationFile(t *testing.T) { diff --git a/pkg/migration/history.go b/pkg/migration/history.go index 2ca14167b..3e6f8a362 100644 --- a/pkg/migration/history.go +++ b/pkg/migration/history.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/pkg/pgxv5" ) const ( diff --git a/pkg/migration/list.go b/pkg/migration/list.go index ec8bf2ac8..dfe9837bf 100644 --- a/pkg/migration/list.go +++ b/pkg/migration/list.go @@ -13,7 +13,7 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgerrcode" "github.com/jackc/pgx/v4" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/pkg/pgxv5" ) func ListRemoteMigrations(ctx context.Context, conn *pgx.Conn) ([]string, error) { diff --git a/pkg/migration/list_test.go b/pkg/migration/list_test.go index 80d09fd40..40a193489 100644 --- a/pkg/migration/list_test.go +++ b/pkg/migration/list_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgerrcode" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) func TestRemoteMigrations(t *testing.T) { diff --git a/pkg/migration/seed_test.go b/pkg/migration/seed_test.go index 7e9cd4aca..1d228e531 100644 --- a/pkg/migration/seed_test.go +++ b/pkg/migration/seed_test.go @@ -11,7 +11,7 @@ import ( "github.com/jackc/pgx/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/v2/pkg/pgtest" ) //go:embed testdata/seed.sql diff --git a/pkg/parser/token.go b/pkg/parser/token.go index db0084342..b939ae6cb 100644 --- a/pkg/parser/token.go +++ b/pkg/parser/token.go @@ -8,7 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/viper" - "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/v2/pkg/cast" ) // Equal to `startBufSize` from `bufio/scan.go` diff --git a/pkg/pgtest/mock.go b/pkg/pgtest/mock.go index 0f5e9bb84..daa1dbd2a 100644 --- a/pkg/pgtest/mock.go +++ b/pkg/pgtest/mock.go @@ -12,7 +12,7 @@ import ( "github.com/jackc/pgproto3/v2" "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" - "github.com/supabase/cli/pkg/pgxv5" + "github.com/supabase/cli/v2/pkg/pgxv5" "google.golang.org/grpc/test/bufconn" ) diff --git a/pkg/storage/api.go b/pkg/storage/api.go index e7765eb9f..3904b52e8 100644 --- a/pkg/storage/api.go +++ b/pkg/storage/api.go @@ -1,6 +1,6 @@ package storage -import "github.com/supabase/cli/pkg/fetcher" +import "github.com/supabase/cli/v2/pkg/fetcher" type StorageAPI struct { *fetcher.Fetcher diff --git a/pkg/storage/batch.go b/pkg/storage/batch.go index 8a681242d..dc54515b5 100644 --- a/pkg/storage/batch.go +++ b/pkg/storage/batch.go @@ -9,8 +9,8 @@ import ( "path/filepath" "github.com/go-errors/errors" - "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/pkg/queue" + "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/pkg/queue" ) func (s *StorageAPI) UpsertBuckets(ctx context.Context, bucketConfig config.BucketConfig, filter ...func(string) bool) error { diff --git a/pkg/storage/buckets.go b/pkg/storage/buckets.go index 1f4bf9cc8..b2d4fc255 100644 --- a/pkg/storage/buckets.go +++ b/pkg/storage/buckets.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/fetcher" ) type BucketResponse struct { diff --git a/pkg/storage/objects.go b/pkg/storage/objects.go index f048cecf6..3a5633cf0 100644 --- a/pkg/storage/objects.go +++ b/pkg/storage/objects.go @@ -11,7 +11,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/v2/pkg/fetcher" ) type ListObjectsQuery struct { diff --git a/tools/bumpdoc/main.go b/tools/bumpdoc/main.go index 55d9de344..10a86772e 100644 --- a/tools/bumpdoc/main.go +++ b/tools/bumpdoc/main.go @@ -12,8 +12,8 @@ import ( "regexp" "github.com/google/go-github/v62/github" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/tools/shared" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/tools/shared" ) const ( diff --git a/tools/changelog/main.go b/tools/changelog/main.go index 97b587ed4..84ce70eca 100644 --- a/tools/changelog/main.go +++ b/tools/changelog/main.go @@ -14,7 +14,7 @@ import ( "github.com/google/go-github/v62/github" "github.com/slack-go/slack" - "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/v2/internal/utils" ) func main() { diff --git a/tools/listdep/main.go b/tools/listdep/main.go index bf3c88985..6d28db52c 100644 --- a/tools/listdep/main.go +++ b/tools/listdep/main.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/v2/pkg/config" ) func main() { diff --git a/tools/publish/main.go b/tools/publish/main.go index be2474edb..c9944a293 100644 --- a/tools/publish/main.go +++ b/tools/publish/main.go @@ -16,9 +16,9 @@ import ( "text/template" "github.com/google/go-github/v62/github" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/fetcher" - "github.com/supabase/cli/tools/shared" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/v2/tools/shared" ) const ( diff --git a/tools/selfhost/main.go b/tools/selfhost/main.go index cb9ada3a0..145c53801 100644 --- a/tools/selfhost/main.go +++ b/tools/selfhost/main.go @@ -11,9 +11,9 @@ import ( "strings" "github.com/google/go-github/v62/github" - "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/config" - "github.com/supabase/cli/tools/shared" + "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/v2/tools/shared" "gopkg.in/yaml.v3" ) From bd0d25023ed2315b2a8048bbd5de60e619dbc6c4 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sat, 7 Dec 2024 23:29:25 +0800 Subject: [PATCH 14/30] chore: update test coverage --- .github/workflows/ci.yml | 9 +++++---- internal/utils/console_test.go | 12 +----------- internal/utils/flags/project_ref.go | 5 +++-- internal/utils/flags/project_ref_test.go | 7 +++++-- internal/utils/prompt.go | 4 ++-- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f4078158..ce32d176b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,12 +21,13 @@ jobs: # Required by: internal/utils/credentials/keyring_test.go - uses: t1m0thyj/unlock-keyring@v1 - run: | - go run gotest.tools/gotestsum -- ./... -race -v -count=1 \ - -coverpkg ./cmd/...,./internal/... -coverprofile=coverage.out + go run gotest.tools/gotestsum -- -race -v -count=1 -coverprofile=coverage.out \ + `go list ./... | grep -Ev 'cmd|docs|examples|pkg/api|tools'` - - uses: shogo82148/actions-goveralls@v1 + - uses: coverallsapp/github-action@v2 with: - path-to-profile: coverage.out + file: coverage.out + format: golang lint: name: Lint diff --git a/internal/utils/console_test.go b/internal/utils/console_test.go index 5fbd53db5..f7662d2d1 100644 --- a/internal/utils/console_test.go +++ b/internal/utils/console_test.go @@ -2,11 +2,9 @@ package utils import ( "context" - "os" "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "github.com/supabase/cli/v2/internal/testing/fstest" ) @@ -34,15 +32,7 @@ func TestPromptYesNo(t *testing.T) { func TestPromptText(t *testing.T) { t.Run("defaults on timeout", func(t *testing.T) { - // Setup stdin - r, _, err := os.Pipe() - require.NoError(t, err) - // Replace stdin - oldStdin := os.Stdin - defer func() { - os.Stdin = oldStdin - }() - os.Stdin = r + t.Cleanup(fstest.MockStdin(t, "")) c := NewConsole() // Run test val, err := c.PromptText(context.Background(), "test") diff --git a/internal/utils/flags/project_ref.go b/internal/utils/flags/project_ref.go index e8f675a16..6b39b02ac 100644 --- a/internal/utils/flags/project_ref.go +++ b/internal/utils/flags/project_ref.go @@ -6,6 +6,7 @@ import ( "fmt" "os" + tea "github.com/charmbracelet/bubbletea" "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" @@ -26,7 +27,7 @@ func ParseProjectRef(ctx context.Context, fsys afero.Fs) error { return errors.New(utils.ErrNotLinked) } -func PromptProjectRef(ctx context.Context, title string) error { +func PromptProjectRef(ctx context.Context, title string, opts ...tea.ProgramOption) error { resp, err := utils.GetSupabase().V1ListAllProjectsWithResponse(ctx) if err != nil { return errors.Errorf("failed to retrieve projects: %w", err) @@ -41,7 +42,7 @@ func PromptProjectRef(ctx context.Context, title string) error { Details: fmt.Sprintf("name: %s, org: %s, region: %s", project.Name, project.OrganizationId, project.Region), } } - choice, err := utils.PromptChoice(ctx, title, items) + choice, err := utils.PromptChoice(ctx, title, items, opts...) if err != nil { return err } diff --git a/internal/utils/flags/project_ref_test.go b/internal/utils/flags/project_ref_test.go index ca910e23d..ee12de886 100644 --- a/internal/utils/flags/project_ref_test.go +++ b/internal/utils/flags/project_ref_test.go @@ -4,8 +4,10 @@ import ( "context" "net/http" "os" + "strings" "testing" + tea "github.com/charmbracelet/bubbletea" "github.com/go-errors/errors" "github.com/h2non/gock" "github.com/spf13/afero" @@ -69,6 +71,7 @@ func TestProjectPrompt(t *testing.T) { t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) t.Run("validates prompt input", func(t *testing.T) { + input := tea.WithInput(strings.NewReader("\r")) // Setup mock api defer gock.OffAll() gock.New(utils.DefaultApiHost). @@ -80,9 +83,9 @@ func TestProjectPrompt(t *testing.T) { OrganizationId: "test-org", }}) // Run test - err := PromptProjectRef(context.Background(), "") + err := PromptProjectRef(context.Background(), "", input) // Check error - assert.ErrorContains(t, err, "failed to prompt choice:") + assert.NoError(t, err) assert.Empty(t, apitest.ListUnmatchedRequests()) }) diff --git a/internal/utils/prompt.go b/internal/utils/prompt.go index 8ff67d97e..5589f49d6 100644 --- a/internal/utils/prompt.go +++ b/internal/utils/prompt.go @@ -103,7 +103,7 @@ func (m model) View() string { } // Prompt user to choose from a list of items, returns the chosen index. -func PromptChoice(ctx context.Context, title string, items []PromptItem) (PromptItem, error) { +func PromptChoice(ctx context.Context, title string, items []PromptItem, opts ...tea.ProgramOption) (PromptItem, error) { // Create list items var listItems []list.Item for _, v := range items { @@ -126,7 +126,7 @@ func PromptChoice(ctx context.Context, title string, items []PromptItem) (Prompt // Create our model ctx, cancel := context.WithCancel(ctx) initial := model{cancel: cancel, list: l} - prog := tea.NewProgram(initial) + prog := tea.NewProgram(initial, opts...) state, err := prog.Run() if err != nil { return initial.choice, errors.Errorf("failed to prompt choice: %w", err) From 0e8d7c49fa3997fefc2f142075b7a6bdd2b0f6f1 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sun, 8 Dec 2024 00:23:48 +0800 Subject: [PATCH 15/30] Revert "chore: bump cli module to v2" This reverts commit e4c39e6ab3401bce21b9b6fd53ceedc29f5c993a. --- cmd/bans.go | 6 +-- cmd/bootstrap.go | 4 +- cmd/branches.go | 20 ++++---- cmd/config.go | 4 +- cmd/db.go | 32 ++++++------- cmd/domains.go | 12 ++--- cmd/encryption.go | 6 +-- cmd/functions.go | 18 ++++---- cmd/gen.go | 8 ++-- cmd/init.go | 4 +- cmd/inspect.go | 46 +++++++++---------- cmd/link.go | 6 +-- cmd/login.go | 4 +- cmd/logout.go | 2 +- cmd/migration.go | 16 +++---- cmd/orgs.go | 4 +- cmd/postgres.go | 6 +-- cmd/projects.go | 14 +++--- cmd/restrictions.go | 6 +-- cmd/root.go | 4 +- cmd/secrets.go | 8 ++-- cmd/seed.go | 6 +-- cmd/services.go | 2 +- cmd/snippets.go | 6 +-- cmd/sslEnforcement.go | 6 +-- cmd/sso.go | 16 +++---- cmd/start.go | 4 +- cmd/status.go | 4 +- cmd/stop.go | 2 +- cmd/storage.go | 12 ++--- cmd/test.go | 4 +- cmd/unlink.go | 2 +- cmd/vanitySubdomains.go | 10 ++-- docs/main.go | 4 +- examples/functions-deploy/main.go | 6 +-- examples/migrations-up/main.go | 4 +- examples/seed-buckets/main.go | 6 +-- go.mod | 21 ++++++++- go.sum | 42 +++++++++++++++++ internal/bans/get/get.go | 2 +- internal/bans/update/update.go | 4 +- internal/bootstrap/bootstrap.go | 24 +++++----- internal/bootstrap/bootstrap_test.go | 4 +- internal/branches/create/create.go | 8 ++-- internal/branches/create/create_test.go | 10 ++-- internal/branches/delete/delete.go | 2 +- internal/branches/disable/disable.go | 4 +- internal/branches/get/get.go | 4 +- internal/branches/list/list.go | 6 +-- internal/branches/update/update.go | 4 +- internal/config/push/push.go | 4 +- internal/db/branch/create/create.go | 2 +- internal/db/branch/create/create_test.go | 4 +- internal/db/branch/delete/delete.go | 2 +- internal/db/branch/delete/delete_test.go | 4 +- internal/db/branch/list/list.go | 2 +- internal/db/branch/list/list_test.go | 2 +- internal/db/branch/switch_/switch_.go | 4 +- internal/db/branch/switch_/switch__test.go | 8 ++-- internal/db/diff/diff.go | 10 ++-- internal/db/diff/diff_test.go | 16 +++---- internal/db/diff/migra.go | 4 +- internal/db/diff/pgadmin.go | 8 ++-- internal/db/dump/dump.go | 4 +- internal/db/dump/dump_test.go | 4 +- internal/db/lint/lint.go | 4 +- internal/db/lint/lint_test.go | 6 +-- internal/db/pull/pull.go | 14 +++--- internal/db/pull/pull_test.go | 10 ++-- internal/db/push/push.go | 8 ++-- internal/db/push/push_test.go | 10 ++-- internal/db/remote/changes/changes.go | 6 +-- internal/db/remote/commit/commit.go | 12 ++--- internal/db/reset/reset.go | 18 ++++---- internal/db/reset/reset_test.go | 16 +++---- internal/db/start/start.go | 8 ++-- internal/db/start/start_test.go | 10 ++-- internal/db/test/test.go | 4 +- internal/db/test/test_test.go | 8 ++-- internal/debug/postgres_test.go | 2 +- internal/encryption/get/get.go | 2 +- internal/encryption/get/get_test.go | 6 +-- internal/encryption/update/update.go | 6 +-- internal/encryption/update/update_test.go | 6 +-- internal/functions/delete/delete.go | 2 +- internal/functions/delete/delete_test.go | 4 +- internal/functions/deploy/bundle.go | 4 +- internal/functions/deploy/bundle_test.go | 4 +- internal/functions/deploy/deploy.go | 10 ++-- internal/functions/deploy/deploy_test.go | 10 ++-- internal/functions/download/download.go | 4 +- internal/functions/download/download_test.go | 6 +-- internal/functions/list/list.go | 4 +- internal/functions/list/list_test.go | 6 +-- internal/functions/new/new.go | 2 +- internal/functions/new/new_test.go | 2 +- internal/functions/serve/serve.go | 6 +-- internal/functions/serve/serve_test.go | 6 +-- internal/gen/keys/keys.go | 4 +- internal/gen/types/types.go | 4 +- internal/gen/types/types_test.go | 8 ++-- internal/hostnames/activate/activate.go | 4 +- internal/hostnames/common.go | 4 +- internal/hostnames/create/create.go | 6 +-- internal/hostnames/delete/delete.go | 2 +- internal/hostnames/get/get.go | 2 +- internal/hostnames/reverify/reverify.go | 4 +- internal/init/init.go | 2 +- internal/init/init_test.go | 6 +-- internal/inspect/bloat/bloat.go | 8 ++-- internal/inspect/bloat/bloat_test.go | 6 +-- internal/inspect/blocking/blocking.go | 6 +-- internal/inspect/blocking/blocking_test.go | 2 +- internal/inspect/cache/cache.go | 6 +-- internal/inspect/cache/cache_test.go | 2 +- internal/inspect/calls/calls.go | 6 +-- internal/inspect/calls/calls_test.go | 2 +- internal/inspect/index_sizes/index_sizes.go | 8 ++-- .../inspect/index_sizes/index_sizes_test.go | 6 +-- internal/inspect/index_usage/index_usage.go | 8 ++-- .../inspect/index_usage/index_usage_test.go | 6 +-- internal/inspect/locks/locks.go | 6 +-- internal/inspect/locks/locks_test.go | 2 +- .../long_running_queries.go | 6 +-- .../long_running_queries_test.go | 2 +- internal/inspect/outliers/outliers.go | 6 +-- internal/inspect/outliers/outliers_test.go | 2 +- .../replication_slots/replication_slots.go | 6 +-- .../replication_slots_test.go | 2 +- internal/inspect/report.go | 4 +- internal/inspect/report_test.go | 42 ++++++++--------- internal/inspect/role_configs/role_configs.go | 6 +-- .../inspect/role_configs/role_configs_test.go | 2 +- .../role_connections/role_connections.go | 6 +-- .../role_connections/role_connections_test.go | 2 +- internal/inspect/seq_scans/seq_scans.go | 8 ++-- internal/inspect/seq_scans/seq_scans_test.go | 6 +-- .../table_index_sizes/table_index_sizes.go | 8 ++-- .../table_index_sizes_test.go | 6 +-- .../table_record_counts.go | 8 ++-- .../table_record_counts_test.go | 6 +-- internal/inspect/table_sizes/table_sizes.go | 8 ++-- .../inspect/table_sizes/table_sizes_test.go | 6 +-- .../total_index_size/total_index_size.go | 8 ++-- .../total_index_size/total_index_size_test.go | 6 +-- .../total_table_sizes/total_table_sizes.go | 8 ++-- .../total_table_sizes_test.go | 6 +-- .../inspect/unused_indexes/unused_indexes.go | 8 ++-- .../unused_indexes/unused_indexes_test.go | 6 +-- internal/inspect/vacuum_stats/vacuum_stats.go | 8 ++-- .../inspect/vacuum_stats/vacuum_stats_test.go | 6 +-- internal/link/link.go | 18 ++++---- internal/link/link_test.go | 16 +++---- internal/login/login.go | 6 +-- internal/login/login_test.go | 6 +-- internal/logout/logout.go | 4 +- internal/logout/logout_test.go | 8 ++-- internal/migration/apply/apply.go | 6 +-- internal/migration/apply/apply_test.go | 10 ++-- internal/migration/fetch/fetch.go | 4 +- internal/migration/list/list.go | 4 +- internal/migration/list/list_test.go | 8 ++-- internal/migration/new/new.go | 2 +- internal/migration/new/new_test.go | 2 +- internal/migration/repair/repair.go | 6 +-- internal/migration/repair/repair_test.go | 10 ++-- internal/migration/squash/squash.go | 14 +++--- internal/migration/squash/squash_test.go | 16 +++---- internal/migration/up/up.go | 4 +- internal/migration/up/up_test.go | 8 ++-- internal/orgs/create/create.go | 4 +- internal/orgs/create/create_test.go | 6 +-- internal/orgs/list/list.go | 4 +- internal/orgs/list/list_test.go | 6 +-- internal/postgresConfig/get/get.go | 4 +- internal/postgresConfig/update/update.go | 4 +- internal/projects/apiKeys/api_keys.go | 6 +-- internal/projects/apiKeys/api_keys_test.go | 6 +-- internal/projects/create/create.go | 8 ++-- internal/projects/create/create_test.go | 6 +-- internal/projects/delete/delete.go | 6 +-- internal/projects/delete/delete_test.go | 6 +-- internal/projects/list/list.go | 8 ++-- internal/projects/list/list_test.go | 6 +-- internal/restrictions/get/get.go | 2 +- internal/restrictions/update/update.go | 4 +- internal/restrictions/update/update_test.go | 6 +-- internal/secrets/list/list.go | 6 +-- internal/secrets/list/list_test.go | 6 +-- internal/secrets/set/set.go | 4 +- internal/secrets/set/set_test.go | 6 +-- internal/secrets/unset/unset.go | 4 +- internal/secrets/unset/unset_test.go | 6 +-- internal/seed/buckets/buckets.go | 4 +- internal/seed/buckets/buckets_test.go | 6 +-- internal/services/services.go | 8 ++-- internal/snippets/download/download.go | 2 +- internal/snippets/list/list.go | 8 ++-- internal/ssl_enforcement/get/get.go | 2 +- internal/ssl_enforcement/update/update.go | 4 +- internal/sso/create/create.go | 8 ++-- internal/sso/get/get.go | 6 +-- internal/sso/get/get_test.go | 4 +- internal/sso/info/info.go | 4 +- internal/sso/internal/render/render.go | 6 +-- internal/sso/internal/saml/files.go | 4 +- internal/sso/list/list.go | 4 +- internal/sso/list/list_test.go | 4 +- internal/sso/remove/remove.go | 6 +-- internal/sso/remove/remove_test.go | 4 +- internal/sso/update/update.go | 8 ++-- internal/sso/update/update_test.go | 6 +-- internal/start/start.go | 16 +++---- internal/start/start_test.go | 10 ++-- internal/status/status.go | 4 +- internal/status/status_test.go | 4 +- internal/stop/stop.go | 2 +- internal/stop/stop_test.go | 4 +- internal/storage/client/api.go | 10 ++-- internal/storage/cp/cp.go | 12 ++--- internal/storage/cp/cp_test.go | 14 +++--- internal/storage/ls/ls.go | 6 +-- internal/storage/ls/ls_test.go | 16 +++---- internal/storage/mv/mv.go | 8 ++-- internal/storage/mv/mv_test.go | 14 +++--- internal/storage/rm/rm.go | 12 ++--- internal/storage/rm/rm_test.go | 16 +++---- internal/test/new/new.go | 2 +- internal/test/new/new_test.go | 2 +- internal/testing/helper/history.go | 4 +- internal/unlink/unlink.go | 4 +- internal/unlink/unlink_test.go | 6 +-- internal/utils/access_token.go | 2 +- internal/utils/access_token_test.go | 6 +-- internal/utils/api.go | 6 +-- internal/utils/api_test.go | 4 +- internal/utils/cloudflare/api.go | 2 +- internal/utils/cloudflare/dns.go | 2 +- internal/utils/config.go | 2 +- internal/utils/connect.go | 4 +- internal/utils/connect_test.go | 6 +-- internal/utils/console.go | 2 +- internal/utils/console_test.go | 2 +- internal/utils/docker_test.go | 2 +- internal/utils/flags/db_url.go | 6 +-- internal/utils/flags/project_ref.go | 2 +- internal/utils/flags/project_ref_test.go | 8 ++-- internal/utils/release_test.go | 4 +- internal/utils/tenant/client.go | 6 +-- internal/utils/tenant/database.go | 2 +- internal/utils/tenant/gotrue.go | 2 +- internal/utils/tenant/gotrue_test.go | 2 +- internal/utils/tenant/postgrest.go | 2 +- .../vanity_subdomains/activate/activate.go | 4 +- internal/vanity_subdomains/check/check.go | 4 +- internal/vanity_subdomains/delete/delete.go | 2 +- internal/vanity_subdomains/get/get.go | 2 +- main.go | 2 +- pkg/config/api.go | 6 +-- pkg/config/api_test.go | 2 +- pkg/config/auth.go | 6 +-- pkg/config/auth_test.go | 4 +- pkg/config/config.go | 4 +- pkg/config/db.go | 6 +-- pkg/config/db_test.go | 4 +- pkg/config/storage.go | 6 +-- pkg/config/updater.go | 2 +- pkg/config/updater_test.go | 4 +- pkg/function/api.go | 2 +- pkg/function/batch.go | 4 +- pkg/function/batch_test.go | 4 +- pkg/migration/apply_test.go | 2 +- pkg/migration/drop.go | 2 +- pkg/migration/drop_test.go | 2 +- pkg/migration/file.go | 2 +- pkg/migration/file_test.go | 4 +- pkg/migration/history.go | 2 +- pkg/migration/list.go | 2 +- pkg/migration/list_test.go | 2 +- pkg/migration/seed_test.go | 2 +- pkg/parser/token.go | 2 +- pkg/pgtest/mock.go | 2 +- pkg/storage/api.go | 2 +- pkg/storage/batch.go | 4 +- pkg/storage/buckets.go | 2 +- pkg/storage/objects.go | 2 +- tools/bumpdoc/main.go | 4 +- tools/changelog/main.go | 2 +- tools/listdep/main.go | 2 +- tools/publish/main.go | 6 +-- tools/selfhost/main.go | 6 +-- 291 files changed, 939 insertions(+), 878 deletions(-) diff --git a/cmd/bans.go b/cmd/bans.go index 6f930c042..603e2dd4d 100644 --- a/cmd/bans.go +++ b/cmd/bans.go @@ -3,9 +3,9 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/bans/get" - "github.com/supabase/cli/v2/internal/bans/update" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/bans/get" + "github.com/supabase/cli/internal/bans/update" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/bootstrap.go b/cmd/bootstrap.go index 21d24fb1f..fd9f74912 100644 --- a/cmd/bootstrap.go +++ b/cmd/bootstrap.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/bootstrap" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/bootstrap" + "github.com/supabase/cli/internal/utils" ) var ( diff --git a/cmd/branches.go b/cmd/branches.go index dd0897d9f..0248e7f31 100644 --- a/cmd/branches.go +++ b/cmd/branches.go @@ -8,16 +8,16 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/branches/create" - "github.com/supabase/cli/v2/internal/branches/delete" - "github.com/supabase/cli/v2/internal/branches/disable" - "github.com/supabase/cli/v2/internal/branches/get" - "github.com/supabase/cli/v2/internal/branches/list" - "github.com/supabase/cli/v2/internal/branches/update" - "github.com/supabase/cli/v2/internal/gen/keys" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/branches/create" + "github.com/supabase/cli/internal/branches/delete" + "github.com/supabase/cli/internal/branches/disable" + "github.com/supabase/cli/internal/branches/get" + "github.com/supabase/cli/internal/branches/list" + "github.com/supabase/cli/internal/branches/update" + "github.com/supabase/cli/internal/gen/keys" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" ) var ( diff --git a/cmd/config.go b/cmd/config.go index 0b0657506..1d0f60733 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -3,8 +3,8 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/config/push" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/config/push" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/db.go b/cmd/db.go index 6737f543e..2d64edd74 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -8,22 +8,22 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/db/branch/create" - "github.com/supabase/cli/v2/internal/db/branch/delete" - "github.com/supabase/cli/v2/internal/db/branch/list" - "github.com/supabase/cli/v2/internal/db/branch/switch_" - "github.com/supabase/cli/v2/internal/db/diff" - "github.com/supabase/cli/v2/internal/db/dump" - "github.com/supabase/cli/v2/internal/db/lint" - "github.com/supabase/cli/v2/internal/db/pull" - "github.com/supabase/cli/v2/internal/db/push" - "github.com/supabase/cli/v2/internal/db/remote/changes" - "github.com/supabase/cli/v2/internal/db/remote/commit" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/db/test" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/db/branch/create" + "github.com/supabase/cli/internal/db/branch/delete" + "github.com/supabase/cli/internal/db/branch/list" + "github.com/supabase/cli/internal/db/branch/switch_" + "github.com/supabase/cli/internal/db/diff" + "github.com/supabase/cli/internal/db/dump" + "github.com/supabase/cli/internal/db/lint" + "github.com/supabase/cli/internal/db/pull" + "github.com/supabase/cli/internal/db/push" + "github.com/supabase/cli/internal/db/remote/changes" + "github.com/supabase/cli/internal/db/remote/commit" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/db/test" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/domains.go b/cmd/domains.go index cbc9ecb6e..9ec4a097d 100644 --- a/cmd/domains.go +++ b/cmd/domains.go @@ -3,12 +3,12 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/hostnames/activate" - "github.com/supabase/cli/v2/internal/hostnames/create" - "github.com/supabase/cli/v2/internal/hostnames/delete" - "github.com/supabase/cli/v2/internal/hostnames/get" - "github.com/supabase/cli/v2/internal/hostnames/reverify" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/hostnames/activate" + "github.com/supabase/cli/internal/hostnames/create" + "github.com/supabase/cli/internal/hostnames/delete" + "github.com/supabase/cli/internal/hostnames/get" + "github.com/supabase/cli/internal/hostnames/reverify" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/encryption.go b/cmd/encryption.go index 5e93d432a..d3b654afc 100644 --- a/cmd/encryption.go +++ b/cmd/encryption.go @@ -4,9 +4,9 @@ import ( "os" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/encryption/get" - "github.com/supabase/cli/v2/internal/encryption/update" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/encryption/get" + "github.com/supabase/cli/internal/encryption/update" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/functions.go b/cmd/functions.go index b765a41ed..36dc47f94 100644 --- a/cmd/functions.go +++ b/cmd/functions.go @@ -5,15 +5,15 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/functions/delete" - "github.com/supabase/cli/v2/internal/functions/deploy" - "github.com/supabase/cli/v2/internal/functions/download" - "github.com/supabase/cli/v2/internal/functions/list" - new_ "github.com/supabase/cli/v2/internal/functions/new" - "github.com/supabase/cli/v2/internal/functions/serve" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/internal/functions/delete" + "github.com/supabase/cli/internal/functions/deploy" + "github.com/supabase/cli/internal/functions/download" + "github.com/supabase/cli/internal/functions/list" + new_ "github.com/supabase/cli/internal/functions/new" + "github.com/supabase/cli/internal/functions/serve" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/cast" ) var ( diff --git a/cmd/gen.go b/cmd/gen.go index 9c6e66129..1789e29ca 100644 --- a/cmd/gen.go +++ b/cmd/gen.go @@ -8,10 +8,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/gen/keys" - "github.com/supabase/cli/v2/internal/gen/types" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/gen/keys" + "github.com/supabase/cli/internal/gen/types" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/init.go b/cmd/init.go index ed9684c23..a9d2d90a8 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -8,8 +8,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - _init "github.com/supabase/cli/v2/internal/init" - "github.com/supabase/cli/v2/internal/utils" + _init "github.com/supabase/cli/internal/init" + "github.com/supabase/cli/internal/utils" ) var ( diff --git a/cmd/inspect.go b/cmd/inspect.go index 29b69795a..2b55c3876 100644 --- a/cmd/inspect.go +++ b/cmd/inspect.go @@ -8,30 +8,30 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/inspect/bloat" - "github.com/supabase/cli/v2/internal/inspect/blocking" - "github.com/supabase/cli/v2/internal/inspect/cache" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/inspect/bloat" + "github.com/supabase/cli/internal/inspect/blocking" + "github.com/supabase/cli/internal/inspect/cache" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" - "github.com/supabase/cli/v2/internal/inspect" - "github.com/supabase/cli/v2/internal/inspect/calls" - "github.com/supabase/cli/v2/internal/inspect/index_sizes" - "github.com/supabase/cli/v2/internal/inspect/index_usage" - "github.com/supabase/cli/v2/internal/inspect/locks" - "github.com/supabase/cli/v2/internal/inspect/long_running_queries" - "github.com/supabase/cli/v2/internal/inspect/outliers" - "github.com/supabase/cli/v2/internal/inspect/replication_slots" - "github.com/supabase/cli/v2/internal/inspect/role_configs" - "github.com/supabase/cli/v2/internal/inspect/role_connections" - "github.com/supabase/cli/v2/internal/inspect/seq_scans" - "github.com/supabase/cli/v2/internal/inspect/table_index_sizes" - "github.com/supabase/cli/v2/internal/inspect/table_record_counts" - "github.com/supabase/cli/v2/internal/inspect/table_sizes" - "github.com/supabase/cli/v2/internal/inspect/total_index_size" - "github.com/supabase/cli/v2/internal/inspect/total_table_sizes" - "github.com/supabase/cli/v2/internal/inspect/unused_indexes" - "github.com/supabase/cli/v2/internal/inspect/vacuum_stats" + "github.com/supabase/cli/internal/inspect" + "github.com/supabase/cli/internal/inspect/calls" + "github.com/supabase/cli/internal/inspect/index_sizes" + "github.com/supabase/cli/internal/inspect/index_usage" + "github.com/supabase/cli/internal/inspect/locks" + "github.com/supabase/cli/internal/inspect/long_running_queries" + "github.com/supabase/cli/internal/inspect/outliers" + "github.com/supabase/cli/internal/inspect/replication_slots" + "github.com/supabase/cli/internal/inspect/role_configs" + "github.com/supabase/cli/internal/inspect/role_connections" + "github.com/supabase/cli/internal/inspect/seq_scans" + "github.com/supabase/cli/internal/inspect/table_index_sizes" + "github.com/supabase/cli/internal/inspect/table_record_counts" + "github.com/supabase/cli/internal/inspect/table_sizes" + "github.com/supabase/cli/internal/inspect/total_index_size" + "github.com/supabase/cli/internal/inspect/total_table_sizes" + "github.com/supabase/cli/internal/inspect/unused_indexes" + "github.com/supabase/cli/internal/inspect/vacuum_stats" ) var ( diff --git a/cmd/link.go b/cmd/link.go index ee947c060..b1aec1d7a 100644 --- a/cmd/link.go +++ b/cmd/link.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/link" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/link" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" "golang.org/x/term" ) diff --git a/cmd/login.go b/cmd/login.go index e186d0d04..ca9aea666 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/login" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/login" + "github.com/supabase/cli/internal/utils" "golang.org/x/term" ) diff --git a/cmd/logout.go b/cmd/logout.go index 52559d204..dda3dd4cc 100644 --- a/cmd/logout.go +++ b/cmd/logout.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/logout" + "github.com/supabase/cli/internal/logout" ) var ( diff --git a/cmd/migration.go b/cmd/migration.go index 1224c6659..30b7716ac 100644 --- a/cmd/migration.go +++ b/cmd/migration.go @@ -8,14 +8,14 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/migration/fetch" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/migration/new" - "github.com/supabase/cli/v2/internal/migration/repair" - "github.com/supabase/cli/v2/internal/migration/squash" - "github.com/supabase/cli/v2/internal/migration/up" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/migration/fetch" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/migration/new" + "github.com/supabase/cli/internal/migration/repair" + "github.com/supabase/cli/internal/migration/squash" + "github.com/supabase/cli/internal/migration/up" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/orgs.go b/cmd/orgs.go index ace1cd960..5d0750dbb 100644 --- a/cmd/orgs.go +++ b/cmd/orgs.go @@ -2,8 +2,8 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/orgs/create" - "github.com/supabase/cli/v2/internal/orgs/list" + "github.com/supabase/cli/internal/orgs/create" + "github.com/supabase/cli/internal/orgs/list" ) var ( diff --git a/cmd/postgres.go b/cmd/postgres.go index c1e84ca72..1c2e0e127 100644 --- a/cmd/postgres.go +++ b/cmd/postgres.go @@ -3,9 +3,9 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/postgresConfig/get" - "github.com/supabase/cli/v2/internal/postgresConfig/update" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/postgresConfig/get" + "github.com/supabase/cli/internal/postgresConfig/update" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/projects.go b/cmd/projects.go index 4b214c517..c119e7171 100644 --- a/cmd/projects.go +++ b/cmd/projects.go @@ -7,13 +7,13 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/projects/apiKeys" - "github.com/supabase/cli/v2/internal/projects/create" - "github.com/supabase/cli/v2/internal/projects/delete" - "github.com/supabase/cli/v2/internal/projects/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/projects/apiKeys" + "github.com/supabase/cli/internal/projects/create" + "github.com/supabase/cli/internal/projects/delete" + "github.com/supabase/cli/internal/projects/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" "golang.org/x/term" ) diff --git a/cmd/restrictions.go b/cmd/restrictions.go index beb1bbf7d..4358d6132 100644 --- a/cmd/restrictions.go +++ b/cmd/restrictions.go @@ -2,9 +2,9 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/restrictions/get" - "github.com/supabase/cli/v2/internal/restrictions/update" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/restrictions/get" + "github.com/supabase/cli/internal/restrictions/update" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/root.go b/cmd/root.go index 8906ef32e..35540a897 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,8 +15,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" "golang.org/x/mod/semver" ) diff --git a/cmd/secrets.go b/cmd/secrets.go index f4ee8d09e..df4084e46 100644 --- a/cmd/secrets.go +++ b/cmd/secrets.go @@ -3,10 +3,10 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/secrets/list" - "github.com/supabase/cli/v2/internal/secrets/set" - "github.com/supabase/cli/v2/internal/secrets/unset" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/secrets/list" + "github.com/supabase/cli/internal/secrets/set" + "github.com/supabase/cli/internal/secrets/unset" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/seed.go b/cmd/seed.go index 7cac7c325..c36b70741 100644 --- a/cmd/seed.go +++ b/cmd/seed.go @@ -6,9 +6,9 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/seed/buckets" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/seed/buckets" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/services.go b/cmd/services.go index 2fc80e6b0..fe298cb43 100644 --- a/cmd/services.go +++ b/cmd/services.go @@ -3,7 +3,7 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/services" + "github.com/supabase/cli/internal/services" ) var ( diff --git a/cmd/snippets.go b/cmd/snippets.go index 848e9b7d9..f69b232af 100644 --- a/cmd/snippets.go +++ b/cmd/snippets.go @@ -3,9 +3,9 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/snippets/download" - "github.com/supabase/cli/v2/internal/snippets/list" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/snippets/download" + "github.com/supabase/cli/internal/snippets/list" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/sslEnforcement.go b/cmd/sslEnforcement.go index 3a7351484..7b44d6ddb 100644 --- a/cmd/sslEnforcement.go +++ b/cmd/sslEnforcement.go @@ -4,9 +4,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/ssl_enforcement/get" - "github.com/supabase/cli/v2/internal/ssl_enforcement/update" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/ssl_enforcement/get" + "github.com/supabase/cli/internal/ssl_enforcement/update" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/sso.go b/cmd/sso.go index 8c7f3109f..a9b4db7d3 100644 --- a/cmd/sso.go +++ b/cmd/sso.go @@ -4,14 +4,14 @@ import ( "github.com/go-errors/errors" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/sso/create" - "github.com/supabase/cli/v2/internal/sso/get" - "github.com/supabase/cli/v2/internal/sso/info" - "github.com/supabase/cli/v2/internal/sso/list" - "github.com/supabase/cli/v2/internal/sso/remove" - "github.com/supabase/cli/v2/internal/sso/update" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/sso/create" + "github.com/supabase/cli/internal/sso/get" + "github.com/supabase/cli/internal/sso/info" + "github.com/supabase/cli/internal/sso/list" + "github.com/supabase/cli/internal/sso/remove" + "github.com/supabase/cli/internal/sso/update" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" ) var ( diff --git a/cmd/start.go b/cmd/start.go index bbdf54d0f..a7af80e0c 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -8,8 +8,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/start" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/start" + "github.com/supabase/cli/internal/utils" ) func validateExcludedContainers(excludedContainers []string) { diff --git a/cmd/status.go b/cmd/status.go index f082a432e..13540bfb1 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -7,8 +7,8 @@ import ( env "github.com/Netflix/go-env" "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/status" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/status" + "github.com/supabase/cli/internal/utils" ) var ( diff --git a/cmd/stop.go b/cmd/stop.go index 797651107..6a6f4aa55 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/stop" + "github.com/supabase/cli/internal/stop" ) var ( diff --git a/cmd/storage.go b/cmd/storage.go index 8269baac0..3e6eb8fea 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -3,12 +3,12 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/storage/client" - "github.com/supabase/cli/v2/internal/storage/cp" - "github.com/supabase/cli/v2/internal/storage/ls" - "github.com/supabase/cli/v2/internal/storage/mv" - "github.com/supabase/cli/v2/internal/storage/rm" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/storage/client" + "github.com/supabase/cli/internal/storage/cp" + "github.com/supabase/cli/internal/storage/ls" + "github.com/supabase/cli/internal/storage/mv" + "github.com/supabase/cli/internal/storage/rm" + "github.com/supabase/cli/pkg/storage" ) var ( diff --git a/cmd/test.go b/cmd/test.go index 91ac6def8..06fb77730 100644 --- a/cmd/test.go +++ b/cmd/test.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/test/new" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/test/new" + "github.com/supabase/cli/internal/utils" ) var ( diff --git a/cmd/unlink.go b/cmd/unlink.go index 8b0f726f7..e017e75ed 100644 --- a/cmd/unlink.go +++ b/cmd/unlink.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/unlink" + "github.com/supabase/cli/internal/unlink" ) var ( diff --git a/cmd/vanitySubdomains.go b/cmd/vanitySubdomains.go index 47f3de7b7..dd3608c53 100644 --- a/cmd/vanitySubdomains.go +++ b/cmd/vanitySubdomains.go @@ -3,11 +3,11 @@ package cmd import ( "github.com/spf13/afero" "github.com/spf13/cobra" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/internal/vanity_subdomains/activate" - "github.com/supabase/cli/v2/internal/vanity_subdomains/check" - "github.com/supabase/cli/v2/internal/vanity_subdomains/delete" - "github.com/supabase/cli/v2/internal/vanity_subdomains/get" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/internal/vanity_subdomains/activate" + "github.com/supabase/cli/internal/vanity_subdomains/check" + "github.com/supabase/cli/internal/vanity_subdomains/delete" + "github.com/supabase/cli/internal/vanity_subdomains/get" ) var ( diff --git a/docs/main.go b/docs/main.go index c7cacc82b..bfacba311 100644 --- a/docs/main.go +++ b/docs/main.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - cli "github.com/supabase/cli/v2/cmd" - "github.com/supabase/cli/v2/internal/utils" + cli "github.com/supabase/cli/cmd" + "github.com/supabase/cli/internal/utils" "gopkg.in/yaml.v3" ) diff --git a/examples/functions-deploy/main.go b/examples/functions-deploy/main.go index e3f7b0469..716ef1462 100644 --- a/examples/functions-deploy/main.go +++ b/examples/functions-deploy/main.go @@ -8,9 +8,9 @@ import ( "os" "time" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/pkg/function" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/pkg/function" ) func main() { diff --git a/examples/migrations-up/main.go b/examples/migrations-up/main.go index 4ff759e95..3ef03242b 100644 --- a/examples/migrations-up/main.go +++ b/examples/migrations-up/main.go @@ -6,8 +6,8 @@ import ( "log" "os" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgxv5" ) func main() { diff --git a/examples/seed-buckets/main.go b/examples/seed-buckets/main.go index 8cd8f69e1..2c62b1084 100644 --- a/examples/seed-buckets/main.go +++ b/examples/seed-buckets/main.go @@ -8,9 +8,9 @@ import ( "os" "time" - "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/pkg/fetcher" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/pkg/storage" ) func main() { diff --git a/go.mod b/go.mod index c33559c93..1c55174b8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/supabase/cli/v2 +module github.com/supabase/cli go 1.23.2 @@ -18,6 +18,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/getsentry/sentry-go v0.30.0 + github.com/gin-gonic/gin v1.10.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.12.0 github.com/go-xmlfmt/xmlfmt v1.1.3 @@ -34,6 +35,7 @@ require ( github.com/jackc/pgtype v1.14.4 github.com/jackc/pgx/v4 v4.18.3 github.com/joho/godotenv v1.5.1 + github.com/matoous/go-nanoid/v2 v2.1.0 github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/runtime v1.1.1 @@ -93,6 +95,8 @@ require ( github.com/breml/errchkjson v0.4.0 // indirect github.com/butuzov/ireturn v0.3.0 // indirect github.com/butuzov/mirror v1.2.0 // indirect + github.com/bytedance/sonic v1.11.6 // indirect + github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -102,6 +106,8 @@ require ( github.com/chavacava/garif v0.1.0 // indirect github.com/ckaznocha/intrange v0.2.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containers/storage v1.56.0 // indirect @@ -127,8 +133,10 @@ require ( github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/getkin/kin-openapi v0.124.0 // indirect github.com/ghostiam/protogetter v0.3.8 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-critic/go-critic v0.11.5 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect @@ -136,6 +144,9 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.20.0 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.2.0 // indirect @@ -145,6 +156,7 @@ require ( github.com/go-toolsmith/typep v1.1.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gobwas/glob v0.2.3 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -184,11 +196,13 @@ require ( github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jjti/go-spancheck v0.6.2 // indirect github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/julz/importas v0.1.0 // indirect github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kisielk/errcheck v1.8.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kulti/thelper v0.6.3 // indirect @@ -197,6 +211,7 @@ require ( github.com/lasiar/canonicalheader v1.1.2 // indirect github.com/ldez/gomoddirectives v0.2.4 // indirect github.com/ldez/tagliatelle v0.5.0 // indirect + github.com/leodido/go-urn v1.4.0 // indirect github.com/leonklingele/grouper v1.1.2 // indirect github.com/lib/pq v1.10.9 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect @@ -219,6 +234,8 @@ require ( github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/term v0.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/moricho/tparallel v0.3.2 // indirect github.com/morikuni/aec v1.0.0 // indirect @@ -281,6 +298,7 @@ require ( github.com/timonwong/loggercheck v0.10.1 // indirect github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.1.1 // indirect @@ -313,6 +331,7 @@ require ( go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.9.0 // indirect go.uber.org/zap v1.24.0 // indirect + golang.org/x/arch v0.8.0 // indirect golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect diff --git a/go.sum b/go.sum index 29f788f41..9313587d7 100644 --- a/go.sum +++ b/go.sum @@ -147,6 +147,10 @@ github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= +github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= +github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= @@ -185,6 +189,10 @@ github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= @@ -279,12 +287,18 @@ github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQ github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= github.com/ghostiam/protogetter v0.3.8 h1:LYcXbYvybUyTIxN2Mj9h6rHrDZBDwZloPoKctWrFyJY= github.com/ghostiam/protogetter v0.3.8/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-critic/go-critic v0.11.5 h1:TkDTOn5v7EEngMxu8KbuFqFR43USaaH8XRJLz1jhVYA= @@ -317,6 +331,14 @@ github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1 github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= +github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -353,6 +375,8 @@ github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUW github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= @@ -578,6 +602,7 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -597,6 +622,10 @@ github.com/kisielk/errcheck v1.8.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -623,6 +652,8 @@ github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJ github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/lib/pq v0.0.0-20150723085316-0dad96c0b94f/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -645,6 +676,8 @@ github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= +github.com/matoous/go-nanoid/v2 v2.1.0 h1:P64+dmq21hhWdtvZfEAofnvJULaRR1Yib0+PnU669bE= +github.com/matoous/go-nanoid/v2 v2.1.0/go.mod h1:KlbGNQ+FhrUNIHUxZdL63t7tl4LaPkZNpUULS8H4uVM= github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2srm/LN17lpybq15AryXIRcWYLE= github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= @@ -691,9 +724,11 @@ github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiT github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= @@ -936,6 +971,8 @@ github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+ github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= @@ -1037,6 +1074,9 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1508,6 +1548,8 @@ mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/internal/bans/get/get.go b/internal/bans/get/get.go index f6f63c401..a9e52901d 100644 --- a/internal/bans/get/get.go +++ b/internal/bans/get/get.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/bans/update/update.go b/internal/bans/update/update.go index 496f187ed..dfb31d8cf 100644 --- a/internal/bans/update/update.go +++ b/internal/bans/update/update.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func validateIps(ips []string) error { diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index aecbdd6e1..677ef1530 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -19,18 +19,18 @@ import ( "github.com/joho/godotenv" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/db/push" - initBlank "github.com/supabase/cli/v2/internal/init" - "github.com/supabase/cli/v2/internal/link" - "github.com/supabase/cli/v2/internal/login" - "github.com/supabase/cli/v2/internal/projects/apiKeys" - "github.com/supabase/cli/v2/internal/projects/create" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/internal/utils/tenant" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/fetcher" - "github.com/supabase/cli/v2/pkg/queue" + "github.com/supabase/cli/internal/db/push" + initBlank "github.com/supabase/cli/internal/init" + "github.com/supabase/cli/internal/link" + "github.com/supabase/cli/internal/login" + "github.com/supabase/cli/internal/projects/apiKeys" + "github.com/supabase/cli/internal/projects/create" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/internal/utils/tenant" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/pkg/queue" "golang.org/x/term" ) diff --git a/internal/bootstrap/bootstrap_test.go b/internal/bootstrap/bootstrap_test.go index 8dd89d46d..6cf6eb6e4 100644 --- a/internal/bootstrap/bootstrap_test.go +++ b/internal/bootstrap/bootstrap_test.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" ) func TestSuggestAppStart(t *testing.T) { diff --git a/internal/branches/create/create.go b/internal/branches/create/create.go index 63dbaad6f..bf2931b68 100644 --- a/internal/branches/create/create.go +++ b/internal/branches/create/create.go @@ -6,10 +6,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/gen/keys" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/gen/keys" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, body api.CreateBranchBody, fsys afero.Fs) error { diff --git a/internal/branches/create/create_test.go b/internal/branches/create/create_test.go index d58ed55ad..e07e10387 100644 --- a/internal/branches/create/create_test.go +++ b/internal/branches/create/create_test.go @@ -10,11 +10,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" ) func TestCreateCommand(t *testing.T) { diff --git a/internal/branches/delete/delete.go b/internal/branches/delete/delete.go index 568fd56c0..b7fdd6671 100644 --- a/internal/branches/delete/delete.go +++ b/internal/branches/delete/delete.go @@ -6,7 +6,7 @@ import ( "net/http" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, branchId string) error { diff --git a/internal/branches/disable/disable.go b/internal/branches/disable/disable.go index b7d54f293..d94c1e6c5 100644 --- a/internal/branches/disable/disable.go +++ b/internal/branches/disable/disable.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" ) func Run(ctx context.Context, fsys afero.Fs) error { diff --git a/internal/branches/get/get.go b/internal/branches/get/get.go index 19f04a58e..ee5bc332c 100644 --- a/internal/branches/get/get.go +++ b/internal/branches/get/get.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, branchId string) error { diff --git a/internal/branches/list/list.go b/internal/branches/list/list.go index d40b3824a..7a153138f 100644 --- a/internal/branches/list/list.go +++ b/internal/branches/list/list.go @@ -7,9 +7,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" ) func Run(ctx context.Context, fsys afero.Fs) error { diff --git a/internal/branches/update/update.go b/internal/branches/update/update.go index 2ddb03f19..6c0f5fc4a 100644 --- a/internal/branches/update/update.go +++ b/internal/branches/update/update.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, branchId string, body api.UpdateBranchBody, fsys afero.Fs) error { diff --git a/internal/config/push/push.go b/internal/config/push/push.go index 5ddc9070c..a4c901473 100644 --- a/internal/config/push/push.go +++ b/internal/config/push/push.go @@ -6,8 +6,8 @@ import ( "os" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/config" ) func Run(ctx context.Context, ref string, fsys afero.Fs) error { diff --git a/internal/db/branch/create/create.go b/internal/db/branch/create/create.go index 66635bad1..085e10f9d 100644 --- a/internal/db/branch/create/create.go +++ b/internal/db/branch/create/create.go @@ -13,7 +13,7 @@ import ( "github.com/docker/docker/pkg/stdcopy" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) var ( diff --git a/internal/db/branch/create/create_test.go b/internal/db/branch/create/create_test.go index 20bfd4ac3..8e3842345 100644 --- a/internal/db/branch/create/create_test.go +++ b/internal/db/branch/create/create_test.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestBranchValidation(t *testing.T) { diff --git a/internal/db/branch/delete/delete.go b/internal/db/branch/delete/delete.go index 9655cd793..f59f5e51c 100644 --- a/internal/db/branch/delete/delete.go +++ b/internal/db/branch/delete/delete.go @@ -11,7 +11,7 @@ import ( "github.com/docker/docker/pkg/stdcopy" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(branch string, fsys afero.Fs) error { diff --git a/internal/db/branch/delete/delete_test.go b/internal/db/branch/delete/delete_test.go index 709a3a520..76957e246 100644 --- a/internal/db/branch/delete/delete_test.go +++ b/internal/db/branch/delete/delete_test.go @@ -9,8 +9,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestBranchDir(t *testing.T) { diff --git a/internal/db/branch/list/list.go b/internal/db/branch/list/list.go index f88104229..b1037ac1b 100644 --- a/internal/db/branch/list/list.go +++ b/internal/db/branch/list/list.go @@ -8,7 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(fsys afero.Fs, out io.Writer) error { diff --git a/internal/db/branch/list/list_test.go b/internal/db/branch/list/list_test.go index fa16586a5..24e34d5e5 100644 --- a/internal/db/branch/list/list_test.go +++ b/internal/db/branch/list/list_test.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func TestListCommand(t *testing.T) { diff --git a/internal/db/branch/switch_/switch_.go b/internal/db/branch/switch_/switch_.go index b1255ea63..462b26c69 100644 --- a/internal/db/branch/switch_/switch_.go +++ b/internal/db/branch/switch_/switch_.go @@ -10,8 +10,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, target string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/db/branch/switch_/switch__test.go b/internal/db/branch/switch_/switch__test.go index 8f22f3214..7c70959ce 100644 --- a/internal/db/branch/switch_/switch__test.go +++ b/internal/db/branch/switch_/switch__test.go @@ -13,10 +13,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) func TestSwitchCommand(t *testing.T) { diff --git a/internal/db/diff/diff.go b/internal/db/diff/diff.go index 05da60459..6c5faa892 100644 --- a/internal/db/diff/diff.go +++ b/internal/db/diff/diff.go @@ -21,11 +21,11 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/gen/keys" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/parser" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/gen/keys" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/parser" ) type DiffFunc func(context.Context, string, string, []string) (string, error) diff --git a/internal/db/diff/diff_test.go b/internal/db/diff/diff_test.go index 3db4d954a..6ada103c7 100644 --- a/internal/db/diff/diff_test.go +++ b/internal/db/diff/diff_test.go @@ -17,14 +17,14 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/testing/helper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/testing/helper" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/diff/migra.go b/internal/db/diff/migra.go index 47f8ba1bf..4e7842693 100644 --- a/internal/db/diff/migra.go +++ b/internal/db/diff/migra.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/config" ) //go:embed templates/migra.sh diff --git a/internal/db/diff/pgadmin.go b/internal/db/diff/pgadmin.go index baa984849..298023580 100644 --- a/internal/db/diff/pgadmin.go +++ b/internal/db/diff/pgadmin.go @@ -8,10 +8,10 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/migration/new" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/migration/new" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/config" ) var warnDiff = `WARNING: The diff tool is not foolproof, so you may need to manually rearrange and modify the generated migration. diff --git a/internal/db/dump/dump.go b/internal/db/dump/dump.go index bef685fe9..94e2ba7af 100644 --- a/internal/db/dump/dump.go +++ b/internal/db/dump/dump.go @@ -13,8 +13,8 @@ import ( "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - cliConfig "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/internal/utils" + cliConfig "github.com/supabase/cli/pkg/config" ) var ( diff --git a/internal/db/dump/dump_test.go b/internal/db/dump/dump_test.go index 62c1240a3..3a7c3cc65 100644 --- a/internal/db/dump/dump_test.go +++ b/internal/db/dump/dump_test.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/lint/lint.go b/internal/db/lint/lint.go index 5fe21d182..5701d89be 100644 --- a/internal/db/lint/lint.go +++ b/internal/db/lint/lint.go @@ -13,8 +13,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) const ENABLE_PGSQL_CHECK = "CREATE EXTENSION IF NOT EXISTS plpgsql_check" diff --git a/internal/db/lint/lint_test.go b/internal/db/lint/lint_test.go index 807540a44..8d7abef8f 100644 --- a/internal/db/lint/lint_test.go +++ b/internal/db/lint/lint_test.go @@ -14,9 +14,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/pull/pull.go b/internal/db/pull/pull.go index ad5e07103..f6a235e11 100644 --- a/internal/db/pull/pull.go +++ b/internal/db/pull/pull.go @@ -12,13 +12,13 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/diff" - "github.com/supabase/cli/v2/internal/db/dump" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/migration/new" - "github.com/supabase/cli/v2/internal/migration/repair" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/db/diff" + "github.com/supabase/cli/internal/db/dump" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/migration/new" + "github.com/supabase/cli/internal/migration/repair" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) var ( diff --git a/internal/db/pull/pull_test.go b/internal/db/pull/pull_test.go index f6248fe9d..2e55fcfed 100644 --- a/internal/db/pull/pull_test.go +++ b/internal/db/pull/pull_test.go @@ -13,11 +13,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/push/push.go b/internal/db/push/push.go index 29555b5be..2141255ae 100644 --- a/internal/db/push/push.go +++ b/internal/db/push/push.go @@ -10,10 +10,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/up" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/migration/up" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/migration" ) func Run(ctx context.Context, dryRun, ignoreVersionMismatch bool, includeRoles, includeSeed bool, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/db/push/push_test.go b/internal/db/push/push_test.go index dad8f2e49..3a3ff3cda 100644 --- a/internal/db/push/push_test.go +++ b/internal/db/push/push_test.go @@ -13,11 +13,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/testing/helper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/testing/helper" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/db/remote/changes/changes.go b/internal/db/remote/changes/changes.go index c711470c8..c735b5984 100644 --- a/internal/db/remote/changes/changes.go +++ b/internal/db/remote/changes/changes.go @@ -6,9 +6,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/diff" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/db/diff" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) var output string diff --git a/internal/db/remote/commit/commit.go b/internal/db/remote/commit/commit.go index 75b9232d8..f9062d492 100644 --- a/internal/db/remote/commit/commit.go +++ b/internal/db/remote/commit/commit.go @@ -10,12 +10,12 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/diff" - "github.com/supabase/cli/v2/internal/db/dump" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/migration/repair" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/db/diff" + "github.com/supabase/cli/internal/db/dump" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/migration/repair" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) func Run(ctx context.Context, schema []string, config pgconn.Config, fsys afero.Fs) error { diff --git a/internal/db/reset/reset.go b/internal/db/reset/reset.go index 81b8e1457..3830a019d 100644 --- a/internal/db/reset/reset.go +++ b/internal/db/reset/reset.go @@ -20,15 +20,15 @@ import ( "github.com/jackc/pgerrcode" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/gen/keys" - "github.com/supabase/cli/v2/internal/migration/apply" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/migration/repair" - "github.com/supabase/cli/v2/internal/seed/buckets" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/gen/keys" + "github.com/supabase/cli/internal/migration/apply" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/migration/repair" + "github.com/supabase/cli/internal/seed/buckets" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/migration" ) func Run(ctx context.Context, version string, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/db/reset/reset_test.go b/internal/db/reset/reset_test.go index 3693ac8b5..4e3558be3 100644 --- a/internal/db/reset/reset_test.go +++ b/internal/db/reset/reset_test.go @@ -16,14 +16,14 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/testing/helper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/testing/helper" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/pkg/storage" ) func TestResetCommand(t *testing.T) { diff --git a/internal/db/start/start.go b/internal/db/start/start.go index f286b1fcb..c4722f22f 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -19,10 +19,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/apply" - "github.com/supabase/cli/v2/internal/status" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/migration/apply" + "github.com/supabase/cli/internal/status" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) var ( diff --git a/internal/db/start/start_test.go b/internal/db/start/start_test.go index e52ecbbbd..475562f2f 100644 --- a/internal/db/start/start_test.go +++ b/internal/db/start/start_test.go @@ -14,11 +14,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/pgtest" ) func TestInitBranch(t *testing.T) { diff --git a/internal/db/test/test.go b/internal/db/test/test.go index 4374e7c98..263305736 100644 --- a/internal/db/test/test.go +++ b/internal/db/test/test.go @@ -15,8 +15,8 @@ import ( "github.com/jackc/pgx/v4" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/utils" - cliConfig "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/internal/utils" + cliConfig "github.com/supabase/cli/pkg/config" ) const ( diff --git a/internal/db/test/test_test.go b/internal/db/test/test_test.go index 30f781fdf..7c9310991 100644 --- a/internal/db/test/test_test.go +++ b/internal/db/test/test_test.go @@ -11,10 +11,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/debug/postgres_test.go b/internal/debug/postgres_test.go index 4d836ce7d..9f46fd6b8 100644 --- a/internal/debug/postgres_test.go +++ b/internal/debug/postgres_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgx/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) func TestPostgresProxy(t *testing.T) { diff --git a/internal/encryption/get/get.go b/internal/encryption/get/get.go index 22b827860..93c698635 100644 --- a/internal/encryption/get/get.go +++ b/internal/encryption/get/get.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string) error { diff --git a/internal/encryption/get/get_test.go b/internal/encryption/get/get_test.go index a3656dc0b..8f280189b 100644 --- a/internal/encryption/get/get_test.go +++ b/internal/encryption/get/get_test.go @@ -7,9 +7,9 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestGetRootKey(t *testing.T) { diff --git a/internal/encryption/update/update.go b/internal/encryption/update/update.go index 172c6429e..ed576823f 100644 --- a/internal/encryption/update/update.go +++ b/internal/encryption/update/update.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef string, stdin *os.File) error { diff --git a/internal/encryption/update/update_test.go b/internal/encryption/update/update_test.go index 5e8bf3434..8a6f60930 100644 --- a/internal/encryption/update/update_test.go +++ b/internal/encryption/update/update_test.go @@ -9,9 +9,9 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestUpdateRootKey(t *testing.T) { diff --git a/internal/functions/delete/delete.go b/internal/functions/delete/delete.go index 0242d5a7a..47d5957ef 100644 --- a/internal/functions/delete/delete.go +++ b/internal/functions/delete/delete.go @@ -7,7 +7,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, slug string, projectRef string, fsys afero.Fs) error { diff --git a/internal/functions/delete/delete_test.go b/internal/functions/delete/delete_test.go index ac39d5ce2..110208ea9 100644 --- a/internal/functions/delete/delete_test.go +++ b/internal/functions/delete/delete_test.go @@ -9,8 +9,8 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestDeleteCommand(t *testing.T) { diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index 4a75e82e4..0119a559c 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -13,8 +13,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/function" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/function" ) type dockerBundler struct { diff --git a/internal/functions/deploy/bundle_test.go b/internal/functions/deploy/bundle_test.go index bb286cc21..f8a68f439 100644 --- a/internal/functions/deploy/bundle_test.go +++ b/internal/functions/deploy/bundle_test.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestDockerBundle(t *testing.T) { diff --git a/internal/functions/deploy/deploy.go b/internal/functions/deploy/deploy.go index 2c97931c8..529b78976 100644 --- a/internal/functions/deploy/deploy.go +++ b/internal/functions/deploy/deploy.go @@ -9,11 +9,11 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/pkg/function" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/pkg/function" ) func Run(ctx context.Context, slugs []string, projectRef string, noVerifyJWT *bool, importMapPath string, fsys afero.Fs) error { diff --git a/internal/functions/deploy/deploy_test.go b/internal/functions/deploy/deploy_test.go index 542094f1a..558a33f32 100644 --- a/internal/functions/deploy/deploy_test.go +++ b/internal/functions/deploy/deploy_test.go @@ -12,11 +12,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/config" ) func TestDeployCommand(t *testing.T) { diff --git a/internal/functions/download/download.go b/internal/functions/download/download.go index 169df9d8b..e3b68cae9 100644 --- a/internal/functions/download/download.go +++ b/internal/functions/download/download.go @@ -15,8 +15,8 @@ import ( "github.com/docker/docker/api/types/network" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) var ( diff --git a/internal/functions/download/download_test.go b/internal/functions/download/download_test.go index 73c8afd80..b727f95c3 100644 --- a/internal/functions/download/download_test.go +++ b/internal/functions/download/download_test.go @@ -13,9 +13,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestMain(m *testing.M) { diff --git a/internal/functions/list/list.go b/internal/functions/list/list.go index 603de90aa..d0d2d9ecc 100644 --- a/internal/functions/list/list.go +++ b/internal/functions/list/list.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/functions/list/list_test.go b/internal/functions/list/list_test.go index 8f9d26174..e9c7f26b7 100644 --- a/internal/functions/list/list_test.go +++ b/internal/functions/list/list_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestFunctionsListCommand(t *testing.T) { diff --git a/internal/functions/new/new.go b/internal/functions/new/new.go index d876a9916..3656e9b5f 100644 --- a/internal/functions/new/new.go +++ b/internal/functions/new/new.go @@ -10,7 +10,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) var ( diff --git a/internal/functions/new/new_test.go b/internal/functions/new/new_test.go index fbb5f5e2d..d5e9c2fc8 100644 --- a/internal/functions/new/new_test.go +++ b/internal/functions/new/new_test.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func TestNewCommand(t *testing.T) { diff --git a/internal/functions/serve/serve.go b/internal/functions/serve/serve.go index 1d9b28258..62811d769 100644 --- a/internal/functions/serve/serve.go +++ b/internal/functions/serve/serve.go @@ -16,9 +16,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/functions/deploy" - "github.com/supabase/cli/v2/internal/secrets/set" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/functions/deploy" + "github.com/supabase/cli/internal/secrets/set" + "github.com/supabase/cli/internal/utils" ) type InspectMode string diff --git a/internal/functions/serve/serve_test.go b/internal/functions/serve/serve_test.go index dbc14852a..570c4b927 100644 --- a/internal/functions/serve/serve_test.go +++ b/internal/functions/serve/serve_test.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/cast" ) func TestServeCommand(t *testing.T) { diff --git a/internal/gen/keys/keys.go b/internal/gen/keys/keys.go index a1079e627..81ed52988 100644 --- a/internal/gen/keys/keys.go +++ b/internal/gen/keys/keys.go @@ -11,8 +11,8 @@ import ( "github.com/go-errors/errors" "github.com/go-git/go-git/v5" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/config" ) type CustomName struct { diff --git a/internal/gen/types/types.go b/internal/gen/types/types.go index 1e158dd10..b399cfb5c 100644 --- a/internal/gen/types/types.go +++ b/internal/gen/types/types.go @@ -12,8 +12,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) const ( diff --git a/internal/gen/types/types_test.go b/internal/gen/types/types_test.go index 07ed9e02f..811ae061d 100644 --- a/internal/gen/types/types_test.go +++ b/internal/gen/types/types_test.go @@ -12,10 +12,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/pgtest" ) func TestGenLocalCommand(t *testing.T) { diff --git a/internal/hostnames/activate/activate.go b/internal/hostnames/activate/activate.go index 1b951085e..3cc01c206 100644 --- a/internal/hostnames/activate/activate.go +++ b/internal/hostnames/activate/activate.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/hostnames" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/hostnames" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, includeRawOutput bool, fsys afero.Fs) error { diff --git a/internal/hostnames/common.go b/internal/hostnames/common.go index b1f55e241..c01e6a0da 100644 --- a/internal/hostnames/common.go +++ b/internal/hostnames/common.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func GetCustomHostnameConfig(ctx context.Context, projectRef string) (*api.V1GetHostnameConfigResponse, error) { diff --git a/internal/hostnames/create/create.go b/internal/hostnames/create/create.go index 4f3e7c3e0..563b524bc 100644 --- a/internal/hostnames/create/create.go +++ b/internal/hostnames/create/create.go @@ -7,9 +7,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/hostnames" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/hostnames" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef string, customHostname string, includeRawOutput bool, fsys afero.Fs) error { diff --git a/internal/hostnames/delete/delete.go b/internal/hostnames/delete/delete.go index 6e472bc6c..3b9f3653c 100644 --- a/internal/hostnames/delete/delete.go +++ b/internal/hostnames/delete/delete.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/hostnames/get/get.go b/internal/hostnames/get/get.go index def0af734..9e17c19f2 100644 --- a/internal/hostnames/get/get.go +++ b/internal/hostnames/get/get.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/hostnames" + "github.com/supabase/cli/internal/hostnames" ) func Run(ctx context.Context, projectRef string, includeRawOutput bool, fsys afero.Fs) error { diff --git a/internal/hostnames/reverify/reverify.go b/internal/hostnames/reverify/reverify.go index c7abe8217..7f4329903 100644 --- a/internal/hostnames/reverify/reverify.go +++ b/internal/hostnames/reverify/reverify.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/hostnames" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/hostnames" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, includeRawOutput bool, fsys afero.Fs) error { diff --git a/internal/init/init.go b/internal/init/init.go index ed99ecb9c..f4e470b02 100644 --- a/internal/init/init.go +++ b/internal/init/init.go @@ -11,7 +11,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) var ( diff --git a/internal/init/init_test.go b/internal/init/init_test.go index b47c2f0f4..99a96dce5 100644 --- a/internal/init/init_test.go +++ b/internal/init/init_test.go @@ -9,9 +9,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/cast" ) func TestInitCommand(t *testing.T) { diff --git a/internal/inspect/bloat/bloat.go b/internal/inspect/bloat/bloat.go index ed680d005..6a97e41c8 100644 --- a/internal/inspect/bloat/bloat.go +++ b/internal/inspect/bloat/bloat.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed bloat.sql diff --git a/internal/inspect/bloat/bloat_test.go b/internal/inspect/bloat/bloat_test.go index e5b75d799..8646565ce 100644 --- a/internal/inspect/bloat/bloat_test.go +++ b/internal/inspect/bloat/bloat_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/blocking/blocking.go b/internal/inspect/blocking/blocking.go index 9aa6baba2..37baed1f9 100644 --- a/internal/inspect/blocking/blocking.go +++ b/internal/inspect/blocking/blocking.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed blocking.sql diff --git a/internal/inspect/blocking/blocking_test.go b/internal/inspect/blocking/blocking_test.go index 15bd69712..46b63441f 100644 --- a/internal/inspect/blocking/blocking_test.go +++ b/internal/inspect/blocking/blocking_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/cache/cache.go b/internal/inspect/cache/cache.go index c36339a66..ce30c1f4a 100644 --- a/internal/inspect/cache/cache.go +++ b/internal/inspect/cache/cache.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed cache.sql diff --git a/internal/inspect/cache/cache_test.go b/internal/inspect/cache/cache_test.go index cc332c857..28fa1cb73 100644 --- a/internal/inspect/cache/cache_test.go +++ b/internal/inspect/cache/cache_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/calls/calls.go b/internal/inspect/calls/calls.go index a1fe4d9e2..2fd0c8df8 100644 --- a/internal/inspect/calls/calls.go +++ b/internal/inspect/calls/calls.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed calls.sql diff --git a/internal/inspect/calls/calls_test.go b/internal/inspect/calls/calls_test.go index 3d5a8408b..ded271009 100644 --- a/internal/inspect/calls/calls_test.go +++ b/internal/inspect/calls/calls_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/index_sizes/index_sizes.go b/internal/inspect/index_sizes/index_sizes.go index 56467f381..2cfc06e8d 100644 --- a/internal/inspect/index_sizes/index_sizes.go +++ b/internal/inspect/index_sizes/index_sizes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed index_sizes.sql diff --git a/internal/inspect/index_sizes/index_sizes_test.go b/internal/inspect/index_sizes/index_sizes_test.go index fe3cf71ed..9071c5710 100644 --- a/internal/inspect/index_sizes/index_sizes_test.go +++ b/internal/inspect/index_sizes/index_sizes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/index_usage/index_usage.go b/internal/inspect/index_usage/index_usage.go index 76019e5cf..cd8875f79 100644 --- a/internal/inspect/index_usage/index_usage.go +++ b/internal/inspect/index_usage/index_usage.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed index_usage.sql diff --git a/internal/inspect/index_usage/index_usage_test.go b/internal/inspect/index_usage/index_usage_test.go index be965bf39..5b735bb60 100644 --- a/internal/inspect/index_usage/index_usage_test.go +++ b/internal/inspect/index_usage/index_usage_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/locks/locks.go b/internal/inspect/locks/locks.go index 57aa8ed67..0b2db71c6 100644 --- a/internal/inspect/locks/locks.go +++ b/internal/inspect/locks/locks.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed locks.sql diff --git a/internal/inspect/locks/locks_test.go b/internal/inspect/locks/locks_test.go index 398c9dce9..e4c55c6bd 100644 --- a/internal/inspect/locks/locks_test.go +++ b/internal/inspect/locks/locks_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/long_running_queries/long_running_queries.go b/internal/inspect/long_running_queries/long_running_queries.go index 31b0095a0..acf4be456 100644 --- a/internal/inspect/long_running_queries/long_running_queries.go +++ b/internal/inspect/long_running_queries/long_running_queries.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed long_running_queries.sql diff --git a/internal/inspect/long_running_queries/long_running_queries_test.go b/internal/inspect/long_running_queries/long_running_queries_test.go index afb2e249f..d936c61a3 100644 --- a/internal/inspect/long_running_queries/long_running_queries_test.go +++ b/internal/inspect/long_running_queries/long_running_queries_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/outliers/outliers.go b/internal/inspect/outliers/outliers.go index 2e5c849d8..06f015c18 100644 --- a/internal/inspect/outliers/outliers.go +++ b/internal/inspect/outliers/outliers.go @@ -10,9 +10,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed outliers.sql diff --git a/internal/inspect/outliers/outliers_test.go b/internal/inspect/outliers/outliers_test.go index f6f83cf34..e5d46432a 100644 --- a/internal/inspect/outliers/outliers_test.go +++ b/internal/inspect/outliers/outliers_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/replication_slots/replication_slots.go b/internal/inspect/replication_slots/replication_slots.go index e0ef52ee2..927ad052a 100644 --- a/internal/inspect/replication_slots/replication_slots.go +++ b/internal/inspect/replication_slots/replication_slots.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed replication_slots.sql diff --git a/internal/inspect/replication_slots/replication_slots_test.go b/internal/inspect/replication_slots/replication_slots_test.go index a7891b4c8..d9e9b3225 100644 --- a/internal/inspect/replication_slots/replication_slots_test.go +++ b/internal/inspect/replication_slots/replication_slots_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/report.go b/internal/inspect/report.go index 718ea5344..de721d954 100644 --- a/internal/inspect/report.go +++ b/internal/inspect/report.go @@ -14,8 +14,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" ) //go:embed **/*.sql diff --git a/internal/inspect/report_test.go b/internal/inspect/report_test.go index 898734c69..6b4220451 100644 --- a/internal/inspect/report_test.go +++ b/internal/inspect/report_test.go @@ -8,27 +8,27 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/inspect/bloat" - "github.com/supabase/cli/v2/internal/inspect/blocking" - "github.com/supabase/cli/v2/internal/inspect/cache" - "github.com/supabase/cli/v2/internal/inspect/calls" - "github.com/supabase/cli/v2/internal/inspect/index_sizes" - "github.com/supabase/cli/v2/internal/inspect/index_usage" - "github.com/supabase/cli/v2/internal/inspect/locks" - "github.com/supabase/cli/v2/internal/inspect/long_running_queries" - "github.com/supabase/cli/v2/internal/inspect/outliers" - "github.com/supabase/cli/v2/internal/inspect/replication_slots" - "github.com/supabase/cli/v2/internal/inspect/role_configs" - "github.com/supabase/cli/v2/internal/inspect/role_connections" - "github.com/supabase/cli/v2/internal/inspect/seq_scans" - "github.com/supabase/cli/v2/internal/inspect/table_index_sizes" - "github.com/supabase/cli/v2/internal/inspect/table_record_counts" - "github.com/supabase/cli/v2/internal/inspect/table_sizes" - "github.com/supabase/cli/v2/internal/inspect/total_index_size" - "github.com/supabase/cli/v2/internal/inspect/total_table_sizes" - "github.com/supabase/cli/v2/internal/inspect/unused_indexes" - "github.com/supabase/cli/v2/internal/inspect/vacuum_stats" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/inspect/bloat" + "github.com/supabase/cli/internal/inspect/blocking" + "github.com/supabase/cli/internal/inspect/cache" + "github.com/supabase/cli/internal/inspect/calls" + "github.com/supabase/cli/internal/inspect/index_sizes" + "github.com/supabase/cli/internal/inspect/index_usage" + "github.com/supabase/cli/internal/inspect/locks" + "github.com/supabase/cli/internal/inspect/long_running_queries" + "github.com/supabase/cli/internal/inspect/outliers" + "github.com/supabase/cli/internal/inspect/replication_slots" + "github.com/supabase/cli/internal/inspect/role_configs" + "github.com/supabase/cli/internal/inspect/role_connections" + "github.com/supabase/cli/internal/inspect/seq_scans" + "github.com/supabase/cli/internal/inspect/table_index_sizes" + "github.com/supabase/cli/internal/inspect/table_record_counts" + "github.com/supabase/cli/internal/inspect/table_sizes" + "github.com/supabase/cli/internal/inspect/total_index_size" + "github.com/supabase/cli/internal/inspect/total_table_sizes" + "github.com/supabase/cli/internal/inspect/unused_indexes" + "github.com/supabase/cli/internal/inspect/vacuum_stats" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/role_configs/role_configs.go b/internal/inspect/role_configs/role_configs.go index 9f605419f..f4fb79382 100644 --- a/internal/inspect/role_configs/role_configs.go +++ b/internal/inspect/role_configs/role_configs.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed role_configs.sql diff --git a/internal/inspect/role_configs/role_configs_test.go b/internal/inspect/role_configs/role_configs_test.go index 67d734301..554a12526 100644 --- a/internal/inspect/role_configs/role_configs_test.go +++ b/internal/inspect/role_configs/role_configs_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/role_connections/role_connections.go b/internal/inspect/role_connections/role_connections.go index e5bec0934..5b0a56539 100644 --- a/internal/inspect/role_connections/role_connections.go +++ b/internal/inspect/role_connections/role_connections.go @@ -9,9 +9,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed role_connections.sql diff --git a/internal/inspect/role_connections/role_connections_test.go b/internal/inspect/role_connections/role_connections_test.go index b7d1ec884..32ecab768 100644 --- a/internal/inspect/role_connections/role_connections_test.go +++ b/internal/inspect/role_connections/role_connections_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/seq_scans/seq_scans.go b/internal/inspect/seq_scans/seq_scans.go index 240112d5b..6b52538ee 100644 --- a/internal/inspect/seq_scans/seq_scans.go +++ b/internal/inspect/seq_scans/seq_scans.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed seq_scans.sql diff --git a/internal/inspect/seq_scans/seq_scans_test.go b/internal/inspect/seq_scans/seq_scans_test.go index 0e2bdfb42..3db6caee5 100644 --- a/internal/inspect/seq_scans/seq_scans_test.go +++ b/internal/inspect/seq_scans/seq_scans_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/table_index_sizes/table_index_sizes.go b/internal/inspect/table_index_sizes/table_index_sizes.go index 8a5b3a096..e61f23361 100644 --- a/internal/inspect/table_index_sizes/table_index_sizes.go +++ b/internal/inspect/table_index_sizes/table_index_sizes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed table_index_sizes.sql diff --git a/internal/inspect/table_index_sizes/table_index_sizes_test.go b/internal/inspect/table_index_sizes/table_index_sizes_test.go index 92e58ef56..20ad80fc9 100644 --- a/internal/inspect/table_index_sizes/table_index_sizes_test.go +++ b/internal/inspect/table_index_sizes/table_index_sizes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/table_record_counts/table_record_counts.go b/internal/inspect/table_record_counts/table_record_counts.go index 19e32a5b3..e0b394374 100644 --- a/internal/inspect/table_record_counts/table_record_counts.go +++ b/internal/inspect/table_record_counts/table_record_counts.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed table_record_counts.sql diff --git a/internal/inspect/table_record_counts/table_record_counts_test.go b/internal/inspect/table_record_counts/table_record_counts_test.go index 753074e77..a03714d97 100644 --- a/internal/inspect/table_record_counts/table_record_counts_test.go +++ b/internal/inspect/table_record_counts/table_record_counts_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/table_sizes/table_sizes.go b/internal/inspect/table_sizes/table_sizes.go index 7ce49e225..7741f0119 100644 --- a/internal/inspect/table_sizes/table_sizes.go +++ b/internal/inspect/table_sizes/table_sizes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed table_sizes.sql diff --git a/internal/inspect/table_sizes/table_sizes_test.go b/internal/inspect/table_sizes/table_sizes_test.go index 057f32d14..5cc6426ad 100644 --- a/internal/inspect/table_sizes/table_sizes_test.go +++ b/internal/inspect/table_sizes/table_sizes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/total_index_size/total_index_size.go b/internal/inspect/total_index_size/total_index_size.go index bd6a13fd9..fbc66b259 100644 --- a/internal/inspect/total_index_size/total_index_size.go +++ b/internal/inspect/total_index_size/total_index_size.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed total_index_size.sql diff --git a/internal/inspect/total_index_size/total_index_size_test.go b/internal/inspect/total_index_size/total_index_size_test.go index c59401469..8eb0e0aa9 100644 --- a/internal/inspect/total_index_size/total_index_size_test.go +++ b/internal/inspect/total_index_size/total_index_size_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/total_table_sizes/total_table_sizes.go b/internal/inspect/total_table_sizes/total_table_sizes.go index 3b96dcadd..80b1c89a8 100644 --- a/internal/inspect/total_table_sizes/total_table_sizes.go +++ b/internal/inspect/total_table_sizes/total_table_sizes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed total_table_sizes.sql diff --git a/internal/inspect/total_table_sizes/total_table_sizes_test.go b/internal/inspect/total_table_sizes/total_table_sizes_test.go index 3419fc762..bc548af60 100644 --- a/internal/inspect/total_table_sizes/total_table_sizes_test.go +++ b/internal/inspect/total_table_sizes/total_table_sizes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/unused_indexes/unused_indexes.go b/internal/inspect/unused_indexes/unused_indexes.go index d7589888d..2a30a46d7 100644 --- a/internal/inspect/unused_indexes/unused_indexes.go +++ b/internal/inspect/unused_indexes/unused_indexes.go @@ -9,10 +9,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed unused_indexes.sql diff --git a/internal/inspect/unused_indexes/unused_indexes_test.go b/internal/inspect/unused_indexes/unused_indexes_test.go index af3936166..ee4182094 100644 --- a/internal/inspect/unused_indexes/unused_indexes_test.go +++ b/internal/inspect/unused_indexes/unused_indexes_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/inspect/vacuum_stats/vacuum_stats.go b/internal/inspect/vacuum_stats/vacuum_stats.go index 950956503..dc9326d79 100644 --- a/internal/inspect/vacuum_stats/vacuum_stats.go +++ b/internal/inspect/vacuum_stats/vacuum_stats.go @@ -10,10 +10,10 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgxv5" ) //go:embed vacuum_stats.sql diff --git a/internal/inspect/vacuum_stats/vacuum_stats_test.go b/internal/inspect/vacuum_stats/vacuum_stats_test.go index fba1e9a47..0d3cbec10 100644 --- a/internal/inspect/vacuum_stats/vacuum_stats_test.go +++ b/internal/inspect/vacuum_stats/vacuum_stats_test.go @@ -7,9 +7,9 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/db/reset" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/link/link.go b/internal/link/link.go index 5f156b11b..e791271b8 100644 --- a/internal/link/link.go +++ b/internal/link/link.go @@ -13,15 +13,15 @@ import ( "github.com/jackc/pgx/v4" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/internal/utils/tenant" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - cliConfig "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/pkg/diff" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/internal/utils/tenant" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + cliConfig "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/pkg/diff" + "github.com/supabase/cli/pkg/migration" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/link/link_test.go b/internal/link/link_test.go index 4f05a296e..18c090ad3 100644 --- a/internal/link/link_test.go +++ b/internal/link/link_test.go @@ -12,14 +12,14 @@ import ( "github.com/jackc/pgx/v4" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/testing/helper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/tenant" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/testing/helper" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/tenant" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" "github.com/zalando/go-keyring" ) diff --git a/internal/login/login.go b/internal/login/login.go index be1265bec..6239b500a 100644 --- a/internal/login/login.go +++ b/internal/login/login.go @@ -20,9 +20,9 @@ import ( "github.com/go-errors/errors" "github.com/google/uuid" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/new" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/internal/migration/new" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/fetcher" ) type RunParams struct { diff --git a/internal/login/login_test.go b/internal/login/login_test.go index 8dd02deab..758fbc5c4 100644 --- a/internal/login/login_test.go +++ b/internal/login/login_test.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/logout/logout.go b/internal/logout/logout.go index ae71bf00b..abbd191b8 100644 --- a/internal/logout/logout.go +++ b/internal/logout/logout.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" ) func Run(ctx context.Context, stdout *os.File, fsys afero.Fs) error { diff --git a/internal/logout/logout_test.go b/internal/logout/logout_test.go index 5a7835824..42f9f8ead 100644 --- a/internal/logout/logout_test.go +++ b/internal/logout/logout_test.go @@ -8,10 +8,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/migration/apply/apply.go b/internal/migration/apply/apply.go index ea7f6cb8b..224b342f7 100644 --- a/internal/migration/apply/apply.go +++ b/internal/migration/apply/apply.go @@ -5,9 +5,9 @@ import ( "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) func MigrateAndSeed(ctx context.Context, version string, conn *pgx.Conn, fsys afero.Fs) error { diff --git a/internal/migration/apply/apply_test.go b/internal/migration/apply/apply_test.go index 49165f275..286093743 100644 --- a/internal/migration/apply/apply_test.go +++ b/internal/migration/apply/apply_test.go @@ -9,11 +9,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/testing/helper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/testing/helper" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) func TestMigrateDatabase(t *testing.T) { diff --git a/internal/migration/fetch/fetch.go b/internal/migration/fetch/fetch.go index fac525787..cb78c70d8 100644 --- a/internal/migration/fetch/fetch.go +++ b/internal/migration/fetch/fetch.go @@ -10,8 +10,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/migration/list/list.go b/internal/migration/list/list.go index d1202d068..3107d4ec6 100644 --- a/internal/migration/list/list.go +++ b/internal/migration/list/list.go @@ -11,8 +11,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/migration/list/list_test.go b/internal/migration/list/list_test.go index c68ade375..b23fa4a2d 100644 --- a/internal/migration/list/list_test.go +++ b/internal/migration/list/list_test.go @@ -12,10 +12,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/migration/new/new.go b/internal/migration/new/new.go index 026c54c7b..be232b591 100644 --- a/internal/migration/new/new.go +++ b/internal/migration/new/new.go @@ -8,7 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(migrationName string, stdin afero.File, fsys afero.Fs) error { diff --git a/internal/migration/new/new_test.go b/internal/migration/new/new_test.go index 232623cb1..39e2fe115 100644 --- a/internal/migration/new/new_test.go +++ b/internal/migration/new/new_test.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func TestNewCommand(t *testing.T) { diff --git a/internal/migration/repair/repair.go b/internal/migration/repair/repair.go index b43779aa6..c0670000a 100644 --- a/internal/migration/repair/repair.go +++ b/internal/migration/repair/repair.go @@ -11,9 +11,9 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) const ( diff --git a/internal/migration/repair/repair_test.go b/internal/migration/repair/repair_test.go index cb035c489..4dea63279 100644 --- a/internal/migration/repair/repair_test.go +++ b/internal/migration/repair/repair_test.go @@ -12,11 +12,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/testing/helper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/testing/helper" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/migration/squash/squash.go b/internal/migration/squash/squash.go index 64429d260..2ed9e6252 100644 --- a/internal/migration/squash/squash.go +++ b/internal/migration/squash/squash.go @@ -14,13 +14,13 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/diff" - "github.com/supabase/cli/v2/internal/db/dump" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/migration/repair" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/db/diff" + "github.com/supabase/cli/internal/db/dump" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/migration/repair" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) var ErrMissingVersion = errors.New("version not found") diff --git a/internal/migration/squash/squash_test.go b/internal/migration/squash/squash_test.go index 1cbd85849..cc0461f3b 100644 --- a/internal/migration/squash/squash_test.go +++ b/internal/migration/squash/squash_test.go @@ -21,14 +21,14 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/migration/repair" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/testing/helper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/migration/repair" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/testing/helper" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/migration/up/up.go b/internal/migration/up/up.go index 8229fd6ed..d33117f33 100644 --- a/internal/migration/up/up.go +++ b/internal/migration/up/up.go @@ -9,8 +9,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) func Run(ctx context.Context, includeAll bool, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { diff --git a/internal/migration/up/up_test.go b/internal/migration/up/up_test.go index 69e9c5ecd..ea41680bc 100644 --- a/internal/migration/up/up_test.go +++ b/internal/migration/up/up_test.go @@ -9,10 +9,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) func TestPendingMigrations(t *testing.T) { diff --git a/internal/orgs/create/create.go b/internal/orgs/create/create.go index df7c1eec5..ed6008ab3 100644 --- a/internal/orgs/create/create.go +++ b/internal/orgs/create/create.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, name string) error { diff --git a/internal/orgs/create/create_test.go b/internal/orgs/create/create_test.go index 8792188f6..f491bdc31 100644 --- a/internal/orgs/create/create_test.go +++ b/internal/orgs/create/create_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestOrganizationCreateCommand(t *testing.T) { diff --git a/internal/orgs/list/list.go b/internal/orgs/list/list.go index 4eb7487f0..abd6c08df 100644 --- a/internal/orgs/list/list.go +++ b/internal/orgs/list/list.go @@ -6,8 +6,8 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context) error { diff --git a/internal/orgs/list/list_test.go b/internal/orgs/list/list_test.go index d538f5fea..00030dbd2 100644 --- a/internal/orgs/list/list_test.go +++ b/internal/orgs/list/list_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestOrganizationListCommand(t *testing.T) { diff --git a/internal/postgresConfig/get/get.go b/internal/postgresConfig/get/get.go index 535f0f171..ad311b396 100644 --- a/internal/postgresConfig/get/get.go +++ b/internal/postgresConfig/get/get.go @@ -9,8 +9,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/postgresConfig/update/update.go b/internal/postgresConfig/update/update.go index 9c8bec823..94632d486 100644 --- a/internal/postgresConfig/update/update.go +++ b/internal/postgresConfig/update/update.go @@ -9,8 +9,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/postgresConfig/get" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/postgresConfig/get" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, values []string, replaceOverrides, noRestart bool, fsys afero.Fs) error { diff --git a/internal/projects/apiKeys/api_keys.go b/internal/projects/apiKeys/api_keys.go index be5035a5b..7daddce21 100644 --- a/internal/projects/apiKeys/api_keys.go +++ b/internal/projects/apiKeys/api_keys.go @@ -8,9 +8,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/projects/apiKeys/api_keys_test.go b/internal/projects/apiKeys/api_keys_test.go index e94a999ce..57130f158 100644 --- a/internal/projects/apiKeys/api_keys_test.go +++ b/internal/projects/apiKeys/api_keys_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestProjectApiKeysCommand(t *testing.T) { diff --git a/internal/projects/create/create.go b/internal/projects/create/create.go index 671020f1f..ddbd46b47 100644 --- a/internal/projects/create/create.go +++ b/internal/projects/create/create.go @@ -9,10 +9,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, params api.V1CreateProjectBodyDto, fsys afero.Fs) error { diff --git a/internal/projects/create/create_test.go b/internal/projects/create/create_test.go index 8db8ef3da..879421d72 100644 --- a/internal/projects/create/create_test.go +++ b/internal/projects/create/create_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestProjectCreateCommand(t *testing.T) { diff --git a/internal/projects/delete/delete.go b/internal/projects/delete/delete.go index dda1dd297..f042f62e1 100644 --- a/internal/projects/delete/delete.go +++ b/internal/projects/delete/delete.go @@ -8,9 +8,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/unlink" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/internal/unlink" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/projects/delete/delete_test.go b/internal/projects/delete/delete_test.go index aaa441229..b83d4cf8c 100644 --- a/internal/projects/delete/delete_test.go +++ b/internal/projects/delete/delete_test.go @@ -10,9 +10,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" "github.com/zalando/go-keyring" ) diff --git a/internal/projects/list/list.go b/internal/projects/list/list.go index 23dae8f07..ef356dfcf 100644 --- a/internal/projects/list/list.go +++ b/internal/projects/list/list.go @@ -8,10 +8,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" ) type linkedProject struct { diff --git a/internal/projects/list/list_test.go b/internal/projects/list/list_test.go index 31a1bc716..d5450bfb4 100644 --- a/internal/projects/list/list_test.go +++ b/internal/projects/list/list_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestProjectListCommand(t *testing.T) { diff --git a/internal/restrictions/get/get.go b/internal/restrictions/get/get.go index ffd4d8fb0..f8e27342d 100644 --- a/internal/restrictions/get/get.go +++ b/internal/restrictions/get/get.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string) error { diff --git a/internal/restrictions/update/update.go b/internal/restrictions/update/update.go index 8b5718a76..98a70da98 100644 --- a/internal/restrictions/update/update.go +++ b/internal/restrictions/update/update.go @@ -6,8 +6,8 @@ import ( "net" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef string, dbCidrsToAllow []string, bypassCidrChecks bool) error { diff --git a/internal/restrictions/update/update_test.go b/internal/restrictions/update/update_test.go index e23a3101e..5a6583ea8 100644 --- a/internal/restrictions/update/update_test.go +++ b/internal/restrictions/update/update_test.go @@ -8,9 +8,9 @@ import ( "github.com/go-errors/errors" "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestUpdateRestrictionsCommand(t *testing.T) { diff --git a/internal/secrets/list/list.go b/internal/secrets/list/list.go index 9cf4efa6a..e5b4d4538 100644 --- a/internal/secrets/list/list.go +++ b/internal/secrets/list/list.go @@ -8,9 +8,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/secrets/list/list_test.go b/internal/secrets/list/list_test.go index 4e831d38c..4e0da98b6 100644 --- a/internal/secrets/list/list_test.go +++ b/internal/secrets/list/list_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestSecretListCommand(t *testing.T) { diff --git a/internal/secrets/set/set.go b/internal/secrets/set/set.go index 14e715c7a..d2877c314 100644 --- a/internal/secrets/set/set.go +++ b/internal/secrets/set/set.go @@ -12,8 +12,8 @@ import ( "github.com/go-errors/errors" "github.com/joho/godotenv" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef, envFilePath string, args []string, fsys afero.Fs) error { diff --git a/internal/secrets/set/set_test.go b/internal/secrets/set/set_test.go index beb15c7fd..6021804c1 100644 --- a/internal/secrets/set/set_test.go +++ b/internal/secrets/set/set_test.go @@ -10,9 +10,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestSecretSetCommand(t *testing.T) { diff --git a/internal/secrets/unset/unset.go b/internal/secrets/unset/unset.go index e9f680d14..f6bbca8cf 100644 --- a/internal/secrets/unset/unset.go +++ b/internal/secrets/unset/unset.go @@ -9,8 +9,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/secrets/list" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/secrets/list" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, args []string, fsys afero.Fs) error { diff --git a/internal/secrets/unset/unset_test.go b/internal/secrets/unset/unset_test.go index e3f6d9dff..3207f8df7 100644 --- a/internal/secrets/unset/unset_test.go +++ b/internal/secrets/unset/unset_test.go @@ -8,9 +8,9 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestSecretUnsetCommand(t *testing.T) { diff --git a/internal/seed/buckets/buckets.go b/internal/seed/buckets/buckets.go index f68344828..b460fdc79 100644 --- a/internal/seed/buckets/buckets.go +++ b/internal/seed/buckets/buckets.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/storage/client" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/storage/client" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, interactive bool, fsys afero.Fs) error { diff --git a/internal/seed/buckets/buckets_test.go b/internal/seed/buckets/buckets_test.go index 9e9c7b1a5..e14a40e74 100644 --- a/internal/seed/buckets/buckets_test.go +++ b/internal/seed/buckets/buckets_test.go @@ -11,9 +11,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/storage" ) func TestSeedBuckets(t *testing.T) { diff --git a/internal/services/services.go b/internal/services/services.go index e32a3ad57..ebc08efca 100644 --- a/internal/services/services.go +++ b/internal/services/services.go @@ -9,10 +9,10 @@ import ( "sync" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/internal/utils/tenant" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/internal/utils/tenant" ) func Run(ctx context.Context, fsys afero.Fs) error { diff --git a/internal/snippets/download/download.go b/internal/snippets/download/download.go index f983d2101..7f1f3a463 100644 --- a/internal/snippets/download/download.go +++ b/internal/snippets/download/download.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, snippetId string, fsys afero.Fs) error { diff --git a/internal/snippets/list/list.go b/internal/snippets/list/list.go index c3c651f7b..f54325eaa 100644 --- a/internal/snippets/list/list.go +++ b/internal/snippets/list/list.go @@ -7,10 +7,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, fsys afero.Fs) error { diff --git a/internal/ssl_enforcement/get/get.go b/internal/ssl_enforcement/get/get.go index 50673d9c9..e6d58693e 100644 --- a/internal/ssl_enforcement/get/get.go +++ b/internal/ssl_enforcement/get/get.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/ssl_enforcement/update/update.go b/internal/ssl_enforcement/update/update.go index f5805d108..51b0b6725 100644 --- a/internal/ssl_enforcement/update/update.go +++ b/internal/ssl_enforcement/update/update.go @@ -6,8 +6,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef string, enforceDbSsl bool, fsys afero.Fs) error { diff --git a/internal/sso/create/create.go b/internal/sso/create/create.go index 1b24e12a9..a33b6e7e7 100644 --- a/internal/sso/create/create.go +++ b/internal/sso/create/create.go @@ -7,10 +7,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/sso/internal/render" - "github.com/supabase/cli/v2/internal/sso/internal/saml" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/sso/internal/render" + "github.com/supabase/cli/internal/sso/internal/saml" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) var Fs = afero.NewOsFs() diff --git a/internal/sso/get/get.go b/internal/sso/get/get.go index 43a8e206e..34370523e 100644 --- a/internal/sso/get/get.go +++ b/internal/sso/get/get.go @@ -7,9 +7,9 @@ import ( "os" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/sso/internal/render" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/sso/internal/render" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, ref, providerId, format string) error { diff --git a/internal/sso/get/get_test.go b/internal/sso/get/get_test.go index 3c506ce78..bd6fd0ef3 100644 --- a/internal/sso/get/get_test.go +++ b/internal/sso/get/get_test.go @@ -7,8 +7,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestSSOProvidersShowCommand(t *testing.T) { diff --git a/internal/sso/info/info.go b/internal/sso/info/info.go index ffe51b8b0..c8a25805f 100644 --- a/internal/sso/info/info.go +++ b/internal/sso/info/info.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/supabase/cli/v2/internal/sso/internal/render" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/sso/internal/render" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, ref string, format string) error { diff --git a/internal/sso/internal/render/render.go b/internal/sso/internal/render/render.go index 3e45b2e01..3f3a03db1 100644 --- a/internal/sso/internal/render/render.go +++ b/internal/sso/internal/render/render.go @@ -7,9 +7,9 @@ import ( "github.com/go-errors/errors" "github.com/go-xmlfmt/xmlfmt" - "github.com/supabase/cli/v2/internal/migration/list" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/migration/list" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func formatProtocol(provider api.Provider) string { diff --git a/internal/sso/internal/saml/files.go b/internal/sso/internal/saml/files.go index 3b47dbe9d..62e0846e3 100644 --- a/internal/sso/internal/saml/files.go +++ b/internal/sso/internal/saml/files.go @@ -12,8 +12,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/fetcher" ) var DefaultClient = http.DefaultClient diff --git a/internal/sso/list/list.go b/internal/sso/list/list.go index 181a86aff..efacb1a04 100644 --- a/internal/sso/list/list.go +++ b/internal/sso/list/list.go @@ -6,8 +6,8 @@ import ( "os" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/sso/internal/render" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/sso/internal/render" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, ref, format string) error { diff --git a/internal/sso/list/list_test.go b/internal/sso/list/list_test.go index 50ab8d745..333ffd4a3 100644 --- a/internal/sso/list/list_test.go +++ b/internal/sso/list/list_test.go @@ -6,8 +6,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestSSOProvidersListCommand(t *testing.T) { diff --git a/internal/sso/remove/remove.go b/internal/sso/remove/remove.go index a8b5b1ccf..1514314da 100644 --- a/internal/sso/remove/remove.go +++ b/internal/sso/remove/remove.go @@ -6,9 +6,9 @@ import ( "os" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/sso/internal/render" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/sso/internal/render" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, ref, providerId, format string) error { diff --git a/internal/sso/remove/remove_test.go b/internal/sso/remove/remove_test.go index c606c8628..f284f7e06 100644 --- a/internal/sso/remove/remove_test.go +++ b/internal/sso/remove/remove_test.go @@ -7,8 +7,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestSSOProvidersRemoveCommand(t *testing.T) { diff --git a/internal/sso/update/update.go b/internal/sso/update/update.go index 5a412fed7..e8a745dc3 100644 --- a/internal/sso/update/update.go +++ b/internal/sso/update/update.go @@ -7,10 +7,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/sso/internal/render" - "github.com/supabase/cli/v2/internal/sso/internal/saml" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/sso/internal/render" + "github.com/supabase/cli/internal/sso/internal/saml" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) var Fs = afero.NewOsFs() diff --git a/internal/sso/update/update_test.go b/internal/sso/update/update_test.go index dd423dadd..6754fd487 100644 --- a/internal/sso/update/update_test.go +++ b/internal/sso/update/update_test.go @@ -10,9 +10,9 @@ import ( "github.com/google/uuid" "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func response(providerId string, domains []string) map[string]any { diff --git a/internal/start/start.go b/internal/start/start.go index c74f6287f..4315d31b7 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -23,14 +23,14 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/db/start" - "github.com/supabase/cli/v2/internal/functions/serve" - "github.com/supabase/cli/v2/internal/seed/buckets" - "github.com/supabase/cli/v2/internal/services" - "github.com/supabase/cli/v2/internal/status" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/internal/db/start" + "github.com/supabase/cli/internal/functions/serve" + "github.com/supabase/cli/internal/seed/buckets" + "github.com/supabase/cli/internal/services" + "github.com/supabase/cli/internal/status" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/config" "golang.org/x/mod/semver" ) diff --git a/internal/start/start_test.go b/internal/start/start_test.go index 93af236d9..079eb3c79 100644 --- a/internal/start/start_test.go +++ b/internal/start/start_test.go @@ -17,11 +17,11 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/pkg/pgtest" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/pkg/storage" ) func TestStartCommand(t *testing.T) { diff --git a/internal/status/status.go b/internal/status/status.go index bcd8ff8bf..1b9d02f90 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -18,8 +18,8 @@ import ( "github.com/docker/docker/api/types/container" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/fetcher" ) type CustomName struct { diff --git a/internal/status/status_test.go b/internal/status/status_test.go index 792b99c65..391a8c998 100644 --- a/internal/status/status_test.go +++ b/internal/status/status_test.go @@ -13,8 +13,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestStatusCommand(t *testing.T) { diff --git a/internal/stop/stop.go b/internal/stop/stop.go index fc9dfebd5..39c5e00e5 100644 --- a/internal/stop/stop.go +++ b/internal/stop/stop.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/volume" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, backup bool, projectId string, all bool, fsys afero.Fs) error { diff --git a/internal/stop/stop_test.go b/internal/stop/stop_test.go index cc287cb9e..b607d87d7 100644 --- a/internal/stop/stop_test.go +++ b/internal/stop/stop_test.go @@ -18,8 +18,8 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" ) func TestStopCommand(t *testing.T) { diff --git a/internal/storage/client/api.go b/internal/storage/client/api.go index ea44f3c7b..c8c2a02ef 100644 --- a/internal/storage/client/api.go +++ b/internal/storage/client/api.go @@ -5,11 +5,11 @@ import ( "net/http" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/status" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/tenant" - "github.com/supabase/cli/v2/pkg/fetcher" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/status" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/tenant" + "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/pkg/storage" ) func NewStorageAPI(ctx context.Context, projectRef string) (storage.StorageAPI, error) { diff --git a/internal/storage/cp/cp.go b/internal/storage/cp/cp.go index 6c5df9f31..e55120a1c 100644 --- a/internal/storage/cp/cp.go +++ b/internal/storage/cp/cp.go @@ -12,12 +12,12 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/storage/client" - "github.com/supabase/cli/v2/internal/storage/ls" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/queue" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/storage/client" + "github.com/supabase/cli/internal/storage/ls" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/queue" + "github.com/supabase/cli/pkg/storage" ) var errUnsupportedOperation = errors.New("Unsupported operation") diff --git a/internal/storage/cp/cp_test.go b/internal/storage/cp/cp_test.go index 83e787692..75a0cf3cd 100644 --- a/internal/storage/cp/cp_test.go +++ b/internal/storage/cp/cp_test.go @@ -10,13 +10,13 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/fetcher" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/pkg/storage" ) var mockFile = storage.ObjectResponse{ diff --git a/internal/storage/ls/ls.go b/internal/storage/ls/ls.go index 0f521ce97..396dc9b7c 100644 --- a/internal/storage/ls/ls.go +++ b/internal/storage/ls/ls.go @@ -8,9 +8,9 @@ import ( "strings" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/storage/client" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/storage/client" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/storage" ) func Run(ctx context.Context, objectPath string, recursive bool, fsys afero.Fs) error { diff --git a/internal/storage/ls/ls_test.go b/internal/storage/ls/ls_test.go index bef37987d..e0e2cd207 100644 --- a/internal/storage/ls/ls_test.go +++ b/internal/storage/ls/ls_test.go @@ -9,14 +9,14 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/storage/client" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/fetcher" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/storage/client" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/pkg/storage" ) var mockFile = storage.ObjectResponse{ diff --git a/internal/storage/mv/mv.go b/internal/storage/mv/mv.go index 91f0ef3b2..a6dc8773c 100644 --- a/internal/storage/mv/mv.go +++ b/internal/storage/mv/mv.go @@ -9,10 +9,10 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/storage/client" - "github.com/supabase/cli/v2/internal/storage/ls" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/storage/client" + "github.com/supabase/cli/internal/storage/ls" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/storage" ) var ( diff --git a/internal/storage/mv/mv_test.go b/internal/storage/mv/mv_test.go index 65164cc46..fd8ecfbcc 100644 --- a/internal/storage/mv/mv_test.go +++ b/internal/storage/mv/mv_test.go @@ -8,13 +8,13 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/fetcher" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/pkg/storage" ) var mockFile = storage.ObjectResponse{ diff --git a/internal/storage/rm/rm.go b/internal/storage/rm/rm.go index 8734cc8ca..720bbce02 100644 --- a/internal/storage/rm/rm.go +++ b/internal/storage/rm/rm.go @@ -8,12 +8,12 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/storage/client" - "github.com/supabase/cli/v2/internal/storage/cp" - "github.com/supabase/cli/v2/internal/storage/ls" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/storage/client" + "github.com/supabase/cli/internal/storage/cp" + "github.com/supabase/cli/internal/storage/ls" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/storage" ) var ( diff --git a/internal/storage/rm/rm_test.go b/internal/storage/rm/rm_test.go index c04a79a6a..46d204cf0 100644 --- a/internal/storage/rm/rm_test.go +++ b/internal/storage/rm/rm_test.go @@ -8,14 +8,14 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/flags" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/fetcher" - "github.com/supabase/cli/v2/pkg/storage" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/pkg/storage" ) var mockFile = storage.ObjectResponse{ diff --git a/internal/test/new/new.go b/internal/test/new/new.go index babe62194..506a9e02e 100644 --- a/internal/test/new/new.go +++ b/internal/test/new/new.go @@ -8,7 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) const ( diff --git a/internal/test/new/new_test.go b/internal/test/new/new_test.go index a03e63dbf..d3f980157 100644 --- a/internal/test/new/new_test.go +++ b/internal/test/new/new_test.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func TestCreatePgTAP(t *testing.T) { diff --git a/internal/testing/helper/history.go b/internal/testing/helper/history.go index 7c5436dc4..95c846b7a 100644 --- a/internal/testing/helper/history.go +++ b/internal/testing/helper/history.go @@ -1,8 +1,8 @@ package helper import ( - "github.com/supabase/cli/v2/pkg/migration" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" ) func MockMigrationHistory(conn *pgtest.MockConn) *pgtest.MockConn { diff --git a/internal/unlink/unlink.go b/internal/unlink/unlink.go index 5750f647d..b59f4d1f0 100644 --- a/internal/unlink/unlink.go +++ b/internal/unlink/unlink.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/unlink/unlink_test.go b/internal/unlink/unlink_test.go index e5967005a..9b526e109 100644 --- a/internal/unlink/unlink_test.go +++ b/internal/unlink/unlink_test.go @@ -8,9 +8,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/utils/access_token.go b/internal/utils/access_token.go index bd48823cb..f7ef90a01 100644 --- a/internal/utils/access_token.go +++ b/internal/utils/access_token.go @@ -7,7 +7,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/utils/access_token_test.go b/internal/utils/access_token_test.go index d05e5f3cd..f31988876 100644 --- a/internal/utils/access_token_test.go +++ b/internal/utils/access_token_test.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils/credentials" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils/credentials" "github.com/zalando/go-keyring" ) diff --git a/internal/utils/api.go b/internal/utils/api.go index 271d8cebf..32b199b69 100644 --- a/internal/utils/api.go +++ b/internal/utils/api.go @@ -14,9 +14,9 @@ import ( "github.com/go-errors/errors" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/utils/cloudflare" - supabase "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/internal/utils/cloudflare" + supabase "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" ) const ( diff --git a/internal/utils/api_test.go b/internal/utils/api_test.go index 8a858441e..09365897d 100644 --- a/internal/utils/api_test.go +++ b/internal/utils/api_test.go @@ -10,8 +10,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils/cloudflare" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils/cloudflare" ) const host = "api.supabase.io" diff --git a/internal/utils/cloudflare/api.go b/internal/utils/cloudflare/api.go index eeadef033..7c7cf10a2 100644 --- a/internal/utils/cloudflare/api.go +++ b/internal/utils/cloudflare/api.go @@ -4,7 +4,7 @@ import ( "net/http" "time" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/fetcher" ) type CloudflareAPI struct { diff --git a/internal/utils/cloudflare/dns.go b/internal/utils/cloudflare/dns.go index 739968ef9..f8a06367c 100644 --- a/internal/utils/cloudflare/dns.go +++ b/internal/utils/cloudflare/dns.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/google/go-querystring/query" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/fetcher" ) type DNSType uint16 diff --git a/internal/utils/config.go b/internal/utils/config.go index 13af5cd34..3f89dc75c 100644 --- a/internal/utils/config.go +++ b/internal/utils/config.go @@ -12,7 +12,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/pkg/config" ) var ( diff --git a/internal/utils/connect.go b/internal/utils/connect.go index c4f20df56..9479d4e4f 100644 --- a/internal/utils/connect.go +++ b/internal/utils/connect.go @@ -13,8 +13,8 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/debug" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/internal/debug" + "github.com/supabase/cli/pkg/pgxv5" ) func ToPostgresURL(config pgconn.Config) string { diff --git a/internal/utils/connect_test.go b/internal/utils/connect_test.go index f66b66659..4ea76c126 100644 --- a/internal/utils/connect_test.go +++ b/internal/utils/connect_test.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/utils/cloudflare" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/utils/cloudflare" + "github.com/supabase/cli/pkg/pgtest" ) var dbConfig = pgconn.Config{ diff --git a/internal/utils/console.go b/internal/utils/console.go index 54c36b968..85bebdc1e 100644 --- a/internal/utils/console.go +++ b/internal/utils/console.go @@ -10,7 +10,7 @@ import ( "time" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/pkg/cast" "golang.org/x/term" ) diff --git a/internal/utils/console_test.go b/internal/utils/console_test.go index f7662d2d1..ffc9532e7 100644 --- a/internal/utils/console_test.go +++ b/internal/utils/console_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/fstest" + "github.com/supabase/cli/internal/testing/fstest" ) func TestPromptYesNo(t *testing.T) { diff --git a/internal/utils/docker_test.go b/internal/utils/docker_test.go index ef166611b..6a0cdf034 100644 --- a/internal/utils/docker_test.go +++ b/internal/utils/docker_test.go @@ -16,7 +16,7 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/apitest" ) const ( diff --git a/internal/utils/flags/db_url.go b/internal/utils/flags/db_url.go index a08c6f0ba..013453b86 100644 --- a/internal/utils/flags/db_url.go +++ b/internal/utils/flags/db_url.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/afero" "github.com/spf13/pflag" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/internal/utils/credentials" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/credentials" + "github.com/supabase/cli/pkg/api" ) type connection int diff --git a/internal/utils/flags/project_ref.go b/internal/utils/flags/project_ref.go index 6b39b02ac..c1629c0fa 100644 --- a/internal/utils/flags/project_ref.go +++ b/internal/utils/flags/project_ref.go @@ -10,7 +10,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" "github.com/spf13/viper" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" "golang.org/x/term" ) diff --git a/internal/utils/flags/project_ref_test.go b/internal/utils/flags/project_ref_test.go index ee12de886..ee6a5374a 100644 --- a/internal/utils/flags/project_ref_test.go +++ b/internal/utils/flags/project_ref_test.go @@ -13,10 +13,10 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/internal/testing/fstest" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/internal/testing/fstest" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func TestProjectRef(t *testing.T) { diff --git a/internal/utils/release_test.go b/internal/utils/release_test.go index c5f413274..25aa920e8 100644 --- a/internal/utils/release_test.go +++ b/internal/utils/release_test.go @@ -9,8 +9,8 @@ import ( "github.com/google/go-github/v62/github" "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/internal/testing/apitest" - "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/internal/testing/apitest" + "github.com/supabase/cli/pkg/cast" ) func TestLatestRelease(t *testing.T) { diff --git a/internal/utils/tenant/client.go b/internal/utils/tenant/client.go index f932a5310..ad0ef6aa7 100644 --- a/internal/utils/tenant/client.go +++ b/internal/utils/tenant/client.go @@ -6,9 +6,9 @@ import ( "time" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/fetcher" ) var ( diff --git a/internal/utils/tenant/database.go b/internal/utils/tenant/database.go index 4f733e29c..1ae1ee6a7 100644 --- a/internal/utils/tenant/database.go +++ b/internal/utils/tenant/database.go @@ -4,7 +4,7 @@ import ( "context" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) var errDatabaseVersion = errors.New("Database version not found.") diff --git a/internal/utils/tenant/gotrue.go b/internal/utils/tenant/gotrue.go index 64269b276..507a63af5 100644 --- a/internal/utils/tenant/gotrue.go +++ b/internal/utils/tenant/gotrue.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/fetcher" ) var errGotrueVersion = errors.New("GoTrue version not found.") diff --git a/internal/utils/tenant/gotrue_test.go b/internal/utils/tenant/gotrue_test.go index 8c08d486f..fcc646e0d 100644 --- a/internal/utils/tenant/gotrue_test.go +++ b/internal/utils/tenant/gotrue_test.go @@ -8,7 +8,7 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/fetcher" ) var mockApi = TenantAPI{Fetcher: fetcher.NewFetcher( diff --git a/internal/utils/tenant/postgrest.go b/internal/utils/tenant/postgrest.go index 00293b4cf..cb8c96d28 100644 --- a/internal/utils/tenant/postgrest.go +++ b/internal/utils/tenant/postgrest.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/fetcher" ) var errPostgrestVersion = errors.New("PostgREST version not found.") diff --git a/internal/vanity_subdomains/activate/activate.go b/internal/vanity_subdomains/activate/activate.go index 2a968d88c..133ec7edd 100644 --- a/internal/vanity_subdomains/activate/activate.go +++ b/internal/vanity_subdomains/activate/activate.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef string, desiredSubdomain string, fsys afero.Fs) error { diff --git a/internal/vanity_subdomains/check/check.go b/internal/vanity_subdomains/check/check.go index 6a8bf9ddd..390122707 100644 --- a/internal/vanity_subdomains/check/check.go +++ b/internal/vanity_subdomains/check/check.go @@ -7,8 +7,8 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/api" ) func Run(ctx context.Context, projectRef string, desiredSubdomain string, fsys afero.Fs) error { diff --git a/internal/vanity_subdomains/delete/delete.go b/internal/vanity_subdomains/delete/delete.go index 592e2880f..3ee24d473 100644 --- a/internal/vanity_subdomains/delete/delete.go +++ b/internal/vanity_subdomains/delete/delete.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/internal/vanity_subdomains/get/get.go b/internal/vanity_subdomains/get/get.go index 450b54f4b..b466f1895 100644 --- a/internal/vanity_subdomains/get/get.go +++ b/internal/vanity_subdomains/get/get.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { diff --git a/main.go b/main.go index be8d4dc88..9b54f5ec4 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/supabase/cli/v2/cmd" + "github.com/supabase/cli/cmd" ) //go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen --config=pkg/api/types.cfg.yaml api/beta.yaml diff --git a/pkg/config/api.go b/pkg/config/api.go index 509e61e56..ec7c4f86d 100644 --- a/pkg/config/api.go +++ b/pkg/config/api.go @@ -3,9 +3,9 @@ package config import ( "strings" - v1API "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/diff" + v1API "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/diff" ) type ( diff --git a/pkg/config/api_test.go b/pkg/config/api_test.go index 951ea3c7c..92859c671 100644 --- a/pkg/config/api_test.go +++ b/pkg/config/api_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - v1API "github.com/supabase/cli/v2/pkg/api" + v1API "github.com/supabase/cli/pkg/api" ) func TestApiToUpdatePostgrestConfigBody(t *testing.T) { diff --git a/pkg/config/auth.go b/pkg/config/auth.go index c02923df7..5cb551cd1 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -5,9 +5,9 @@ import ( "strings" "time" - v1API "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/diff" + v1API "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/diff" ) type PasswordRequirements string diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index 428a6d055..057c5ccdd 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -8,8 +8,8 @@ import ( "github.com/go-errors/errors" "github.com/stretchr/testify/assert" - v1API "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" + v1API "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" ) func newWithDefaults() auth { diff --git a/pkg/config/config.go b/pkg/config/config.go index 425e02c12..938016e83 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -30,8 +30,8 @@ import ( "github.com/joho/godotenv" "github.com/mitchellh/mapstructure" "github.com/spf13/viper" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/fetcher" "golang.org/x/mod/semver" ) diff --git a/pkg/config/db.go b/pkg/config/db.go index e08176587..2a1d31cad 100644 --- a/pkg/config/db.go +++ b/pkg/config/db.go @@ -3,9 +3,9 @@ package config import ( "bytes" - v1API "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/diff" + v1API "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/diff" ) type PoolMode string diff --git a/pkg/config/db_test.go b/pkg/config/db_test.go index 8e7006d14..575fd202d 100644 --- a/pkg/config/db_test.go +++ b/pkg/config/db_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - v1API "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" + v1API "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" ) func TestDbSettingsToUpdatePostgresConfigBody(t *testing.T) { diff --git a/pkg/config/storage.go b/pkg/config/storage.go index b56907895..b11b28a10 100644 --- a/pkg/config/storage.go +++ b/pkg/config/storage.go @@ -1,9 +1,9 @@ package config import ( - v1API "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" - "github.com/supabase/cli/v2/pkg/diff" + v1API "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" + "github.com/supabase/cli/pkg/diff" ) type ( diff --git a/pkg/config/updater.go b/pkg/config/updater.go index 7a6d08d08..445000d0b 100644 --- a/pkg/config/updater.go +++ b/pkg/config/updater.go @@ -6,7 +6,7 @@ import ( "os" "github.com/go-errors/errors" - v1API "github.com/supabase/cli/v2/pkg/api" + v1API "github.com/supabase/cli/pkg/api" ) type ConfigUpdater struct { diff --git a/pkg/config/updater_test.go b/pkg/config/updater_test.go index d595d60b6..471e84963 100644 --- a/pkg/config/updater_test.go +++ b/pkg/config/updater_test.go @@ -8,8 +8,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - v1API "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/cast" + v1API "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" ) func TestUpdateApi(t *testing.T) { diff --git a/pkg/function/api.go b/pkg/function/api.go index 622786dc4..e3f641dee 100644 --- a/pkg/function/api.go +++ b/pkg/function/api.go @@ -4,7 +4,7 @@ import ( "context" "io" - "github.com/supabase/cli/v2/pkg/api" + "github.com/supabase/cli/pkg/api" ) type EdgeRuntimeAPI struct { diff --git a/pkg/function/batch.go b/pkg/function/batch.go index 0b61375c9..43f837fc4 100644 --- a/pkg/function/batch.go +++ b/pkg/function/batch.go @@ -12,8 +12,8 @@ import ( "github.com/cenkalti/backoff/v4" "github.com/docker/go-units" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/config" ) const ( diff --git a/pkg/function/batch_test.go b/pkg/function/batch_test.go index dfba2f4af..1489cd329 100644 --- a/pkg/function/batch_test.go +++ b/pkg/function/batch_test.go @@ -10,8 +10,8 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/pkg/api" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/config" ) type MockBundler struct { diff --git a/pkg/migration/apply_test.go b/pkg/migration/apply_test.go index 060702f11..65a75028a 100644 --- a/pkg/migration/apply_test.go +++ b/pkg/migration/apply_test.go @@ -9,7 +9,7 @@ import ( "github.com/jackc/pgerrcode" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) func TestPendingMigrations(t *testing.T) { diff --git a/pkg/migration/drop.go b/pkg/migration/drop.go index 68677ac26..362f2a9d2 100644 --- a/pkg/migration/drop.go +++ b/pkg/migration/drop.go @@ -7,7 +7,7 @@ import ( "github.com/go-errors/errors" "github.com/jackc/pgx/v4" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/pkg/pgxv5" ) var ( diff --git a/pkg/migration/drop_test.go b/pkg/migration/drop_test.go index a218d883f..d2c25ed56 100644 --- a/pkg/migration/drop_test.go +++ b/pkg/migration/drop_test.go @@ -6,7 +6,7 @@ import ( "github.com/jackc/pgerrcode" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) var escapedSchemas = append(ManagedSchemas, "extensions", "public") diff --git a/pkg/migration/file.go b/pkg/migration/file.go index d0bed5ad7..79da1c86a 100644 --- a/pkg/migration/file.go +++ b/pkg/migration/file.go @@ -14,7 +14,7 @@ import ( "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" "github.com/spf13/viper" - "github.com/supabase/cli/v2/pkg/parser" + "github.com/supabase/cli/pkg/parser" ) type MigrationFile struct { diff --git a/pkg/migration/file_test.go b/pkg/migration/file_test.go index 3b2877c52..a38238f8d 100644 --- a/pkg/migration/file_test.go +++ b/pkg/migration/file_test.go @@ -10,8 +10,8 @@ import ( "github.com/jackc/pgerrcode" "github.com/spf13/viper" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/parser" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/parser" + "github.com/supabase/cli/pkg/pgtest" ) func TestMigrationFile(t *testing.T) { diff --git a/pkg/migration/history.go b/pkg/migration/history.go index 3e6f8a362..2ca14167b 100644 --- a/pkg/migration/history.go +++ b/pkg/migration/history.go @@ -6,7 +6,7 @@ import ( "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/pkg/pgxv5" ) const ( diff --git a/pkg/migration/list.go b/pkg/migration/list.go index dfe9837bf..ec8bf2ac8 100644 --- a/pkg/migration/list.go +++ b/pkg/migration/list.go @@ -13,7 +13,7 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgerrcode" "github.com/jackc/pgx/v4" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/pkg/pgxv5" ) func ListRemoteMigrations(ctx context.Context, conn *pgx.Conn) ([]string, error) { diff --git a/pkg/migration/list_test.go b/pkg/migration/list_test.go index 40a193489..80d09fd40 100644 --- a/pkg/migration/list_test.go +++ b/pkg/migration/list_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgerrcode" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) func TestRemoteMigrations(t *testing.T) { diff --git a/pkg/migration/seed_test.go b/pkg/migration/seed_test.go index 1d228e531..7e9cd4aca 100644 --- a/pkg/migration/seed_test.go +++ b/pkg/migration/seed_test.go @@ -11,7 +11,7 @@ import ( "github.com/jackc/pgx/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/v2/pkg/pgtest" + "github.com/supabase/cli/pkg/pgtest" ) //go:embed testdata/seed.sql diff --git a/pkg/parser/token.go b/pkg/parser/token.go index b939ae6cb..db0084342 100644 --- a/pkg/parser/token.go +++ b/pkg/parser/token.go @@ -8,7 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/viper" - "github.com/supabase/cli/v2/pkg/cast" + "github.com/supabase/cli/pkg/cast" ) // Equal to `startBufSize` from `bufio/scan.go` diff --git a/pkg/pgtest/mock.go b/pkg/pgtest/mock.go index daa1dbd2a..0f5e9bb84 100644 --- a/pkg/pgtest/mock.go +++ b/pkg/pgtest/mock.go @@ -12,7 +12,7 @@ import ( "github.com/jackc/pgproto3/v2" "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" - "github.com/supabase/cli/v2/pkg/pgxv5" + "github.com/supabase/cli/pkg/pgxv5" "google.golang.org/grpc/test/bufconn" ) diff --git a/pkg/storage/api.go b/pkg/storage/api.go index 3904b52e8..e7765eb9f 100644 --- a/pkg/storage/api.go +++ b/pkg/storage/api.go @@ -1,6 +1,6 @@ package storage -import "github.com/supabase/cli/v2/pkg/fetcher" +import "github.com/supabase/cli/pkg/fetcher" type StorageAPI struct { *fetcher.Fetcher diff --git a/pkg/storage/batch.go b/pkg/storage/batch.go index dc54515b5..8a681242d 100644 --- a/pkg/storage/batch.go +++ b/pkg/storage/batch.go @@ -9,8 +9,8 @@ import ( "path/filepath" "github.com/go-errors/errors" - "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/pkg/queue" + "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/pkg/queue" ) func (s *StorageAPI) UpsertBuckets(ctx context.Context, bucketConfig config.BucketConfig, filter ...func(string) bool) error { diff --git a/pkg/storage/buckets.go b/pkg/storage/buckets.go index b2d4fc255..1f4bf9cc8 100644 --- a/pkg/storage/buckets.go +++ b/pkg/storage/buckets.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/fetcher" ) type BucketResponse struct { diff --git a/pkg/storage/objects.go b/pkg/storage/objects.go index 3a5633cf0..f048cecf6 100644 --- a/pkg/storage/objects.go +++ b/pkg/storage/objects.go @@ -11,7 +11,7 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/v2/pkg/fetcher" + "github.com/supabase/cli/pkg/fetcher" ) type ListObjectsQuery struct { diff --git a/tools/bumpdoc/main.go b/tools/bumpdoc/main.go index 10a86772e..55d9de344 100644 --- a/tools/bumpdoc/main.go +++ b/tools/bumpdoc/main.go @@ -12,8 +12,8 @@ import ( "regexp" "github.com/google/go-github/v62/github" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/tools/shared" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/tools/shared" ) const ( diff --git a/tools/changelog/main.go b/tools/changelog/main.go index 84ce70eca..97b587ed4 100644 --- a/tools/changelog/main.go +++ b/tools/changelog/main.go @@ -14,7 +14,7 @@ import ( "github.com/google/go-github/v62/github" "github.com/slack-go/slack" - "github.com/supabase/cli/v2/internal/utils" + "github.com/supabase/cli/internal/utils" ) func main() { diff --git a/tools/listdep/main.go b/tools/listdep/main.go index 6d28db52c..bf3c88985 100644 --- a/tools/listdep/main.go +++ b/tools/listdep/main.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "github.com/supabase/cli/v2/pkg/config" + "github.com/supabase/cli/pkg/config" ) func main() { diff --git a/tools/publish/main.go b/tools/publish/main.go index c9944a293..be2474edb 100644 --- a/tools/publish/main.go +++ b/tools/publish/main.go @@ -16,9 +16,9 @@ import ( "text/template" "github.com/google/go-github/v62/github" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/fetcher" - "github.com/supabase/cli/v2/tools/shared" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/fetcher" + "github.com/supabase/cli/tools/shared" ) const ( diff --git a/tools/selfhost/main.go b/tools/selfhost/main.go index 145c53801..cb9ada3a0 100644 --- a/tools/selfhost/main.go +++ b/tools/selfhost/main.go @@ -11,9 +11,9 @@ import ( "strings" "github.com/google/go-github/v62/github" - "github.com/supabase/cli/v2/internal/utils" - "github.com/supabase/cli/v2/pkg/config" - "github.com/supabase/cli/v2/tools/shared" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/config" + "github.com/supabase/cli/tools/shared" "gopkg.in/yaml.v3" ) From ac76d14c59f60385271b283b0999ec7d67ce7ff3 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sun, 8 Dec 2024 03:41:42 +0800 Subject: [PATCH 16/30] fix: optional smtp block should not override remote (#2954) --- internal/start/start.go | 2 +- pkg/config/auth.go | 70 ++++++++++++------- pkg/config/auth_test.go | 10 +++ pkg/config/config.go | 2 +- pkg/config/templates/config.toml | 1 + .../local_disabled_remote_enabled.diff | 14 ---- .../local_enabled_remote_disabled.diff | 13 ++-- 7 files changed, 67 insertions(+), 45 deletions(-) diff --git a/internal/start/start.go b/internal/start/start.go index 4315d31b7..2483b6aed 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -500,7 +500,7 @@ EOF fmt.Sprintf("GOTRUE_MFA_MAX_ENROLLED_FACTORS=%v", utils.Config.Auth.MFA.MaxEnrolledFactors), } - if utils.Config.Auth.Email.Smtp != nil { + if utils.Config.Auth.Email.Smtp != nil && utils.Config.Auth.Email.Smtp.IsEnabled() { env = append(env, fmt.Sprintf("GOTRUE_SMTP_HOST=%s", utils.Config.Auth.Email.Smtp.Host), fmt.Sprintf("GOTRUE_SMTP_PORT=%d", utils.Config.Auth.Email.Smtp.Port), diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 5cb551cd1..2341b9b4b 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -115,6 +115,7 @@ type ( } smtp struct { + Enabled *bool `toml:"enabled"` Host string `toml:"host"` Port uint16 `toml:"port"` User string `toml:"user"` @@ -380,16 +381,9 @@ func (e email) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { body.MailerOtpExp = cast.UintToIntPtr(&e.OtpExpiry) body.SecurityUpdatePasswordRequireReauthentication = &e.SecurePasswordChange body.SmtpMaxFrequency = cast.Ptr(int(e.MaxFrequency.Seconds())) + // When local config is not set, we assume platform defaults should not change if e.Smtp != nil { - body.SmtpHost = &e.Smtp.Host - body.SmtpPort = cast.Ptr(strconv.Itoa(int(e.Smtp.Port))) - body.SmtpUser = &e.Smtp.User - body.SmtpPass = &e.Smtp.Pass - body.SmtpAdminEmail = &e.Smtp.AdminEmail - body.SmtpSenderName = &e.Smtp.SenderName - } else { - // Setting a single empty string disables SMTP - body.SmtpHost = cast.Ptr("") + e.Smtp.toAuthConfigBody(body) } if len(e.Template) == 0 { return @@ -423,27 +417,14 @@ func (e *email) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { e.OtpExpiry = cast.IntToUint(remoteConfig.MailerOtpExp) e.SecurePasswordChange = cast.Val(remoteConfig.SecurityUpdatePasswordRequireReauthentication, false) e.MaxFrequency = time.Duration(cast.Val(remoteConfig.SmtpMaxFrequency, 0)) * time.Second - // Api resets all values when SMTP is disabled - if remoteConfig.SmtpHost != nil { - e.Smtp = &smtp{ - Host: *remoteConfig.SmtpHost, - User: cast.Val(remoteConfig.SmtpUser, ""), - Pass: hashPrefix + cast.Val(remoteConfig.SmtpPass, ""), - AdminEmail: cast.Val(remoteConfig.SmtpAdminEmail, ""), - SenderName: cast.Val(remoteConfig.SmtpSenderName, ""), - } - portStr := cast.Val(remoteConfig.SmtpPort, "") - if port, err := strconv.ParseUint(portStr, 10, 16); err == nil { - e.Smtp.Port = uint16(port) - } - } else { - e.Smtp = nil + // When local config is not set, we assume platform defaults should not change + if e.Smtp != nil { + e.Smtp.fromAuthConfig(remoteConfig) } if len(e.Template) == 0 { return } var tmpl emailTemplate - // When local config is not set, we assume platform defaults should not change tmpl = e.Template["invite"] if tmpl.Subject != nil { tmpl.Subject = remoteConfig.MailerSubjectsInvite @@ -499,6 +480,45 @@ func (e *email) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { e.Template["reauthentication"] = tmpl } +func (s smtp) IsEnabled() bool { + // If Enabled is not defined, or defined and set to true + return cast.Val(s.Enabled, true) +} + +func (s smtp) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { + if !s.IsEnabled() { + // Setting a single empty string disables SMTP + body.SmtpHost = cast.Ptr("") + return + } + body.SmtpHost = &s.Host + body.SmtpPort = cast.Ptr(strconv.Itoa(int(s.Port))) + body.SmtpUser = &s.User + body.SmtpPass = &s.Pass + body.SmtpAdminEmail = &s.AdminEmail + body.SmtpSenderName = &s.SenderName +} + +func (s *smtp) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { + showDiff := s.IsEnabled() + // Api resets all values when SMTP is disabled + if enabled := remoteConfig.SmtpHost != nil; s.Enabled != nil { + *s.Enabled = enabled + } + if !showDiff { + return + } + s.Host = cast.Val(remoteConfig.SmtpHost, "") + s.User = cast.Val(remoteConfig.SmtpUser, "") + s.Pass = hashPrefix + cast.Val(remoteConfig.SmtpPass, "") + s.AdminEmail = cast.Val(remoteConfig.SmtpAdminEmail, "") + s.SenderName = cast.Val(remoteConfig.SmtpSenderName, "") + portStr := cast.Val(remoteConfig.SmtpPort, "0") + if port, err := strconv.ParseUint(portStr, 10, 16); err == nil { + s.Port = uint16(port) + } +} + func (s sms) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { body.ExternalPhoneEnabled = &s.EnableSignup body.SmsMaxFrequency = cast.Ptr(int(s.MaxFrequency.Seconds())) diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index 057c5ccdd..aa35bcf9f 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -365,6 +365,7 @@ func TestEmailDiff(t *testing.T) { }, }, Smtp: &smtp{ + Enabled: cast.Ptr(true), Host: "smtp.sendgrid.net", Port: 587, User: "apikey", @@ -535,6 +536,15 @@ func TestEmailDiff(t *testing.T) { "email_change": {}, "reauthentication": {}, }, + Smtp: &smtp{ + Enabled: cast.Ptr(false), + Host: "smtp.sendgrid.net", + Port: 587, + User: "apikey", + Pass: "test-key", + AdminEmail: "admin@email.com", + SenderName: "Admin", + }, MaxFrequency: time.Minute, OtpLength: 6, OtpExpiry: 3600, diff --git a/pkg/config/config.go b/pkg/config/config.go index 938016e83..fcc2d3710 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -843,7 +843,7 @@ func (e *email) validate(fsys fs.FS) (err error) { } e.Template[name] = tmpl } - if e.Smtp != nil { + if e.Smtp != nil && e.Smtp.IsEnabled() { if len(e.Smtp.Host) == 0 { return errors.New("Missing required field in config: auth.email.smtp.host") } diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index f59dab08b..26c480c33 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -137,6 +137,7 @@ otp_expiry = 3600 # Use a production-ready SMTP server # [auth.email.smtp] +# enabled = true # host = "smtp.sendgrid.net" # port = 587 # user = "apikey" diff --git a/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff index 3123336fa..3308fd0a4 100644 --- a/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff +++ b/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff @@ -22,17 +22,3 @@ diff remote[auth] local[auth] [email.template] [email.template.confirmation] content_path = "" -@@ -71,13 +71,6 @@ - content_path = "" - [email.template.recovery] - content_path = "" --[email.smtp] --host = "smtp.sendgrid.net" --port = 587 --user = "apikey" --pass = "hash:ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e" --admin_email = "admin@email.com" --sender_name = "Admin" - - [sms] - enable_signup = false diff --git a/pkg/config/testdata/TestEmailDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestEmailDiff/local_enabled_remote_disabled.diff index 24386ae91..d42967e05 100644 --- a/pkg/config/testdata/TestEmailDiff/local_enabled_remote_disabled.diff +++ b/pkg/config/testdata/TestEmailDiff/local_enabled_remote_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -51,28 +51,43 @@ +@@ -51,35 +51,43 @@ inactivity_timeout = "0s" [email] @@ -40,10 +40,15 @@ diff remote[auth] local[auth] +content = "" content_path = "" [email.template.recovery] --content_path = "" +content = "recovery-content" -+content_path = "" -+[email.smtp] + content_path = "" + [email.smtp] +-host = "" +-port = 0 +-user = "" +-pass = "hash:" +-admin_email = "" +-sender_name = "" +host = "smtp.sendgrid.net" +port = 587 +user = "apikey" From 11a9f429ac2ae2aa0f4ebbe038c1947baeb6ad9c Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 9 Dec 2024 15:10:42 +0800 Subject: [PATCH 17/30] fix: ignore undefined external auth provider (#2955) chore: ignore undefined external auth provider --- pkg/config/auth.go | 469 ++++++++++-------- pkg/config/auth_test.go | 30 +- pkg/config/config.go | 24 +- .../local_enabled_and_disabled.diff | 17 +- 4 files changed, 299 insertions(+), 241 deletions(-) diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 2341b9b4b..6c14cf649 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -601,107 +601,125 @@ func (e external) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { if len(e) == 0 { return } - var p *provider // Ignore configs of disabled providers because their envs are not loaded - p = cast.Ptr(e["apple"]) - if body.ExternalAppleEnabled = &p.Enabled; *body.ExternalAppleEnabled { - body.ExternalAppleClientId = &p.ClientId - body.ExternalAppleSecret = &p.Secret - } - p = cast.Ptr(e["azure"]) - if body.ExternalAzureEnabled = &p.Enabled; *body.ExternalAzureEnabled { - body.ExternalAzureClientId = &p.ClientId - body.ExternalAzureSecret = &p.Secret - body.ExternalAzureUrl = &p.Url - } - p = cast.Ptr(e["bitbucket"]) - if body.ExternalBitbucketEnabled = &p.Enabled; *body.ExternalBitbucketEnabled { - body.ExternalBitbucketClientId = &p.ClientId - body.ExternalBitbucketSecret = &p.Secret - } - p = cast.Ptr(e["discord"]) - if body.ExternalDiscordEnabled = &p.Enabled; *body.ExternalDiscordEnabled { - body.ExternalDiscordClientId = &p.ClientId - body.ExternalDiscordSecret = &p.Secret - } - p = cast.Ptr(e["facebook"]) - if body.ExternalFacebookEnabled = &p.Enabled; *body.ExternalFacebookEnabled { - body.ExternalFacebookClientId = &p.ClientId - body.ExternalFacebookSecret = &p.Secret - } - p = cast.Ptr(e["figma"]) - if body.ExternalFigmaEnabled = &p.Enabled; *body.ExternalFigmaEnabled { - body.ExternalFigmaClientId = &p.ClientId - body.ExternalFigmaSecret = &p.Secret - } - p = cast.Ptr(e["github"]) - if body.ExternalGithubEnabled = &p.Enabled; *body.ExternalGithubEnabled { - body.ExternalGithubClientId = &p.ClientId - body.ExternalGithubSecret = &p.Secret - } - p = cast.Ptr(e["gitlab"]) - if body.ExternalGitlabEnabled = &p.Enabled; *body.ExternalGitlabEnabled { - body.ExternalGitlabClientId = &p.ClientId - body.ExternalGitlabSecret = &p.Secret - body.ExternalGitlabUrl = &p.Url - } - p = cast.Ptr(e["google"]) - if body.ExternalGoogleEnabled = &p.Enabled; *body.ExternalGoogleEnabled { - body.ExternalGoogleClientId = &p.ClientId - body.ExternalGoogleSecret = &p.Secret - body.ExternalGoogleSkipNonceCheck = &p.SkipNonceCheck - } - p = cast.Ptr(e["kakao"]) - if body.ExternalKakaoEnabled = &p.Enabled; *body.ExternalKakaoEnabled { - body.ExternalKakaoClientId = &p.ClientId - body.ExternalKakaoSecret = &p.Secret - } - p = cast.Ptr(e["keycloak"]) - if body.ExternalKeycloakEnabled = &p.Enabled; *body.ExternalKeycloakEnabled { - body.ExternalKeycloakClientId = &p.ClientId - body.ExternalKeycloakSecret = &p.Secret - body.ExternalKeycloakUrl = &p.Url - } - p = cast.Ptr(e["linkedin_oidc"]) - if body.ExternalLinkedinOidcEnabled = &p.Enabled; *body.ExternalLinkedinOidcEnabled { - body.ExternalLinkedinOidcClientId = &p.ClientId - body.ExternalLinkedinOidcSecret = &p.Secret - } - p = cast.Ptr(e["notion"]) - if body.ExternalNotionEnabled = &p.Enabled; *body.ExternalNotionEnabled { - body.ExternalNotionClientId = &p.ClientId - body.ExternalNotionSecret = &p.Secret - } - p = cast.Ptr(e["slack_oidc"]) - if body.ExternalSlackOidcEnabled = &p.Enabled; *body.ExternalSlackOidcEnabled { - body.ExternalSlackOidcClientId = &p.ClientId - body.ExternalSlackOidcSecret = &p.Secret - } - p = cast.Ptr(e["spotify"]) - if body.ExternalSpotifyEnabled = &p.Enabled; *body.ExternalSpotifyEnabled { - body.ExternalSpotifyClientId = &p.ClientId - body.ExternalSpotifySecret = &p.Secret - } - p = cast.Ptr(e["twitch"]) - if body.ExternalTwitchEnabled = &p.Enabled; *body.ExternalTwitchEnabled { - body.ExternalTwitchClientId = &p.ClientId - body.ExternalTwitchSecret = &p.Secret - } - p = cast.Ptr(e["twitter"]) - if body.ExternalTwitterEnabled = &p.Enabled; *body.ExternalTwitterEnabled { - body.ExternalTwitterClientId = &p.ClientId - body.ExternalTwitterSecret = &p.Secret - } - p = cast.Ptr(e["workos"]) - if body.ExternalWorkosEnabled = &p.Enabled; *body.ExternalWorkosEnabled { - body.ExternalWorkosClientId = &p.ClientId - body.ExternalWorkosSecret = &p.Secret - body.ExternalWorkosUrl = &p.Url - } - p = cast.Ptr(e["zoom"]) - if body.ExternalZoomEnabled = &p.Enabled; *body.ExternalZoomEnabled { - body.ExternalZoomClientId = &p.ClientId - body.ExternalZoomSecret = &p.Secret + if p, ok := e["apple"]; ok { + if body.ExternalAppleEnabled = &p.Enabled; *body.ExternalAppleEnabled { + body.ExternalAppleClientId = &p.ClientId + body.ExternalAppleSecret = &p.Secret + } + } + if p, ok := e["azure"]; ok { + if body.ExternalAzureEnabled = &p.Enabled; *body.ExternalAzureEnabled { + body.ExternalAzureClientId = &p.ClientId + body.ExternalAzureSecret = &p.Secret + body.ExternalAzureUrl = &p.Url + } + } + if p, ok := e["bitbucket"]; ok { + if body.ExternalBitbucketEnabled = &p.Enabled; *body.ExternalBitbucketEnabled { + body.ExternalBitbucketClientId = &p.ClientId + body.ExternalBitbucketSecret = &p.Secret + } + } + if p, ok := e["discord"]; ok { + if body.ExternalDiscordEnabled = &p.Enabled; *body.ExternalDiscordEnabled { + body.ExternalDiscordClientId = &p.ClientId + body.ExternalDiscordSecret = &p.Secret + } + } + if p, ok := e["facebook"]; ok { + if body.ExternalFacebookEnabled = &p.Enabled; *body.ExternalFacebookEnabled { + body.ExternalFacebookClientId = &p.ClientId + body.ExternalFacebookSecret = &p.Secret + } + } + if p, ok := e["figma"]; ok { + if body.ExternalFigmaEnabled = &p.Enabled; *body.ExternalFigmaEnabled { + body.ExternalFigmaClientId = &p.ClientId + body.ExternalFigmaSecret = &p.Secret + } + } + if p, ok := e["github"]; ok { + if body.ExternalGithubEnabled = &p.Enabled; *body.ExternalGithubEnabled { + body.ExternalGithubClientId = &p.ClientId + body.ExternalGithubSecret = &p.Secret + } + } + if p, ok := e["gitlab"]; ok { + if body.ExternalGitlabEnabled = &p.Enabled; *body.ExternalGitlabEnabled { + body.ExternalGitlabClientId = &p.ClientId + body.ExternalGitlabSecret = &p.Secret + body.ExternalGitlabUrl = &p.Url + } + } + if p, ok := e["google"]; ok { + if body.ExternalGoogleEnabled = &p.Enabled; *body.ExternalGoogleEnabled { + body.ExternalGoogleClientId = &p.ClientId + body.ExternalGoogleSecret = &p.Secret + body.ExternalGoogleSkipNonceCheck = &p.SkipNonceCheck + } + } + if p, ok := e["kakao"]; ok { + if body.ExternalKakaoEnabled = &p.Enabled; *body.ExternalKakaoEnabled { + body.ExternalKakaoClientId = &p.ClientId + body.ExternalKakaoSecret = &p.Secret + } + } + if p, ok := e["keycloak"]; ok { + if body.ExternalKeycloakEnabled = &p.Enabled; *body.ExternalKeycloakEnabled { + body.ExternalKeycloakClientId = &p.ClientId + body.ExternalKeycloakSecret = &p.Secret + body.ExternalKeycloakUrl = &p.Url + } + } + if p, ok := e["linkedin_oidc"]; ok { + if body.ExternalLinkedinOidcEnabled = &p.Enabled; *body.ExternalLinkedinOidcEnabled { + body.ExternalLinkedinOidcClientId = &p.ClientId + body.ExternalLinkedinOidcSecret = &p.Secret + } + } + if p, ok := e["notion"]; ok { + if body.ExternalNotionEnabled = &p.Enabled; *body.ExternalNotionEnabled { + body.ExternalNotionClientId = &p.ClientId + body.ExternalNotionSecret = &p.Secret + } + } + if p, ok := e["slack_oidc"]; ok { + if body.ExternalSlackOidcEnabled = &p.Enabled; *body.ExternalSlackOidcEnabled { + body.ExternalSlackOidcClientId = &p.ClientId + body.ExternalSlackOidcSecret = &p.Secret + } + } + if p, ok := e["spotify"]; ok { + if body.ExternalSpotifyEnabled = &p.Enabled; *body.ExternalSpotifyEnabled { + body.ExternalSpotifyClientId = &p.ClientId + body.ExternalSpotifySecret = &p.Secret + } + } + if p, ok := e["twitch"]; ok { + if body.ExternalTwitchEnabled = &p.Enabled; *body.ExternalTwitchEnabled { + body.ExternalTwitchClientId = &p.ClientId + body.ExternalTwitchSecret = &p.Secret + } + } + if p, ok := e["twitter"]; ok { + if body.ExternalTwitterEnabled = &p.Enabled; *body.ExternalTwitterEnabled { + body.ExternalTwitterClientId = &p.ClientId + body.ExternalTwitterSecret = &p.Secret + } + } + if p, ok := e["workos"]; ok { + if body.ExternalWorkosEnabled = &p.Enabled; *body.ExternalWorkosEnabled { + body.ExternalWorkosClientId = &p.ClientId + body.ExternalWorkosSecret = &p.Secret + body.ExternalWorkosUrl = &p.Url + } + } + if p, ok := e["zoom"]; ok { + if body.ExternalZoomEnabled = &p.Enabled; *body.ExternalZoomEnabled { + body.ExternalZoomClientId = &p.ClientId + body.ExternalZoomSecret = &p.Secret + } } } @@ -709,151 +727,188 @@ func (e external) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { if len(e) == 0 { return } - var p provider // Ignore configs of disabled providers because their envs are not loaded - if p = e["apple"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalAppleClientId, "") - if ids := cast.Val(remoteConfig.ExternalAppleAdditionalClientIds, ""); len(ids) > 0 { - p.ClientId += "," + ids + if p, ok := e["apple"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalAppleClientId, "") + if ids := cast.Val(remoteConfig.ExternalAppleAdditionalClientIds, ""); len(ids) > 0 { + p.ClientId += "," + ids + } + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalAppleSecret, "") } - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalAppleSecret, "") - } - p.Enabled = cast.Val(remoteConfig.ExternalAppleEnabled, false) - e["apple"] = p - - if p = e["azure"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalAzureClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalAzureSecret, "") - p.Url = cast.Val(remoteConfig.ExternalAzureUrl, "") + p.Enabled = cast.Val(remoteConfig.ExternalAppleEnabled, false) + e["apple"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalAzureEnabled, false) - e["azure"] = p - if p = e["bitbucket"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalBitbucketClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalBitbucketSecret, "") + if p, ok := e["azure"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalAzureClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalAzureSecret, "") + p.Url = cast.Val(remoteConfig.ExternalAzureUrl, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalAzureEnabled, false) + e["azure"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalBitbucketEnabled, false) - e["bitbucket"] = p - if p = e["discord"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalDiscordClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalDiscordSecret, "") + if p, ok := e["bitbucket"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalBitbucketClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalBitbucketSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalBitbucketEnabled, false) + e["bitbucket"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalDiscordEnabled, false) - e["discord"] = p - if p = e["facebook"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalFacebookClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalFacebookSecret, "") + if p, ok := e["discord"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalDiscordClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalDiscordSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalDiscordEnabled, false) + e["discord"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalFacebookEnabled, false) - e["facebook"] = p - if p = e["figma"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalFigmaClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalFigmaSecret, "") + if p, ok := e["facebook"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalFacebookClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalFacebookSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalFacebookEnabled, false) + e["facebook"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalFigmaEnabled, false) - e["figma"] = p - if p = e["github"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalGithubClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalGithubSecret, "") + if p, ok := e["figma"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalFigmaClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalFigmaSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalFigmaEnabled, false) + e["figma"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalGithubEnabled, false) - e["github"] = p - if p = e["gitlab"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalGitlabClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalGitlabSecret, "") - p.Url = cast.Val(remoteConfig.ExternalGitlabUrl, "") + if p, ok := e["github"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalGithubClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalGithubSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalGithubEnabled, false) + e["github"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalGitlabEnabled, false) - e["gitlab"] = p - if p = e["google"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalGoogleClientId, "") - if ids := cast.Val(remoteConfig.ExternalGoogleAdditionalClientIds, ""); len(ids) > 0 { - p.ClientId += "," + ids + if p, ok := e["gitlab"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalGitlabClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalGitlabSecret, "") + p.Url = cast.Val(remoteConfig.ExternalGitlabUrl, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalGitlabEnabled, false) + e["gitlab"] = p + } + + if p, ok := e["google"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalGoogleClientId, "") + if ids := cast.Val(remoteConfig.ExternalGoogleAdditionalClientIds, ""); len(ids) > 0 { + p.ClientId += "," + ids + } + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalGoogleSecret, "") + p.SkipNonceCheck = cast.Val(remoteConfig.ExternalGoogleSkipNonceCheck, false) } - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalGoogleSecret, "") - p.SkipNonceCheck = cast.Val(remoteConfig.ExternalGoogleSkipNonceCheck, false) + p.Enabled = cast.Val(remoteConfig.ExternalGoogleEnabled, false) + e["google"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalGoogleEnabled, false) - e["google"] = p - if p = e["kakao"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalKakaoClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalKakaoSecret, "") + if p, ok := e["kakao"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalKakaoClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalKakaoSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalKakaoEnabled, false) + e["kakao"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalKakaoEnabled, false) - e["kakao"] = p - if p = e["keycloak"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalKeycloakClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalKeycloakSecret, "") - p.Url = cast.Val(remoteConfig.ExternalKeycloakUrl, "") + if p, ok := e["keycloak"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalKeycloakClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalKeycloakSecret, "") + p.Url = cast.Val(remoteConfig.ExternalKeycloakUrl, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalKeycloakEnabled, false) + e["keycloak"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalKeycloakEnabled, false) - e["keycloak"] = p - if p = e["linkedin_oidc"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalLinkedinOidcClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalLinkedinOidcSecret, "") + if p, ok := e["linkedin_oidc"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalLinkedinOidcClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalLinkedinOidcSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalLinkedinOidcEnabled, false) + e["linkedin_oidc"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalLinkedinOidcEnabled, false) - e["linkedin_oidc"] = p - if p = e["notion"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalNotionClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalNotionSecret, "") + if p, ok := e["notion"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalNotionClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalNotionSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalNotionEnabled, false) + e["notion"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalNotionEnabled, false) - e["notion"] = p - if p = e["slack_oidc"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalSlackOidcClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalSlackOidcSecret, "") + if p, ok := e["slack_oidc"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalSlackOidcClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalSlackOidcSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalSlackOidcEnabled, false) + e["slack_oidc"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalSlackOidcEnabled, false) - e["slack_oidc"] = p - if p = e["spotify"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalSpotifyClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalSpotifySecret, "") + if p, ok := e["spotify"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalSpotifyClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalSpotifySecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalSpotifyEnabled, false) + e["spotify"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalSpotifyEnabled, false) - e["spotify"] = p - if p = e["twitch"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalTwitchClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalTwitchSecret, "") + if p, ok := e["twitch"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalTwitchClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalTwitchSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalTwitchEnabled, false) + e["twitch"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalTwitchEnabled, false) - e["twitch"] = p - if p = e["twitter"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalTwitterClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalTwitterSecret, "") + if p, ok := e["twitter"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalTwitterClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalTwitterSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalTwitterEnabled, false) + e["twitter"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalTwitterEnabled, false) - e["twitter"] = p - if p = e["workos"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalWorkosClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalWorkosSecret, "") - p.Url = cast.Val(remoteConfig.ExternalWorkosUrl, "") + if p, ok := e["workos"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalWorkosClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalWorkosSecret, "") + p.Url = cast.Val(remoteConfig.ExternalWorkosUrl, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalWorkosEnabled, false) + e["workos"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalWorkosEnabled, false) - e["workos"] = p - if p = e["zoom"]; p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalZoomClientId, "") - p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalZoomSecret, "") + if p, ok := e["zoom"]; ok { + if p.Enabled { + p.ClientId = cast.Val(remoteConfig.ExternalZoomClientId, "") + p.Secret = hashPrefix + cast.Val(remoteConfig.ExternalZoomSecret, "") + } + p.Enabled = cast.Val(remoteConfig.ExternalZoomEnabled, false) + e["zoom"] = p } - p.Enabled = cast.Val(remoteConfig.ExternalZoomEnabled, false) - e["zoom"] = p } func (a *auth) DiffWithRemote(projectRef string, remoteConfig v1API.AuthConfigResponse) ([]byte, error) { diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index aa35bcf9f..404f1cbb6 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -835,15 +835,24 @@ func TestExternalDiff(t *testing.T) { ClientId: "test-client-1,test-client-2", Secret: "test-secret", }, - "azure": {}, - "bitbucket": {}, - "discord": {}, - "facebook": {}, - "figma": {}, - "github": {}, - "gitlab": {}, - "google": {}, - "kakao": {}, + "azure": { + Enabled: true, + ClientId: "test-client-1", + Secret: "test-secret", + }, + "bitbucket": {}, + "discord": {}, + "facebook": {}, + "figma": {}, + "github": {}, + "gitlab": {}, + "google": { + Enabled: false, + ClientId: "test-client-2", + Secret: "env(test_secret)", + SkipNonceCheck: false, + }, + // "kakao": {}, "keycloak": {}, "linkedin_oidc": {}, "notion": {}, @@ -865,6 +874,9 @@ func TestExternalDiff(t *testing.T) { ExternalGoogleEnabled: cast.Ptr(true), ExternalGoogleSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), ExternalGoogleSkipNonceCheck: cast.Ptr(true), + ExternalKakaoClientId: cast.Ptr("test-client-2"), + ExternalKakaoEnabled: cast.Ptr(true), + ExternalKakaoSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), }) // Check error assert.NoError(t, err) diff --git a/pkg/config/config.go b/pkg/config/config.go index fcc2d3710..6b8306ba5 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -306,29 +306,7 @@ func NewConfig(editors ...ConfigEditor) config { Sms: sms{ TestOTP: map[string]string{}, }, - External: map[string]provider{ - "apple": {}, - "azure": {}, - "bitbucket": {}, - "discord": {}, - "facebook": {}, - "figma": {}, - "github": {}, - "gitlab": {}, - "google": {}, - "kakao": {}, - "keycloak": {}, - "linkedin": {}, // TODO: remove this field in v2 - "linkedin_oidc": {}, - "notion": {}, - "twitch": {}, - "twitter": {}, - "slack": {}, // TODO: remove this field in v2 - "slack_oidc": {}, - "spotify": {}, - "workos": {}, - "zoom": {}, - }, + External: map[string]provider{}, JwtSecret: defaultJwtSecret, }, Inbucket: inbucket{ diff --git a/pkg/config/testdata/TestExternalDiff/local_enabled_and_disabled.diff b/pkg/config/testdata/TestExternalDiff/local_enabled_and_disabled.diff index 234e422f4..37ab653dd 100644 --- a/pkg/config/testdata/TestExternalDiff/local_enabled_and_disabled.diff +++ b/pkg/config/testdata/TestExternalDiff/local_enabled_and_disabled.diff @@ -10,12 +10,25 @@ diff remote[auth] local[auth] client_id = "test-client-1,test-client-2" secret = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252" url = "" +@@ -98,9 +98,9 @@ + redirect_uri = "" + skip_nonce_check = false + [external.azure] +-enabled = false +-client_id = "" +-secret = "hash:" ++enabled = true ++client_id = "test-client-1" ++secret = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252" + url = "" + redirect_uri = "" + skip_nonce_check = false @@ -147,7 +147,7 @@ redirect_uri = "" skip_nonce_check = false [external.google] -enabled = true +enabled = false - client_id = "" - secret = "" + client_id = "test-client-2" + secret = "env(test_secret)" url = "" From 8627a1632f8079840cd71021e5bc827426deb692 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 04:08:00 +0000 Subject: [PATCH 18/30] chore(deps): bump github.com/docker/cli from 27.3.1+incompatible to 27.4.0+incompatible (#2959) chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 27.3.1+incompatible to 27.4.0+incompatible. - [Commits](https://github.com/docker/cli/compare/v27.3.1...v27.4.0) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 21 +-------------------- go.sum | 46 ++-------------------------------------------- 2 files changed, 3 insertions(+), 64 deletions(-) diff --git a/go.mod b/go.mod index 1c55174b8..7d1632a6a 100644 --- a/go.mod +++ b/go.mod @@ -13,12 +13,11 @@ require ( github.com/charmbracelet/lipgloss v0.12.1 github.com/containers/common v0.61.0 github.com/deepmap/oapi-codegen/v2 v2.2.0 - github.com/docker/cli v27.3.1+incompatible + github.com/docker/cli v27.4.0+incompatible github.com/docker/docker v27.3.1+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/getsentry/sentry-go v0.30.0 - github.com/gin-gonic/gin v1.10.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.12.0 github.com/go-xmlfmt/xmlfmt v1.1.3 @@ -35,7 +34,6 @@ require ( github.com/jackc/pgtype v1.14.4 github.com/jackc/pgx/v4 v4.18.3 github.com/joho/godotenv v1.5.1 - github.com/matoous/go-nanoid/v2 v2.1.0 github.com/mitchellh/mapstructure v1.5.0 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/runtime v1.1.1 @@ -95,8 +93,6 @@ require ( github.com/breml/errchkjson v0.4.0 // indirect github.com/butuzov/ireturn v0.3.0 // indirect github.com/butuzov/mirror v1.2.0 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -106,8 +102,6 @@ require ( github.com/chavacava/garif v0.1.0 // indirect github.com/ckaznocha/intrange v0.2.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/cloudwego/base64x v0.1.4 // indirect - github.com/cloudwego/iasm v0.2.0 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containers/storage v1.56.0 // indirect @@ -133,10 +127,8 @@ require ( github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/getkin/kin-openapi v0.124.0 // indirect github.com/ghostiam/protogetter v0.3.8 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-critic/go-critic v0.11.5 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect @@ -144,9 +136,6 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.20.0 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.2.0 // indirect @@ -156,7 +145,6 @@ require ( github.com/go-toolsmith/typep v1.1.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -196,13 +184,11 @@ require ( github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jjti/go-spancheck v0.6.2 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/julz/importas v0.1.0 // indirect github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kisielk/errcheck v1.8.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kulti/thelper v0.6.3 // indirect @@ -211,7 +197,6 @@ require ( github.com/lasiar/canonicalheader v1.1.2 // indirect github.com/ldez/gomoddirectives v0.2.4 // indirect github.com/ldez/tagliatelle v0.5.0 // indirect - github.com/leodido/go-urn v1.4.0 // indirect github.com/leonklingele/grouper v1.1.2 // indirect github.com/lib/pq v1.10.9 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect @@ -234,8 +219,6 @@ require ( github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/term v0.5.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/moricho/tparallel v0.3.2 // indirect github.com/morikuni/aec v1.0.0 // indirect @@ -298,7 +281,6 @@ require ( github.com/timonwong/loggercheck v0.10.1 // indirect github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.1.1 // indirect @@ -331,7 +313,6 @@ require ( go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.9.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/arch v0.8.0 // indirect golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect diff --git a/go.sum b/go.sum index 9313587d7..2e82216da 100644 --- a/go.sum +++ b/go.sum @@ -147,10 +147,6 @@ github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= -github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= @@ -189,10 +185,6 @@ github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= -github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= -github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= -github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= @@ -234,8 +226,8 @@ github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v27.3.1+incompatible h1:qEGdFBF3Xu6SCvCYhc7CzaQTlBmqDuzxPDpigSyeKQQ= -github.com/docker/cli v27.3.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v27.4.0+incompatible h1:/nJzWkcI1MDMN+U+px/YXnQWJqnu4J+QKGTfD6ptiTc= +github.com/docker/cli v27.4.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= @@ -287,18 +279,12 @@ github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQ github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= github.com/ghostiam/protogetter v0.3.8 h1:LYcXbYvybUyTIxN2Mj9h6rHrDZBDwZloPoKctWrFyJY= github.com/ghostiam/protogetter v0.3.8/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= -github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-critic/go-critic v0.11.5 h1:TkDTOn5v7EEngMxu8KbuFqFR43USaaH8XRJLz1jhVYA= @@ -331,14 +317,6 @@ github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1 github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= -github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -375,8 +353,6 @@ github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUW github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= @@ -602,7 +578,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -622,10 +597,6 @@ github.com/kisielk/errcheck v1.8.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -652,8 +623,6 @@ github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJ github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= -github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= -github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/lib/pq v0.0.0-20150723085316-0dad96c0b94f/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -676,8 +645,6 @@ github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= -github.com/matoous/go-nanoid/v2 v2.1.0 h1:P64+dmq21hhWdtvZfEAofnvJULaRR1Yib0+PnU669bE= -github.com/matoous/go-nanoid/v2 v2.1.0/go.mod h1:KlbGNQ+FhrUNIHUxZdL63t7tl4LaPkZNpUULS8H4uVM= github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2srm/LN17lpybq15AryXIRcWYLE= github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= @@ -724,11 +691,9 @@ github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiT github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= @@ -971,8 +936,6 @@ github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+ github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= @@ -1074,9 +1037,6 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= -golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1548,8 +1508,6 @@ mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 89357663cc1dd3b6506a62faec1df97e27d1d000 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 10 Dec 2024 18:26:29 +0800 Subject: [PATCH 19/30] fix: enforce auth hook secrets conform to standard webhooks (#2961) * fix: enforce auth hook secrets conform to standard webhooks * fix: skip hashing empty secrets * chore: mark all hook configs as optional * chore: update unit tests --- internal/start/start.go | 30 ++-- pkg/config/auth.go | 133 ++++++++-------- pkg/config/auth_test.go | 142 ++++++++++++------ pkg/config/config.go | 40 +++-- pkg/config/config_test.go | 10 +- .../local_enabled_and_disabled.diff | 2 +- .../local_disabled_remote_enabled.diff | 2 +- .../local_enabled_remote_disabled.diff | 2 +- .../local_enabled_and_disabled.diff | 6 +- .../local_disabled_remote_enabled.diff | 27 ++++ .../local_enabled_and_disabled.diff | 36 ----- .../local_enabled_remote_disabled.diff | 33 ++++ .../local_enabled_and_disabled.diff | 4 +- .../enable_sign_up_without_provider.diff | 2 +- .../local_disabled_remote_enabled.diff | 4 +- .../local_enabled_remote_disabled.diff | 6 +- 16 files changed, 290 insertions(+), 189 deletions(-) create mode 100644 pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff delete mode 100644 pkg/config/testdata/TestHookDiff/local_enabled_and_disabled.diff create mode 100644 pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff diff --git a/internal/start/start.go b/internal/start/start.go index 2483b6aed..9096f381d 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -583,44 +583,44 @@ EOF ) } - if utils.Config.Auth.Hook.MFAVerificationAttempt.Enabled { + if hook := utils.Config.Auth.Hook.MFAVerificationAttempt; hook != nil && hook.Enabled { env = append( env, "GOTRUE_HOOK_MFA_VERIFICATION_ATTEMPT_ENABLED=true", - "GOTRUE_HOOK_MFA_VERIFICATION_ATTEMPT_URI="+utils.Config.Auth.Hook.MFAVerificationAttempt.URI, - "GOTRUE_HOOK_MFA_VERIFICATION_ATTEMPT_SECRETS="+utils.Config.Auth.Hook.MFAVerificationAttempt.Secrets, + "GOTRUE_HOOK_MFA_VERIFICATION_ATTEMPT_URI="+hook.URI, + "GOTRUE_HOOK_MFA_VERIFICATION_ATTEMPT_SECRETS="+hook.Secrets, ) } - if utils.Config.Auth.Hook.PasswordVerificationAttempt.Enabled { + if hook := utils.Config.Auth.Hook.PasswordVerificationAttempt; hook != nil && hook.Enabled { env = append( env, "GOTRUE_HOOK_PASSWORD_VERIFICATION_ATTEMPT_ENABLED=true", - "GOTRUE_HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI="+utils.Config.Auth.Hook.PasswordVerificationAttempt.URI, - "GOTRUE_HOOK_PASSWORD_VERIFICATION_ATTEMPT_SECRETS="+utils.Config.Auth.Hook.PasswordVerificationAttempt.Secrets, + "GOTRUE_HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI="+hook.URI, + "GOTRUE_HOOK_PASSWORD_VERIFICATION_ATTEMPT_SECRETS="+hook.Secrets, ) } - if utils.Config.Auth.Hook.CustomAccessToken.Enabled { + if hook := utils.Config.Auth.Hook.CustomAccessToken; hook != nil && hook.Enabled { env = append( env, "GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_ENABLED=true", - "GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_URI="+utils.Config.Auth.Hook.CustomAccessToken.URI, - "GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_SECRETS="+utils.Config.Auth.Hook.CustomAccessToken.Secrets, + "GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_URI="+hook.URI, + "GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_SECRETS="+hook.Secrets, ) } - if utils.Config.Auth.Hook.SendSMS.Enabled { + if hook := utils.Config.Auth.Hook.SendSMS; hook != nil && hook.Enabled { env = append( env, "GOTRUE_HOOK_SEND_SMS_ENABLED=true", - "GOTRUE_HOOK_SEND_SMS_URI="+utils.Config.Auth.Hook.SendSMS.URI, - "GOTRUE_HOOK_SEND_SMS_SECRETS="+utils.Config.Auth.Hook.SendSMS.Secrets, + "GOTRUE_HOOK_SEND_SMS_URI="+hook.URI, + "GOTRUE_HOOK_SEND_SMS_SECRETS="+hook.Secrets, ) } - if utils.Config.Auth.Hook.SendEmail.Enabled { + if hook := utils.Config.Auth.Hook.SendEmail; hook != nil && hook.Enabled { env = append( env, "GOTRUE_HOOK_SEND_EMAIL_ENABLED=true", - "GOTRUE_HOOK_SEND_EMAIL_URI="+utils.Config.Auth.Hook.SendEmail.URI, - "GOTRUE_HOOK_SEND_EMAIL_SECRETS="+utils.Config.Auth.Hook.SendEmail.Secrets, + "GOTRUE_HOOK_SEND_EMAIL_URI="+hook.URI, + "GOTRUE_HOOK_SEND_EMAIL_SECRETS="+hook.Secrets, ) } diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 6c14cf649..b2e6b0fa6 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -145,11 +145,11 @@ type ( } hook struct { - MFAVerificationAttempt hookConfig `toml:"mfa_verification_attempt"` - PasswordVerificationAttempt hookConfig `toml:"password_verification_attempt"` - CustomAccessToken hookConfig `toml:"custom_access_token"` - SendSMS hookConfig `toml:"send_sms"` - SendEmail hookConfig `toml:"send_email"` + MFAVerificationAttempt *hookConfig `toml:"mfa_verification_attempt"` + PasswordVerificationAttempt *hookConfig `toml:"password_verification_attempt"` + CustomAccessToken *hookConfig `toml:"custom_access_token"` + SendSMS *hookConfig `toml:"send_sms"` + SendEmail *hookConfig `toml:"send_email"` } factorTypeConfiguration struct { @@ -261,80 +261,88 @@ func (a *auth) FromRemoteAuthConfig(remoteConfig v1API.AuthConfigResponse) { } func (h hook) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { - if body.HookCustomAccessTokenEnabled = &h.CustomAccessToken.Enabled; *body.HookCustomAccessTokenEnabled { - body.HookCustomAccessTokenUri = &h.CustomAccessToken.URI - if len(h.CustomAccessToken.Secrets) > 0 { - body.HookCustomAccessTokenSecrets = &h.CustomAccessToken.Secrets + // When local config is not set, we assume platform defaults should not change + if hook := h.CustomAccessToken; hook != nil { + if body.HookCustomAccessTokenEnabled = &hook.Enabled; hook.Enabled { + body.HookCustomAccessTokenUri = &hook.URI + if len(hook.Secrets) > 0 { + body.HookCustomAccessTokenSecrets = &hook.Secrets + } } } - if body.HookSendEmailEnabled = &h.SendEmail.Enabled; *body.HookSendEmailEnabled { - body.HookSendEmailUri = &h.SendEmail.URI - if len(h.SendEmail.Secrets) > 0 { - body.HookSendEmailSecrets = &h.SendEmail.Secrets + if hook := h.SendEmail; hook != nil { + if body.HookSendEmailEnabled = &hook.Enabled; hook.Enabled { + body.HookSendEmailUri = &hook.URI + if len(hook.Secrets) > 0 { + body.HookSendEmailSecrets = &hook.Secrets + } } } - if body.HookSendSmsEnabled = &h.SendSMS.Enabled; *body.HookSendSmsEnabled { - body.HookSendSmsUri = &h.SendSMS.URI - if len(h.SendSMS.Secrets) > 0 { - body.HookSendSmsSecrets = &h.SendSMS.Secrets + if hook := h.SendSMS; hook != nil { + if body.HookSendSmsEnabled = &hook.Enabled; hook.Enabled { + body.HookSendSmsUri = &hook.URI + if len(hook.Secrets) > 0 { + body.HookSendSmsSecrets = &hook.Secrets + } } } // Enterprise and team only features - if body.HookMfaVerificationAttemptEnabled = &h.MFAVerificationAttempt.Enabled; *body.HookMfaVerificationAttemptEnabled { - body.HookMfaVerificationAttemptUri = &h.MFAVerificationAttempt.URI - if len(h.MFAVerificationAttempt.Secrets) > 0 { - body.HookMfaVerificationAttemptSecrets = &h.MFAVerificationAttempt.Secrets + if hook := h.MFAVerificationAttempt; hook != nil { + if body.HookMfaVerificationAttemptEnabled = &hook.Enabled; hook.Enabled { + body.HookMfaVerificationAttemptUri = &hook.URI + if len(hook.Secrets) > 0 { + body.HookMfaVerificationAttemptSecrets = &hook.Secrets + } } } - if body.HookPasswordVerificationAttemptEnabled = &h.PasswordVerificationAttempt.Enabled; *body.HookPasswordVerificationAttemptEnabled { - body.HookPasswordVerificationAttemptUri = &h.PasswordVerificationAttempt.URI - if len(h.PasswordVerificationAttempt.Secrets) > 0 { - body.HookPasswordVerificationAttemptSecrets = &h.PasswordVerificationAttempt.Secrets + if hook := h.PasswordVerificationAttempt; hook != nil { + if body.HookPasswordVerificationAttemptEnabled = &hook.Enabled; hook.Enabled { + body.HookPasswordVerificationAttemptUri = &hook.URI + if len(hook.Secrets) > 0 { + body.HookPasswordVerificationAttemptSecrets = &hook.Secrets + } } } } func (h *hook) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { - // Ignore disabled hooks because their envs are not loaded - if h.CustomAccessToken.Enabled { - h.CustomAccessToken.URI = cast.Val(remoteConfig.HookCustomAccessTokenUri, "") - if remoteConfig.HookCustomAccessTokenSecrets != nil { - h.CustomAccessToken.Secrets = hashPrefix + cast.Val(remoteConfig.HookCustomAccessTokenSecrets, "") + // When local config is not set, we assume platform defaults should not change + if hook := h.CustomAccessToken; hook != nil { + // Ignore disabled hooks because their envs are not loaded + if hook.Enabled { + hook.URI = cast.Val(remoteConfig.HookCustomAccessTokenUri, "") + hook.Secrets = hashPrefix + cast.Val(remoteConfig.HookCustomAccessTokenSecrets, "") } + hook.Enabled = cast.Val(remoteConfig.HookCustomAccessTokenEnabled, false) } - h.CustomAccessToken.Enabled = cast.Val(remoteConfig.HookCustomAccessTokenEnabled, false) - - if h.SendEmail.Enabled { - h.SendEmail.URI = cast.Val(remoteConfig.HookSendEmailUri, "") - if remoteConfig.HookSendEmailSecrets != nil { - h.SendEmail.Secrets = hashPrefix + cast.Val(remoteConfig.HookSendEmailSecrets, "") + if hook := h.SendEmail; hook != nil { + if hook.Enabled { + hook.URI = cast.Val(remoteConfig.HookSendEmailUri, "") + hook.Secrets = hashPrefix + cast.Val(remoteConfig.HookSendEmailSecrets, "") } + hook.Enabled = cast.Val(remoteConfig.HookSendEmailEnabled, false) } - h.SendEmail.Enabled = cast.Val(remoteConfig.HookSendEmailEnabled, false) - - if h.SendSMS.Enabled { - h.SendSMS.URI = cast.Val(remoteConfig.HookSendSmsUri, "") - if remoteConfig.HookSendSmsSecrets != nil { - h.SendSMS.Secrets = hashPrefix + cast.Val(remoteConfig.HookSendSmsSecrets, "") + if hook := h.SendSMS; hook != nil { + if hook.Enabled { + hook.URI = cast.Val(remoteConfig.HookSendSmsUri, "") + hook.Secrets = hashPrefix + cast.Val(remoteConfig.HookSendSmsSecrets, "") } + hook.Enabled = cast.Val(remoteConfig.HookSendSmsEnabled, false) } - h.SendSMS.Enabled = cast.Val(remoteConfig.HookSendSmsEnabled, false) - // Enterprise and team only features - if h.MFAVerificationAttempt.Enabled { - h.MFAVerificationAttempt.URI = cast.Val(remoteConfig.HookMfaVerificationAttemptUri, "") - if remoteConfig.HookMfaVerificationAttemptSecrets != nil { - h.MFAVerificationAttempt.Secrets = hashPrefix + cast.Val(remoteConfig.HookMfaVerificationAttemptSecrets, "") + if hook := h.MFAVerificationAttempt; hook != nil { + if hook.Enabled { + hook.URI = cast.Val(remoteConfig.HookMfaVerificationAttemptUri, "") + hook.Secrets = hashPrefix + cast.Val(remoteConfig.HookMfaVerificationAttemptSecrets, "") } + hook.Enabled = cast.Val(remoteConfig.HookMfaVerificationAttemptEnabled, false) } - h.MFAVerificationAttempt.Enabled = cast.Val(remoteConfig.HookMfaVerificationAttemptEnabled, false) - - if h.PasswordVerificationAttempt.Enabled { - h.PasswordVerificationAttempt.URI = cast.Val(remoteConfig.HookPasswordVerificationAttemptUri, "") - if remoteConfig.HookPasswordVerificationAttemptSecrets != nil { - h.PasswordVerificationAttempt.Secrets = hashPrefix + cast.Val(remoteConfig.HookPasswordVerificationAttemptSecrets, "") + if hook := h.PasswordVerificationAttempt; hook != nil { + if hook.Enabled { + hook.URI = cast.Val(remoteConfig.HookPasswordVerificationAttemptUri, "") + hook.Secrets = hashPrefix + cast.Val(remoteConfig.HookPasswordVerificationAttemptSecrets, "") } + hook.Enabled = cast.Val(remoteConfig.HookPasswordVerificationAttemptEnabled, false) } - h.PasswordVerificationAttempt.Enabled = cast.Val(remoteConfig.HookPasswordVerificationAttemptEnabled, false) } func (m mfa) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { @@ -931,9 +939,12 @@ const hashPrefix = "hash:" func (a *auth) HashSecrets(key string) { hash := func(v string) string { + if len(v) == 0 { + return hashPrefix + } return hashPrefix + sha256Hmac(key, v) } - if a.Email.Smtp != nil && len(a.Email.Smtp.Pass) > 0 { + if a.Email.Smtp != nil && a.Email.Smtp.IsEnabled() { a.Email.Smtp.Pass = hash(a.Email.Smtp.Pass) } // Only hash secrets for locally enabled providers because other envs won't be loaded @@ -949,19 +960,19 @@ func (a *auth) HashSecrets(key string) { case a.Sms.Vonage.Enabled: a.Sms.Vonage.ApiSecret = hash(a.Sms.Vonage.ApiSecret) } - if a.Hook.MFAVerificationAttempt.Enabled && len(a.Hook.MFAVerificationAttempt.Secrets) > 0 { + if a.Hook.MFAVerificationAttempt != nil && a.Hook.MFAVerificationAttempt.Enabled { a.Hook.MFAVerificationAttempt.Secrets = hash(a.Hook.MFAVerificationAttempt.Secrets) } - if a.Hook.PasswordVerificationAttempt.Enabled && len(a.Hook.PasswordVerificationAttempt.Secrets) > 0 { + if a.Hook.PasswordVerificationAttempt != nil && a.Hook.PasswordVerificationAttempt.Enabled { a.Hook.PasswordVerificationAttempt.Secrets = hash(a.Hook.PasswordVerificationAttempt.Secrets) } - if a.Hook.CustomAccessToken.Enabled && len(a.Hook.CustomAccessToken.Secrets) > 0 { + if a.Hook.CustomAccessToken != nil && a.Hook.CustomAccessToken.Enabled { a.Hook.CustomAccessToken.Secrets = hash(a.Hook.CustomAccessToken.Secrets) } - if a.Hook.SendSMS.Enabled && len(a.Hook.SendSMS.Secrets) > 0 { + if a.Hook.SendSMS != nil && a.Hook.SendSMS.Enabled { a.Hook.SendSMS.Secrets = hash(a.Hook.SendSMS.Secrets) } - if a.Hook.SendEmail.Enabled && len(a.Hook.SendEmail.Secrets) > 0 { + if a.Hook.SendEmail != nil && a.Hook.SendEmail.Enabled { a.Hook.SendEmail.Secrets = hash(a.Hook.SendEmail.Secrets) } for name, provider := range a.External { diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index 404f1cbb6..e659da166 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -121,27 +121,27 @@ func TestHookDiff(t *testing.T) { t.Run("local and remote enabled", func(t *testing.T) { c := newWithDefaults() c.Hook = hook{ - CustomAccessToken: hookConfig{ + CustomAccessToken: &hookConfig{ Enabled: true, URI: "http://example.com", Secrets: "test-secret", }, - SendSMS: hookConfig{ + SendSMS: &hookConfig{ Enabled: true, URI: "http://example.com", Secrets: "test-secret", }, - SendEmail: hookConfig{ + SendEmail: &hookConfig{ Enabled: true, URI: "https://example.com", Secrets: "test-secret", }, - MFAVerificationAttempt: hookConfig{ + MFAVerificationAttempt: &hookConfig{ Enabled: true, URI: "https://example.com", Secrets: "test-secret", }, - PasswordVerificationAttempt: hookConfig{ + PasswordVerificationAttempt: &hookConfig{ Enabled: true, URI: "pg-functions://verifyPassword", }, @@ -151,12 +151,12 @@ func TestHookDiff(t *testing.T) { HookCustomAccessTokenEnabled: cast.Ptr(true), HookCustomAccessTokenUri: cast.Ptr("http://example.com"), HookCustomAccessTokenSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), - HookSendEmailEnabled: cast.Ptr(true), - HookSendEmailUri: cast.Ptr("https://example.com"), - HookSendEmailSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), HookSendSmsEnabled: cast.Ptr(true), HookSendSmsUri: cast.Ptr("http://example.com"), HookSendSmsSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookSendEmailEnabled: cast.Ptr(true), + HookSendEmailUri: cast.Ptr("https://example.com"), + HookSendEmailSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), HookMfaVerificationAttemptEnabled: cast.Ptr(true), HookMfaVerificationAttemptUri: cast.Ptr("https://example.com"), HookMfaVerificationAttemptSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), @@ -168,41 +168,38 @@ func TestHookDiff(t *testing.T) { assert.Empty(t, string(diff)) }) - t.Run("local enabled and disabled", func(t *testing.T) { + t.Run("local disabled remote enabled", func(t *testing.T) { c := newWithDefaults() c.Hook = hook{ - CustomAccessToken: hookConfig{ - Enabled: true, - URI: "http://example.com", - Secrets: "test-secret", + CustomAccessToken: &hookConfig{ + Enabled: false, }, - SendSMS: hookConfig{ + SendSMS: &hookConfig{ Enabled: false, URI: "https://example.com", Secrets: "test-secret", }, - SendEmail: hookConfig{ - Enabled: true, - URI: "pg-functions://sendEmail", + SendEmail: &hookConfig{ + Enabled: false, }, - MFAVerificationAttempt: hookConfig{ + MFAVerificationAttempt: &hookConfig{ Enabled: false, - URI: "pg-functions://verifyMFA", + URI: "pg-functions://postgres/public/verifyMFA", }, - PasswordVerificationAttempt: hookConfig{Enabled: false}, + PasswordVerificationAttempt: nil, } // Run test diff, err := c.DiffWithRemote("", v1API.AuthConfigResponse{ - HookCustomAccessTokenEnabled: cast.Ptr(false), - HookCustomAccessTokenUri: cast.Ptr(""), - HookCustomAccessTokenSecrets: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), - HookSendEmailEnabled: cast.Ptr(false), - HookSendEmailUri: cast.Ptr(""), + HookCustomAccessTokenEnabled: cast.Ptr(true), + HookCustomAccessTokenUri: cast.Ptr("http://example.com"), + HookCustomAccessTokenSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), HookSendSmsEnabled: cast.Ptr(true), - HookSendSmsUri: cast.Ptr("http://example.com"), + HookSendSmsUri: cast.Ptr("https://example.com"), HookSendSmsSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookSendEmailEnabled: cast.Ptr(true), + HookSendEmailUri: cast.Ptr("pg-functions://postgres/public/sendEmail"), HookMfaVerificationAttemptEnabled: cast.Ptr(true), - HookMfaVerificationAttemptUri: cast.Ptr("pg-functions://verifyMFA"), + HookMfaVerificationAttemptUri: cast.Ptr("pg-functions://postgres/public/verifyMFA"), HookPasswordVerificationAttemptEnabled: cast.Ptr(true), HookPasswordVerificationAttemptUri: cast.Ptr("https://example.com"), HookPasswordVerificationAttemptSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), @@ -212,13 +209,62 @@ func TestHookDiff(t *testing.T) { assertSnapshotEqual(t, diff) }) - t.Run("local and remote disabled", func(t *testing.T) { + t.Run("local enabled remote disabled", func(t *testing.T) { c := newWithDefaults() + c.Hook = hook{ + CustomAccessToken: &hookConfig{ + Enabled: true, + URI: "http://example.com", + Secrets: "test-secret", + }, + SendSMS: &hookConfig{ + Enabled: true, + URI: "https://example.com", + Secrets: "test-secret", + }, + SendEmail: &hookConfig{ + Enabled: true, + URI: "pg-functions://postgres/public/sendEmail", + }, + MFAVerificationAttempt: &hookConfig{ + Enabled: true, + URI: "pg-functions://postgres/public/verifyMFA", + }, + PasswordVerificationAttempt: nil, + } // Run test diff, err := c.DiffWithRemote("", v1API.AuthConfigResponse{ HookCustomAccessTokenEnabled: cast.Ptr(false), + HookCustomAccessTokenUri: cast.Ptr("pg-functions://postgres/public/customToken"), + HookSendSmsEnabled: cast.Ptr(false), + HookSendSmsUri: cast.Ptr("https://example.com"), + HookSendSmsSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), HookSendEmailEnabled: cast.Ptr(false), + HookSendEmailUri: cast.Ptr("https://example.com"), + HookSendEmailSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookMfaVerificationAttemptEnabled: cast.Ptr(false), + HookMfaVerificationAttemptUri: cast.Ptr("pg-functions://postgres/public/verifyMFA"), + HookPasswordVerificationAttemptEnabled: cast.Ptr(false), + }) + // Check error + assert.NoError(t, err) + assertSnapshotEqual(t, diff) + }) + + t.Run("local and remote disabled", func(t *testing.T) { + c := newWithDefaults() + c.Hook = hook{ + CustomAccessToken: &hookConfig{Enabled: false}, + SendSMS: &hookConfig{Enabled: false}, + SendEmail: &hookConfig{Enabled: false}, + MFAVerificationAttempt: &hookConfig{Enabled: false}, + PasswordVerificationAttempt: &hookConfig{Enabled: false}, + } + // Run test + diff, err := c.DiffWithRemote("", v1API.AuthConfigResponse{ + HookCustomAccessTokenEnabled: cast.Ptr(false), HookSendSmsEnabled: cast.Ptr(false), + HookSendEmailEnabled: cast.Ptr(false), HookMfaVerificationAttemptEnabled: cast.Ptr(false), HookPasswordVerificationAttemptEnabled: cast.Ptr(false), }) @@ -719,7 +765,7 @@ func TestSmsDiff(t *testing.T) { diff, err := c.DiffWithRemote("", v1API.AuthConfigResponse{ ExternalPhoneEnabled: cast.Ptr(false), SmsProvider: cast.Ptr("messagebird"), - SmsMessagebirdAccessKey: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + SmsMessagebirdAccessKey: cast.Ptr(""), }) // Check error assert.NoError(t, err) @@ -756,67 +802,67 @@ func TestExternalDiff(t *testing.T) { ExternalAppleAdditionalClientIds: cast.Ptr(""), ExternalAppleClientId: cast.Ptr(""), ExternalAppleEnabled: cast.Ptr(true), - ExternalAppleSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalAppleSecret: cast.Ptr(""), ExternalAzureClientId: cast.Ptr(""), ExternalAzureEnabled: cast.Ptr(true), - ExternalAzureSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalAzureSecret: cast.Ptr(""), ExternalAzureUrl: cast.Ptr(""), ExternalBitbucketClientId: cast.Ptr(""), ExternalBitbucketEnabled: cast.Ptr(true), - ExternalBitbucketSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalBitbucketSecret: cast.Ptr(""), ExternalDiscordClientId: cast.Ptr(""), ExternalDiscordEnabled: cast.Ptr(true), - ExternalDiscordSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalDiscordSecret: cast.Ptr(""), ExternalFacebookClientId: cast.Ptr(""), ExternalFacebookEnabled: cast.Ptr(true), - ExternalFacebookSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalFacebookSecret: cast.Ptr(""), ExternalFigmaClientId: cast.Ptr(""), ExternalFigmaEnabled: cast.Ptr(true), - ExternalFigmaSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalFigmaSecret: cast.Ptr(""), ExternalGithubClientId: cast.Ptr(""), ExternalGithubEnabled: cast.Ptr(true), - ExternalGithubSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalGithubSecret: cast.Ptr(""), ExternalGitlabClientId: cast.Ptr(""), ExternalGitlabEnabled: cast.Ptr(true), - ExternalGitlabSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalGitlabSecret: cast.Ptr(""), ExternalGitlabUrl: cast.Ptr(""), ExternalGoogleAdditionalClientIds: cast.Ptr(""), ExternalGoogleClientId: cast.Ptr(""), ExternalGoogleEnabled: cast.Ptr(true), - ExternalGoogleSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalGoogleSecret: cast.Ptr(""), ExternalGoogleSkipNonceCheck: cast.Ptr(false), ExternalKakaoClientId: cast.Ptr(""), ExternalKakaoEnabled: cast.Ptr(true), - ExternalKakaoSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalKakaoSecret: cast.Ptr(""), ExternalKeycloakClientId: cast.Ptr(""), ExternalKeycloakEnabled: cast.Ptr(true), - ExternalKeycloakSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalKeycloakSecret: cast.Ptr(""), ExternalKeycloakUrl: cast.Ptr(""), ExternalLinkedinOidcClientId: cast.Ptr(""), ExternalLinkedinOidcEnabled: cast.Ptr(true), - ExternalLinkedinOidcSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalLinkedinOidcSecret: cast.Ptr(""), ExternalNotionClientId: cast.Ptr(""), ExternalNotionEnabled: cast.Ptr(true), - ExternalNotionSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalNotionSecret: cast.Ptr(""), ExternalSlackOidcClientId: cast.Ptr(""), ExternalSlackOidcEnabled: cast.Ptr(true), - ExternalSlackOidcSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalSlackOidcSecret: cast.Ptr(""), ExternalSpotifyClientId: cast.Ptr(""), ExternalSpotifyEnabled: cast.Ptr(true), - ExternalSpotifySecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalSpotifySecret: cast.Ptr(""), ExternalTwitchClientId: cast.Ptr(""), ExternalTwitchEnabled: cast.Ptr(true), - ExternalTwitchSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalTwitchSecret: cast.Ptr(""), ExternalTwitterClientId: cast.Ptr(""), ExternalTwitterEnabled: cast.Ptr(true), - ExternalTwitterSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalTwitterSecret: cast.Ptr(""), ExternalWorkosClientId: cast.Ptr(""), ExternalWorkosEnabled: cast.Ptr(true), - ExternalWorkosSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalWorkosSecret: cast.Ptr(""), ExternalWorkosUrl: cast.Ptr(""), ExternalZoomClientId: cast.Ptr(""), ExternalZoomEnabled: cast.Ptr(true), - ExternalZoomSecret: cast.Ptr("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalZoomSecret: cast.Ptr(""), // Deprecated fields should be ignored ExternalSlackClientId: cast.Ptr(""), ExternalSlackEnabled: cast.Ptr(true), diff --git a/pkg/config/config.go b/pkg/config/config.go index 6b8306ba5..0e3f00a84 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -950,21 +950,36 @@ func (e external) validate() (err error) { } func (h *hook) validate() error { - if err := h.MFAVerificationAttempt.validate("mfa_verification_attempt"); err != nil { - return err + if hook := h.MFAVerificationAttempt; hook != nil { + if err := hook.validate("mfa_verification_attempt"); err != nil { + return err + } } - if err := h.PasswordVerificationAttempt.validate("password_verification_attempt"); err != nil { - return err + if hook := h.PasswordVerificationAttempt; hook != nil { + if err := hook.validate("password_verification_attempt"); err != nil { + return err + } } - if err := h.CustomAccessToken.validate("custom_access_token"); err != nil { - return err + if hook := h.CustomAccessToken; hook != nil { + if err := hook.validate("custom_access_token"); err != nil { + return err + } } - if err := h.SendSMS.validate("send_sms"); err != nil { - return err + if hook := h.SendSMS; hook != nil { + if err := hook.validate("send_sms"); err != nil { + return err + } + } + if hook := h.SendEmail; hook != nil { + if err := h.SendEmail.validate("send_email"); err != nil { + return err + } } - return h.SendEmail.validate("send_email") + return nil } +var hookSecretPattern = regexp.MustCompile(`^v1,whsec_[A-Za-z0-9+/=]{32,88}$`) + func (h *hookConfig) validate(hookType string) (err error) { // If not enabled do nothing if !h.Enabled { @@ -984,12 +999,17 @@ func (h *hookConfig) validate(hookType string) (err error) { } else if h.Secrets, err = maybeLoadEnv(h.Secrets); err != nil { return err } + for _, secret := range strings.Split(h.Secrets, "|") { + if !hookSecretPattern.MatchString(secret) { + return errors.Errorf(`Invalid hook config: auth.hook.%s.secrets must be formatted as "v1,whsec_"`, hookType) + } + } case "pg-functions": if len(h.Secrets) > 0 { return errors.Errorf("Invalid hook config: auth.hook.%s.secrets is unsupported for pg-functions URI", hookType) } default: - return errors.Errorf("Invalid hook config: auth.hook.%v should be a HTTP, HTTPS, or pg-functions URI", hookType) + return errors.Errorf("Invalid hook config: auth.hook.%s.uri should be a HTTP, HTTPS, or pg-functions URI", hookType) } return nil } diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 4aa7ce243..e1678f2ed 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -214,7 +214,7 @@ func TestValidateHookURI(t *testing.T) { hookConfig: hookConfig{ Enabled: true, URI: "http://example.com", - Secrets: "test-secret", + Secrets: "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==", }, }, { @@ -222,7 +222,7 @@ func TestValidateHookURI(t *testing.T) { hookConfig: hookConfig{ Enabled: true, URI: "https://example.com", - Secrets: "test-secret", + Secrets: "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==", }, }, { @@ -237,16 +237,16 @@ func TestValidateHookURI(t *testing.T) { hookConfig: hookConfig{ Enabled: true, URI: "ftp://example.com", - Secrets: "test-secret", + Secrets: "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==", }, - errorMsg: "Invalid hook config: auth.hook.invalid URI with unsupported scheme should be a HTTP, HTTPS, or pg-functions URI", + errorMsg: "Invalid hook config: auth.hook.invalid URI with unsupported scheme.uri should be a HTTP, HTTPS, or pg-functions URI", }, { name: "invalid URI with parsing error", hookConfig: hookConfig{ Enabled: true, URI: "http://a b.com", - Secrets: "test-secret", + Secrets: "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==", }, errorMsg: "failed to parse template url: parse \"http://a b.com\": invalid character \" \" in host name", }, diff --git a/pkg/config/testdata/TestAuthDiff/local_enabled_and_disabled.diff b/pkg/config/testdata/TestAuthDiff/local_enabled_and_disabled.diff index 3db4d5462..b4022569c 100644 --- a/pkg/config/testdata/TestAuthDiff/local_enabled_and_disabled.diff +++ b/pkg/config/testdata/TestAuthDiff/local_enabled_and_disabled.diff @@ -25,4 +25,4 @@ diff remote[auth] local[auth] +password_requirements = "lower_upper_letters_digits_symbols" [hook] - [hook.mfa_verification_attempt] + diff --git a/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff index 3308fd0a4..99a50071f 100644 --- a/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff +++ b/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -51,13 +51,13 @@ +@@ -31,13 +31,13 @@ inactivity_timeout = "0s" [email] diff --git a/pkg/config/testdata/TestEmailDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestEmailDiff/local_enabled_remote_disabled.diff index d42967e05..85d30362a 100644 --- a/pkg/config/testdata/TestEmailDiff/local_enabled_remote_disabled.diff +++ b/pkg/config/testdata/TestEmailDiff/local_enabled_remote_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -51,35 +51,43 @@ +@@ -31,35 +31,43 @@ inactivity_timeout = "0s" [email] diff --git a/pkg/config/testdata/TestExternalDiff/local_enabled_and_disabled.diff b/pkg/config/testdata/TestExternalDiff/local_enabled_and_disabled.diff index 37ab653dd..089d74eee 100644 --- a/pkg/config/testdata/TestExternalDiff/local_enabled_and_disabled.diff +++ b/pkg/config/testdata/TestExternalDiff/local_enabled_and_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -91,7 +91,7 @@ +@@ -71,7 +71,7 @@ [external] [external.apple] @@ -10,7 +10,7 @@ diff remote[auth] local[auth] client_id = "test-client-1,test-client-2" secret = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252" url = "" -@@ -98,9 +98,9 @@ +@@ -78,9 +78,9 @@ redirect_uri = "" skip_nonce_check = false [external.azure] @@ -23,7 +23,7 @@ diff remote[auth] local[auth] url = "" redirect_uri = "" skip_nonce_check = false -@@ -147,7 +147,7 @@ +@@ -127,7 +127,7 @@ redirect_uri = "" skip_nonce_check = false [external.google] diff --git a/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff new file mode 100644 index 000000000..c8cf4c5f0 --- /dev/null +++ b/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff @@ -0,0 +1,27 @@ +diff remote[auth] local[auth] +--- remote[auth] ++++ local[auth] +@@ -11,19 +11,19 @@ + + [hook] + [hook.mfa_verification_attempt] +-enabled = true ++enabled = false + uri = "pg-functions://postgres/public/verifyMFA" + secrets = "" + [hook.custom_access_token] +-enabled = true ++enabled = false + uri = "" + secrets = "" + [hook.send_sms] +-enabled = true ++enabled = false + uri = "https://example.com" + secrets = "test-secret" + [hook.send_email] +-enabled = true ++enabled = false + uri = "" + secrets = "" + diff --git a/pkg/config/testdata/TestHookDiff/local_enabled_and_disabled.diff b/pkg/config/testdata/TestHookDiff/local_enabled_and_disabled.diff deleted file mode 100644 index e3afeb491..000000000 --- a/pkg/config/testdata/TestHookDiff/local_enabled_and_disabled.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff remote[auth] local[auth] ---- remote[auth] -+++ local[auth] -@@ -11,24 +11,24 @@ - - [hook] - [hook.mfa_verification_attempt] --enabled = true -+enabled = false - uri = "pg-functions://verifyMFA" - secrets = "" - [hook.password_verification_attempt] --enabled = true -+enabled = false - uri = "" - secrets = "" - [hook.custom_access_token] --enabled = false --uri = "" --secrets = "hash:b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad" -+enabled = true -+uri = "http://example.com" -+secrets = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252" - [hook.send_sms] --enabled = true -+enabled = false - uri = "https://example.com" - secrets = "test-secret" - [hook.send_email] --enabled = false --uri = "" -+enabled = true -+uri = "pg-functions://sendEmail" - secrets = "" - - [mfa] diff --git a/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff new file mode 100644 index 000000000..e5f26740e --- /dev/null +++ b/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff @@ -0,0 +1,33 @@ +diff remote[auth] local[auth] +--- remote[auth] ++++ local[auth] +@@ -11,21 +11,21 @@ + + [hook] + [hook.mfa_verification_attempt] +-enabled = false ++enabled = true + uri = "pg-functions://postgres/public/verifyMFA" + secrets = "hash:" + [hook.custom_access_token] +-enabled = false +-uri = "pg-functions://postgres/public/customToken" +-secrets = "hash:" ++enabled = true ++uri = "http://example.com" ++secrets = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252" + [hook.send_sms] +-enabled = false ++enabled = true + uri = "https://example.com" + secrets = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252" + [hook.send_email] +-enabled = false +-uri = "https://example.com" +-secrets = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252" ++enabled = true ++uri = "pg-functions://postgres/public/sendEmail" ++secrets = "hash:" + + [mfa] + max_enrolled_factors = 0 diff --git a/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff b/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff index 866ce8fae..e5fa7c476 100644 --- a/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff +++ b/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff @@ -1,8 +1,8 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -32,16 +32,16 @@ - secrets = "" +@@ -12,16 +12,16 @@ + [hook] [mfa] -max_enrolled_factors = 10 diff --git a/pkg/config/testdata/TestSmsDiff/enable_sign_up_without_provider.diff b/pkg/config/testdata/TestSmsDiff/enable_sign_up_without_provider.diff index 637a0206e..a7c312c91 100644 --- a/pkg/config/testdata/TestSmsDiff/enable_sign_up_without_provider.diff +++ b/pkg/config/testdata/TestSmsDiff/enable_sign_up_without_provider.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -60,7 +60,7 @@ +@@ -40,7 +40,7 @@ otp_expiry = 0 [sms] diff --git a/pkg/config/testdata/TestSmsDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestSmsDiff/local_disabled_remote_enabled.diff index 4348c80ba..1dd938cd7 100644 --- a/pkg/config/testdata/TestSmsDiff/local_disabled_remote_enabled.diff +++ b/pkg/config/testdata/TestSmsDiff/local_disabled_remote_enabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -60,12 +60,12 @@ +@@ -40,12 +40,12 @@ otp_expiry = 0 [sms] @@ -19,7 +19,7 @@ diff remote[auth] local[auth] account_sid = "" message_service_sid = "" auth_token = "" -@@ -88,8 +88,6 @@ +@@ -68,8 +68,6 @@ api_key = "" api_secret = "" [sms.test_otp] diff --git a/pkg/config/testdata/TestSmsDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestSmsDiff/local_enabled_remote_disabled.diff index e29c287ed..4418013bf 100644 --- a/pkg/config/testdata/TestSmsDiff/local_enabled_remote_disabled.diff +++ b/pkg/config/testdata/TestSmsDiff/local_enabled_remote_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -60,12 +60,12 @@ +@@ -40,12 +40,12 @@ otp_expiry = 0 [sms] @@ -19,7 +19,7 @@ diff remote[auth] local[auth] account_sid = "" message_service_sid = "" auth_token = "" -@@ -75,9 +75,9 @@ +@@ -55,9 +55,9 @@ message_service_sid = "" auth_token = "" [sms.messagebird] @@ -32,7 +32,7 @@ diff remote[auth] local[auth] [sms.textlocal] enabled = false sender = "" -@@ -88,6 +88,7 @@ +@@ -68,6 +68,7 @@ api_key = "" api_secret = "" [sms.test_otp] From 440764786fe117d0dddcb34c0a85e86ab3a5ce00 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 10 Dec 2024 19:09:53 +0800 Subject: [PATCH 20/30] fix: handle pointers when cloning auth hooks (#2962) --- pkg/config/config.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index 0e3f00a84..a9536f43e 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -224,6 +224,26 @@ func (a *auth) Clone() auth { mailer := *a.Email.Smtp copy.Email.Smtp = &mailer } + if a.Hook.MFAVerificationAttempt != nil { + hook := *a.Hook.MFAVerificationAttempt + copy.Hook.MFAVerificationAttempt = &hook + } + if a.Hook.PasswordVerificationAttempt != nil { + hook := *a.Hook.PasswordVerificationAttempt + copy.Hook.PasswordVerificationAttempt = &hook + } + if a.Hook.CustomAccessToken != nil { + hook := *a.Hook.CustomAccessToken + copy.Hook.CustomAccessToken = &hook + } + if a.Hook.SendSMS != nil { + hook := *a.Hook.SendSMS + copy.Hook.SendSMS = &hook + } + if a.Hook.SendEmail != nil { + hook := *a.Hook.SendEmail + copy.Hook.SendEmail = &hook + } copy.Email.Template = maps.Clone(a.Email.Template) copy.Sms.TestOTP = maps.Clone(a.Sms.TestOTP) return copy From 06044cea4bae549528ec61a8ff34c3f5ecbd4231 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 11 Dec 2024 11:41:14 +0800 Subject: [PATCH 21/30] chore: update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e58bd32eb..25b00f97a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @supabase/cli +* @supabase/dev-workflows From baa2c23fa2379f532ba38e9bbf7d9e69a41bcbe0 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 11 Dec 2024 15:20:43 +0800 Subject: [PATCH 22/30] fix: rewrite content template path in nested directory (#2965) * fix: rewrite content template path in nested directory * chore: remove unnecessary clean --- pkg/config/config.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index a9536f43e..fa8da8bf4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -495,6 +495,15 @@ func (c *config) Load(path string, fsys fs.FS) error { if version, err := fs.ReadFile(fsys, builder.PgmetaVersionPath); err == nil && len(version) > 0 { c.Studio.PgmetaImage = replaceImageTag(pgmetaImage, string(version)) } + // Update content paths + for name, tmpl := range c.Auth.Email.Template { + // FIXME: only email template is relative to repo directory + cwd := filepath.Dir(builder.SupabaseDirPath) + if len(tmpl.ContentPath) > 0 && !filepath.IsAbs(tmpl.ContentPath) { + tmpl.ContentPath = filepath.Join(cwd, tmpl.ContentPath) + } + c.Auth.Email.Template[name] = tmpl + } // Update fallback configs for name, bucket := range c.Storage.Buckets { if bucket.FileSizeLimit == 0 { @@ -834,7 +843,7 @@ func (e *email) validate(fsys fs.FS) (err error) { } continue } - if content, err := fs.ReadFile(fsys, filepath.Clean(tmpl.ContentPath)); err != nil { + if content, err := fs.ReadFile(fsys, tmpl.ContentPath); err != nil { return errors.Errorf("Invalid config for auth.email.%s.content_path: %w", name, err) } else { tmpl.Content = cast.Ptr(string(content)) From 8cac0be02711cdd3bc08b56db4dfb256ea574423 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 11 Dec 2024 17:49:40 +0800 Subject: [PATCH 23/30] fix: disable image transformation and mfa by default (#2966) * fix: disable image transformation by default * fix: disable mfa totp by default * chore: update test config * chore: disable instead of commenting out * chore: add note about pro plan * fix: remove default value for image transformation config --- pkg/config/config.go | 3 +-- pkg/config/templates/config.toml | 14 ++++++++------ pkg/config/testdata/config.toml | 29 ++++++++++++++++++++--------- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index fa8da8bf4..410bd7aa3 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -307,8 +307,7 @@ func NewConfig(editors ...ConfigEditor) config { Region: "local", }, ImageTransformation: imageTransformation{ - Enabled: true, - Image: imageProxyImage, + Image: imageProxyImage, }, }, Auth: auth{ diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index 26c480c33..e3f55ae68 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -82,8 +82,9 @@ enabled = true # The maximum file size allowed (e.g. "5MB", "500KB"). file_size_limit = "50MiB" +# Image transformation API is available to Supabase Pro plan. [storage.image_transformation] -enabled = true +enabled = false # Uncomment to configure local storage buckets # [storage.buckets.images] @@ -184,16 +185,17 @@ message_service_sid = "" # DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" +# Multi-factor-authentication is available to Supabase Pro plan. [auth.mfa] # Control how many MFA factors can be enrolled at once per user. max_enrolled_factors = 10 -# Control use of MFA via App Authenticator (TOTP) +# Control MFA via App Authenticator (TOTP) [auth.mfa.totp] -enroll_enabled = true -verify_enabled = true +enroll_enabled = false +verify_enabled = false -# Configure Multi-factor-authentication via Phone Messaging +# Configure MFA via Phone Messaging [auth.mfa.phone] enroll_enabled = false verify_enabled = false @@ -201,7 +203,7 @@ otp_length = 6 template = "Your code is {{ `{{ .Code }}` }}" max_frequency = "5s" -# Configure Multi-factor-authentication via WebAuthn +# Configure MFA via WebAuthn # [auth.mfa.web_authn] # enroll_enabled = true # verify_enabled = true diff --git a/pkg/config/testdata/config.toml b/pkg/config/testdata/config.toml index ce845743e..113626868 100644 --- a/pkg/config/testdata/config.toml +++ b/pkg/config/testdata/config.toml @@ -1,3 +1,5 @@ +# For detailed configuration reference documentation, visit: +# https://supabase.com/docs/guides/local-development/cli/config # A string used to distinguish different Supabase projects on the same host. Defaults to the # working directory name when running `supabase init`. project_id = "test" @@ -7,7 +9,7 @@ enabled = true # Port to use for the API URL. port = 54321 # Schemas to expose in your API. Tables, views and stored procedures in this schema will get API -# endpoints. public and storage are always included. +# endpoints. `public` and `graphql_public` schemas are included by default. schemas = ["public", "graphql_public"] # Extra schemas to add to the search_path of every request. public is always included. extra_search_path = ["public", "extensions"] @@ -16,6 +18,7 @@ extra_search_path = ["public", "extensions"] max_rows = 1000 [api.tls] +# Enable HTTPS endpoints locally using a self-signed certificate. enabled = true [db] @@ -43,8 +46,7 @@ max_client_conn = 100 # If enabled, seeds the database after migrations during a db reset. enabled = true # Specifies an ordered list of seed files to load during db reset. -# Supports glob patterns relative to supabase directory. For example: -# sql_paths = ['./seeds/*.sql', '../project-src/seeds/*-load-testing.sql'] +# Supports glob patterns relative to supabase directory: './seeds/*.sql' sql_paths = ['./seed.sql'] [realtime] @@ -72,14 +74,17 @@ port = 54324 # Uncomment to expose additional ports for testing user applications that send emails. # smtp_port = 54325 # pop3_port = 54326 +# admin_email = "admin@email.com" +# sender_name = "Admin" [storage] enabled = true # The maximum file size allowed (e.g. "5MB", "500KB"). file_size_limit = "50MiB" +# Image transformation API is available to Supabase Pro plan. [storage.image_transformation] -enabled = false +enabled = true # Uncomment to configure local storage buckets [storage.buckets.images] @@ -104,6 +109,8 @@ enable_refresh_token_rotation = true refresh_token_reuse_interval = 10 # Allow/disallow new user signups to your project. enable_signup = true +# Allow/disallow anonymous sign-ins to your project. +enable_anonymous_sign_ins = true # Allow/disallow testing manual linking of accounts enable_manual_linking = true # Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more. @@ -120,15 +127,18 @@ enable_signup = true double_confirm_changes = true # If enabled, users need to confirm their email address before signing in. enable_confirmations = false +# If enabled, users will need to reauthenticate or have logged in recently to change their password. +secure_password_change = true # Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email. max_frequency = "1s" # Number of characters used in the email OTP. otp_length = 6 -# Number of seconds before the email OTP expires. -otp_expiry = 300 +# Number of seconds before the email OTP expires (defaults to 1 hour). +otp_expiry = 3600 # Use a production-ready SMTP server [auth.email.smtp] +enabled = true host = "smtp.sendgrid.net" port = 587 user = "apikey" @@ -162,6 +172,7 @@ timebox = "24h" # Force log out if the user has been inactive longer than the specified duration. inactivity_timeout = "8h" +# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. [auth.hook.custom_access_token] enabled = true uri = "pg-functions://postgres/auth/custom-access-token-hook" @@ -171,7 +182,6 @@ enabled = true uri = "http://host.docker.internal/functions/v1/send_sms" secrets = "env(AUTH_SEND_SMS_SECRETS)" - # Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. [auth.sms.twilio] enabled = true @@ -180,6 +190,7 @@ message_service_sid = "message_service_sid" # DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: auth_token = "env(TWILIO_AUTH_TOKEN)" +# Multi-factor-authentication is available to Supabase Pro plan. [auth.mfa] max_enrolled_factors = 10 @@ -188,7 +199,7 @@ max_enrolled_factors = 10 enroll_enabled = true verify_enabled = true -# Configure Multi-factor-authentication via Phone Messaging +# Configure MFA via Phone Messaging [auth.mfa.phone] enroll_enabled = true verify_enabled = true @@ -196,7 +207,7 @@ otp_length = 6 template = "Your code is {{ `{{ .Code }}` }}" max_frequency = "5s" -# Configure Multi-factor-authentication via Phone Messaging +# Configure MFA via Phone Messaging [auth.mfa.web_authn] enroll_enabled = true verify_enabled = true From f1b57bc32205965ad01d6e2267be752eb126eda3 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 11 Dec 2024 22:02:48 +0800 Subject: [PATCH 24/30] fix: make image transformation feature optional (#2967) --- internal/start/start.go | 8 +++++--- internal/start/start_test.go | 2 +- pkg/config/config.go | 6 ++---- pkg/config/storage.go | 25 ++++++++++++++++++------- pkg/config/templates/config.toml | 4 ++-- pkg/config/updater_test.go | 2 +- 6 files changed, 29 insertions(+), 18 deletions(-) diff --git a/internal/start/start.go b/internal/start/start.go index 9096f381d..f31a950cc 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -169,6 +169,8 @@ func run(p utils.Program, ctx context.Context, fsys afero.Fs, excludedContainers var started []string var isStorageEnabled = utils.Config.Storage.Enabled && !isContainerExcluded(utils.Config.Storage.Image, excluded) + var isImgProxyEnabled = utils.Config.Storage.ImageTransformation != nil && + utils.Config.Storage.ImageTransformation.Enabled && !isContainerExcluded(utils.Config.Storage.ImgProxyImage, excluded) p.Send(utils.StatusMsg("Starting containers...")) // Start Logflare @@ -833,7 +835,7 @@ EOF // TODO: https://github.com/supabase/storage-api/issues/55 "STORAGE_S3_REGION=" + utils.Config.Storage.S3Credentials.Region, "GLOBAL_S3_BUCKET=stub", - fmt.Sprintf("ENABLE_IMAGE_TRANSFORMATION=%t", utils.Config.Storage.ImageTransformation.Enabled), + fmt.Sprintf("ENABLE_IMAGE_TRANSFORMATION=%t", isImgProxyEnabled), fmt.Sprintf("IMGPROXY_URL=http://%s:5001", utils.ImgProxyId), "TUS_URL_PATH=/storage/v1/upload/resumable", "S3_PROTOCOL_ACCESS_KEY_ID=" + utils.Config.Storage.S3Credentials.AccessKeyId, @@ -872,11 +874,11 @@ EOF } // Start Storage ImgProxy. - if isStorageEnabled && utils.Config.Storage.ImageTransformation.Enabled && !isContainerExcluded(utils.Config.Storage.ImageTransformation.Image, excluded) { + if isStorageEnabled && isImgProxyEnabled { if _, err := utils.DockerStart( ctx, container.Config{ - Image: utils.Config.Storage.ImageTransformation.Image, + Image: utils.Config.Storage.ImgProxyImage, Env: []string{ "IMGPROXY_BIND=:5001", "IMGPROXY_LOCAL_FILESYSTEM_ROOT=/", diff --git a/internal/start/start_test.go b/internal/start/start_test.go index 079eb3c79..b61cb9cd4 100644 --- a/internal/start/start_test.go +++ b/internal/start/start_test.go @@ -133,7 +133,7 @@ func TestDatabaseStart(t *testing.T) { utils.StorageId = "test-storage" apitest.MockDockerStart(utils.Docker, utils.GetRegistryImageUrl(utils.Config.Storage.Image), utils.StorageId) utils.ImgProxyId = "test-imgproxy" - apitest.MockDockerStart(utils.Docker, utils.GetRegistryImageUrl(utils.Config.Storage.ImageTransformation.Image), utils.ImgProxyId) + apitest.MockDockerStart(utils.Docker, utils.GetRegistryImageUrl(utils.Config.Storage.ImgProxyImage), utils.ImgProxyId) utils.EdgeRuntimeId = "test-edge-runtime" apitest.MockDockerStart(utils.Docker, utils.GetRegistryImageUrl(utils.Config.EdgeRuntime.Image), utils.EdgeRuntimeId) utils.PgmetaId = "test-pgmeta" diff --git a/pkg/config/config.go b/pkg/config/config.go index 410bd7aa3..5c7fc0946 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -300,15 +300,13 @@ func NewConfig(editors ...ConfigEditor) config { SecretKeyBase: "EAx3IQ/wRG1v47ZD4NE4/9RzBI8Jmil3x0yhcW4V2NHBP6c2iPIzwjofi2Ep4HIG", }, Storage: storage{ - Image: storageImage, + Image: storageImage, + ImgProxyImage: imageProxyImage, S3Credentials: storageS3Credentials{ AccessKeyId: "625729a08b95bf1b7ff351a663f3a23c", SecretAccessKey: "850181e4652dd023b7a98c58ae0d2d34bd487ee0cc3254aed6eda37307425907", Region: "local", }, - ImageTransformation: imageTransformation{ - Image: imageProxyImage, - }, }, Auth: auth{ Image: gotrueImage, diff --git a/pkg/config/storage.go b/pkg/config/storage.go index b11b28a10..3b5696738 100644 --- a/pkg/config/storage.go +++ b/pkg/config/storage.go @@ -10,15 +10,15 @@ type ( storage struct { Enabled bool `toml:"enabled"` Image string `toml:"-"` + ImgProxyImage string `toml:"-"` FileSizeLimit sizeInBytes `toml:"file_size_limit"` + ImageTransformation *imageTransformation `toml:"image_transformation"` S3Credentials storageS3Credentials `toml:"-"` - ImageTransformation imageTransformation `toml:"image_transformation"` Buckets BucketConfig `toml:"buckets"` } imageTransformation struct { - Enabled bool `toml:"enabled"` - Image string `toml:"-"` + Enabled bool `toml:"enabled"` } storageS3Credentials struct { @@ -38,15 +38,26 @@ type ( ) func (s *storage) ToUpdateStorageConfigBody() v1API.UpdateStorageConfigBody { - body := v1API.UpdateStorageConfigBody{Features: &v1API.StorageFeatures{}} - body.FileSizeLimit = cast.Ptr(int64(s.FileSizeLimit)) - body.Features.ImageTransformation.Enabled = s.ImageTransformation.Enabled + body := v1API.UpdateStorageConfigBody{ + FileSizeLimit: cast.Ptr(int64(s.FileSizeLimit)), + } + // When local config is not set, we assume platform defaults should not change + if s.ImageTransformation != nil { + body.Features = &v1API.StorageFeatures{ + ImageTransformation: v1API.StorageFeatureImageTransformation{ + Enabled: s.ImageTransformation.Enabled, + }, + } + } return body } func (s *storage) FromRemoteStorageConfig(remoteConfig v1API.StorageConfigResponse) { s.FileSizeLimit = sizeInBytes(remoteConfig.FileSizeLimit) - s.ImageTransformation.Enabled = remoteConfig.Features.ImageTransformation.Enabled + // When local config is not set, we assume platform defaults should not change + if s.ImageTransformation != nil { + s.ImageTransformation.Enabled = remoteConfig.Features.ImageTransformation.Enabled + } } func (s *storage) DiffWithRemote(remoteConfig v1API.StorageConfigResponse) ([]byte, error) { diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index e3f55ae68..5345f4d0d 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -83,8 +83,8 @@ enabled = true file_size_limit = "50MiB" # Image transformation API is available to Supabase Pro plan. -[storage.image_transformation] -enabled = false +# [storage.image_transformation] +# enabled = true # Uncomment to configure local storage buckets # [storage.buckets.images] diff --git a/pkg/config/updater_test.go b/pkg/config/updater_test.go index 471e84963..f3eb0bcb4 100644 --- a/pkg/config/updater_test.go +++ b/pkg/config/updater_test.go @@ -336,7 +336,7 @@ func TestUpdateRemoteConfig(t *testing.T) { Storage: storage{ Enabled: true, FileSizeLimit: 100, - ImageTransformation: imageTransformation{ + ImageTransformation: &imageTransformation{ Enabled: true, }, }, From c414ec87532a28920417833ba9d7255a84ca4f01 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 11 Dec 2024 22:58:13 +0800 Subject: [PATCH 25/30] fix: copy image transform by value (#2969) --- pkg/config/storage.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/config/storage.go b/pkg/config/storage.go index 3b5696738..b026d0cf6 100644 --- a/pkg/config/storage.go +++ b/pkg/config/storage.go @@ -62,6 +62,10 @@ func (s *storage) FromRemoteStorageConfig(remoteConfig v1API.StorageConfigRespon func (s *storage) DiffWithRemote(remoteConfig v1API.StorageConfigResponse) ([]byte, error) { copy := *s + if s.ImageTransformation != nil { + img := *s.ImageTransformation + copy.ImageTransformation = &img + } // Convert the config values into easily comparable remoteConfig values currentValue, err := ToTomlBytes(copy) if err != nil { From e0d03ec6a50074dc92c739745bff089531f7a12c Mon Sep 17 00:00:00 2001 From: Andrew Valleteau Date: Wed, 11 Dec 2024 18:21:52 +0100 Subject: [PATCH 26/30] feat(dump): print complete filedist path for dump (#2968) * choredump): print complete filedist path for dump * Update cmd/db.go Co-authored-by: Han Qiao --------- Co-authored-by: Han Qiao --- cmd/db.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/db.go b/cmd/db.go index 2d64edd74..13f29401f 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "os/signal" + "path/filepath" "github.com/spf13/afero" "github.com/spf13/cobra" @@ -125,7 +126,11 @@ var ( }, PostRun: func(cmd *cobra.Command, args []string) { if len(file) > 0 { - fmt.Fprintln(os.Stderr, "Dumped schema to "+utils.Bold(file)+".") + if absPath, err := filepath.Abs(file); err != nil { + fmt.Fprintln(os.Stderr, "Dumped schema to "+utils.Bold(file)+".") + } else { + fmt.Fprintln(os.Stderr, "Dumped schema to "+utils.Bold(absPath)+".") + } } }, } From 3b0df03bda6e1bcf84ab68795807d182858e2a9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 05:01:44 +0000 Subject: [PATCH 27/30] chore(deps): bump google.golang.org/grpc from 1.68.1 to 1.69.0 (#2973) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.68.1 to 1.69.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.68.1...v1.69.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 7d1632a6a..82190adb8 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( golang.org/x/mod v0.22.0 golang.org/x/oauth2 v0.24.0 golang.org/x/term v0.27.0 - google.golang.org/grpc v1.68.1 + google.golang.org/grpc v1.69.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.0 ) @@ -305,8 +305,8 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect - go.opentelemetry.io/otel/sdk v1.28.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.9.0 // indirect @@ -321,8 +321,8 @@ require ( golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.20.0 // indirect golang.org/x/tools v0.27.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 2e82216da..8644ebb55 100644 --- a/go.sum +++ b/go.sum @@ -1008,10 +1008,10 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= -go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= -go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= -go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= -go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= @@ -1424,10 +1424,10 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 h1:fVoAXEKA4+yufmbdVYv+SE73+cPZbbbe8paLsHfkK+U= +google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53/go.mod h1:riSXTwQ4+nqmPGtobMFyW5FqVAmIs0St6VPp4Ug7CE4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.0.5/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1441,8 +1441,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= -google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= +google.golang.org/grpc v1.69.0 h1:quSiOM1GJPmPH5XtU+BCoVXcDVJJAzNcoyfC2cCjGkI= +google.golang.org/grpc v1.69.0/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 574b879f19d0da995e08121d01c13b7834e00b46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 05:06:42 +0000 Subject: [PATCH 28/30] chore(deps): bump github.com/docker/docker from 27.3.1+incompatible to 27.4.0+incompatible (#2960) chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 27.3.1+incompatible to 27.4.0+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v27.3.1...v27.4.0) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 82190adb8..61074c80d 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containers/common v0.61.0 github.com/deepmap/oapi-codegen/v2 v2.2.0 github.com/docker/cli v27.4.0+incompatible - github.com/docker/docker v27.3.1+incompatible + github.com/docker/docker v27.4.0+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/getsentry/sentry-go v0.30.0 diff --git a/go.sum b/go.sum index 8644ebb55..1ccf6a50a 100644 --- a/go.sum +++ b/go.sum @@ -231,8 +231,8 @@ github.com/docker/cli v27.4.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvM github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= -github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v27.4.0+incompatible h1:I9z7sQ5qyzO0BfAb9IMOawRkAGxhYsidKiTMcm0DU+A= +github.com/docker/docker v27.4.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= From b6c230337a411f265260f76f12dee5d2c266d236 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 05:11:36 +0000 Subject: [PATCH 29/30] chore(deps): bump go.opentelemetry.io/otel from 1.32.0 to 1.33.0 (#2974) Bumps [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) from 1.32.0 to 1.33.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.32.0...v1.33.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 7 ++++--- go.sum | 14 ++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 61074c80d..09f10d325 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/stripe/pg-schema-diff v0.8.0 github.com/withfig/autocomplete-tools/packages/cobra v1.2.0 github.com/zalando/go-keyring v0.2.6 - go.opentelemetry.io/otel v1.32.0 + go.opentelemetry.io/otel v1.33.0 golang.org/x/mod v0.22.0 golang.org/x/oauth2 v0.24.0 golang.org/x/term v0.27.0 @@ -299,15 +299,16 @@ require ( gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.13.0 // indirect go-simpler.org/sloglint v0.7.2 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect - go.opentelemetry.io/otel/metric v1.32.0 // indirect + go.opentelemetry.io/otel/metric v1.33.0 // indirect go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect - go.opentelemetry.io/otel/trace v1.32.0 // indirect + go.opentelemetry.io/otel/trace v1.33.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.6.0 // indirect diff --git a/go.sum b/go.sum index 1ccf6a50a..804a4c0fd 100644 --- a/go.sum +++ b/go.sum @@ -994,10 +994,12 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= -go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= +go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 h1:U2guen0GhqH8o/G2un8f/aG/y++OuW6MyCo6hT9prXk= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0/go.mod h1:yeGZANgEcpdx/WK0IvvRFC+2oLiMS2u4L/0Rj2M2Qr0= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= @@ -1006,14 +1008,14 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6Z go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03ymgYhPKmeXGk5Zu+cIZOlVzd9Zv7QIiyItjFBU= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk= -go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= -go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= +go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= -go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= -go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= +go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= +go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= From 9432d4322faa48f2421c479bc861b03e825006d7 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Mon, 16 Dec 2024 16:19:20 +0100 Subject: [PATCH 30/30] fix: update storage image v1.14.5 (#2976) --- pkg/config/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/constants.go b/pkg/config/constants.go index 44b61997e..318052679 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -17,7 +17,7 @@ const ( supavisorImage = "supabase/supavisor:1.1.56" gotrueImage = "supabase/gotrue:v2.164.0" realtimeImage = "supabase/realtime:v2.33.58" - storageImage = "supabase/storage-api:v1.11.13" + storageImage = "supabase/storage-api:v1.14.5" logflareImage = "supabase/logflare:1.4.0" // Append to JobImages when adding new dependencies below DifferImage = "supabase/pgadmin-schema-diff:cli-0.0.5"