From 4c3036087770db2266c35e58ff9abdf6d01b25b3 Mon Sep 17 00:00:00 2001 From: Alan Daniel Date: Thu, 16 Oct 2025 18:45:00 -0400 Subject: [PATCH 1/2] 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/2] 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)