Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/docker/docker v28.3.3+incompatible
github.com/docker/go-connections v0.5.0
github.com/fsnotify/fsnotify v1.9.0
github.com/getsentry/sentry-go v0.34.1
github.com/getsentry/sentry-go v0.35.0
github.com/go-errors/errors v1.5.1
github.com/go-git/go-git/v5 v5.16.2
github.com/go-xmlfmt/xmlfmt v1.1.3
Expand Down Expand Up @@ -151,7 +151,7 @@ require (
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
github.com/golang-jwt/jwt/v5 v5.2.3 // indirect
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo=
github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA=
github.com/getkin/kin-openapi v0.131.0 h1:NO2UeHnFKRYhZ8wg6Nyh5Cq7dHk4suQQr72a4pMrDxE=
github.com/getkin/kin-openapi v0.131.0/go.mod h1:3OlG51PCYNsPByuiMB0t4fjnNlIDnaEDsjiKUV8nL58=
github.com/getsentry/sentry-go v0.34.1 h1:HSjc1C/OsnZttohEPrrqKH42Iud0HuLCXpv8cU1pWcw=
github.com/getsentry/sentry-go v0.34.1/go.mod h1:C55omcY9ChRQIUcVcGcs+Zdy4ZpQGvNJ7JYHIoSWOtE=
github.com/getsentry/sentry-go v0.35.0 h1:+FJNlnjJsZMG3g0/rmmP7GiKjQoUF5EXfEtBwtPtkzY=
github.com/getsentry/sentry-go v0.35.0/go.mod h1:C55omcY9ChRQIUcVcGcs+Zdy4ZpQGvNJ7JYHIoSWOtE=
github.com/ghostiam/protogetter v0.3.15 h1:1KF5sXel0HE48zh1/vn0Loiw25A9ApyseLzQuif1mLY=
github.com/ghostiam/protogetter v0.3.15/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA=
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
Expand Down Expand Up @@ -377,8 +377,8 @@ github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v5 v5.2.3 h1:kkGXqQOBSDDWRhWNXTFpqGSCMyh/PLnqUvMGJPDJDs0=
github.com/golang-jwt/jwt/v5 v5.2.3/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down
6 changes: 3 additions & 3 deletions internal/link/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func(
if err != nil {
return err
}
LinkServices(ctx, projectRef, keys.Anon, fsys)
LinkServices(ctx, projectRef, keys.ServiceRole, fsys)

// 2. Check database connection
config := flags.NewDbConfigWithPassword(ctx, projectRef)
Expand All @@ -66,7 +66,7 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func(
return nil
}

func LinkServices(ctx context.Context, projectRef, anonKey string, fsys afero.Fs) {
func LinkServices(ctx context.Context, projectRef, serviceKey string, fsys afero.Fs) {
// Ignore non-fatal errors linking services
var wg sync.WaitGroup
wg.Add(8)
Expand Down Expand Up @@ -106,7 +106,7 @@ func LinkServices(ctx context.Context, projectRef, anonKey string, fsys afero.Fs
fmt.Fprintln(os.Stderr, err)
}
}()
api := tenant.NewTenantAPI(ctx, projectRef, anonKey)
api := tenant.NewTenantAPI(ctx, projectRef, serviceKey)
go func() {
defer wg.Done()
if err := linkPostgrestVersion(ctx, api, fsys); err != nil && viper.GetBool("DEBUG") {
Expand Down
7 changes: 6 additions & 1 deletion internal/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"sync"

"github.com/spf13/afero"
"github.com/spf13/viper"
"github.com/supabase/cli/internal/migration/list"
"github.com/supabase/cli/internal/utils"
"github.com/supabase/cli/internal/utils/flags"
Expand Down Expand Up @@ -79,18 +80,22 @@ func listRemoteImages(ctx context.Context, projectRef string) map[string]string
wg.Wait()
return linked
}
api := tenant.NewTenantAPI(ctx, projectRef, keys.Anon)
api := tenant.NewTenantAPI(ctx, projectRef, keys.ServiceRole)
wg.Add(2)
go func() {
defer wg.Done()
if version, err := api.GetGotrueVersion(ctx); err == nil {
linked[utils.Config.Auth.Image] = version
} else if viper.GetBool("DEBUG") {
fmt.Fprintln(os.Stderr, err)
}
}()
go func() {
defer wg.Done()
if version, err := api.GetPostgrestVersion(ctx); err == nil {
linked[utils.Config.Api.Image] = version
} else if viper.GetBool("DEBUG") {
fmt.Fprintln(os.Stderr, err)
}
}()
wg.Wait()
Expand Down
4 changes: 2 additions & 2 deletions internal/utils/tenant/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ type TenantAPI struct {
*fetcher.Fetcher
}

func NewTenantAPI(ctx context.Context, projectRef, anonKey string) TenantAPI {
func NewTenantAPI(ctx context.Context, projectRef, serviceKey string) TenantAPI {
return TenantAPI{Fetcher: fetcher.NewServiceGateway(
"https://"+utils.GetSupabaseHost(projectRef),
anonKey,
serviceKey,
fetcher.WithUserAgent("SupabaseCLI/"+utils.Version),
)}
}
Loading