From 4c3036087770db2266c35e58ff9abdf6d01b25b3 Mon Sep 17 00:00:00 2001 From: Alan Daniel Date: Thu, 16 Oct 2025 18:45:00 -0400 Subject: [PATCH 1/3] show api keys with deprecated flag --- internal/status/status.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/status/status.go b/internal/status/status.go index ee087062b..6bcb7e432 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -234,11 +234,14 @@ func PrettyPrint(w io.Writer, exclude ...string) { val := reflect.ValueOf(names) for i := 0; i < val.NumField(); i++ { k := val.Field(i).String() - if tag := t.Field(i).Tag.Get("env"); isDeprecated(tag) { - continue - } + tag := t.Field(i).Tag.Get("env") + deprecated := isDeprecated(tag) if v, ok := values[k]; ok { - fmt.Fprintf(w, "%s: %s\n", k, v) + if deprecated { + fmt.Fprintf(w, "%s: %s %s\n", k, v, utils.Yellow("(deprecating soon)")) + } else { + fmt.Fprintf(w, "%s: %s\n", k, v) + } } } } From 498644fbe2a64b18f3b00f24a82290682cd87427 Mon Sep 17 00:00:00 2001 From: Alan Daniel Date: Mon, 20 Oct 2025 20:31:05 -0400 Subject: [PATCH 2/3] add new keys suggestion --- cmd/root.go | 6 +++--- internal/status/status.go | 23 +++++------------------ internal/utils/colors.go | 4 ++++ 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 5a1072284..bf7922b11 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -145,12 +145,12 @@ func Execute() { if err != nil { fmt.Fprintln(utils.GetDebugLogger(), err) } - if semver.Compare(version, "v"+utils.Version) > 0 { - fmt.Fprintln(os.Stderr, suggestUpgrade(version)) - } if len(utils.CmdSuggestion) > 0 { fmt.Fprintln(os.Stderr, utils.CmdSuggestion) } + if semver.Compare(version, "v"+utils.Version) > 0 { + fmt.Fprintln(os.Stderr, suggestUpgrade(version)) + } } func checkUpgrade(ctx context.Context, fsys afero.Fs) (string, error) { diff --git a/internal/status/status.go b/internal/status/status.go index 6bcb7e432..77d9a31dc 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -12,7 +12,6 @@ import ( "os" "reflect" "slices" - "strings" "sync" "time" @@ -100,6 +99,10 @@ func Run(ctx context.Context, names CustomName, format string, fsys afero.Fs) er if len(stopped) > 0 { fmt.Fprintln(os.Stderr, "Stopped services:", stopped) } + // Set suggestion to use new keys instead of deprecated ones + if utils.Config.Auth.Enabled && !slices.Contains(stopped, utils.GotrueId) && !slices.Contains(stopped, utils.ShortContainerImageName(utils.Config.Auth.Image)) { + utils.CmdSuggestion = utils.Orange("Please use publishable and secret key instead of anon and service role key.") + } if format == utils.OutputPretty { fmt.Fprintf(os.Stderr, "%s local development setup is running.\n\n", utils.Aqua("supabase")) PrettyPrint(os.Stdout, stopped...) @@ -230,27 +233,11 @@ func PrettyPrint(w io.Writer, exclude ...string) { } values := names.toValues(exclude...) // Iterate through map in order of declared struct fields - t := reflect.TypeOf(names) val := reflect.ValueOf(names) for i := 0; i < val.NumField(); i++ { k := val.Field(i).String() - tag := t.Field(i).Tag.Get("env") - deprecated := isDeprecated(tag) if v, ok := values[k]; ok { - if deprecated { - fmt.Fprintf(w, "%s: %s %s\n", k, v, utils.Yellow("(deprecating soon)")) - } else { - fmt.Fprintf(w, "%s: %s\n", k, v) - } - } - } -} - -func isDeprecated(tag string) bool { - for part := range strings.SplitSeq(tag, ",") { - if strings.EqualFold(part, "deprecated") { - return true + fmt.Fprintf(w, "%s: %s\n", k, v) } } - return false } diff --git a/internal/utils/colors.go b/internal/utils/colors.go index ed710c4a2..f2fa94752 100644 --- a/internal/utils/colors.go +++ b/internal/utils/colors.go @@ -13,6 +13,10 @@ func Yellow(str string) string { return lipgloss.NewStyle().Foreground(lipgloss.Color("11")).Render(str) } +func Orange(str string) string { + return lipgloss.NewStyle().Foreground(lipgloss.Color("214")).Render(str) +} + // For errors. func Red(str string) string { return lipgloss.NewStyle().Foreground(lipgloss.Color("9")).Render(str) From 1aa4e5564529e96d14186bf16cb9710acfe3e7e9 Mon Sep 17 00:00:00 2001 From: Alan Daniel Date: Thu, 6 Nov 2025 11:13:28 -0400 Subject: [PATCH 3/3] remove deprecated keys --- internal/status/status.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/internal/status/status.go b/internal/status/status.go index 77d9a31dc..bc3dbf917 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -67,13 +67,9 @@ func (c *CustomName) toValues(exclude ...string) map[string]string { if authEnabled { values[c.PublishableKey] = utils.Config.Auth.PublishableKey.Value values[c.SecretKey] = utils.Config.Auth.SecretKey.Value - values[c.JWTSecret] = utils.Config.Auth.JwtSecret.Value - values[c.AnonKey] = utils.Config.Auth.AnonKey.Value - values[c.ServiceRoleKey] = utils.Config.Auth.ServiceRoleKey.Value } if inbucketEnabled { values[c.MailpitURL] = fmt.Sprintf("http://%s:%d", utils.Config.Hostname, utils.Config.Inbucket.Port) - values[c.InbucketURL] = fmt.Sprintf("http://%s:%d", utils.Config.Hostname, utils.Config.Inbucket.Port) } if storageEnabled { values[c.StorageS3URL] = utils.GetApiUrl("/storage/v1/s3") @@ -220,13 +216,9 @@ func PrettyPrint(w io.Writer, exclude ...string) { McpURL: " " + utils.Aqua("MCP URL"), DbURL: " " + utils.Aqua("Database URL"), StudioURL: " " + utils.Aqua("Studio URL"), - InbucketURL: " " + utils.Aqua("Inbucket URL"), MailpitURL: " " + utils.Aqua("Mailpit URL"), PublishableKey: " " + utils.Aqua("Publishable key"), SecretKey: " " + utils.Aqua("Secret key"), - JWTSecret: " " + utils.Aqua("JWT secret"), - AnonKey: " " + utils.Aqua("anon key"), - ServiceRoleKey: "" + utils.Aqua("service_role key"), StorageS3AccessKeyId: " " + utils.Aqua("S3 Access Key"), StorageS3SecretAccessKey: " " + utils.Aqua("S3 Secret Key"), StorageS3Region: " " + utils.Aqua("S3 Region"),