From ea930545fa426f06443d00c86890bb5a6f58e813 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 27 Mar 2025 02:02:58 +0100 Subject: [PATCH 001/359] Revert "fix: clean up storage schema on db reset" (#3359) --- pkg/migration/queries/drop.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/migration/queries/drop.sql b/pkg/migration/queries/drop.sql index ed07c7242..a153891fe 100644 --- a/pkg/migration/queries/drop.sql +++ b/pkg/migration/queries/drop.sql @@ -55,13 +55,12 @@ begin execute format('drop table if exists %I.%I cascade', rec.relnamespace::regnamespace::name, rec.relname); end loop; - -- truncate tables in auth, storage, webhooks, and migrations schema + -- truncate tables in auth, webhooks, and migrations schema for rec in select * from pg_class c where (c.relnamespace::regnamespace::name = 'auth' and c.relname != 'schema_migrations' - or c.relnamespace::regnamespace::name = 'storage' and c.relname != 'migrations' or c.relnamespace::regnamespace::name = 'supabase_functions' and c.relname != 'migrations' or c.relnamespace::regnamespace::name = 'supabase_migrations') and c.relkind = 'r' From c180c3e11a10e93f1e62bee0efc11239d8d590dd Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 28 Mar 2025 01:56:06 +0100 Subject: [PATCH 002/359] fix: bump viper and mapstructure (#3364) chore: bump viper and mapstructure --- go.mod | 14 ++++---------- go.sum | 22 ++++++---------------- pkg/config/config.go | 2 +- pkg/config/config_test.go | 8 ++++---- pkg/config/constants.go | 2 +- pkg/config/constants_test.go | 2 +- pkg/config/secret.go | 2 +- 7 files changed, 18 insertions(+), 34 deletions(-) diff --git a/go.mod b/go.mod index 4531caa13..1111ec273 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( github.com/getsentry/sentry-go v0.31.1 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.14.0 + github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golang-jwt/jwt/v5 v5.2.2 github.com/golangci/golangci-lint v1.64.8 @@ -36,7 +37,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/mitchellh/mapstructure v1.5.0 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 github.com/oapi-codegen/runtime v1.1.1 @@ -44,7 +44,7 @@ require ( github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 - github.com/spf13/viper v1.19.0 + github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 github.com/stripe/pg-schema-diff v0.8.0 github.com/tidwall/jsonc v0.3.2 @@ -151,7 +151,6 @@ require ( github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect 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/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.12.1 // indirect @@ -180,7 +179,6 @@ require ( github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/invopop/yaml v0.3.1 // indirect @@ -212,7 +210,6 @@ require ( github.com/lib/pq v1.10.9 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/macabu/inamedparam v0.1.3 // indirect - github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.1 // indirect @@ -263,8 +260,7 @@ require ( github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/ryancurrah/gomodguard v1.3.5 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect - github.com/sagikazarmark/locafero v0.4.0 // indirect - github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f // indirect github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect @@ -280,7 +276,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/speakeasy-api/openapi-overlay v0.9.0 // indirect - github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cast v1.7.1 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect github.com/stretchr/objx v0.5.2 // indirect @@ -326,7 +322,6 @@ require ( go.uber.org/multierr v1.9.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.36.0 // indirect - golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 // indirect golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect golang.org/x/net v0.37.0 // indirect golang.org/x/sync v0.12.0 // indirect @@ -336,7 +331,6 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect google.golang.org/protobuf v1.36.5 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect honnef.co/go/tools v0.6.1 // indirect diff --git a/go.sum b/go.sum index 715c72d57..7d973dd74 100644 --- a/go.sum +++ b/go.sum @@ -505,8 +505,6 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -654,8 +652,6 @@ github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= github.com/magiconair/properties v1.5.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= @@ -697,8 +693,6 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= @@ -856,10 +850,8 @@ github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= -github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= -github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= -github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= -github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f h1:MvTmaQdww/z0Q4wrYjDSCcZ78NoftLQyHBSLW/Cx79Y= github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/sanposhiho/wastedassign/v2 v2.1.0 h1:crurBF7fJKIORrV85u9UUpePDYGWnwvv3+A96WvwXT0= @@ -908,8 +900,8 @@ github.com/speakeasy-api/openapi-overlay v0.9.0/go.mod h1:f5FloQrHA7MsxYg9djzMD5 github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA= github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo= github.com/spf13/cast v0.0.0-20150508191742-4d07383ffe94/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= @@ -919,8 +911,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v0.0.0-20150530192845-be5ff3e4840c/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= -github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= -github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= +github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= +github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= @@ -1487,8 +1479,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1 h1:d4KQkxAaAiRY2h5Zqis161Pv91A37uZyJOx73duwUwM= gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1/go.mod h1:WbjuEoo1oadwzQ4apSDU+JTvmllEHtsNHS6y7vFc7iw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/pkg/config/config.go b/pkg/config/config.go index 83eb724cc..5edc7d50b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -26,9 +26,9 @@ import ( "github.com/BurntSushi/toml" "github.com/docker/go-units" "github.com/go-errors/errors" + "github.com/go-viper/mapstructure/v2" "github.com/golang-jwt/jwt/v5" "github.com/joho/godotenv" - "github.com/mitchellh/mapstructure" "github.com/spf13/viper" "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/fetcher" diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index c2f695842..8b204063c 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -464,7 +464,7 @@ func TestLoadFunctionErrorMessageParsing(t *testing.T) { // Run test err := config.Load("", fsys) // Check error contains both decode errors - assert.ErrorContains(t, err, "* 'functions[hello]' has invalid keys: unknown_field") + assert.ErrorContains(t, err, "'functions[hello]' has invalid keys: unknown_field") }) t.Run("returns error with function slug for invalid field value", func(t *testing.T) { @@ -479,7 +479,7 @@ func TestLoadFunctionErrorMessageParsing(t *testing.T) { // Run test err := config.Load("", fsys) // Check error contains both decode errors - assert.ErrorContains(t, err, `* cannot parse 'functions[hello].verify_jwt' as bool: strconv.ParseBool: parsing "not-a-bool"`) + assert.ErrorContains(t, err, `cannot parse 'functions[hello].verify_jwt' as bool: strconv.ParseBool: parsing "not-a-bool"`) }) t.Run("returns error for unknown function fields", func(t *testing.T) { @@ -494,7 +494,7 @@ func TestLoadFunctionErrorMessageParsing(t *testing.T) { } // Run test err := config.Load("", fsys) - assert.ErrorContains(t, err, `* 'functions[name]' expected a map, got 'string'`) - assert.ErrorContains(t, err, `* 'functions[verify_jwt]' expected a map, got 'bool'`) + assert.ErrorContains(t, err, `'functions[name]' expected a map, got 'string'`) + assert.ErrorContains(t, err, `'functions[verify_jwt]' expected a map, got 'bool'`) }) } diff --git a/pkg/config/constants.go b/pkg/config/constants.go index 6e14890d2..28e6ae927 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -5,7 +5,7 @@ import ( "regexp" "github.com/go-errors/errors" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) const ( diff --git a/pkg/config/constants_test.go b/pkg/config/constants_test.go index 831ce302f..1f8badef3 100644 --- a/pkg/config/constants_test.go +++ b/pkg/config/constants_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/secret.go b/pkg/config/secret.go index c78a5b8b8..72c075ba7 100644 --- a/pkg/config/secret.go +++ b/pkg/config/secret.go @@ -8,7 +8,7 @@ import ( ecies "github.com/ecies/go/v2" "github.com/go-errors/errors" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) type Secret struct { From af413835f7996c2ac0752438abfb0932a6280cf5 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 28 Mar 2025 02:11:44 +0100 Subject: [PATCH 003/359] fix: remote block should override env (#3366) --- pkg/config/config.go | 92 ++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 5edc7d50b..764bea381 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -440,35 +440,19 @@ func (c *config) Eject(w io.Writer) error { // Loads custom config file to struct fields tagged with toml. func (c *config) loadFromFile(filename string, fsys fs.FS) error { v := viper.New() - v.SetConfigType("toml") - // Load default values - var buf bytes.Buffer - if err := c.Eject(&buf); err != nil { + if err := c.mergeDefaultValues(v); err != nil { return err - } else if err := c.loadFromReader(v, &buf); err != nil { + } else if err := mergeFileConfig(v, filename, fsys); err != nil { return err } - // Load custom config - if ext := filepath.Ext(filename); len(ext) > 0 { - v.SetConfigType(ext[1:]) - } - f, err := fsys.Open(filename) - if errors.Is(err, os.ErrNotExist) { - return nil - } else if err != nil { - return errors.Errorf("failed to read file config: %w", err) - } - defer f.Close() - return c.loadFromReader(v, f) -} - -func (c *config) loadFromReader(v *viper.Viper, r io.Reader) error { - if err := v.MergeConfig(r); err != nil { - return errors.Errorf("failed to merge config: %w", err) + // Load base config and mapstructure overrides + if err := c.load(v); err != nil { + return err + } else if err := c.loadFromEnv(); err != nil { + return err } // Find [remotes.*] block to override base config - baseId := v.GetString("project_id") - idToName := map[string]string{baseId: "base"} + idToName := map[string]string{} for name, remote := range v.GetStringMap("remotes") { projectId := v.GetString(fmt.Sprintf("remotes.%s.project_id", name)) // Track remote project_id to check for duplication @@ -481,9 +465,43 @@ func (c *config) loadFromReader(v *viper.Viper, r io.Reader) error { if err := v.MergeConfigMap(remote.(map[string]any)); err != nil { return err } - v.Set("project_id", baseId) } } + if _, exists := idToName[c.ProjectId]; exists { + return c.load(v) + } + return nil +} + +func (c *config) mergeDefaultValues(v *viper.Viper) error { + v.SetConfigType("toml") + var buf bytes.Buffer + if err := c.Eject(&buf); err != nil { + return err + } else if err := v.MergeConfig(&buf); err != nil { + return errors.Errorf("failed to merge default values: %w", err) + } + return nil +} + +func mergeFileConfig(v *viper.Viper, filename string, fsys fs.FS) error { + if ext := filepath.Ext(filename); len(ext) > 0 { + v.SetConfigType(ext[1:]) + } + f, err := fsys.Open(filename) + if errors.Is(err, os.ErrNotExist) { + return nil + } else if err != nil { + return errors.Errorf("failed to read file config: %w", err) + } + defer f.Close() + if err := v.MergeConfig(f); err != nil { + return errors.Errorf("failed to merge file config: %w", err) + } + return nil +} + +func (c *config) load(v *viper.Viper) error { // Set default values for [functions.*] when config struct is empty for key, value := range v.GetStringMap("functions") { if _, ok := value.(map[string]any); !ok { @@ -520,7 +538,7 @@ func (c *config) loadFromReader(v *viper.Viper, r io.Reader) error { return nil } -func (c *config) newDecodeHook(fs ...mapstructure.DecodeHookFunc) mapstructure.DecodeHookFunc { +func (c *baseConfig) newDecodeHook(fs ...mapstructure.DecodeHookFunc) mapstructure.DecodeHookFunc { fs = append(fs, mapstructure.StringToTimeDurationHookFunc(), mapstructure.StringToIPHookFunc(), @@ -532,26 +550,11 @@ func (c *config) newDecodeHook(fs ...mapstructure.DecodeHookFunc) mapstructure.D } // Loads envs prefixed with supabase_ to struct fields tagged with mapstructure. -func (c *config) loadFromEnv() error { - v := viper.New() +func (c *baseConfig) loadFromEnv() error { + v := viper.NewWithOptions(viper.ExperimentalBindStruct()) v.SetEnvPrefix("SUPABASE") v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) v.AutomaticEnv() - // Viper does not parse env vars automatically. Instead of calling viper.BindEnv - // per key, we decode all keys from an existing struct, and merge them to viper. - // Ref: https://github.com/spf13/viper/issues/761#issuecomment-859306364 - envKeysMap := map[string]interface{}{} - if dec, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ - Result: &envKeysMap, - IgnoreUntaggedFields: true, - }); err != nil { - return errors.Errorf("failed to create decoder: %w", err) - } else if err := dec.Decode(c.baseConfig); err != nil { - return errors.Errorf("failed to decode env: %w", err) - } else if err := v.MergeConfigMap(envKeysMap); err != nil { - return errors.Errorf("failed to merge env config: %w", err) - } - // Writes viper state back to config struct, with automatic env substitution if err := v.UnmarshalExact(c, viper.DecodeHook(c.newDecodeHook())); err != nil { return errors.Errorf("failed to parse env override: %w", err) } @@ -567,9 +570,6 @@ func (c *config) Load(path string, fsys fs.FS) error { if err := c.loadFromFile(builder.ConfigPath, fsys); err != nil { return err } - if err := c.loadFromEnv(); err != nil { - return err - } // Generate JWT tokens if len(c.Auth.AnonKey) == 0 { anonToken := CustomClaims{Role: "anon"}.NewToken() From 19a7c33397ead24e32dcbb9e4c22bc927b60eb68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 04:19:04 +0000 Subject: [PATCH 004/359] chore(deps): bump github.com/docker/cli from 28.0.2+incompatible to 28.0.4+incompatible (#3368) chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.0.2+incompatible to 28.0.4+incompatible. - [Commits](https://github.com/docker/cli/compare/v28.0.2...v28.0.4) --- updated-dependencies: - dependency-name: github.com/docker/cli 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 | 6 ++---- go.sum | 18 ++---------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 1111ec273..5379e5b9f 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,6 @@ module github.com/supabase/cli go 1.23.2 - toolchain go1.24.1 require ( @@ -14,7 +13,7 @@ require ( github.com/charmbracelet/glamour v0.7.0 github.com/charmbracelet/lipgloss v0.12.1 github.com/containers/common v0.62.2 - github.com/docker/cli v28.0.2+incompatible + github.com/docker/cli v28.0.4+incompatible github.com/docker/docker v28.0.2+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 @@ -122,8 +121,8 @@ require ( github.com/dnephin/pflag v1.0.7 // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.2 // indirect - github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect github.com/docker/go-metrics v0.0.1 // indirect + github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/ethereum/go-ethereum v1.14.13 // indirect @@ -221,7 +220,6 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/mgechev/revive v1.7.0 // indirect github.com/microcosm-cc/bluemonday v1.0.25 // indirect - github.com/miekg/pkcs11 v1.1.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect diff --git a/go.sum b/go.sum index 7d973dd74..f2a2cc035 100644 --- a/go.sum +++ b/go.sum @@ -74,7 +74,6 @@ github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgz github.com/ProtonMail/go-crypto v1.1.5 h1:eoAQfK2dwL+tFSFpr7TbOaPNUbPiJj4fLYwwGE1FQO4= github.com/ProtonMail/go-crypto v1.1.5/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= -github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d h1:hi6J4K6DKrR4/ljxn6SF6nURyu785wKMuQcjt7H3VCQ= github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= @@ -138,11 +137,8 @@ github.com/breml/bidichk v0.3.2 h1:xV4flJ9V5xWTqxL+/PMFF6dtJPvZLPsyixAoPe8BGJs= github.com/breml/bidichk v0.3.2/go.mod h1:VzFLBxuYtT23z5+iVkamXO386OB+/sVwZOpIj6zXGos= github.com/breml/errchkjson v0.4.0 h1:gftf6uWZMtIa/Is3XJgibewBm2ksAQSY/kABDNFTAdk= github.com/breml/errchkjson v0.4.0/go.mod h1:AuBOSTHyLSaaAFlWsRSuRBIroCh3eh7ZHh5YeelDIk8= -github.com/bugsnag/bugsnag-go v1.0.5-0.20150529004307-13fd6b8acda0 h1:s7+5BfS4WFJoVF9pnB8kBk03S7pZXRdKamnV0FOl5Sc= github.com/bugsnag/bugsnag-go v1.0.5-0.20150529004307-13fd6b8acda0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembjv71DPz3uX/V/6MMlSyD9JBQ6kQ= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXer/kZD8Ri1aaunCxIEsOst1BVJswV0o= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/butuzov/ireturn v0.3.1 h1:mFgbEI6m+9W8oP/oDdfA34dLisRFCj2G6o/yiI1yZrY= github.com/butuzov/ireturn v0.3.1/go.mod h1:ZfRp+E7eJLC0NQmk1Nrm1LOrn/gQlOykv+cVPdiXH5M= @@ -181,7 +177,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/ckaznocha/intrange v0.3.0 h1:VqnxtK32pxgkhJgYQEeOArVidIPg+ahLP7WBOXZd5ZY= github.com/ckaznocha/intrange v0.3.0/go.mod h1:+I/o2d2A1FBHgGELbGxzIcyd3/9l9DuwjM8FsbSS3Lo= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004 h1:lkAMpLVBDaj17e85keuznYcH5rqI438v41pKcBl4ZxQ= github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= github.com/cloudflare/circl v1.6.0 h1:cr5JKic4HI+LkINy2lg3W2jF8sHCVTBncJr5gIIq7qk= github.com/cloudflare/circl v1.6.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= @@ -226,8 +221,8 @@ github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxK github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v28.0.2+incompatible h1:cRPZ77FK3/IXTAIQQj1vmhlxiLS5m+MIUDwS6f57lrE= -github.com/docker/cli v28.0.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.0.4+incompatible h1:pBJSJeNd9QeIWPjRcV91RVJihd/TXB77q1ef64XEu4A= +github.com/docker/cli v28.0.4+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= @@ -325,8 +320,6 @@ github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ 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= -github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= -github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= @@ -422,7 +415,6 @@ github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNF github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/certificate-transparency-go v1.0.10-0.20180222191210-5ab67e519c93 h1:jc2UWq7CbdszqeH6qu1ougXMIUBfSy8Pbh/anURYbGI= github.com/google/certificate-transparency-go v1.0.10-0.20180222191210-5ab67e519c93/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -492,7 +484,6 @@ github.com/h2non/gock v1.2.0 h1:K6ol8rfrRkUOefooBC8elXoaNGYkpp7y2qcxGG6BzUE= github.com/h2non/gock v1.2.0/go.mod h1:tNhoxHYW2W42cYkYb1WqzdbYIieALC99kpYr7rH/BQk= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/go-immutable-radix/v2 v2.1.0 h1:CUW5RYIcysz+D3B+l1mDeXrQ7fUvGGCwJfdASSzbrfo= github.com/hashicorp/go-immutable-radix/v2 v2.1.0/go.mod h1:hgdqLXA4f6NIjRVisM1TJ9aOJVNRqKZj+xDGF6m7PBw= @@ -573,9 +564,7 @@ github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5 github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8 h1:CZkYfurY6KGhVtlalI4QwQ6T0Cu6iuY3e0x5RLu96WE= github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo= -github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVtDElaEIDdKwpPqUIZJfzkNLV34htpEc= github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jjti/go-spancheck v0.6.4 h1:Tl7gQpYf4/TMU7AT84MN83/6PutY21Nb9fuQjFTpRRc= @@ -763,7 +752,6 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= @@ -1467,7 +1455,6 @@ google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwl google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/cenkalti/backoff.v2 v2.2.1 h1:eJ9UAg01/HIHG987TwxvnzK2MgxXq97YY6rYDpY9aII= gopkg.in/cenkalti/backoff.v2 v2.2.1/go.mod h1:S0QdOvT2AlerfSBkp0O+dk+bbIMaNbEmVk876gPCthU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1479,7 +1466,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1 h1:d4KQkxAaAiRY2h5Zqis161Pv91A37uZyJOx73duwUwM= gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1/go.mod h1:WbjuEoo1oadwzQ4apSDU+JTvmllEHtsNHS6y7vFc7iw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= From 241133908bc1f3dff51b530c78da23fb04e9fedd Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 28 Mar 2025 13:59:06 +0100 Subject: [PATCH 005/359] fix: load config once using viper (#3367) --- internal/db/start/start.go | 18 ++-- internal/functions/new/new.go | 2 +- internal/functions/serve/serve.go | 6 +- internal/gen/keys/keys.go | 14 +-- internal/start/start.go | 22 ++--- internal/status/status.go | 8 +- internal/storage/client/api.go | 4 +- pkg/config/auth.go | 28 +++--- pkg/config/config.go | 92 +++++++++---------- pkg/config/config_test.go | 51 +++++++--- pkg/config/db.go | 2 +- .../local_enabled_and_disabled.diff | 6 +- .../local_disabled_remote_enabled.diff | 2 +- .../local_enabled_remote_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 | 2 +- .../local_enabled_remote_disabled.diff | 2 +- .../local_enabled_and_disabled.diff | 2 +- .../local_and_remote_rate_limits_differ.diff | 4 +- .../enable_sign_up_without_provider.diff | 2 +- .../local_disabled_remote_enabled.diff | 4 +- .../local_enabled_remote_disabled.diff | 6 +- 24 files changed, 154 insertions(+), 135 deletions(-) diff --git a/internal/db/start/start.go b/internal/db/start/start.go index bb26b71ca..608e5ca61 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -63,7 +63,7 @@ func NewContainerConfig() container.Config { env := []string{ "POSTGRES_PASSWORD=" + utils.Config.Db.Password, "POSTGRES_HOST=/var/run/postgresql", - "JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, fmt.Sprintf("JWT_EXP=%d", utils.Config.Auth.JwtExpiry), } if len(utils.Config.Experimental.OrioleDBVersion) > 0 { @@ -96,7 +96,7 @@ docker-entrypoint.sh postgres -D /etc/postgresql ` + webhookSchema + ` ` + _supabaseSchema + ` EOF -` + utils.Config.Db.RootKey + ` +` + utils.Config.Db.RootKey.Value + ` EOF ` + utils.Config.Db.Settings.ToPostgresConfig() + ` EOF`}, @@ -157,7 +157,7 @@ docker-entrypoint.sh postgres -D /etc/postgresql EOF ` + restoreScript + ` EOF -` + utils.Config.Db.RootKey + ` +` + utils.Config.Db.RootKey.Value + ` EOF ` + utils.Config.Db.Settings.ToPostgresConfig() + ` EOF`} @@ -284,8 +284,8 @@ func initRealtimeJob(host string) utils.DockerJob { "DB_NAME=postgres", "DB_AFTER_CONNECT_QUERY=SET search_path TO _realtime", "DB_ENC_KEY=" + utils.Config.Realtime.EncryptionKey, - "API_JWT_SECRET=" + utils.Config.Auth.JwtSecret, - "METRICS_JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "API_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, + "METRICS_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, "APP_NAME=realtime", "SECRET_KEY_BASE=" + utils.Config.Realtime.SecretKeyBase, "ERL_AFLAGS=" + utils.ToRealtimeEnv(utils.Config.Realtime.IpVersion), @@ -305,9 +305,9 @@ func initStorageJob(host string) utils.DockerJob { Image: utils.Config.Storage.Image, Env: []string{ "DB_INSTALL_ROLES=false", - "ANON_KEY=" + utils.Config.Auth.AnonKey, - "SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey, - "PGRST_JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "ANON_KEY=" + utils.Config.Auth.AnonKey.Value, + "SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value, + "PGRST_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, fmt.Sprintf("DATABASE_URL=postgresql://supabase_storage_admin:%s@%s:5432/postgres", utils.Config.Db.Password, host), fmt.Sprintf("FILE_SIZE_LIMIT=%v", utils.Config.Storage.FileSizeLimit), "STORAGE_BACKEND=file", @@ -330,7 +330,7 @@ func initAuthJob(host string) utils.DockerJob { "GOTRUE_DB_DRIVER=postgres", fmt.Sprintf("GOTRUE_DB_DATABASE_URL=postgresql://supabase_auth_admin:%s@%s:5432/postgres", utils.Config.Db.Password, host), "GOTRUE_SITE_URL=" + utils.Config.Auth.SiteUrl, - "GOTRUE_JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "GOTRUE_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, }, Cmd: []string{"gotrue", "migrate"}, } diff --git a/internal/functions/new/new.go b/internal/functions/new/new.go index 877928c84..5785e0783 100644 --- a/internal/functions/new/new.go +++ b/internal/functions/new/new.go @@ -73,7 +73,7 @@ func createEntrypointFile(slug string, fsys afero.Fs) error { defer f.Close() if err := indexTemplate.Option("missingkey=error").Execute(f, indexConfig{ URL: utils.GetApiUrl("/functions/v1/" + slug), - Token: utils.Config.Auth.AnonKey, + Token: utils.Config.Auth.AnonKey.Value, }); err != nil { return errors.Errorf("failed to write entrypoint: %w", err) } diff --git a/internal/functions/serve/serve.go b/internal/functions/serve/serve.go index b3d43a6b8..e8cc5e6a3 100644 --- a/internal/functions/serve/serve.go +++ b/internal/functions/serve/serve.go @@ -104,10 +104,10 @@ func ServeFunctions(ctx context.Context, envFilePath string, noVerifyJWT *bool, } env = append(env, fmt.Sprintf("SUPABASE_URL=http://%s:8000", utils.KongAliases[0]), - "SUPABASE_ANON_KEY="+utils.Config.Auth.AnonKey, - "SUPABASE_SERVICE_ROLE_KEY="+utils.Config.Auth.ServiceRoleKey, + "SUPABASE_ANON_KEY="+utils.Config.Auth.AnonKey.Value, + "SUPABASE_SERVICE_ROLE_KEY="+utils.Config.Auth.ServiceRoleKey.Value, "SUPABASE_DB_URL="+dbUrl, - "SUPABASE_INTERNAL_JWT_SECRET="+utils.Config.Auth.JwtSecret, + "SUPABASE_INTERNAL_JWT_SECRET="+utils.Config.Auth.JwtSecret.Value, fmt.Sprintf("SUPABASE_INTERNAL_HOST_PORT=%d", utils.Config.Api.Port), ) if viper.GetBool("DEBUG") { diff --git a/internal/gen/keys/keys.go b/internal/gen/keys/keys.go index 81ed52988..6c81f4bd3 100644 --- a/internal/gen/keys/keys.go +++ b/internal/gen/keys/keys.go @@ -31,9 +31,9 @@ func Run(ctx context.Context, projectRef, format string, names CustomName, fsys return utils.EncodeOutput(format, os.Stdout, map[string]string{ names.DbHost: fmt.Sprintf("%s-%s.fly.dev", projectRef, branch), names.DbPassword: utils.Config.Db.Password, - names.JWTSecret: utils.Config.Auth.JwtSecret, - names.AnonKey: utils.Config.Auth.AnonKey, - names.ServiceRoleKey: utils.Config.Auth.ServiceRoleKey, + names.JWTSecret: utils.Config.Auth.JwtSecret.Value, + names.AnonKey: utils.Config.Auth.AnonKey.Value, + names.ServiceRoleKey: utils.Config.Auth.ServiceRoleKey.Value, }) } @@ -46,11 +46,11 @@ func GenerateSecrets(ctx context.Context, projectRef, branch string, fsys afero. if resp.JSON200 == nil { return errors.New("Unexpected error retrieving JWT secret: " + string(resp.Body)) } - utils.Config.Auth.JwtSecret = *resp.JSON200.JwtSecret + utils.Config.Auth.JwtSecret.Value = *resp.JSON200.JwtSecret // Generate database password key := strings.Join([]string{ projectRef, - utils.Config.Auth.JwtSecret, + utils.Config.Auth.JwtSecret.Value, branch, }, ":") hash := sha256.Sum256([]byte(key)) @@ -61,7 +61,7 @@ func GenerateSecrets(ctx context.Context, projectRef, branch string, fsys afero. Ref: projectRef, Role: "anon", }.NewToken() - if utils.Config.Auth.AnonKey, err = anonToken.SignedString([]byte(utils.Config.Auth.JwtSecret)); err != nil { + if utils.Config.Auth.AnonKey.Value, err = anonToken.SignedString([]byte(utils.Config.Auth.JwtSecret.Value)); err != nil { return errors.Errorf("failed to sign anon key: %w", err) } serviceToken := config.CustomClaims{ @@ -69,7 +69,7 @@ func GenerateSecrets(ctx context.Context, projectRef, branch string, fsys afero. Ref: projectRef, Role: "service_role", }.NewToken() - if utils.Config.Auth.ServiceRoleKey, err = serviceToken.SignedString([]byte(utils.Config.Auth.JwtSecret)); err != nil { + if utils.Config.Auth.ServiceRoleKey.Value, err = serviceToken.SignedString([]byte(utils.Config.Auth.JwtSecret.Value)); err != nil { return errors.Errorf("failed to sign service_role key: %w", err) } return nil diff --git a/internal/start/start.go b/internal/start/start.go index 50c294f60..db5638c02 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -464,7 +464,7 @@ EOF "GOTRUE_JWT_AUD=authenticated", "GOTRUE_JWT_DEFAULT_GROUP_NAME=authenticated", fmt.Sprintf("GOTRUE_JWT_EXP=%v", utils.Config.Auth.JwtExpiry), - "GOTRUE_JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "GOTRUE_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, "GOTRUE_JWT_ISSUER=" + utils.GetApiUrl("/auth/v1"), fmt.Sprintf("GOTRUE_EXTERNAL_EMAIL_ENABLED=%v", utils.Config.Auth.Email.EnableSignup), @@ -755,9 +755,9 @@ EOF "DB_NAME=" + dbConfig.Database, "DB_AFTER_CONNECT_QUERY=SET search_path TO _realtime", "DB_ENC_KEY=" + utils.Config.Realtime.EncryptionKey, - "API_JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "API_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, fmt.Sprintf("API_JWT_JWKS=%s", jwks), - "METRICS_JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "METRICS_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, "APP_NAME=realtime", "SECRET_KEY_BASE=" + utils.Config.Realtime.SecretKeyBase, "ERL_AFLAGS=" + utils.ToRealtimeEnv(utils.Config.Realtime.IpVersion), @@ -838,9 +838,9 @@ EOF container.Config{ Image: utils.Config.Storage.Image, Env: []string{ - "ANON_KEY=" + utils.Config.Auth.AnonKey, - "SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey, - "AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "ANON_KEY=" + utils.Config.Auth.AnonKey.Value, + "SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value, + "AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, fmt.Sprintf("AUTH_JWT_JWKS=%s", jwks), fmt.Sprintf("DATABASE_URL=postgresql://supabase_storage_admin:%s@%s:%d/%s", dbConfig.Password, dbConfig.Host, dbConfig.Port, dbConfig.Database), fmt.Sprintf("FILE_SIZE_LIMIT=%v", utils.Config.Storage.FileSizeLimit), @@ -986,9 +986,9 @@ EOF "POSTGRES_PASSWORD=" + dbConfig.Password, "SUPABASE_URL=http://" + utils.KongId + ":8000", "SUPABASE_PUBLIC_URL=" + utils.Config.Studio.ApiUrl, - "AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret, - "SUPABASE_ANON_KEY=" + utils.Config.Auth.AnonKey, - "SUPABASE_SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey, + "AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, + "SUPABASE_ANON_KEY=" + utils.Config.Auth.AnonKey.Value, + "SUPABASE_SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value, "LOGFLARE_API_KEY=" + utils.Config.Analytics.ApiKey, "OPENAI_API_KEY=" + utils.Config.Studio.OpenaiApiKey.Value, fmt.Sprintf("LOGFLARE_URL=http://%v:4000", utils.LogflareId), @@ -1056,8 +1056,8 @@ EOF "CLUSTER_POSTGRES=true", "SECRET_KEY_BASE=" + utils.Config.Db.Pooler.SecretKeyBase, "VAULT_ENC_KEY=" + utils.Config.Db.Pooler.EncryptionKey, - "API_JWT_SECRET=" + utils.Config.Auth.JwtSecret, - "METRICS_JWT_SECRET=" + utils.Config.Auth.JwtSecret, + "API_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, + "METRICS_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, "REGION=local", "RUN_JANITOR=true", "ERL_AFLAGS=-proto_dist inet_tcp", diff --git a/internal/status/status.go b/internal/status/status.go index 68eae2fe3..ef5d42c25 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -50,9 +50,9 @@ func (c *CustomName) toValues(exclude ...string) map[string]string { values[c.StudioURL] = fmt.Sprintf("http://%s:%d", utils.Config.Hostname, utils.Config.Studio.Port) } if utils.Config.Auth.Enabled && !utils.SliceContains(exclude, utils.GotrueId) && !utils.SliceContains(exclude, utils.ShortContainerImageName(utils.Config.Auth.Image)) { - values[c.JWTSecret] = utils.Config.Auth.JwtSecret - values[c.AnonKey] = utils.Config.Auth.AnonKey - values[c.ServiceRoleKey] = utils.Config.Auth.ServiceRoleKey + 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 utils.Config.Inbucket.Enabled && !utils.SliceContains(exclude, utils.InbucketId) && !utils.SliceContains(exclude, utils.ShortContainerImageName(utils.Config.Inbucket.Image)) { values[c.InbucketURL] = fmt.Sprintf("http://%s:%d", utils.Config.Hostname, utils.Config.Inbucket.Port) @@ -178,7 +178,7 @@ func checkHTTPHead(ctx context.Context, path string) error { healthOnce.Do(func() { server := utils.Config.Api.ExternalUrl header := func(req *http.Request) { - req.Header.Add("apikey", utils.Config.Auth.AnonKey) + req.Header.Add("apikey", utils.Config.Auth.AnonKey.Value) } client := NewKongClient() healthClient = fetcher.NewFetcher( diff --git a/internal/storage/client/api.go b/internal/storage/client/api.go index c8c2a02ef..a05eaffeb 100644 --- a/internal/storage/client/api.go +++ b/internal/storage/client/api.go @@ -18,7 +18,7 @@ func NewStorageAPI(ctx context.Context, projectRef string) (storage.StorageAPI, client.Fetcher = newLocalClient() } else if viper.IsSet("AUTH_SERVICE_ROLE_KEY") { // Special case for calling storage API without personal access token - client.Fetcher = newRemoteClient(projectRef, utils.Config.Auth.ServiceRoleKey) + client.Fetcher = newRemoteClient(projectRef, utils.Config.Auth.ServiceRoleKey.Value) } else if apiKey, err := tenant.GetApiKeys(ctx, projectRef); err == nil { client.Fetcher = newRemoteClient(projectRef, apiKey.ServiceRole) } else { @@ -32,7 +32,7 @@ func newLocalClient() *fetcher.Fetcher { return fetcher.NewFetcher( utils.Config.Api.ExternalUrl, fetcher.WithHTTPClient(client), - fetcher.WithBearerToken(utils.Config.Auth.ServiceRoleKey), + fetcher.WithBearerToken(utils.Config.Auth.ServiceRoleKey.Value), fetcher.WithUserAgent("SupabaseCLI/"+utils.Version), fetcher.WithExpectedStatus(http.StatusOK), ) diff --git a/pkg/config/auth.go b/pkg/config/auth.go index dcbd0f197..4cf2a31b8 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -72,7 +72,7 @@ type ( Enabled bool `toml:"enabled"` Image string `toml:"-"` - SiteUrl string `toml:"site_url" mapstructure:"site_url"` + SiteUrl string `toml:"site_url"` AdditionalRedirectUrls []string `toml:"additional_redirect_urls"` JwtExpiry uint `toml:"jwt_expiry"` EnableRefreshTokenRotation bool `toml:"enable_refresh_token_rotation"` @@ -93,9 +93,9 @@ type ( External external `toml:"external"` // Custom secrets can be injected from .env file - JwtSecret string `toml:"-" mapstructure:"jwt_secret"` - AnonKey string `toml:"-" mapstructure:"anon_key"` - ServiceRoleKey string `toml:"-" mapstructure:"service_role_key"` + JwtSecret Secret `toml:"jwt_secret"` + AnonKey Secret `toml:"anon_key"` + ServiceRoleKey Secret `toml:"service_role_key"` ThirdParty thirdParty `toml:"third_party"` } @@ -177,11 +177,11 @@ type ( EnableSignup bool `toml:"enable_signup"` EnableConfirmations bool `toml:"enable_confirmations"` Template string `toml:"template"` - Twilio twilioConfig `toml:"twilio" mapstructure:"twilio"` - TwilioVerify twilioConfig `toml:"twilio_verify" mapstructure:"twilio_verify"` - Messagebird messagebirdConfig `toml:"messagebird" mapstructure:"messagebird"` - Textlocal textlocalConfig `toml:"textlocal" mapstructure:"textlocal"` - Vonage vonageConfig `toml:"vonage" mapstructure:"vonage"` + Twilio twilioConfig `toml:"twilio"` + TwilioVerify twilioConfig `toml:"twilio_verify"` + Messagebird messagebirdConfig `toml:"messagebird"` + Textlocal textlocalConfig `toml:"textlocal"` + Vonage vonageConfig `toml:"vonage"` TestOTP map[string]string `toml:"test_otp"` MaxFrequency time.Duration `toml:"max_frequency"` } @@ -234,26 +234,26 @@ type ( Enabled bool `toml:"enabled"` AccountSid string `toml:"account_sid"` MessageServiceSid string `toml:"message_service_sid"` - AuthToken Secret `toml:"auth_token" mapstructure:"auth_token"` + AuthToken Secret `toml:"auth_token"` } messagebirdConfig struct { Enabled bool `toml:"enabled"` Originator string `toml:"originator"` - AccessKey Secret `toml:"access_key" mapstructure:"access_key"` + AccessKey Secret `toml:"access_key"` } textlocalConfig struct { Enabled bool `toml:"enabled"` Sender string `toml:"sender"` - ApiKey Secret `toml:"api_key" mapstructure:"api_key"` + ApiKey Secret `toml:"api_key"` } vonageConfig struct { Enabled bool `toml:"enabled"` From string `toml:"from"` - ApiKey string `toml:"api_key" mapstructure:"api_key"` - ApiSecret Secret `toml:"api_secret" mapstructure:"api_secret"` + ApiKey string `toml:"api_key"` + ApiSecret Secret `toml:"api_secret"` } provider struct { diff --git a/pkg/config/config.go b/pkg/config/config.go index 764bea381..264ec161f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -156,16 +156,6 @@ func (c CustomClaims) NewToken() *jwt.Token { // // > secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" // -// If you are adding an internal config or secret that doesn't need to be overridden by the user, -// exclude the field from toml serialization. For example, -// -// type auth struct { -// AnonKey string `toml:"-" mapstructure:"anon_key"` -// } -// -// Use `mapstructure:"anon_key"` tag only if you want inject values from a predictable environment -// variable, such as SUPABASE_AUTH_ANON_KEY. -// // Default values for internal configs should be added to `var Config` initializer. type ( // Common config fields between our "base" config and any "remote" branch specific @@ -173,12 +163,12 @@ type ( ProjectId string `toml:"project_id"` Hostname string `toml:"-"` Api api `toml:"api"` - Db db `toml:"db" mapstructure:"db"` + Db db `toml:"db"` Realtime realtime `toml:"realtime"` Studio studio `toml:"studio"` Inbucket inbucket `toml:"inbucket"` Storage storage `toml:"storage"` - Auth auth `toml:"auth" mapstructure:"auth"` + Auth auth `toml:"auth"` EdgeRuntime edgeRuntime `toml:"edge_runtime"` Functions FunctionConfig `toml:"functions"` Analytics analytics `toml:"analytics"` @@ -186,8 +176,8 @@ type ( } config struct { - baseConfig `mapstructure:",squash"` - Remotes map[string]baseConfig `toml:"remotes"` + baseConfig + Remotes map[string]baseConfig `toml:"remotes"` } realtime struct { @@ -248,7 +238,7 @@ type ( GcpProjectId string `toml:"gcp_project_id"` GcpProjectNumber string `toml:"gcp_project_number"` GcpJwtPath string `toml:"gcp_jwt_path"` - ApiKey string `toml:"-" mapstructure:"api_key"` + ApiKey string `toml:"-"` // Deprecated together with syslog VectorPort uint16 `toml:"vector_port"` } @@ -345,7 +335,9 @@ func NewConfig(editors ...ConfigEditor) config { Db: db{ Image: Images.Pg15, Password: "postgres", - RootKey: "d4dc5b6d4a1d6a10b2c1e76112c994d65db7cec380572cc1839624d4be3fa275", + RootKey: Secret{ + Value: "d4dc5b6d4a1d6a10b2c1e76112c994d65db7cec380572cc1839624d4be3fa275", + }, Pooler: pooler{ Image: Images.Supavisor, TenantId: "pooler-dev", @@ -382,8 +374,10 @@ func NewConfig(editors ...ConfigEditor) config { Sms: sms{ TestOTP: map[string]string{}, }, - External: map[string]provider{}, - JwtSecret: defaultJwtSecret, + External: map[string]provider{}, + JwtSecret: Secret{ + Value: defaultJwtSecret, + }, }, Inbucket: inbucket{ Image: Images.Inbucket, @@ -439,18 +433,17 @@ func (c *config) Eject(w io.Writer) error { // Loads custom config file to struct fields tagged with toml. func (c *config) loadFromFile(filename string, fsys fs.FS) error { - v := viper.New() + v := viper.NewWithOptions( + viper.ExperimentalBindStruct(), + viper.EnvKeyReplacer(strings.NewReplacer(".", "_")), + ) + v.SetEnvPrefix("SUPABASE") + v.AutomaticEnv() if err := c.mergeDefaultValues(v); err != nil { return err } else if err := mergeFileConfig(v, filename, fsys); err != nil { return err } - // Load base config and mapstructure overrides - if err := c.load(v); err != nil { - return err - } else if err := c.loadFromEnv(); err != nil { - return err - } // Find [remotes.*] block to override base config idToName := map[string]string{} for name, remote := range v.GetStringMap("remotes") { @@ -462,15 +455,12 @@ func (c *config) loadFromFile(filename string, fsys fs.FS) error { idToName[projectId] = fmt.Sprintf("[remotes.%s]", name) if projectId == c.ProjectId { fmt.Fprintln(os.Stderr, "Loading config override:", idToName[projectId]) - if err := v.MergeConfigMap(remote.(map[string]any)); err != nil { + if err := mergeRemoteConfig(v, remote.(map[string]any)); err != nil { return err } } } - if _, exists := idToName[c.ProjectId]; exists { - return c.load(v) - } - return nil + return c.load(v) } func (c *config) mergeDefaultValues(v *viper.Viper) error { @@ -501,6 +491,20 @@ func mergeFileConfig(v *viper.Viper, filename string, fsys fs.FS) error { return nil } +func mergeRemoteConfig(v *viper.Viper, remote map[string]any) error { + u := viper.New() + if err := u.MergeConfigMap(remote); err != nil { + return errors.Errorf("failed to merge remote config: %w", err) + } + for _, k := range u.AllKeys() { + v.Set(k, u.Get(k)) + } + if key := "db.seed.enabled"; !u.IsSet(key) { + v.Set(key, false) + } + return nil +} + func (c *config) load(v *viper.Viper) error { // Set default values for [functions.*] when config struct is empty for key, value := range v.GetStringMap("functions") { @@ -538,7 +542,7 @@ func (c *config) load(v *viper.Viper) error { return nil } -func (c *baseConfig) newDecodeHook(fs ...mapstructure.DecodeHookFunc) mapstructure.DecodeHookFunc { +func (c *config) newDecodeHook(fs ...mapstructure.DecodeHookFunc) mapstructure.DecodeHookFunc { fs = append(fs, mapstructure.StringToTimeDurationHookFunc(), mapstructure.StringToIPHookFunc(), @@ -549,18 +553,6 @@ func (c *baseConfig) newDecodeHook(fs ...mapstructure.DecodeHookFunc) mapstructu return mapstructure.ComposeDecodeHookFunc(fs...) } -// Loads envs prefixed with supabase_ to struct fields tagged with mapstructure. -func (c *baseConfig) loadFromEnv() error { - v := viper.NewWithOptions(viper.ExperimentalBindStruct()) - v.SetEnvPrefix("SUPABASE") - v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - v.AutomaticEnv() - if err := v.UnmarshalExact(c, viper.DecodeHook(c.newDecodeHook())); err != nil { - return errors.Errorf("failed to parse env override: %w", err) - } - return nil -} - func (c *config) Load(path string, fsys fs.FS) error { builder := NewPathBuilder(path) // Load secrets from .env file @@ -571,20 +563,20 @@ func (c *config) Load(path string, fsys fs.FS) error { return err } // Generate JWT tokens - if len(c.Auth.AnonKey) == 0 { + if len(c.Auth.AnonKey.Value) == 0 { anonToken := CustomClaims{Role: "anon"}.NewToken() - if signed, err := anonToken.SignedString([]byte(c.Auth.JwtSecret)); err != nil { + if signed, err := anonToken.SignedString([]byte(c.Auth.JwtSecret.Value)); err != nil { return errors.Errorf("failed to generate anon key: %w", err) } else { - c.Auth.AnonKey = signed + c.Auth.AnonKey.Value = signed } } - if len(c.Auth.ServiceRoleKey) == 0 { + if len(c.Auth.ServiceRoleKey.Value) == 0 { anonToken := CustomClaims{Role: "service_role"}.NewToken() - if signed, err := anonToken.SignedString([]byte(c.Auth.JwtSecret)); err != nil { + if signed, err := anonToken.SignedString([]byte(c.Auth.JwtSecret.Value)); err != nil { return errors.Errorf("failed to generate service_role key: %w", err) } else { - c.Auth.ServiceRoleKey = signed + c.Auth.ServiceRoleKey.Value = signed } } // TODO: move linked pooler connection string elsewhere @@ -1372,7 +1364,7 @@ func (a *auth) ResolveJWKS(ctx context.Context) (string, error) { } secretJWK.KeyType = "oct" - secretJWK.KeyBase64URL = base64.RawURLEncoding.EncodeToString([]byte(a.JwtSecret)) + secretJWK.KeyBase64URL = base64.RawURLEncoding.EncodeToString([]byte(a.JwtSecret.Value)) secretJWKEncoded, err := json.Marshal(&secretJWK) if err != nil { diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 8b204063c..0d21c3b15 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -69,6 +69,45 @@ func TestConfigParsing(t *testing.T) { // Run test assert.Error(t, config.Load("", fsys)) }) +} + +func TestRemoteOverride(t *testing.T) { + t.Run("load staging override", func(t *testing.T) { + config := NewConfig() + config.ProjectId = "bvikqvbczudanvggcord" + // Setup in-memory fs + fsys := fs.MapFS{ + "supabase/config.toml": &fs.MapFile{Data: testInitConfigEmbed}, + "supabase/templates/invite.html": &fs.MapFile{}, + } + // Run test + t.Setenv("SUPABASE_AUTH_SITE_URL", "http://preview.com") + t.Setenv("AUTH_SEND_SMS_SECRETS", "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==") + assert.NoError(t, config.Load("", fsys)) + // Check error + assert.True(t, config.Db.Seed.Enabled) + assert.Equal(t, "http://preview.com", config.Auth.SiteUrl) + assert.Equal(t, []string{"image/png"}, config.Storage.Buckets["images"].AllowedMimeTypes) + }) + + t.Run("load production override", func(t *testing.T) { + config := NewConfig() + config.ProjectId = "vpefcjyosynxeiebfscx" + // Setup in-memory fs + fsys := fs.MapFS{ + "supabase/config.toml": &fs.MapFile{Data: testInitConfigEmbed}, + "supabase/templates/invite.html": &fs.MapFile{}, + } + // Run test + t.Setenv("SUPABASE_AUTH_SITE_URL", "http://preview.com") + t.Setenv("AUTH_SEND_SMS_SECRETS", "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==") + assert.NoError(t, config.Load("", fsys)) + // Check error + assert.False(t, config.Db.Seed.Enabled) + assert.Equal(t, "http://feature-auth-branch.com/", config.Auth.SiteUrl) + assert.Equal(t, false, config.Auth.External["azure"].Enabled) + assert.Equal(t, "nope", config.Auth.External["azure"].ClientId) + }) t.Run("config file with remotes", func(t *testing.T) { config := NewConfig() @@ -372,18 +411,6 @@ func TestGlobFiles(t *testing.T) { }) } -func TestLoadEnv(t *testing.T) { - t.Setenv("SUPABASE_AUTH_JWT_SECRET", "test-secret") - t.Setenv("SUPABASE_DB_ROOT_KEY", "test-root-key") - config := NewConfig() - // Run test - err := config.loadFromEnv() - // Check error - assert.NoError(t, err) - assert.Equal(t, "test-secret", config.Auth.JwtSecret) - assert.Equal(t, "test-root-key", config.Db.RootKey) -} - func TestLoadFunctionImportMap(t *testing.T) { t.Run("uses deno.json as import map when present", func(t *testing.T) { config := NewConfig() diff --git a/pkg/config/db.go b/pkg/config/db.go index ee77a7906..bdbc4da5d 100644 --- a/pkg/config/db.go +++ b/pkg/config/db.go @@ -73,7 +73,7 @@ type ( ShadowPort uint16 `toml:"shadow_port"` MajorVersion uint `toml:"major_version"` Password string `toml:"-"` - RootKey string `toml:"-" mapstructure:"root_key"` + RootKey Secret `toml:"root_key"` Pooler pooler `toml:"pooler"` Migrations migrations `toml:"migrations"` Seed seed `toml:"seed"` diff --git a/pkg/config/testdata/TestAuthDiff/local_enabled_and_disabled.diff b/pkg/config/testdata/TestAuthDiff/local_enabled_and_disabled.diff index b997bb15a..5425d1265 100644 --- a/pkg/config/testdata/TestAuthDiff/local_enabled_and_disabled.diff +++ b/pkg/config/testdata/TestAuthDiff/local_enabled_and_disabled.diff @@ -23,6 +23,6 @@ diff remote[auth] local[auth] +enable_anonymous_sign_ins = false +minimum_password_length = 6 +password_requirements = "lower_upper_letters_digits_symbols" - - [rate_limit] - anonymous_users = 0 + jwt_secret = "" + anon_key = "" + service_role_key = "" diff --git a/pkg/config/testdata/TestCaptchaDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestCaptchaDiff/local_disabled_remote_enabled.diff index 514251aa3..33e424e85 100644 --- a/pkg/config/testdata/TestCaptchaDiff/local_disabled_remote_enabled.diff +++ b/pkg/config/testdata/TestCaptchaDiff/local_disabled_remote_enabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -19,7 +19,7 @@ +@@ -22,7 +22,7 @@ sms_sent = 0 [captcha] diff --git a/pkg/config/testdata/TestCaptchaDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestCaptchaDiff/local_enabled_remote_disabled.diff index 7bbf9ee8a..9b8e0a2cc 100644 --- a/pkg/config/testdata/TestCaptchaDiff/local_enabled_remote_disabled.diff +++ b/pkg/config/testdata/TestCaptchaDiff/local_enabled_remote_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -19,9 +19,9 @@ +@@ -22,9 +22,9 @@ sms_sent = 0 [captcha] diff --git a/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff index 031c2c5f1..9c65fd39e 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] -@@ -40,13 +40,13 @@ +@@ -43,13 +43,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 b9f205742..aac657d91 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] -@@ -40,36 +40,44 @@ +@@ -43,36 +43,44 @@ 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 2eef288c5..e1c72aea2 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] -@@ -80,7 +80,7 @@ +@@ -83,7 +83,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 = "" -@@ -87,9 +87,9 @@ +@@ -90,9 +90,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 -@@ -136,7 +136,7 @@ +@@ -139,7 +139,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 index b3cb9e1b7..2f58f7348 100644 --- a/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff +++ b/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -20,19 +20,19 @@ +@@ -23,19 +23,19 @@ [hook] [hook.mfa_verification_attempt] diff --git a/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff index b618fb667..ca8d99e1e 100644 --- a/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff +++ b/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -20,20 +20,20 @@ +@@ -23,20 +23,20 @@ [hook] [hook.mfa_verification_attempt] diff --git a/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff b/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff index dbb25a845..66918e27b 100644 --- a/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff +++ b/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -21,16 +21,16 @@ +@@ -24,16 +24,16 @@ [hook] [mfa] diff --git a/pkg/config/testdata/TestRateLimitsDiff/local_and_remote_rate_limits_differ.diff b/pkg/config/testdata/TestRateLimitsDiff/local_and_remote_rate_limits_differ.diff index c403f9cbb..04a638630 100644 --- a/pkg/config/testdata/TestRateLimitsDiff/local_and_remote_rate_limits_differ.diff +++ b/pkg/config/testdata/TestRateLimitsDiff/local_and_remote_rate_limits_differ.diff @@ -1,8 +1,8 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -11,12 +11,12 @@ - password_requirements = "" +@@ -14,12 +14,12 @@ + service_role_key = "" [rate_limit] -anonymous_users = 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 a9b5eb63b..27c9d143d 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] -@@ -49,7 +49,7 @@ +@@ -52,7 +52,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 b1cf6e99d..6cf27da6e 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] -@@ -49,12 +49,12 @@ +@@ -52,12 +52,12 @@ otp_expiry = 0 [sms] @@ -19,7 +19,7 @@ diff remote[auth] local[auth] account_sid = "" message_service_sid = "" auth_token = "" -@@ -77,8 +77,6 @@ +@@ -80,8 +80,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 e2853e76e..3cbb49a40 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] -@@ -49,12 +49,12 @@ +@@ -52,12 +52,12 @@ otp_expiry = 0 [sms] @@ -19,7 +19,7 @@ diff remote[auth] local[auth] account_sid = "" message_service_sid = "" auth_token = "" -@@ -64,9 +64,9 @@ +@@ -67,9 +67,9 @@ message_service_sid = "" auth_token = "" [sms.messagebird] @@ -32,7 +32,7 @@ diff remote[auth] local[auth] [sms.textlocal] enabled = false sender = "" -@@ -77,6 +77,7 @@ +@@ -80,6 +80,7 @@ api_key = "" api_secret = "" [sms.test_otp] From b9503cf81a62809f007f24659429b2a4e6ae2146 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 22:34:45 +0800 Subject: [PATCH 006/359] chore(deps): bump golangci/golangci-lint-action from 6 to 7 (#3347) * chore(deps): bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * chore: update go version * chore: bump linter to v2 * chore: migrate linter config file * chore: address linter errors --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han Co-authored-by: Han Qiao --- .github/workflows/ci.yml | 2 +- .golangci.yml | 43 +++++++++---- go.mod | 54 +++++++++-------- go.sum | 104 ++++++++++++++++++-------------- internal/inspect/cache/cache.go | 5 +- pkg/config/config.go | 4 +- pkg/config/config_test.go | 2 +- tools/bumpdoc/main.go | 2 +- tools/publish/main.go | 2 +- tools/selfhost/main.go | 2 +- tools/tools.go | 2 +- 11 files changed, 128 insertions(+), 94 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6bdee179..e7cf2b30b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: # Linter requires no cache cache: false - - uses: golangci/golangci-lint-action@v6 + - uses: golangci/golangci-lint-action@v7 with: args: --timeout 3m --verbose diff --git a/.golangci.yml b/.golangci.yml index b91c1afd6..634b5fe62 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,23 +1,40 @@ +version: "2" linters: enable: - dogsled - dupl - - gofmt - - goimports - gosec - misspell - nakedret - - stylecheck + - staticcheck - unconvert - unparam - whitespace - - errcheck - - gosimple - - staticcheck - - ineffassign - - unused -linters-settings: - stylecheck: - checks: ["all", "-ST1003"] - dupl: - threshold: 250 + settings: + dupl: + threshold: 250 + exclusions: + generated: lax + rules: + - text: 'ST1003:' + linters: + - staticcheck + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/go.mod b/go.mod index 5379e5b9f..96cb98f65 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,6 @@ module github.com/supabase/cli -go 1.23.2 -toolchain go1.24.1 +go 1.24.1 require ( github.com/BurntSushi/toml v1.5.0 @@ -11,7 +10,7 @@ require ( github.com/charmbracelet/bubbles v0.18.0 github.com/charmbracelet/bubbletea v0.25.0 github.com/charmbracelet/glamour v0.7.0 - github.com/charmbracelet/lipgloss v0.12.1 + github.com/charmbracelet/lipgloss v1.1.0 github.com/containers/common v0.62.2 github.com/docker/cli v28.0.4+incompatible github.com/docker/docker v28.0.2+incompatible @@ -24,7 +23,7 @@ require ( github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golang-jwt/jwt/v5 v5.2.2 - github.com/golangci/golangci-lint v1.64.8 + github.com/golangci/golangci-lint/v2 v2.0.2 github.com/google/go-github/v62 v62.0.0 github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 @@ -65,14 +64,14 @@ require ( dario.cat/mergo v1.0.1 // indirect github.com/4meepo/tagalign v1.4.2 // indirect github.com/Abirdcfly/dupword v0.1.3 // indirect - github.com/Antonboom/errname v1.0.0 // indirect - github.com/Antonboom/nilnil v1.0.1 // indirect - github.com/Antonboom/testifylint v1.5.2 // indirect + github.com/Antonboom/errname v1.1.0 // indirect + github.com/Antonboom/nilnil v1.1.0 // indirect + github.com/Antonboom/testifylint v1.6.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/Crocmagnon/fatcontext v0.7.1 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect - github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/Masterminds/semver/v3 v3.3.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect github.com/ProtonMail/go-crypto v1.1.5 // indirect @@ -92,27 +91,31 @@ require ( github.com/bitfield/gotestdox v0.2.2 // indirect github.com/bkielbasa/cyclop v1.2.3 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v4 v4.5.0 // indirect - github.com/breml/bidichk v0.3.2 // indirect - github.com/breml/errchkjson v0.4.0 // indirect + github.com/bombsimon/wsl/v4 v4.6.0 // indirect + github.com/breml/bidichk v0.3.3 // indirect + github.com/breml/errchkjson v0.4.1 // indirect github.com/butuzov/ireturn v0.3.1 // indirect github.com/butuzov/mirror v1.3.0 // indirect - github.com/catenacyber/perfsprint v0.8.2 // indirect + github.com/catenacyber/perfsprint v0.9.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect + github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect github.com/charmbracelet/harmonica v0.2.0 // indirect - github.com/charmbracelet/x/ansi v0.1.4 // indirect + github.com/charmbracelet/x/ansi v0.8.0 // indirect + github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect + github.com/charmbracelet/x/term v0.2.1 // indirect github.com/chavacava/garif v0.1.0 // indirect - github.com/ckaznocha/intrange v0.3.0 // indirect + github.com/ckaznocha/intrange v0.3.1 // indirect github.com/cloudflare/circl v1.6.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.57.2 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect - github.com/daixiang0/gci v0.13.5 // indirect + github.com/daixiang0/gci v0.13.6 // indirect github.com/danieljoos/wincred v1.2.2 // indirect + github.com/dave/dst v0.27.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect @@ -135,8 +138,8 @@ require ( github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/getkin/kin-openapi v0.127.0 // indirect - github.com/ghostiam/protogetter v0.3.9 // indirect - github.com/go-critic/go-critic v0.12.0 // indirect + github.com/ghostiam/protogetter v0.3.12 // indirect + github.com/go-critic/go-critic v0.13.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.2 // indirect github.com/go-logr/logr v1.4.2 // indirect @@ -159,6 +162,7 @@ require ( github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect github.com/golangci/go-printf-func-name v0.1.0 // indirect github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect + github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 // indirect github.com/golangci/misspell v0.6.0 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/golangci/revgrep v0.8.0 // indirect @@ -208,7 +212,7 @@ require ( 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 - github.com/macabu/inamedparam v0.1.3 // indirect + github.com/macabu/inamedparam v0.2.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.1 // indirect @@ -230,7 +234,7 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect github.com/muesli/cancelreader v0.2.2 // indirect - github.com/muesli/termenv v0.15.2 // indirect + github.com/muesli/termenv v0.16.0 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect @@ -248,7 +252,7 @@ require ( github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect + github.com/quasilyte/go-ruleguard v0.4.4 // indirect github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect @@ -256,7 +260,7 @@ require ( github.com/raeperd/recvcheck v0.2.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect - github.com/ryancurrah/gomodguard v1.3.5 // indirect + github.com/ryancurrah/gomodguard v1.4.1 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f // indirect @@ -268,7 +272,6 @@ require ( github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect - github.com/sivchari/tenv v1.12.1 // indirect github.com/skeema/knownhosts v1.3.1 // indirect github.com/sonatard/noctx v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect @@ -282,7 +285,7 @@ require ( github.com/tdakkota/asciicheck v0.4.1 // indirect github.com/tetafro/godot v1.5.0 // indirect github.com/theupdateframework/notary v0.7.0 // indirect - github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 // indirect + github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect github.com/timonwong/loggercheck v0.10.1 // indirect github.com/tomarrell/wrapcheck/v2 v2.10.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect @@ -295,7 +298,8 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - github.com/xen0n/gosmopolitan v1.2.2 // indirect + github.com/xen0n/gosmopolitan v1.3.0 // indirect + github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.3.0 // indirect github.com/ykadowak/zerologlint v0.1.5 // indirect @@ -333,5 +337,5 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect honnef.co/go/tools v0.6.1 // indirect mvdan.cc/gofumpt v0.7.0 // indirect - mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect + mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect ) diff --git a/go.sum b/go.sum index f2a2cc035..ce90f1fb7 100644 --- a/go.sum +++ b/go.sum @@ -43,12 +43,12 @@ github.com/4meepo/tagalign v1.4.2 h1:0hcLHPGMjDyM1gHG58cS73aQF8J4TdVR96TZViorO9E github.com/4meepo/tagalign v1.4.2/go.mod h1:+p4aMyFM+ra7nb41CnFG6aSDXqRxU/w1VQqScKqDARI= github.com/Abirdcfly/dupword v0.1.3 h1:9Pa1NuAsZvpFPi9Pqkd93I7LIYRURj+A//dFd5tgBeE= github.com/Abirdcfly/dupword v0.1.3/go.mod h1:8VbB2t7e10KRNdwTVoxdBaxla6avbhGzb8sCTygUMhw= -github.com/Antonboom/errname v1.0.0 h1:oJOOWR07vS1kRusl6YRSlat7HFnb3mSfMl6sDMRoTBA= -github.com/Antonboom/errname v1.0.0/go.mod h1:gMOBFzK/vrTiXN9Oh+HFs+e6Ndl0eTFbtsRTSRdXyGI= -github.com/Antonboom/nilnil v1.0.1 h1:C3Tkm0KUxgfO4Duk3PM+ztPncTFlOf0b2qadmS0s4xs= -github.com/Antonboom/nilnil v1.0.1/go.mod h1:CH7pW2JsRNFgEh8B2UaPZTEPhCMuFowP/e8Udp9Nnb0= -github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5lGoQazk= -github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= +github.com/Antonboom/errname v1.1.0 h1:A+ucvdpMwlo/myWrkHEUEBWc/xuXdud23S8tmTb/oAE= +github.com/Antonboom/errname v1.1.0/go.mod h1:O1NMrzgUcVBGIfi3xlVuvX8Q/VP/73sseCaAppfjqZw= +github.com/Antonboom/nilnil v1.1.0 h1:jGxJxjgYS3VUUtOTNk8Z1icwT5ESpLH/426fjmQG+ng= +github.com/Antonboom/nilnil v1.1.0/go.mod h1:b7sAlogQjFa1wV8jUW3o4PMzDVFLbTux+xnQdvzdcIE= +github.com/Antonboom/testifylint v1.6.0 h1:6rdILVPt4+rqcvhid8w9wJNynKLUgqHNpFyM67UeXyc= +github.com/Antonboom/testifylint v1.6.0/go.mod h1:k+nEkathI2NFjKO6HvwmSrbzUcQ6FAnbZV+ZRrnXPLI= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -62,8 +62,8 @@ github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5H github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 h1:Sz1JIXEcSfhz7fUi7xHnhpIE0thVASYjvosApmHuD2k= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1/go.mod h1:n/LSCXNuIYqVfBlVXyHfMQkZDdp1/mmxfSjADd3z1Zg= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= -github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= +github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= @@ -131,12 +131,12 @@ github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bombsimon/wsl/v4 v4.5.0 h1:iZRsEvDdyhd2La0FVi5k6tYehpOR/R7qIUjmKk7N74A= -github.com/bombsimon/wsl/v4 v4.5.0/go.mod h1:NOQ3aLF4nD7N5YPXMruR6ZXDOAqLoM0GEpLwTdvmOSc= -github.com/breml/bidichk v0.3.2 h1:xV4flJ9V5xWTqxL+/PMFF6dtJPvZLPsyixAoPe8BGJs= -github.com/breml/bidichk v0.3.2/go.mod h1:VzFLBxuYtT23z5+iVkamXO386OB+/sVwZOpIj6zXGos= -github.com/breml/errchkjson v0.4.0 h1:gftf6uWZMtIa/Is3XJgibewBm2ksAQSY/kABDNFTAdk= -github.com/breml/errchkjson v0.4.0/go.mod h1:AuBOSTHyLSaaAFlWsRSuRBIroCh3eh7ZHh5YeelDIk8= +github.com/bombsimon/wsl/v4 v4.6.0 h1:ew2R/N42su553DKTYqt3HSxaQN+uHQPv4xZ2MBmwaW4= +github.com/bombsimon/wsl/v4 v4.6.0/go.mod h1:uV/+6BkffuzSAVYD+yGyld1AChO7/EuLrCF/8xTiapg= +github.com/breml/bidichk v0.3.3 h1:WSM67ztRusf1sMoqH6/c4OBCUlRVTKq+CbSeo0R17sE= +github.com/breml/bidichk v0.3.3/go.mod h1:ISbsut8OnjB367j5NseXEGGgO/th206dVa427kR8YTE= +github.com/breml/errchkjson v0.4.1 h1:keFSS8D7A2T0haP9kzZTi7o26r7kE3vymjZNeNDRDwg= +github.com/breml/errchkjson v0.4.1/go.mod h1:a23OvR6Qvcl7DG/Z4o0el6BRAjKnaReoPQFciAl9U3s= github.com/bugsnag/bugsnag-go v1.0.5-0.20150529004307-13fd6b8acda0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= @@ -144,8 +144,8 @@ github.com/butuzov/ireturn v0.3.1 h1:mFgbEI6m+9W8oP/oDdfA34dLisRFCj2G6o/yiI1yZrY github.com/butuzov/ireturn v0.3.1/go.mod h1:ZfRp+E7eJLC0NQmk1Nrm1LOrn/gQlOykv+cVPdiXH5M= github.com/butuzov/mirror v1.3.0 h1:HdWCXzmwlQHdVhwvsfBb2Au0r3HyINry3bDWLYXiKoc= github.com/butuzov/mirror v1.3.0/go.mod h1:AEij0Z8YMALaq4yQj9CPPVYOyJQyiexpQEQgihajRfI= -github.com/catenacyber/perfsprint v0.8.2 h1:+o9zVmCSVa7M4MvabsWvESEhpsMkhfE7k0sHNGL95yw= -github.com/catenacyber/perfsprint v0.8.2/go.mod h1:q//VWC2fWbcdSLEY1R3l8n0zQCDPdE4IjZwyY1HMunM= +github.com/catenacyber/perfsprint v0.9.1 h1:5LlTp4RwTooQjJCvGEFV6XksZvWE7wCOUvjD2z0vls0= +github.com/catenacyber/perfsprint v0.9.1/go.mod h1:q//VWC2fWbcdSLEY1R3l8n0zQCDPdE4IjZwyY1HMunM= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= @@ -161,21 +161,27 @@ github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/ github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw= github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM= github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg= +github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs= +github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk= github.com/charmbracelet/glamour v0.7.0 h1:2BtKGZ4iVJCDfMF229EzbeR1QRKLWztO9dMtjmqZSng= github.com/charmbracelet/glamour v0.7.0/go.mod h1:jUMh5MeihljJPQbJ/wf4ldw2+yBP59+ctV36jASy7ps= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= -github.com/charmbracelet/lipgloss v0.12.1 h1:/gmzszl+pedQpjCOH+wFkZr/N90Snz40J/NR7A0zQcs= -github.com/charmbracelet/lipgloss v0.12.1/go.mod h1:V2CiwIuhx9S1S1ZlADfOj9HmxeMAORuz5izHb0zGbB8= -github.com/charmbracelet/x/ansi v0.1.4 h1:IEU3D6+dWwPSgZ6HBH+v6oUuZ/nVawMiWj5831KfiLM= -github.com/charmbracelet/x/ansi v0.1.4/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= +github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= +github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE= +github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q= +github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8= +github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= +github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= +github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/ckaznocha/intrange v0.3.0 h1:VqnxtK32pxgkhJgYQEeOArVidIPg+ahLP7WBOXZd5ZY= -github.com/ckaznocha/intrange v0.3.0/go.mod h1:+I/o2d2A1FBHgGELbGxzIcyd3/9l9DuwjM8FsbSS3Lo= +github.com/ckaznocha/intrange v0.3.1 h1:j1onQyXvHUsPWujDH6WIjhyH26gkRt/txNlV7LspvJs= +github.com/ckaznocha/intrange v0.3.1/go.mod h1:QVepyz1AkUoFQkpEqksSYpNpUo3c5W7nWh/s6SHIJJk= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= github.com/cloudflare/circl v1.6.0 h1:cr5JKic4HI+LkINy2lg3W2jF8sHCVTBncJr5gIIq7qk= @@ -202,10 +208,14 @@ github.com/curioswitch/go-reassign v0.3.0 h1:dh3kpQHuADL3cobV/sSGETA8DOv457dwl+f github.com/curioswitch/go-reassign v0.3.0/go.mod h1:nApPCCTtqLJN/s8HfItCcKV0jIPwluBOvZP+dsJGA88= github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= -github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c= -github.com/daixiang0/gci v0.13.5/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= +github.com/daixiang0/gci v0.13.6 h1:RKuEOSkGpSadkGbvZ6hJ4ddItT3cVZ9Vn9Rybk6xjl8= +github.com/daixiang0/gci v0.13.6/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0= github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8= +github.com/dave/dst v0.27.3 h1:P1HPoMza3cMEquVf9kKy8yXsFirry4zEnWOdYPOoIzY= +github.com/dave/dst v0.27.3/go.mod h1:jHh6EOibnHgcUW3WjKHisiooEkYwqpHLBSX1iOBhEyc= +github.com/dave/jennifer v1.7.1 h1:B4jJJDHelWcDhlRQxWeo0Npa/pYKBLrirAQoTN45txo= +github.com/dave/jennifer v1.7.1/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -283,12 +293,12 @@ github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3 github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= github.com/getsentry/sentry-go v0.31.1 h1:ELVc0h7gwyhnXHDouXkhqTFSO5oslsRDk0++eyE0KJ4= github.com/getsentry/sentry-go v0.31.1/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY= -github.com/ghostiam/protogetter v0.3.9 h1:j+zlLLWzqLay22Cz/aYwTHKQ88GE2DQ6GkWSYFOI4lQ= -github.com/ghostiam/protogetter v0.3.9/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= +github.com/ghostiam/protogetter v0.3.12 h1:xTPjH97iKph27vXRRKV0OCke5sAMoHPbVeVstdzmCLE= +github.com/ghostiam/protogetter v0.3.12/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= -github.com/go-critic/go-critic v0.12.0 h1:iLosHZuye812wnkEz1Xu3aBwn5ocCPfc9yqmFG9pa6w= -github.com/go-critic/go-critic v0.12.0/go.mod h1:DpE0P6OVc6JzVYzmM5gq5jMU31zLr4am5mB/VfFK64w= +github.com/go-critic/go-critic v0.13.0 h1:kJzM7wzltQasSUXtYyTl6UaPVySO6GkaR1thFnJ6afY= +github.com/go-critic/go-critic v0.13.0/go.mod h1:M/YeuJ3vOCQDnP2SU+ZhjgRzwzcBW87JqLpMJLrZDLI= github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= @@ -403,8 +413,10 @@ github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUP github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY= -github.com/golangci/golangci-lint v1.64.8 h1:y5TdeVidMtBGG32zgSC7ZXTFNHrsJkDnpO4ItB3Am+I= -github.com/golangci/golangci-lint v1.64.8/go.mod h1:5cEsUQBSr6zi8XI8OjmcY2Xmliqc4iYL7YoPrL+zLJ4= +github.com/golangci/golangci-lint/v2 v2.0.2 h1:dMCC8ikPiLDvHMFy3+XypSAuGDBOLzwWqqamer+bWsY= +github.com/golangci/golangci-lint/v2 v2.0.2/go.mod h1:ptNNMeGBQrbves0Qq38xvfdJg18PzxmT+7KRCOpm6i8= +github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 h1:AkK+w9FZBXlU/xUmBtSJN1+tAI4FIvy5WtnUnY8e4p8= +github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95/go.mod h1:k9mmcyWKSTMcPPvQUCfRWWQ9VHJ1U9Dc0R7kaXAgtnQ= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= @@ -638,8 +650,8 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= -github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= +github.com/macabu/inamedparam v0.2.0 h1:VyPYpOc10nkhI2qeNUdh3Zket4fcZjEWe35poddBCpE= +github.com/macabu/inamedparam v0.2.0/go.mod h1:+Pee9/YfGe5LJ62pYXqB89lJ+0k5bsR8Wgz/C0Zlq3U= github.com/magiconair/properties v1.5.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= @@ -705,8 +717,8 @@ github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELU github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= -github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= +github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= @@ -810,8 +822,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo= -github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= +github.com/quasilyte/go-ruleguard v0.4.4 h1:53DncefIeLX3qEpjzlS1lyUmQoUEeOWPFWqaTJq9eAQ= +github.com/quasilyte/go-ruleguard v0.4.4/go.mod h1:Vl05zJ538vcEEwu16V/Hdu7IYZWyKSwIy4c88Ro1kRE= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= @@ -834,8 +846,8 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU= -github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= +github.com/ryancurrah/gomodguard v1.4.1 h1:eWC8eUMNZ/wM/PWuZBv7JxxqT5fiIKSIyTvjb7Elr+g= +github.com/ryancurrah/gomodguard v1.4.1/go.mod h1:qnMJwV1hX9m+YJseXEBhd2s90+1Xn6x9dLz11ualI1I= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= @@ -871,8 +883,6 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= -github.com/sivchari/tenv v1.12.1 h1:+E0QzjktdnExv/wwsnnyk4oqZBUfuh89YMQT1cyuvSY= -github.com/sivchari/tenv v1.12.1/go.mod h1:1LjSOUCc25snIr5n3DtGGrENhX3LuWefcplwVGC24mw= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= github.com/slack-go/slack v0.16.0 h1:khp/WCFv+Hb/B/AJaAwvcxKun0hM6grN0bUZ8xG60P8= @@ -940,8 +950,8 @@ github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4D github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw= github.com/tidwall/jsonc v0.3.2 h1:ZTKrmejRlAJYdn0kcaFqRAKlxxFIC21pYq8vLa4p2Wc= github.com/tidwall/jsonc v0.3.2/go.mod h1:dw+3CIxqHi+t8eFSpzzMlcVYxKp08UP5CD8/uSFCyJE= -github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 h1:y4mJRFlM6fUyPhoXuFg/Yu02fg/nIPFMOY8tOqppoFg= -github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= +github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk5r6+hJnar67cgpDIz/iyD+rfl5r2Vk= +github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= github.com/timonwong/loggercheck v0.10.1 h1:uVZYClxQFpw55eh+PIoqM7uAOHMrhVcDoWDery9R8Lg= github.com/timonwong/loggercheck v0.10.1/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= github.com/tomarrell/wrapcheck/v2 v2.10.0 h1:SzRCryzy4IrAH7bVGG4cK40tNUhmVmMDuJujy4XwYDg= @@ -970,8 +980,10 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= -github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= +github.com/xen0n/gosmopolitan v1.3.0 h1:zAZI1zefvo7gcpbCOrPSHJZJYA9ZgLfJqtKzZ5pHqQM= +github.com/xen0n/gosmopolitan v1.3.0/go.mod h1:rckfr5T6o4lBtM1ga7mLGKZmLxswUoH1zxHgNXOsEt4= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= @@ -1499,8 +1511,8 @@ honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI= honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4= 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= +mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 h1:WjUu4yQoT5BHT1w8Zu56SP8367OuBV5jvo+4Ulppyf8= +mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4/go.mod h1:rthT7OuvRbaGcd5ginj6dA2oLE7YNlta9qhBNNdCaLE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 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/inspect/cache/cache.go b/internal/inspect/cache/cache.go index ce30c1f4a..2b7ad5f25 100644 --- a/internal/inspect/cache/cache.go +++ b/internal/inspect/cache/cache.go @@ -45,9 +45,10 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu ok = "Maybe not..." } var explanation string - if r.Name == "index hit rate" { + switch r.Name { + case "index hit rate": explanation = "This is the ratio of index hits to index scans. If this ratio is low, it means that the database is not using indexes effectively. Check the `index-usage` command for more info." - } else if r.Name == "table hit rate" { + case "table hit rate": explanation = "This is the ratio of table hits to table scans. If this ratio is low, it means that your queries are not finding the data effectively. Check your query performance and it might be worth increasing your compute." } table += fmt.Sprintf("|`%s`|`%.6f`|`%s`|`%s`|\n", r.Name, r.Ratio, ok, explanation) diff --git a/pkg/config/config.go b/pkg/config/config.go index 264ec161f..92fb5ba08 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -628,7 +628,7 @@ func (c *config) Load(path string, fsys fs.FS) error { c.Studio.PgmetaImage = replaceImageTag(Images.Pgmeta, string(version)) } // TODO: replace derived config resolution with viper decode hooks - if err := c.baseConfig.resolve(builder, fsys); err != nil { + if err := c.resolve(builder, fsys); err != nil { return err } return c.Validate(fsys) @@ -1399,7 +1399,7 @@ func (c *baseConfig) GetServiceImages() []string { // Retrieve the final base config to use taking into account the remotes override // Pre: config must be loaded after setting config.ProjectID = "ref" func (c *config) GetRemoteByProjectRef(projectRef string) (baseConfig, error) { - base := c.baseConfig.Clone() + base := c.Clone() for _, remote := range c.Remotes { if remote.ProjectId == projectRef { base.ProjectId = projectRef diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 0d21c3b15..54278862c 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -318,7 +318,7 @@ func TestValidateHookURI(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - err := tt.hookConfig.validate(tt.name) + err := tt.validate(tt.name) if len(tt.errorMsg) > 0 { assert.Error(t, err, "Expected an error for %v", tt.name) assert.EqualError(t, err, tt.errorMsg, "Expected error message does not match for %v", tt.name) diff --git a/tools/bumpdoc/main.go b/tools/bumpdoc/main.go index 55d9de344..e8309724e 100644 --- a/tools/bumpdoc/main.go +++ b/tools/bumpdoc/main.go @@ -78,7 +78,7 @@ func updateRefDoc(ctx context.Context, path string, stdin io.Reader) error { if err != nil { return err } - fmt.Fprintln(os.Stderr, "Committed changes to", *resp.Commit.SHA) + fmt.Fprintln(os.Stderr, "Committed changes to", *resp.SHA) // Create pull request pr := github.NewPullRequest{ Title: &message, diff --git a/tools/publish/main.go b/tools/publish/main.go index be2474edb..c61e68adc 100644 --- a/tools/publish/main.go +++ b/tools/publish/main.go @@ -146,7 +146,7 @@ func updatePackage(ctx context.Context, client *github.Client, repo, path string if err != nil { return err } - fmt.Fprintln(os.Stderr, "Committed changes to", *resp.Commit.SHA) + fmt.Fprintln(os.Stderr, "Committed changes to", *resp.SHA) // Create pull request pr := github.NewPullRequest{ Title: &message, diff --git a/tools/selfhost/main.go b/tools/selfhost/main.go index 2a5ed65a6..8eb19befc 100644 --- a/tools/selfhost/main.go +++ b/tools/selfhost/main.go @@ -111,6 +111,6 @@ func updateComposeVersion(ctx context.Context, client *github.Client, path, ref if err != nil { return err } - fmt.Fprintln(os.Stderr, "Committed changes to", *resp.Commit.SHA) + fmt.Fprintln(os.Stderr, "Committed changes to", *resp.SHA) return nil } diff --git a/tools/tools.go b/tools/tools.go index 5aadac6dd..e0ae60a6c 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -8,7 +8,7 @@ import ( // the library. // This should be migrated directly to go.mod when the following is complete: // https://github.com/golang/go/issues/48429 - _ "github.com/golangci/golangci-lint/cmd/golangci-lint" + _ "github.com/golangci/golangci-lint/v2/cmd/golangci-lint" _ "github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen" _ "gotest.tools/gotestsum" ) From 03f23ee3a2133fd1a36f4f9c43cb5b0529af949f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 22:44:56 +0800 Subject: [PATCH 007/359] chore(deps): bump github.com/charmbracelet/glamour from 0.7.0 to 0.9.1 (#3322) * chore(deps): bump github.com/charmbracelet/glamour from 0.7.0 to 0.9.1 Bumps [github.com/charmbracelet/glamour](https://github.com/charmbracelet/glamour) from 0.7.0 to 0.9.1. - [Release notes](https://github.com/charmbracelet/glamour/releases) - [Changelog](https://github.com/charmbracelet/glamour/blob/master/.goreleaser.yml) - [Commits](https://github.com/charmbracelet/glamour/compare/v0.7.0...v0.9.1) --- updated-dependencies: - dependency-name: github.com/charmbracelet/glamour dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: add line break --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han --- go.mod | 12 ++++++------ go.sum | 30 +++++++++++++++++------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 96cb98f65..049b7283d 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 github.com/charmbracelet/bubbles v0.18.0 github.com/charmbracelet/bubbletea v0.25.0 - github.com/charmbracelet/glamour v0.7.0 + github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 github.com/containers/common v0.62.2 github.com/docker/cli v28.0.4+incompatible @@ -75,7 +75,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect github.com/ProtonMail/go-crypto v1.1.5 // indirect - github.com/alecthomas/chroma/v2 v2.8.0 // indirect + github.com/alecthomas/chroma/v2 v2.14.0 // indirect github.com/alecthomas/go-check-sumtype v0.3.1 // indirect github.com/alexkohler/nakedret/v2 v2.0.5 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect @@ -170,7 +170,7 @@ require ( github.com/google/go-cmp v0.7.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect - github.com/gorilla/css v1.0.0 // indirect + github.com/gorilla/css v1.0.1 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect @@ -223,7 +223,7 @@ require ( github.com/mattn/go-runewidth v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/mgechev/revive v1.7.0 // indirect - github.com/microcosm-cc/bluemonday v1.0.25 // indirect + github.com/microcosm-cc/bluemonday v1.0.27 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect @@ -303,8 +303,8 @@ require ( github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.3.0 // indirect github.com/ykadowak/zerologlint v0.1.5 // indirect - github.com/yuin/goldmark v1.5.4 // indirect - github.com/yuin/goldmark-emoji v1.0.2 // indirect + github.com/yuin/goldmark v1.7.8 // indirect + github.com/yuin/goldmark-emoji v1.0.5 // indirect gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.13.0 // indirect go-simpler.org/sloglint v0.9.0 // indirect diff --git a/go.sum b/go.sum index ce90f1fb7..8730bacc0 100644 --- a/go.sum +++ b/go.sum @@ -77,8 +77,8 @@ github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMz github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/chroma/v2 v2.8.0 h1:w9WJUjFFmHHB2e8mRpL9jjy3alYDlU0QLDezj1xE264= -github.com/alecthomas/chroma/v2 v2.8.0/go.mod h1:yrkMI9807G1ROx13fhe1v6PN2DDeaR73L3d+1nmYQtw= +github.com/alecthomas/chroma/v2 v2.14.0 h1:R3+wzpnUArGcQz7fCETQBzO5n9IMNi13iIs46aU4V9E= +github.com/alecthomas/chroma/v2 v2.14.0/go.mod h1:QolEbTfmUHIMVpBqxeDnNBj2uoeI4EbYP4i6n68SG4I= github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU= github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= @@ -112,6 +112,8 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8= +github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= @@ -163,8 +165,8 @@ github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg= github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs= github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk= -github.com/charmbracelet/glamour v0.7.0 h1:2BtKGZ4iVJCDfMF229EzbeR1QRKLWztO9dMtjmqZSng= -github.com/charmbracelet/glamour v0.7.0/go.mod h1:jUMh5MeihljJPQbJ/wf4ldw2+yBP59+ctV36jASy7ps= +github.com/charmbracelet/glamour v0.9.1 h1:11dEfiGP8q1BEqvGoIjivuc2rBk+5qEXdPtaQ2WoiCM= +github.com/charmbracelet/glamour v0.9.1/go.mod h1:+SHvIS8qnwhgTpVMiXwn7OfGomSqff1cHBCI8jLOetk= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= @@ -173,6 +175,8 @@ github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2ll github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q= github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8= github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= +github.com/charmbracelet/x/exp/golden v0.0.0-20240806155701-69247e0abc2a h1:G99klV19u0QnhiizODirwVksQB91TJKV/UaTnACcG30= +github.com/charmbracelet/x/exp/golden v0.0.0-20240806155701-69247e0abc2a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= @@ -469,8 +473,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= -github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= +github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= +github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= @@ -684,8 +688,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182aff github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgechev/revive v1.7.0 h1:JyeQ4yO5K8aZhIKf5rec56u0376h8AlKNQEmjfkjKlY= github.com/mgechev/revive v1.7.0/go.mod h1:qZnwcNhoguE58dfi96IJeSTPeZQejNeoMQLUZGi4SW4= -github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= -github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= +github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk= +github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA= github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= @@ -997,13 +1001,13 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.3.7/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU= -github.com/yuin/goldmark v1.5.4/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark-emoji v1.0.2 h1:c/RgTShNgHTtc6xdz2KKI74jJr6rWi7FPgnP9GAsO5s= -github.com/yuin/goldmark-emoji v1.0.2/go.mod h1:RhP/RWpexdp+KHs7ghKnifRoIs/Bq4nDS7tRbCkOwKY= +github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= +github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark-emoji v1.0.5 h1:EMVWyCGPlXJfUXBXpuMu+ii3TIaxbVBnEX9uaDC4cIk= +github.com/yuin/goldmark-emoji v1.0.5/go.mod h1:tTkZEbwu5wkPmgTcitqddVxY9osFZiavD+r4AzQrh1U= github.com/zalando/go-keyring v0.2.6 h1:r7Yc3+H+Ux0+M72zacZoItR3UDxeWfKTcabvkI8ua9s= github.com/zalando/go-keyring v0.2.6/go.mod h1:2TCrxYrbUNYfNS/Kgy/LSrkSQzZ5UPVH85RwfczwvcI= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= From 4244b3a1164a43cae25a297032b5a8a391b0b722 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 04:23:56 +0000 Subject: [PATCH 008/359] chore(deps): bump github.com/containers/common from 0.62.2 to 0.62.3 (#3371) Bumps [github.com/containers/common](https://github.com/containers/common) from 0.62.2 to 0.62.3. - [Release notes](https://github.com/containers/common/releases) - [Commits](https://github.com/containers/common/compare/v0.62.2...v0.62.3) --- updated-dependencies: - dependency-name: github.com/containers/common 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 | 3 +-- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 049b7283d..11f7de8dc 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,6 @@ module github.com/supabase/cli go 1.24.1 - require ( github.com/BurntSushi/toml v1.5.0 github.com/Netflix/go-env v0.1.2 @@ -11,7 +10,7 @@ require ( github.com/charmbracelet/bubbletea v0.25.0 github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 - github.com/containers/common v0.62.2 + github.com/containers/common v0.62.3 github.com/docker/cli v28.0.4+incompatible github.com/docker/docker v28.0.2+incompatible github.com/docker/go-connections v0.5.0 diff --git a/go.sum b/go.sum index 8730bacc0..165a94ce9 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,8 @@ github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2 github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/containers/common v0.62.2 h1:xO45OOoeq17EZMIDZoSyRqg7GXGcRHa9sXlrr75zH+U= -github.com/containers/common v0.62.2/go.mod h1:veFiR9iq2j3CHXtB4YnPHuOkSRdhIQ3bAY8AFMP/5bE= +github.com/containers/common v0.62.3 h1:aOGryqXfW6aKBbHbqOveH7zB+ihavUN03X/2pUSvWFI= +github.com/containers/common v0.62.3/go.mod h1:3R8kDox2prC9uj/a2hmXj/YjZz5sBEUNrcDiw51S0Lo= github.com/containers/storage v1.57.2 h1:2roCtTyE9pzIaBDHibK72DTnYkPmwWaq5uXxZdaWK4U= github.com/containers/storage v1.57.2/go.mod h1:i/Hb4lu7YgFr9G0K6BMjqW0BLJO1sFsnWQwj2UoWCUM= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= From 2c08dd080083f0a73ab09934a7839927b6569b8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 04:29:31 +0000 Subject: [PATCH 009/359] chore(deps): bump github.com/docker/docker from 28.0.2+incompatible to 28.0.4+incompatible (#3372) chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.0.2+incompatible to 28.0.4+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v28.0.2...v28.0.4) --- updated-dependencies: - dependency-name: github.com/docker/docker 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 11f7de8dc..3b824ead9 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/containers/common v0.62.3 github.com/docker/cli v28.0.4+incompatible - github.com/docker/docker v28.0.2+incompatible + github.com/docker/docker v28.0.4+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.10 diff --git a/go.sum b/go.sum index 165a94ce9..2d11c81fc 100644 --- a/go.sum +++ b/go.sum @@ -240,8 +240,8 @@ github.com/docker/cli v28.0.4+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 v28.0.2+incompatible h1:9BILleFwug5FSSqWBgVevgL3ewDJfWWWyZVqlDMttE8= -github.com/docker/docker v28.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.0.4+incompatible h1:JNNkBctYKurkw6FrHfKqY0nKIDf5nrbxjVBtS+cdcok= +github.com/docker/docker v28.0.4+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 8ed922bfa974aa196eb72ae55e44e77b89206b56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 04:37:13 +0000 Subject: [PATCH 010/359] chore(deps): bump supabase/realtime from v2.34.43 to v2.34.45 in /pkg/config/templates (#3373) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.34.43 to v2.34.45. --- updated-dependencies: - dependency-name: supabase/realtime dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 8cbbea5c7..5277e5387 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.4.14 AS supavisor FROM supabase/gotrue:v2.170.0 AS gotrue -FROM supabase/realtime:v2.34.43 AS realtime +FROM supabase/realtime:v2.34.45 AS realtime FROM supabase/storage-api:v1.19.3 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From ef7b4878a3d5c23f68c4996b5fe8137ca8ae43b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 05:20:10 +0000 Subject: [PATCH 011/359] chore(deps): bump supabase/postgres-meta from v0.87.1 to v0.88.0 in /pkg/config/templates (#3377) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.87.1 to v0.88.0. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.88.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5277e5387..fb0e93dd5 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:15.8.1.060 AS pg15 FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.8 AS postgrest -FROM supabase/postgres-meta:v0.87.1 AS pgmeta +FROM supabase/postgres-meta:v0.88.0 AS pgmeta FROM supabase/studio:20250317-6955350 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From 2393b0ed10023fe9082bd10e855b24dbb27cc85e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 04:27:36 +0000 Subject: [PATCH 012/359] chore(deps): bump supabase/postgres-meta from v0.88.0 to v0.88.2 in /pkg/config/templates (#3382) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.88.0 to v0.88.2. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index fb0e93dd5..13257acdc 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:15.8.1.060 AS pg15 FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.8 AS postgrest -FROM supabase/postgres-meta:v0.88.0 AS pgmeta +FROM supabase/postgres-meta:v0.88.2 AS pgmeta FROM supabase/studio:20250317-6955350 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From 55f1394897733ae19ce1722f73f9ad3bb67f37db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 05:07:35 +0000 Subject: [PATCH 013/359] chore(deps): bump google.golang.org/grpc from 1.71.0 to 1.71.1 (#3383) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.71.0 to 1.71.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.71.0...v1.71.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 3b824ead9..1304d3698 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( golang.org/x/mod v0.24.0 golang.org/x/oauth2 v0.28.0 golang.org/x/term v0.30.0 - google.golang.org/grpc v1.71.0 + google.golang.org/grpc v1.71.1 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.1 ) diff --git a/go.sum b/go.sum index 2d11c81fc..abf905cc6 100644 --- a/go.sum +++ b/go.sum @@ -1453,8 +1453,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.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= -google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI= +google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= 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 f5b3db85eb0ab2d859e79a58015263e1fb525d01 Mon Sep 17 00:00:00 2001 From: Lakshan Perera Date: Thu, 3 Apr 2025 02:24:48 +1100 Subject: [PATCH 014/359] fix: bump deno2 to use latest develop release (#3384) --- 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 28e6ae927..6cd352d68 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -11,7 +11,7 @@ import ( const ( pg13 = "supabase/postgres:13.3.0" pg14 = "supabase/postgres:14.1.0.89" - deno2 = "supabase/edge-runtime:v1.68.0-develop.8" + deno2 = "supabase/edge-runtime:v1.68.0-develop.12" ) type images struct { From a921cb9579c4944f7638f34bb506d16d8005e6cb Mon Sep 17 00:00:00 2001 From: Nyannyacha Date: Fri, 4 Apr 2025 10:45:29 +0900 Subject: [PATCH 015/359] fix: bump edge-runtime to 1.68.0-develop.13 --- 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 6cd352d68..1cb39832d 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -11,7 +11,7 @@ import ( const ( pg13 = "supabase/postgres:13.3.0" pg14 = "supabase/postgres:14.1.0.89" - deno2 = "supabase/edge-runtime:v1.68.0-develop.12" + deno2 = "supabase/edge-runtime:v1.68.0-develop.13" ) type images struct { From b1b3d1ff744cec6a13becf750b8dcb22d3f575fd Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sat, 5 Apr 2025 01:37:42 +0800 Subject: [PATCH 016/359] fix: resolve legacy import map (#3395) --- pkg/function/deploy.go | 65 +++++++++++++++++--- pkg/function/deploy_test.go | 28 ++++++++- pkg/function/testdata/nested/deno.json | 6 +- pkg/function/testdata/nested/index.ts | 1 + pkg/function/testdata/writes_import_map.form | 7 ++- 5 files changed, 95 insertions(+), 12 deletions(-) diff --git a/pkg/function/deploy.go b/pkg/function/deploy.go index 3eef79284..3a2f35d0c 100644 --- a/pkg/function/deploy.go +++ b/pkg/function/deploy.go @@ -163,6 +163,9 @@ func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs. if err := importMap.Parse(data); err != nil { return err } + if err := importMap.Resolve(imPath, fsys); err != nil { + return err + } // TODO: replace with addFile once edge runtime supports jsonc fmt.Fprintf(os.Stderr, "Uploading asset (%s): %s\n", *meta.Name, imPath) f, err := form.CreateFormFile("file", imPath) @@ -201,6 +204,41 @@ func (m *ImportMap) Parse(data []byte) error { return nil } +func (m *ImportMap) Resolve(imPath string, fsys fs.FS) error { + // Resolve all paths relative to current file + for k, v := range m.Imports { + m.Imports[k] = resolveHostPath(imPath, v, fsys) + } + for module, mapping := range m.Scopes { + for k, v := range mapping { + m.Scopes[module][k] = resolveHostPath(imPath, v, fsys) + } + } + return nil +} + +func resolveHostPath(jsonPath, hostPath string, fsys fs.FS) string { + // Leave absolute paths unchanged + if path.IsAbs(hostPath) { + return hostPath + } + resolved := path.Join(path.Dir(jsonPath), hostPath) + if _, err := fs.Stat(fsys, filepath.FromSlash(resolved)); err != nil { + // Leave URLs unchanged + return hostPath + } + // Directory imports need to be suffixed with / + // Ref: https://deno.com/manual@v1.33.0/basics/import_maps + if strings.HasSuffix(hostPath, "/") { + resolved += "/" + } + // Relative imports must be prefixed with ./ or ../ + if !path.IsAbs(resolved) { + resolved = "./" + resolved + } + return resolved +} + // Ref: https://regex101.com/r/DfBdJA/1 var importPathPattern = regexp.MustCompile(`(?i)(?:import|export)\s+(?:{[^{}]+}|.*?)\s*(?:from)?\s*['"](.*?)['"]|import\(\s*['"](.*?)['"]\)`) @@ -237,22 +275,35 @@ func walkImportPaths(srcPath string, importMap ImportMap, readFile func(curr str } mod = strings.TrimSpace(mod) // Substitute kv from import map + substituted := false for k, v := range importMap.Imports { if strings.HasPrefix(mod, k) { mod = v + mod[len(k):] + substituted = true } } - // Deno import path must begin with these prefixes - if strings.HasPrefix(mod, "./") || strings.HasPrefix(mod, "../") { - mod = path.Join(path.Dir(curr), mod) - } else if !strings.HasPrefix(mod, "/") { + // Ignore URLs and directories + if len(path.Ext(mod)) == 0 { continue } - if len(path.Ext(mod)) > 0 { - // Cleans import path to help detect duplicates - q = append(q, path.Clean(mod)) + // Deno import path must begin with one of these prefixes + if !isRelPath(mod) && !isAbsPath(mod) { + continue } + if isRelPath(mod) && !substituted { + mod = path.Join(path.Dir(curr), mod) + } + // Cleans import path to help detect duplicates + q = append(q, path.Clean(mod)) } } return nil } + +func isRelPath(mod string) bool { + return strings.HasPrefix(mod, "./") || strings.HasPrefix(mod, "../") +} + +func isAbsPath(mod string) bool { + return strings.HasPrefix(mod, "/") +} diff --git a/pkg/function/deploy_test.go b/pkg/function/deploy_test.go index 424478aa3..7927afd77 100644 --- a/pkg/function/deploy_test.go +++ b/pkg/function/deploy_test.go @@ -49,8 +49,7 @@ func TestImportPaths(t *testing.T) { fsys.On("ReadFile", "testdata/modules/imports.ts").Once() fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() // Run test - im := ImportMap{} - err := walkImportPaths("testdata/modules/imports.ts", im, fsys.ReadFile) + err := walkImportPaths("testdata/modules/imports.ts", ImportMap{}, fsys.ReadFile) // Check error assert.NoError(t, err) fsys.AssertExpectations(t) @@ -65,10 +64,33 @@ func TestImportPaths(t *testing.T) { fsys.On("ReadFile", "testdata/shared/whatever.ts").Once() fsys.On("ReadFile", "testdata/shared/mod.ts").Once() fsys.On("ReadFile", "testdata/nested/index.ts").Once() - // Run test + // Setup deno.json im := ImportMap{Imports: map[string]string{ "module-name/": "../shared/", }} + assert.NoError(t, im.Resolve("testdata/modules/deno.json", testImports)) + // Run test + err := walkImportPaths("testdata/modules/imports.ts", im, fsys.ReadFile) + // Check error + assert.NoError(t, err) + fsys.AssertExpectations(t) + }) + + t.Run("resolves legacy import map", func(t *testing.T) { + // Setup in-memory fs + fsys := MockFS{} + fsys.On("ReadFile", "/modules/my-module.ts").Once() + fsys.On("ReadFile", "testdata/modules/imports.ts").Once() + fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() + fsys.On("ReadFile", "testdata/shared/whatever.ts").Once() + fsys.On("ReadFile", "testdata/shared/mod.ts").Once() + fsys.On("ReadFile", "testdata/nested/index.ts").Once() + // Setup legacy import map + im := ImportMap{Imports: map[string]string{ + "module-name/": "./shared/", + }} + assert.NoError(t, im.Resolve("testdata/import_map.json", testImports)) + // Run test err := walkImportPaths("testdata/modules/imports.ts", im, fsys.ReadFile) // Check error assert.NoError(t, err) diff --git a/pkg/function/testdata/nested/deno.json b/pkg/function/testdata/nested/deno.json index 0967ef424..bfba6fbb2 100644 --- a/pkg/function/testdata/nested/deno.json +++ b/pkg/function/testdata/nested/deno.json @@ -1 +1,5 @@ -{} +{ + "imports": { + "module": "jsr:@supabase/functions-js/edge-runtime.d.ts" + } +} diff --git a/pkg/function/testdata/nested/index.ts b/pkg/function/testdata/nested/index.ts index e69de29bb..b0539a467 100644 --- a/pkg/function/testdata/nested/index.ts +++ b/pkg/function/testdata/nested/index.ts @@ -0,0 +1 @@ +import "module"; diff --git a/pkg/function/testdata/writes_import_map.form b/pkg/function/testdata/writes_import_map.form index 75df843f7..174a55f6b 100644 --- a/pkg/function/testdata/writes_import_map.form +++ b/pkg/function/testdata/writes_import_map.form @@ -7,7 +7,11 @@ Content-Disposition: form-data; name="metadata" Content-Disposition: form-data; name="file"; filename="testdata/nested/deno.json" Content-Type: application/octet-stream -{} +{ + "imports": { + "module": "jsr:@supabase/functions-js/edge-runtime.d.ts" + } +} --test Content-Disposition: form-data; name="file"; filename="testdata/geometries/Geometries.js" @@ -18,3 +22,4 @@ Content-Type: application/octet-stream Content-Disposition: form-data; name="file"; filename="testdata/nested/index.ts" Content-Type: application/octet-stream +import "module"; From b07c64320e566ae2f8e2fc8d4b44cf7f1ed90a55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 04:09:52 +0800 Subject: [PATCH 017/359] chore(deps): bump github.com/stripe/pg-schema-diff from 0.8.0 to 0.9.0 (#3344) * chore(deps): bump github.com/stripe/pg-schema-diff from 0.8.0 to 0.9.0 Bumps [github.com/stripe/pg-schema-diff](https://github.com/stripe/pg-schema-diff) from 0.8.0 to 0.9.0. - [Release notes](https://github.com/stripe/pg-schema-diff/releases) - [Commits](https://github.com/stripe/pg-schema-diff/compare/v0.8.0...v0.9.0) --- updated-dependencies: - dependency-name: github.com/stripe/pg-schema-diff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: update schema source --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han --- go.mod | 3 ++- go.sum | 4 ++-- internal/db/diff/pgschema.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 1304d3698..f14452378 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/supabase/cli go 1.24.1 + require ( github.com/BurntSushi/toml v1.5.0 github.com/Netflix/go-env v0.1.2 @@ -43,7 +44,7 @@ require ( github.com/spf13/pflag v1.0.6 github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 - github.com/stripe/pg-schema-diff v0.8.0 + github.com/stripe/pg-schema-diff v0.9.0 github.com/tidwall/jsonc v0.3.2 github.com/withfig/autocomplete-tools/packages/cobra v1.2.0 github.com/zalando/go-keyring v0.2.6 diff --git a/go.sum b/go.sum index abf905cc6..310e11e8b 100644 --- a/go.sum +++ b/go.sum @@ -938,8 +938,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stripe/pg-schema-diff v0.8.0 h1:Ggm4yDbPtaflYQLV3auEMTLxQPaentV/wmDEoCF5jxQ= -github.com/stripe/pg-schema-diff v0.8.0/go.mod h1:HuTBuWLuvnY9g9nptbSD58xugN19zSJNkF4w/sYRtdU= +github.com/stripe/pg-schema-diff v0.9.0 h1:qzm2VUdbZ2kYwqxoQqtEP3uLQI0B+ymS947zqFTZGBk= +github.com/stripe/pg-schema-diff v0.9.0/go.mod h1:cl2VC6te/cCTOewTRvv4pYsgQqAOhvRQmatCHfYwy8c= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tdakkota/asciicheck v0.4.1 h1:bm0tbcmi0jezRA2b5kg4ozmMuGAFotKI3RZfrhfovg8= diff --git a/internal/db/diff/pgschema.go b/internal/db/diff/pgschema.go index a72a3c39a..75ead3b52 100644 --- a/internal/db/diff/pgschema.go +++ b/internal/db/diff/pgschema.go @@ -24,7 +24,7 @@ func DiffPgSchema(ctx context.Context, source, target string, schema []string) ( // Generate DDL based on schema plan plan, err := pgschema.Generate( ctx, - dbSrc, + pgschema.DBSchemaSource(dbSrc), pgschema.DBSchemaSource(dbDst), pgschema.WithDoNotValidatePlan(), pgschema.WithIncludeSchemas(schema...), From 07f6bde0611f924e9dda3c809c616e794e2537e2 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sun, 6 Apr 2025 07:07:28 +0800 Subject: [PATCH 018/359] chore: use ascii style for markdown renders --- internal/migration/list/list.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/migration/list/list.go b/internal/migration/list/list.go index 3107d4ec6..c10245d56 100644 --- a/internal/migration/list/list.go +++ b/internal/migration/list/list.go @@ -7,6 +7,7 @@ import ( "strconv" "github.com/charmbracelet/glamour" + "github.com/charmbracelet/glamour/styles" "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" @@ -73,7 +74,7 @@ func makeTable(remoteMigrations, localMigrations []string) string { func RenderTable(markdown string) error { r, err := glamour.NewTermRenderer( - glamour.WithAutoStyle(), + glamour.WithStandardStyle(styles.AsciiStyle), glamour.WithWordWrap(-1), ) if err != nil { From 4f13f22c8268d582d841c8259542201ae6d81c6f Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sun, 6 Apr 2025 07:18:49 +0800 Subject: [PATCH 019/359] fix: format output for branches list --- internal/branches/list/list.go | 45 ++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/internal/branches/list/list.go b/internal/branches/list/list.go index fd40da97c..85b00411b 100644 --- a/internal/branches/list/list.go +++ b/internal/branches/list/list.go @@ -3,6 +3,7 @@ package list import ( "context" "fmt" + "os" "strings" "github.com/go-errors/errors" @@ -19,27 +20,39 @@ func Run(ctx context.Context, fsys afero.Fs) error { return err } - table := `|ID|NAME|DEFAULT|GIT BRANCH|STATUS|CREATED AT (UTC)|UPDATED AT (UTC)| + switch utils.OutputFormat.Value { + case utils.OutputPretty: + table := `|ID|NAME|DEFAULT|GIT BRANCH|STATUS|CREATED AT (UTC)|UPDATED AT (UTC)| |-|-|-|-|-|-|-| ` - for _, branch := range branches { - gitBranch := " " - if branch.GitBranch != nil { - gitBranch = *branch.GitBranch + for _, branch := range branches { + gitBranch := " " + if branch.GitBranch != nil { + gitBranch = *branch.GitBranch + } + table += fmt.Sprintf( + "|`%s`|`%s`|`%t`|`%s`|`%s`|`%s`|`%s`|\n", + branch.Id, + strings.ReplaceAll(branch.Name, "|", "\\|"), + branch.IsDefault, + strings.ReplaceAll(gitBranch, "|", "\\|"), + branch.Status, + utils.FormatTimestamp(branch.CreatedAt), + utils.FormatTimestamp(branch.UpdatedAt), + ) } - table += fmt.Sprintf( - "|`%s`|`%s`|`%t`|`%s`|`%s`|`%s`|`%s`|\n", - branch.Id, - strings.ReplaceAll(branch.Name, "|", "\\|"), - branch.IsDefault, - strings.ReplaceAll(gitBranch, "|", "\\|"), - branch.Status, - utils.FormatTimestamp(branch.CreatedAt), - utils.FormatTimestamp(branch.UpdatedAt), - ) + return list.RenderTable(table) + case utils.OutputToml: + return utils.EncodeOutput(utils.OutputFormat.Value, os.Stdout, struct { + Branches []api.BranchResponse `toml:"branches"` + }{ + Branches: branches, + }) + case utils.OutputEnv: + return errors.Errorf("--output env flag is not supported") } - return list.RenderTable(table) + return utils.EncodeOutput(utils.OutputFormat.Value, os.Stdout, branches) } type BranchFilter func(api.BranchResponse) bool From ecf6afdfb6a04988212a44631ba33cb80735103d Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sun, 6 Apr 2025 07:20:49 +0800 Subject: [PATCH 020/359] fix: add jwt secret to branch get --- internal/branches/get/get.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/branches/get/get.go b/internal/branches/get/get.go index eebd8b4c2..f13b75598 100644 --- a/internal/branches/get/get.go +++ b/internal/branches/get/get.go @@ -105,5 +105,6 @@ func toStandardEnvs(detail api.BranchDetailResponse, pooler api.SupavisorConfigR envs["POSTGRES_URL"] = utils.ToPostgresURL(*config) envs["POSTGRES_URL_NON_POOLING"] = utils.ToPostgresURL(direct) envs["SUPABASE_URL"] = "https://" + utils.GetSupabaseHost(detail.Ref) + envs["SUPABASE_JWT_SECRET"] = *detail.JwtSecret return envs } From 7b4dd2573a8a9fff1b473b21438636e1be8c7c80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 23:29:18 +0800 Subject: [PATCH 021/359] chore(deps): bump golang.org/x/term from 0.30.0 to 0.31.0 (#3399) Bumps [golang.org/x/term](https://github.com/golang/term) from 0.30.0 to 0.31.0. - [Commits](https://github.com/golang/term/compare/v0.30.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/term dependency-version: 0.31.0 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 f14452378..d75608e25 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( go.opentelemetry.io/otel v1.35.0 golang.org/x/mod v0.24.0 golang.org/x/oauth2 v0.28.0 - golang.org/x/term v0.30.0 + golang.org/x/term v0.31.0 google.golang.org/grpc v1.71.1 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.1 @@ -327,7 +327,7 @@ require ( golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect golang.org/x/net v0.37.0 // indirect golang.org/x/sync v0.12.0 // indirect - golang.org/x/sys v0.31.0 // indirect + golang.org/x/sys v0.32.0 // indirect golang.org/x/text v0.23.0 // indirect golang.org/x/tools v0.31.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect diff --git a/go.sum b/go.sum index 310e11e8b..7d913baf8 100644 --- a/go.sum +++ b/go.sum @@ -1278,8 +1278,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 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= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1290,8 +1290,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= -golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= 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 6b04a1ea52712da9b7a532a7de6b967b05838f74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 00:01:02 +0800 Subject: [PATCH 022/359] chore(deps): bump golang.org/x/oauth2 from 0.28.0 to 0.29.0 (#3398) Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.28.0 to 0.29.0. - [Commits](https://github.com/golang/oauth2/compare/v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-version: 0.29.0 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 d75608e25..fefba50eb 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( github.com/zalando/go-keyring v0.2.6 go.opentelemetry.io/otel v1.35.0 golang.org/x/mod v0.24.0 - golang.org/x/oauth2 v0.28.0 + golang.org/x/oauth2 v0.29.0 golang.org/x/term v0.31.0 google.golang.org/grpc v1.71.1 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 7d913baf8..2b266e9b2 100644 --- a/go.sum +++ b/go.sum @@ -1193,8 +1193,8 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= -golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98= +golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 65e56853811578fd69406e2590b5552e3120fbbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 04:27:19 +0000 Subject: [PATCH 023/359] chore(deps): bump supabase/realtime from v2.34.45 to v2.34.46 in /pkg/config/templates (#3402) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.34.45 to v2.34.46. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.34.46 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 13257acdc..da6980d90 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.4.14 AS supavisor FROM supabase/gotrue:v2.170.0 AS gotrue -FROM supabase/realtime:v2.34.45 AS realtime +FROM supabase/realtime:v2.34.46 AS realtime FROM supabase/storage-api:v1.19.3 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From 2b5458ae4002e8ab36aaa1bc747ef151dec5d26b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 04:32:11 +0000 Subject: [PATCH 024/359] chore(deps): bump supabase/storage-api from v1.19.3 to v1.20.1 in /pkg/config/templates (#3400) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.19.3 to v1.20.1. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.20.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index da6980d90..3312985f0 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.4.14 AS supavisor FROM supabase/gotrue:v2.170.0 AS gotrue FROM supabase/realtime:v2.34.46 AS realtime -FROM supabase/storage-api:v1.19.3 AS storage +FROM supabase/storage-api:v1.20.1 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 2d3bd368a46473940f468933868c0579e5f36e81 Mon Sep 17 00:00:00 2001 From: Andrew Valleteau Date: Tue, 8 Apr 2025 11:18:32 +0200 Subject: [PATCH 025/359] feat(cli): setup postgres17 for local development (#3387) * feat(cli): setup postgres17 for local development * chore: use v17 by default * chore: nitpick * chore: apply pr comments * chore: fix lint * chore: set default image based on major version * chore: use current db image for dump --------- Co-authored-by: Qiao Han --- internal/db/dump/dump.go | 3 +-- pkg/config/config.go | 26 +++++++++++++++++--------- pkg/config/constants.go | 3 ++- pkg/config/templates/Dockerfile | 2 +- tools/selfhost/main.go | 2 +- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/internal/db/dump/dump.go b/internal/db/dump/dump.go index 5336e624a..6c668f5bd 100644 --- a/internal/db/dump/dump.go +++ b/internal/db/dump/dump.go @@ -14,7 +14,6 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/supabase/cli/internal/utils" - cliConfig "github.com/supabase/cli/pkg/config" ) var ( @@ -173,7 +172,7 @@ func dump(ctx context.Context, config pgconn.Config, script string, env []string return utils.DockerRunOnceWithConfig( ctx, container.Config{ - Image: cliConfig.Images.Pg15, + Image: utils.Config.Db.Image, Env: allEnvs, Cmd: []string{"bash", "-c", script, "--"}, }, diff --git a/pkg/config/config.go b/pkg/config/config.go index 92fb5ba08..5471ca4e4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -333,7 +333,7 @@ func NewConfig(editors ...ConfigEditor) config { KongImage: Images.Kong, }, Db: db{ - Image: Images.Pg15, + Image: Images.Pg, Password: "postgres", RootKey: Secret{ Value: "d4dc5b6d4a1d6a10b2c1e76112c994d65db7cec380572cc1839624d4be3fa275", @@ -596,12 +596,22 @@ func (c *config) Load(path string, fsys fs.FS) error { c.Api.ExternalUrl = apiUrl.String() } // Update image versions - if version, err := fs.ReadFile(fsys, builder.PostgresVersionPath); err == nil { - if strings.HasPrefix(string(version), "15.") && semver.Compare(string(version[3:]), "1.0.55") >= 0 { - c.Db.Image = replaceImageTag(Images.Pg15, string(version)) - } + switch c.Db.MajorVersion { + case 13: + c.Db.Image = pg15 + case 14: + c.Db.Image = pg14 + case 15: + c.Db.Image = pg15 } if c.Db.MajorVersion > 14 { + if version, err := fs.ReadFile(fsys, builder.PostgresVersionPath); err == nil { + // Only replace image if postgres version is above 15.1.0.55 + if strings.HasPrefix(string(version), fmt.Sprintf("%d.", c.Db.MajorVersion)) && + (c.Db.MajorVersion != 15 || semver.Compare(string(version[3:]), "1.0.55") >= 0) { + c.Db.Image = replaceImageTag(pg15, string(version)) + } + } if version, err := fs.ReadFile(fsys, builder.RestVersionPath); err == nil && len(version) > 0 { c.Api.Image = replaceImageTag(Images.Postgrest, string(version)) } @@ -725,10 +735,8 @@ func (c *config) Validate(fsys fs.FS) error { return errors.New("Missing required field in config: db.major_version") case 12: return errors.New("Postgres version 12.x is unsupported. To use the CLI, either start a new project or follow project migration steps here: https://supabase.com/docs/guides/database#migrating-between-projects.") - case 13: - c.Db.Image = pg13 - case 14: - c.Db.Image = pg14 + case 13, 14, 17: + // TODO: support oriole db 17 eventually case 15: if len(c.Experimental.OrioleDBVersion) > 0 { c.Db.Image = "supabase/postgres:orioledb-" + c.Experimental.OrioleDBVersion diff --git a/pkg/config/constants.go b/pkg/config/constants.go index 1cb39832d..28f61b208 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -11,11 +11,12 @@ import ( const ( pg13 = "supabase/postgres:13.3.0" pg14 = "supabase/postgres:14.1.0.89" + pg15 = "supabase/postgres:15.8.1.069" deno2 = "supabase/edge-runtime:v1.68.0-develop.13" ) type images struct { - Pg15 string `mapstructure:"pg15"` + Pg string `mapstructure:"pg"` // Append to Services when adding new dependencies below Kong string `mapstructure:"kong"` Inbucket string `mapstructure:"mailpit"` diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 3312985f0..f35c15815 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:15.8.1.060 AS pg15 +FROM supabase/postgres:17.4.1.012 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit diff --git a/tools/selfhost/main.go b/tools/selfhost/main.go index 8eb19befc..be7886ae9 100644 --- a/tools/selfhost/main.go +++ b/tools/selfhost/main.go @@ -61,7 +61,7 @@ func updateSelfHosted(ctx context.Context, branch string) error { } func getStableVersions() map[string]string { - images := append(config.Images.Services(), config.Images.Pg15) + images := append(config.Images.Services(), config.Images.Pg) result := make(map[string]string, len(images)) for _, img := range images { parts := strings.Split(img, ":") From 2902199899908fbddc5abe8176441d91b7e6dbcf Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 9 Apr 2025 01:47:02 +0800 Subject: [PATCH 026/359] fix: convert all paths to relative for deploy (#3403) * fix: convert all paths to relative for deploy * chore: move log statement to callback --- pkg/function/deploy.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkg/function/deploy.go b/pkg/function/deploy.go index 3a2f35d0c..fe367cb3f 100644 --- a/pkg/function/deploy.go +++ b/pkg/function/deploy.go @@ -28,6 +28,7 @@ func (s *EdgeRuntimeAPI) Deploy(ctx context.Context, functionConfig config.Funct if s.eszip != nil { return s.UpsertFunctions(ctx, functionConfig) } + // Convert all paths in functions config to relative when using api deploy var toDeploy []api.FunctionDeployMetadata for slug, fc := range functionConfig { if !fc.Enabled { @@ -36,13 +37,13 @@ func (s *EdgeRuntimeAPI) Deploy(ctx context.Context, functionConfig config.Funct } meta := api.FunctionDeployMetadata{ Name: &slug, - EntrypointPath: filepath.ToSlash(fc.Entrypoint), - ImportMapPath: cast.Ptr(filepath.ToSlash(fc.ImportMap)), + EntrypointPath: toRelPath(fc.Entrypoint), + ImportMapPath: cast.Ptr(toRelPath(fc.ImportMap)), VerifyJwt: &fc.VerifyJWT, } files := make([]string, len(fc.StaticFiles)) for i, sf := range fc.StaticFiles { - files[i] = filepath.ToSlash(sf) + files[i] = toRelPath(sf) } meta.StaticPatterns = &files toDeploy = append(toDeploy, meta) @@ -57,16 +58,27 @@ func (s *EdgeRuntimeAPI) Deploy(ctx context.Context, functionConfig config.Funct return s.bulkUpload(ctx, toDeploy, fsys) } +func toRelPath(fp string) string { + if filepath.IsAbs(fp) { + if cwd, err := os.Getwd(); err == nil { + if relPath, err := filepath.Rel(cwd, fp); err == nil { + fp = relPath + } + } + } + return filepath.ToSlash(fp) +} + func (s *EdgeRuntimeAPI) bulkUpload(ctx context.Context, toDeploy []api.FunctionDeployMetadata, fsys fs.FS) error { jq := queue.NewJobQueue(s.maxJobs) toUpdate := make([]api.BulkUpdateFunctionBody, len(toDeploy)) for i, meta := range toDeploy { - fmt.Fprintln(os.Stderr, "Deploying Function:", *meta.Name) param := api.V1DeployAFunctionParams{ Slug: meta.Name, BundleOnly: cast.Ptr(true), } bundle := func() error { + fmt.Fprintln(os.Stderr, "Deploying Function:", *meta.Name) resp, err := s.upload(ctx, param, meta, fsys) if err != nil { return err From 640655afe0313e3fdd53e27d50438d149878eb42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 04:35:44 +0000 Subject: [PATCH 027/359] chore(deps): bump supabase/storage-api from v1.20.1 to v1.21.1 in /pkg/config/templates (#3407) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.20.1 to v1.21.1. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.21.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index f35c15815..1cb83e07c 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.4.14 AS supavisor FROM supabase/gotrue:v2.170.0 AS gotrue FROM supabase/realtime:v2.34.46 AS realtime -FROM supabase/storage-api:v1.20.1 AS storage +FROM supabase/storage-api:v1.21.1 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From a67137d9f64103b2ac28797d25979ce511ad144a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 04:40:11 +0000 Subject: [PATCH 028/359] chore(deps): bump supabase/postgres from 17.4.1.012 to 17.4.1.013 in /pkg/config/templates (#3408) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.012 to 17.4.1.013. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.013 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 1cb83e07c..dfc2f971a 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.012 AS pg +FROM supabase/postgres:17.4.1.013 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 4a56ff22c39aee3df9b86094846c5a32edf5eb30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 05:17:47 +0000 Subject: [PATCH 029/359] chore(deps): bump supabase/storage-api from v1.21.1 to v1.22.1 in /pkg/config/templates (#3413) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.21.1 to v1.22.1. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index dfc2f971a..791e9393d 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.4.14 AS supavisor FROM supabase/gotrue:v2.170.0 AS gotrue FROM supabase/realtime:v2.34.46 AS realtime -FROM supabase/storage-api:v1.21.1 AS storage +FROM supabase/storage-api:v1.22.1 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 4cd75f9c9763a7be3f1ccf998385862f09fcd986 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 05:22:11 +0000 Subject: [PATCH 030/359] chore(deps): bump supabase/postgres-meta from v0.88.2 to v0.88.4 in /pkg/config/templates (#3414) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.88.2 to v0.88.4. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.88.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 791e9393d..0c95d46c0 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.013 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.8 AS postgrest -FROM supabase/postgres-meta:v0.88.2 AS pgmeta +FROM supabase/postgres-meta:v0.88.4 AS pgmeta FROM supabase/studio:20250317-6955350 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From ec28ccf53029bd06a4ffa1f48cf07304ca6c2adb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 04:56:52 +0000 Subject: [PATCH 031/359] chore(deps): bump supabase/postgres-meta from v0.88.4 to v0.88.7 in /pkg/config/templates (#3419) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.88.4 to v0.88.7. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.88.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 0c95d46c0..c0e413d51 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.013 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.8 AS postgrest -FROM supabase/postgres-meta:v0.88.4 AS pgmeta +FROM supabase/postgres-meta:v0.88.7 AS pgmeta FROM supabase/studio:20250317-6955350 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From 30955ba7aa460ae4b1f2c0b8e20d4a2e644a4131 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 05:01:26 +0000 Subject: [PATCH 032/359] chore(deps): bump supabase/storage-api from v1.22.1 to v1.22.2 in /pkg/config/templates (#3422) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.1 to v1.22.2. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index c0e413d51..f7364eeca 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.4.14 AS supavisor FROM supabase/gotrue:v2.170.0 AS gotrue FROM supabase/realtime:v2.34.46 AS realtime -FROM supabase/storage-api:v1.22.1 AS storage +FROM supabase/storage-api:v1.22.2 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From ebfa2ed5a5ff52aafaa4c872b342a9763dedd896 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 05:06:04 +0000 Subject: [PATCH 033/359] chore(deps): bump supabase/supavisor from 2.4.14 to 2.5.0 in /pkg/config/templates (#3421) chore(deps): bump supabase/supavisor in /pkg/config/templates Bumps supabase/supavisor from 2.4.14 to 2.5.0. --- updated-dependencies: - dependency-name: supabase/supavisor dependency-version: 2.5.0 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index f7364eeca..6df8513ee 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -9,7 +9,7 @@ FROM supabase/studio:20250317-6955350 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector -FROM supabase/supavisor:2.4.14 AS supavisor +FROM supabase/supavisor:2.5.0 AS supavisor FROM supabase/gotrue:v2.170.0 AS gotrue FROM supabase/realtime:v2.34.46 AS realtime FROM supabase/storage-api:v1.22.2 AS storage From 96a407fc84ef6cad93d5d6a13e844809776c3b5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 05:11:03 +0000 Subject: [PATCH 034/359] chore(deps): bump supabase/postgres from 17.4.1.013 to 17.4.1.014 in /pkg/config/templates (#3420) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.013 to 17.4.1.014. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.014 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 6df8513ee..63382efba 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.013 AS pg +FROM supabase/postgres:17.4.1.014 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 3dfb4a116d0fab8db9ffbf8e81352614b7d1b3fa Mon Sep 17 00:00:00 2001 From: Kalleby Santos <105971119+kallebysantos@users.noreply.github.com> Date: Sat, 12 Apr 2025 09:09:50 +0100 Subject: [PATCH 035/359] fix: outside import with relative module graph (#3417) * refactor: removing duplicated `ImportMap` struct * fix: resolving relative outside imports It applies the import map walking to resolve the Module Graph * refactor: revert some changes from 7a43b81 Moving `ImportMap` struct to `functions/pkg` and importing it inside internals * stamp: lint * stamp: lint & using unix separator * stamp: copying file buffer directly to writer - we don't need to tee here, just copy from file to the writer will do. * stamp: removing duplicated code for `ImportMap.Resolve()` - using `afero.NewIOFS(fsys)` to cast to `io.FS` * stamp: use absolute filepath while bundling - Convert `srcPath` inside `addFile`, since docker mount always expect an absolute path * chore: bind relative imports in source files * chore: refactor bind host modules * chore: update unit tests * fix: change import map flag to relative path * chore: update unit tests * chore: test for relative entrypoint --------- Co-authored-by: Qiao Han --- internal/functions/deploy/bundle.go | 39 +++----- internal/functions/deploy/bundle_test.go | 2 +- internal/functions/deploy/deploy.go | 17 +++- internal/functions/deploy/deploy_test.go | 3 +- internal/functions/serve/serve.go | 14 ++- internal/functions/serve/serve_test.go | 1 + internal/utils/deno.go | 109 ++++++++--------------- internal/utils/deno_test.go | 50 +++++------ pkg/function/deploy.go | 7 +- pkg/function/deploy_test.go | 7 +- 10 files changed, 104 insertions(+), 145 deletions(-) diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index dc20da5d3..436321493 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -122,41 +122,24 @@ func GetBindMounts(cwd, hostFuncDir, hostOutputDir, hostEntrypointPath, hostImpo binds = append(binds, hostOutputDir+":"+dockerOutputDir+":rw") } } - // Allow entrypoints outside the functions directory - hostEntrypointDir := filepath.Dir(hostEntrypointPath) - if len(hostEntrypointDir) > 0 { - if !filepath.IsAbs(hostEntrypointDir) { - hostEntrypointDir = filepath.Join(cwd, hostEntrypointDir) - } - if !strings.HasSuffix(hostEntrypointDir, sep) { - hostEntrypointDir += sep - } - if !strings.HasPrefix(hostEntrypointDir, hostFuncDir) && - !strings.HasPrefix(hostEntrypointDir, hostOutputDir) { - dockerEntrypointDir := utils.ToDockerPath(hostEntrypointDir) - binds = append(binds, hostEntrypointDir+":"+dockerEntrypointDir+":ro") - } + // Imports outside of ./supabase/functions will be bound by walking the entrypoint + modules, err := utils.BindHostModules(cwd, hostEntrypointPath, hostImportMapPath, fsys) + if err != nil { + return nil, err } - // Imports outside of ./supabase/functions will be bound by absolute path if len(hostImportMapPath) > 0 { if !filepath.IsAbs(hostImportMapPath) { hostImportMapPath = filepath.Join(cwd, hostImportMapPath) } - importMap, err := utils.NewImportMap(hostImportMapPath, fsys) - if err != nil { - return nil, err - } - modules := importMap.BindHostModules() dockerImportMapPath := utils.ToDockerPath(hostImportMapPath) modules = append(modules, hostImportMapPath+":"+dockerImportMapPath+":ro") - // Remove any duplicate mount points - for _, mod := range modules { - hostPath := strings.Split(mod, ":")[0] - if !strings.HasPrefix(hostPath, hostFuncDir) && - (len(hostOutputDir) == 0 || !strings.HasPrefix(hostPath, hostOutputDir)) && - (len(hostEntrypointDir) == 0 || !strings.HasPrefix(hostPath, hostEntrypointDir)) { - binds = append(binds, mod) - } + } + // Remove any duplicate mount points + for _, mod := range modules { + hostPath := strings.Split(mod, ":")[0] + if !strings.HasPrefix(hostPath, hostFuncDir) && + (len(hostOutputDir) == 0 || !strings.HasPrefix(hostPath, hostOutputDir)) { + binds = append(binds, mod) } } return binds, nil diff --git a/internal/functions/deploy/bundle_test.go b/internal/functions/deploy/bundle_test.go index 7e436a2ed..5933e77dc 100644 --- a/internal/functions/deploy/bundle_test.go +++ b/internal/functions/deploy/bundle_test.go @@ -29,7 +29,7 @@ func TestDockerBundle(t *testing.T) { t.Run("throws error on bundle failure", func(t *testing.T) { // Setup in-memory fs fsys := afero.NewMemMapFs() - absImportMap := filepath.Join(cwd, "hello", "deno.json") + absImportMap := filepath.Join("hello", "deno.json") require.NoError(t, utils.WriteFile(absImportMap, []byte("{}"), fsys)) // Setup deno error t.Setenv("TEST_DENO_ERROR", "bundle failed") diff --git a/internal/functions/deploy/deploy.go b/internal/functions/deploy/deploy.go index 8686a426f..a3dba3e18 100644 --- a/internal/functions/deploy/deploy.go +++ b/internal/functions/deploy/deploy.go @@ -32,6 +32,19 @@ func Run(ctx context.Context, slugs []string, useDocker bool, noVerifyJWT *bool, if len(slugs) == 0 { return errors.Errorf("No Functions specified or found in %s", utils.Bold(utils.FunctionsDir)) } + // Flag import map is specified relative to current directory instead of workdir + cwd, err := os.Getwd() + if err != nil { + return errors.Errorf("failed to get working directory: %w", err) + } + if len(importMapPath) > 0 { + if !filepath.IsAbs(importMapPath) { + importMapPath = filepath.Join(utils.CurrentDirAbs, importMapPath) + } + if importMapPath, err = filepath.Rel(cwd, importMapPath); err != nil { + return errors.Errorf("failed to resolve relative path: %w", err) + } + } functionConfig, err := GetFunctionConfig(slugs, importMapPath, noVerifyJWT, fsys) if err != nil { return err @@ -83,10 +96,6 @@ func GetFunctionConfig(slugs []string, importMapPath string, noVerifyJWT *bool, } else if err != nil { return nil, errors.Errorf("failed to fallback import map: %w", err) } - // Flag import map is specified relative to current directory instead of workdir - if len(importMapPath) > 0 && !filepath.IsAbs(importMapPath) { - importMapPath = filepath.Join(utils.CurrentDirAbs, importMapPath) - } functionConfig := make(config.FunctionConfig, len(slugs)) for _, name := range slugs { function, ok := utils.Config.Functions[name] diff --git a/internal/functions/deploy/deploy_test.go b/internal/functions/deploy/deploy_test.go index 9510d4c73..6b59dd3cf 100644 --- a/internal/functions/deploy/deploy_test.go +++ b/internal/functions/deploy/deploy_test.go @@ -84,8 +84,7 @@ import_map = "./import_map.json" `) require.NoError(t, err) require.NoError(t, f.Close()) - importMapPath, err := filepath.Abs(filepath.Join(utils.SupabaseDirPath, "import_map.json")) - require.NoError(t, err) + importMapPath := filepath.Join(utils.SupabaseDirPath, "import_map.json") require.NoError(t, afero.WriteFile(fsys, importMapPath, []byte("{}"), 0644)) // Setup function entrypoint entrypointPath := filepath.Join(utils.FunctionsDir, slug, "index.ts") diff --git a/internal/functions/serve/serve.go b/internal/functions/serve/serve.go index e8cc5e6a3..9fba48a76 100644 --- a/internal/functions/serve/serve.go +++ b/internal/functions/serve/serve.go @@ -64,10 +64,8 @@ const ( dockerRuntimeInspectorPort = 8083 ) -var ( - //go:embed templates/main.ts - mainFuncEmbed string -) +//go:embed templates/main.ts +var mainFuncEmbed string func Run(ctx context.Context, envFilePath string, noVerifyJWT *bool, importMapPath string, runtimeOption RuntimeOption, fsys afero.Fs) error { // 1. Sanity checks. @@ -121,6 +119,14 @@ func ServeFunctions(ctx context.Context, envFilePath string, noVerifyJWT *bool, if err != nil { return errors.Errorf("failed to get working directory: %w", err) } + if len(importMapPath) > 0 { + if !filepath.IsAbs(importMapPath) { + importMapPath = filepath.Join(utils.CurrentDirAbs, importMapPath) + } + if importMapPath, err = filepath.Rel(cwd, importMapPath); err != nil { + return errors.Errorf("failed to resolve relative path: %w", err) + } + } binds, functionsConfigString, err := populatePerFunctionConfigs(cwd, importMapPath, noVerifyJWT, fsys) if err != nil { return err diff --git a/internal/functions/serve/serve_test.go b/internal/functions/serve/serve_test.go index 5f66d8e93..7dbd75377 100644 --- a/internal/functions/serve/serve_test.go +++ b/internal/functions/serve/serve_test.go @@ -88,6 +88,7 @@ func TestServeCommand(t *testing.T) { }) t.Run("throws error on missing import map", func(t *testing.T) { + utils.CurrentDirAbs = "/" // Setup in-memory fs fsys := afero.NewMemMapFs() require.NoError(t, utils.InitConfig(utils.InitParams{ProjectId: "test"}, fsys)) diff --git a/internal/utils/deno.go b/internal/utils/deno.go index 54e1fc59a..ee6ac5de4 100644 --- a/internal/utils/deno.go +++ b/internal/utils/deno.go @@ -6,20 +6,20 @@ import ( "context" "crypto/sha256" "embed" - "encoding/json" "fmt" "io" "io/fs" "net/http" "os" "os/exec" + "path" "path/filepath" "runtime" "strings" "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/tidwall/jsonc" + "github.com/supabase/cli/pkg/function" ) var ( @@ -197,7 +197,6 @@ func CopyDenoScripts(ctx context.Context, fsys afero.Fs) (*DenoScriptDir, error) return nil }) - if err != nil { return nil, err } @@ -210,87 +209,57 @@ func CopyDenoScripts(ctx context.Context, fsys afero.Fs) (*DenoScriptDir, error) return &sd, nil } -type ImportMap struct { - Imports map[string]string `json:"imports"` - Scopes map[string]map[string]string `json:"scopes"` -} - -func NewImportMap(absJsonPath string, fsys afero.Fs) (*ImportMap, error) { - data, err := afero.ReadFile(fsys, absJsonPath) +func newImportMap(relJsonPath string, fsys afero.Fs) (function.ImportMap, error) { + var result function.ImportMap + if len(relJsonPath) == 0 { + return result, nil + } + data, err := afero.ReadFile(fsys, relJsonPath) if err != nil { - return nil, errors.Errorf("failed to load import map: %w", err) + return result, errors.Errorf("failed to load import map: %w", err) } - result := ImportMap{} if err := result.Parse(data); err != nil { - return nil, err - } - // Resolve all paths relative to current file - for k, v := range result.Imports { - result.Imports[k] = resolveHostPath(absJsonPath, v, fsys) + return result, err } - for module, mapping := range result.Scopes { - for k, v := range mapping { - result.Scopes[module][k] = resolveHostPath(absJsonPath, v, fsys) - } - } - return &result, nil -} - -func (m *ImportMap) Parse(data []byte) error { - data = jsonc.ToJSONInPlace(data) - decoder := json.NewDecoder(bytes.NewReader(data)) - if err := decoder.Decode(&m); err != nil { - return errors.Errorf("failed to parse import map: %w", err) + unixPath := filepath.ToSlash(relJsonPath) + if err := result.Resolve(unixPath, afero.NewIOFS(fsys)); err != nil { + return result, err } - return nil + return result, nil } -func resolveHostPath(jsonPath, hostPath string, fsys afero.Fs) string { - // Leave absolute paths unchanged - if filepath.IsAbs(hostPath) { - return hostPath +func BindHostModules(cwd, relEntrypointPath, relImportMapPath string, fsys afero.Fs) ([]string, error) { + importMap, err := newImportMap(relImportMapPath, fsys) + if err != nil { + return nil, err } - resolved := filepath.Join(filepath.Dir(jsonPath), hostPath) - if exists, err := afero.Exists(fsys, resolved); !exists { - // Leave URLs unchanged + var modules []string + // Resolving all Import Graph + addModule := func(unixPath string, w io.Writer) error { + hostPath := filepath.FromSlash(unixPath) + if path.IsAbs(unixPath) { + hostPath = filepath.VolumeName(cwd) + hostPath + } else { + hostPath = filepath.Join(cwd, hostPath) + } + f, err := fsys.Open(hostPath) if err != nil { - logger := GetDebugLogger() - fmt.Fprintln(logger, err) + return errors.Errorf("failed to read file: %w", err) } - return hostPath - } - // Directory imports need to be suffixed with / - // Ref: https://deno.com/manual@v1.33.0/basics/import_maps - if strings.HasSuffix(hostPath, string(filepath.Separator)) { - resolved += string(filepath.Separator) - } - return resolved -} - -func (m *ImportMap) BindHostModules() []string { - hostFuncDir, err := filepath.Abs(FunctionsDir) - if err != nil { - logger := GetDebugLogger() - fmt.Fprintln(logger, err) - } - binds := []string{} - for _, hostPath := range m.Imports { - if !filepath.IsAbs(hostPath) || strings.HasPrefix(hostPath, hostFuncDir) { - continue + defer f.Close() + if _, err := io.Copy(w, f); err != nil { + return errors.Errorf("failed to copy file content: %w", err) } dockerPath := ToDockerPath(hostPath) - binds = append(binds, hostPath+":"+dockerPath+":ro") + modules = append(modules, hostPath+":"+dockerPath+":ro") + return nil } - for _, mapping := range m.Scopes { - for _, hostPath := range mapping { - if !filepath.IsAbs(hostPath) || strings.HasPrefix(hostPath, hostFuncDir) { - continue - } - dockerPath := ToDockerPath(hostPath) - binds = append(binds, hostPath+":"+dockerPath+":ro") - } + unixPath := filepath.ToSlash(relEntrypointPath) + if err := importMap.WalkImportPaths(unixPath, addModule); err != nil { + return nil, err } - return binds + // TODO: support scopes + return modules, nil } func ToDockerPath(absHostPath string) string { diff --git a/internal/utils/deno_test.go b/internal/utils/deno_test.go index c65e7ab78..32f6b42c7 100644 --- a/internal/utils/deno_test.go +++ b/internal/utils/deno_test.go @@ -31,7 +31,7 @@ func TestResolveImports(t *testing.T) { require.NoError(t, fsys.Mkdir(filepath.Join(cwd, DbTestsDir), 0755)) require.NoError(t, fsys.Mkdir(filepath.Join(cwd, FunctionsDir, "child"), 0755)) // Run test - resolved, err := NewImportMap(jsonPath, fsys) + resolved, err := newImportMap(jsonPath, fsys) // Check error assert.NoError(t, err) assert.Equal(t, "/tmp/", resolved.Imports["abs/"]) @@ -53,7 +53,7 @@ func TestResolveImports(t *testing.T) { fsys := afero.NewMemMapFs() require.NoError(t, afero.WriteFile(fsys, FallbackImportMapPath, importMap, 0644)) // Run test - resolved, err := NewImportMap(FallbackImportMapPath, fsys) + resolved, err := newImportMap(FallbackImportMapPath, fsys) // Check error assert.NoError(t, err) assert.Equal(t, "https://deno.land", resolved.Scopes["my-scope"]["my-mod"]) @@ -62,37 +62,27 @@ func TestResolveImports(t *testing.T) { func TestBindModules(t *testing.T) { t.Run("binds docker imports", func(t *testing.T) { - cwd, err := os.Getwd() - require.NoError(t, err) - importMap := ImportMap{ - Imports: map[string]string{ - "abs/": "/tmp/", - "root": cwd + "/common", - "parent": cwd + "/supabase/tests", - "child": cwd + "/supabase/functions/child/", - }, - } + fsys := afero.NewMemMapFs() + entrypoint := `import "https://deno.land" +import "/tmp/index.ts" +import "../common/index.ts" +import "../../../supabase/tests/index.ts" +import "./child/index.ts"` + require.NoError(t, WriteFile("/app/supabase/functions/hello/index.ts", []byte(entrypoint), fsys)) + require.NoError(t, WriteFile("/tmp/index.ts", []byte{}, fsys)) + require.NoError(t, WriteFile("/app/supabase/functions/common/index.ts", []byte{}, fsys)) + require.NoError(t, WriteFile("/app/supabase/tests/index.ts", []byte{}, fsys)) + require.NoError(t, WriteFile("/app/supabase/functions/hello/child/index.ts", []byte{}, fsys)) // Run test - mods := importMap.BindHostModules() + mods, err := BindHostModules("/app", "supabase/functions/hello/index.ts", "", fsys) // Check error + assert.NoError(t, err) assert.ElementsMatch(t, mods, []string{ - "/tmp/:/tmp/:ro", - cwd + "/common:" + cwd + "/common:ro", - cwd + "/supabase/tests:" + cwd + "/supabase/tests:ro", + "/app/supabase/functions/hello/index.ts:/app/supabase/functions/hello/index.ts:ro", + "/tmp/index.ts:/tmp/index.ts:ro", + "/app/supabase/functions/common/index.ts:/app/supabase/functions/common/index.ts:ro", + "/app/supabase/tests/index.ts:/app/supabase/tests/index.ts:ro", + "/app/supabase/functions/hello/child/index.ts:/app/supabase/functions/hello/child/index.ts:ro", }) }) - - t.Run("binds docker scopes", func(t *testing.T) { - importMap := ImportMap{ - Scopes: map[string]map[string]string{ - "my-scope": { - "my-mod": "https://deno.land", - }, - }, - } - // Run test - mods := importMap.BindHostModules() - // Check error - assert.Empty(t, mods) - }) } diff --git a/pkg/function/deploy.go b/pkg/function/deploy.go index fe367cb3f..c44155ca9 100644 --- a/pkg/function/deploy.go +++ b/pkg/function/deploy.go @@ -199,7 +199,7 @@ func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs. return err } } - return walkImportPaths(meta.EntrypointPath, importMap, addFile) + return importMap.WalkImportPaths(meta.EntrypointPath, addFile) } type ImportMap struct { @@ -254,7 +254,7 @@ func resolveHostPath(jsonPath, hostPath string, fsys fs.FS) string { // Ref: https://regex101.com/r/DfBdJA/1 var importPathPattern = regexp.MustCompile(`(?i)(?:import|export)\s+(?:{[^{}]+}|.*?)\s*(?:from)?\s*['"](.*?)['"]|import\(\s*['"](.*?)['"]\)`) -func walkImportPaths(srcPath string, importMap ImportMap, readFile func(curr string, w io.Writer) error) error { +func (importMap *ImportMap) WalkImportPaths(srcPath string, readFile func(curr string, w io.Writer) error) error { seen := map[string]struct{}{} // DFS because it's more efficient to pop from end of array q := make([]string, 1) @@ -294,7 +294,8 @@ func walkImportPaths(srcPath string, importMap ImportMap, readFile func(curr str substituted = true } } - // Ignore URLs and directories + // Ignore URLs and directories, assuming no sloppy imports + // https://github.com/denoland/deno/issues/2506#issuecomment-2727635545 if len(path.Ext(mod)) == 0 { continue } diff --git a/pkg/function/deploy_test.go b/pkg/function/deploy_test.go index 7927afd77..dbbb44b45 100644 --- a/pkg/function/deploy_test.go +++ b/pkg/function/deploy_test.go @@ -49,7 +49,8 @@ func TestImportPaths(t *testing.T) { fsys.On("ReadFile", "testdata/modules/imports.ts").Once() fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() // Run test - err := walkImportPaths("testdata/modules/imports.ts", ImportMap{}, fsys.ReadFile) + im := ImportMap{} + err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) // Check error assert.NoError(t, err) fsys.AssertExpectations(t) @@ -70,7 +71,7 @@ func TestImportPaths(t *testing.T) { }} assert.NoError(t, im.Resolve("testdata/modules/deno.json", testImports)) // Run test - err := walkImportPaths("testdata/modules/imports.ts", im, fsys.ReadFile) + err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) // Check error assert.NoError(t, err) fsys.AssertExpectations(t) @@ -91,7 +92,7 @@ func TestImportPaths(t *testing.T) { }} assert.NoError(t, im.Resolve("testdata/import_map.json", testImports)) // Run test - err := walkImportPaths("testdata/modules/imports.ts", im, fsys.ReadFile) + err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) // Check error assert.NoError(t, err) fsys.AssertExpectations(t) From 2afb164a91d8e7cae34f21893c1809d7985da73c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 16:10:03 +0800 Subject: [PATCH 036/359] chore(deps): bump github.com/getsentry/sentry-go from 0.31.1 to 0.32.0 (#3418) Bumps [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) from 0.31.1 to 0.32.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.31.1...v0.32.0) --- updated-dependencies: - dependency-name: github.com/getsentry/sentry-go dependency-version: 0.32.0 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 fefba50eb..bc186535a 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.10 - github.com/getsentry/sentry-go v0.31.1 + github.com/getsentry/sentry-go v0.32.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.14.0 github.com/go-viper/mapstructure/v2 v2.2.1 diff --git a/go.sum b/go.sum index 2b266e9b2..fcf19ff22 100644 --- a/go.sum +++ b/go.sum @@ -295,8 +295,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.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY= github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= -github.com/getsentry/sentry-go v0.31.1 h1:ELVc0h7gwyhnXHDouXkhqTFSO5oslsRDk0++eyE0KJ4= -github.com/getsentry/sentry-go v0.31.1/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY= +github.com/getsentry/sentry-go v0.32.0 h1:YKs+//QmwE3DcYtfKRH8/KyOOF/I6Qnx7qYGNHCGmCY= +github.com/getsentry/sentry-go v0.32.0/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY= github.com/ghostiam/protogetter v0.3.12 h1:xTPjH97iKph27vXRRKV0OCke5sAMoHPbVeVstdzmCLE= github.com/ghostiam/protogetter v0.3.12/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= From fcc681942a7a7782b7a07b632f0aafea6cc63ab8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 04:34:02 +0000 Subject: [PATCH 037/359] chore(deps): bump supabase/postgres from 17.4.1.014 to 17.4.1.015 in /pkg/config/templates (#3434) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.014 to 17.4.1.015. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.015 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 63382efba..6ea88a905 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.014 AS pg +FROM supabase/postgres:17.4.1.015 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From db26339d7ad85097fcb384f9f421009874fd4922 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 04:38:52 +0000 Subject: [PATCH 038/359] chore(deps): bump supabase/storage-api from v1.22.2 to v1.22.3 in /pkg/config/templates (#3435) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.2 to v1.22.3. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 6ea88a905..c187173be 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.0 AS supavisor FROM supabase/gotrue:v2.170.0 AS gotrue FROM supabase/realtime:v2.34.46 AS realtime -FROM supabase/storage-api:v1.22.2 AS storage +FROM supabase/storage-api:v1.22.3 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From bbab3a364846782066f02b19ee84ddf2bd3cc065 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 04:43:31 +0000 Subject: [PATCH 039/359] chore(deps): bump supabase/postgres-meta from v0.88.7 to v0.88.8 in /pkg/config/templates (#3433) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.88.7 to v0.88.8. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.88.8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index c187173be..e5bcbd51f 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.015 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.8 AS postgrest -FROM supabase/postgres-meta:v0.88.7 AS pgmeta +FROM supabase/postgres-meta:v0.88.8 AS pgmeta FROM supabase/studio:20250317-6955350 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From 953f475be7516ffc7595b762b6f71340340bea22 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 14 Apr 2025 13:30:55 +0800 Subject: [PATCH 040/359] fix: bump studio version and add version flag (#3423) --- internal/start/start.go | 1 + pkg/config/templates/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/start/start.go b/internal/start/start.go index db5638c02..4f31306b7 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -982,6 +982,7 @@ EOF container.Config{ Image: utils.Config.Studio.Image, Env: []string{ + "CURRENT_CLI_VERSION=" + utils.Version, "STUDIO_PG_META_URL=http://" + utils.PgmetaId + ":8080", "POSTGRES_PASSWORD=" + dbConfig.Password, "SUPABASE_URL=http://" + utils.KongId + ":8000", diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e5bcbd51f..419930136 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.8 AS postgrest FROM supabase/postgres-meta:v0.88.8 AS pgmeta -FROM supabase/studio:20250317-6955350 AS studio +FROM supabase/studio:2025.04.11-43cba0d AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 12cd52b8a750cfb11cf61243c7d3f820caace669 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 05:35:34 +0000 Subject: [PATCH 041/359] chore(deps): bump github.com/golangci/golangci-lint/v2 from 2.0.2 to 2.1.1 (#3436) chore(deps): bump github.com/golangci/golangci-lint/v2 Bumps [github.com/golangci/golangci-lint/v2](https://github.com/golangci/golangci-lint) from 2.0.2 to 2.1.1. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/main/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v2.0.2...v2.1.1) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint/v2 dependency-version: 2.1.1 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> Co-authored-by: Han Qiao --- go.mod | 57 +++++++++++++------------- go.sum | 126 +++++++++++++++++++++++++++++---------------------------- 2 files changed, 93 insertions(+), 90 deletions(-) diff --git a/go.mod b/go.mod index bc186535a..064bfd90b 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golang-jwt/jwt/v5 v5.2.2 - github.com/golangci/golangci-lint/v2 v2.0.2 + github.com/golangci/golangci-lint/v2 v2.1.1 github.com/google/go-github/v62 v62.0.0 github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 @@ -66,21 +66,21 @@ require ( github.com/Abirdcfly/dupword v0.1.3 // indirect github.com/Antonboom/errname v1.1.0 // indirect github.com/Antonboom/nilnil v1.1.0 // indirect - github.com/Antonboom/testifylint v1.6.0 // indirect + github.com/Antonboom/testifylint v1.6.1 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect - github.com/Crocmagnon/fatcontext v0.7.1 // indirect + github.com/Crocmagnon/fatcontext v0.7.2 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect github.com/Masterminds/semver/v3 v3.3.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect github.com/ProtonMail/go-crypto v1.1.5 // indirect - github.com/alecthomas/chroma/v2 v2.14.0 // indirect + github.com/alecthomas/chroma/v2 v2.16.0 // indirect github.com/alecthomas/go-check-sumtype v0.3.1 // indirect - github.com/alexkohler/nakedret/v2 v2.0.5 // indirect + github.com/alexkohler/nakedret/v2 v2.0.6 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect - github.com/alingse/nilnesserr v0.1.2 // indirect + github.com/alingse/nilnesserr v0.2.0 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.2.0 // indirect @@ -91,10 +91,10 @@ require ( github.com/bitfield/gotestdox v0.2.2 // indirect github.com/bkielbasa/cyclop v1.2.3 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v4 v4.6.0 // indirect + github.com/bombsimon/wsl/v4 v4.7.0 // indirect github.com/breml/bidichk v0.3.3 // indirect github.com/breml/errchkjson v0.4.1 // indirect - github.com/butuzov/ireturn v0.3.1 // indirect + github.com/butuzov/ireturn v0.4.0 // indirect github.com/butuzov/mirror v1.3.0 // indirect github.com/catenacyber/perfsprint v0.9.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect @@ -120,7 +120,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect github.com/distribution/reference v0.6.0 // indirect - github.com/dlclark/regexp2 v1.11.0 // indirect + github.com/dlclark/regexp2 v1.11.5 // indirect github.com/dnephin/pflag v1.0.7 // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.2 // indirect @@ -133,12 +133,12 @@ require ( github.com/fatih/color v1.18.0 // indirect github.com/fatih/structtag v1.2.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/firefart/nonamedreturns v1.0.5 // indirect + github.com/firefart/nonamedreturns v1.0.6 // indirect 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/getkin/kin-openapi v0.127.0 // indirect - github.com/ghostiam/protogetter v0.3.12 // indirect + github.com/ghostiam/protogetter v0.3.13 // indirect github.com/go-critic/go-critic v0.13.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.2 // indirect @@ -166,7 +166,7 @@ require ( github.com/golangci/misspell v0.6.0 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/golangci/revgrep v0.8.0 // indirect - github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect + github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect @@ -190,7 +190,7 @@ require ( github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jgautheron/goconst v1.7.1 // indirect + github.com/jgautheron/goconst v1.8.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jjti/go-spancheck v0.6.4 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -202,7 +202,7 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kulti/thelper v0.6.3 // indirect - github.com/kunwardeep/paralleltest v1.0.10 // indirect + github.com/kunwardeep/paralleltest v1.0.14 // indirect github.com/lasiar/canonicalheader v1.1.2 // indirect github.com/ldez/exptostd v0.4.2 // indirect github.com/ldez/gomoddirectives v0.6.1 // indirect @@ -214,6 +214,7 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/macabu/inamedparam v0.2.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect + github.com/manuelarte/funcorder v0.2.1 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.1 // indirect github.com/matoous/godox v1.1.0 // indirect @@ -222,7 +223,7 @@ require ( github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mgechev/revive v1.7.0 // indirect + github.com/mgechev/revive v1.9.0 // indirect github.com/microcosm-cc/bluemonday v1.0.27 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect @@ -242,12 +243,12 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pjbgf/sha1cd v0.3.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/polyfloyd/go-errorlint v1.7.1 // indirect + github.com/polyfloyd/go-errorlint v1.8.0 // indirect github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect github.com/prometheus/common v0.32.1 // indirect @@ -268,7 +269,7 @@ require ( github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.28.0 // indirect - github.com/securego/gosec/v2 v2.22.2 // indirect + github.com/securego/gosec/v2 v2.22.3 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect @@ -286,8 +287,8 @@ require ( github.com/tetafro/godot v1.5.0 // indirect github.com/theupdateframework/notary v0.7.0 // indirect github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect - github.com/timonwong/loggercheck v0.10.1 // indirect - github.com/tomarrell/wrapcheck/v2 v2.10.0 // indirect + github.com/timonwong/loggercheck v0.11.0 // indirect + github.com/tomarrell/wrapcheck/v2 v2.11.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ultraware/funlen v0.2.0 // indirect github.com/ultraware/whitespace v0.2.0 // indirect @@ -307,7 +308,7 @@ require ( github.com/yuin/goldmark-emoji v1.0.5 // indirect gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.13.0 // indirect - go-simpler.org/sloglint v0.9.0 // indirect + go-simpler.org/sloglint v0.11.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect @@ -323,16 +324,16 @@ 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/crypto v0.36.0 // indirect + golang.org/x/crypto v0.37.0 // indirect golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect - golang.org/x/net v0.37.0 // indirect - golang.org/x/sync v0.12.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sync v0.13.0 // indirect golang.org/x/sys v0.32.0 // indirect - golang.org/x/text v0.23.0 // indirect - golang.org/x/tools v0.31.0 // indirect + golang.org/x/text v0.24.0 // indirect + golang.org/x/tools v0.32.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect - google.golang.org/protobuf v1.36.5 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 // indirect + google.golang.org/protobuf v1.36.6 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect honnef.co/go/tools v0.6.1 // indirect diff --git a/go.sum b/go.sum index fcf19ff22..ec1f6404e 100644 --- a/go.sum +++ b/go.sum @@ -47,16 +47,16 @@ github.com/Antonboom/errname v1.1.0 h1:A+ucvdpMwlo/myWrkHEUEBWc/xuXdud23S8tmTb/o github.com/Antonboom/errname v1.1.0/go.mod h1:O1NMrzgUcVBGIfi3xlVuvX8Q/VP/73sseCaAppfjqZw= github.com/Antonboom/nilnil v1.1.0 h1:jGxJxjgYS3VUUtOTNk8Z1icwT5ESpLH/426fjmQG+ng= github.com/Antonboom/nilnil v1.1.0/go.mod h1:b7sAlogQjFa1wV8jUW3o4PMzDVFLbTux+xnQdvzdcIE= -github.com/Antonboom/testifylint v1.6.0 h1:6rdILVPt4+rqcvhid8w9wJNynKLUgqHNpFyM67UeXyc= -github.com/Antonboom/testifylint v1.6.0/go.mod h1:k+nEkathI2NFjKO6HvwmSrbzUcQ6FAnbZV+ZRrnXPLI= +github.com/Antonboom/testifylint v1.6.1 h1:6ZSytkFWatT8mwZlmRCHkWz1gPi+q6UBSbieji2Gj/o= +github.com/Antonboom/testifylint v1.6.1/go.mod h1:k+nEkathI2NFjKO6HvwmSrbzUcQ6FAnbZV+ZRrnXPLI= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Crocmagnon/fatcontext v0.7.1 h1:SC/VIbRRZQeQWj/TcQBS6JmrXcfA+BU4OGSVUt54PjM= -github.com/Crocmagnon/fatcontext v0.7.1/go.mod h1:1wMvv3NXEBJucFGfwOJBxSVWcoIO6emV215SMkW9MFU= +github.com/Crocmagnon/fatcontext v0.7.2 h1:BY5/dUhs2kuD3sDn7vZrgOneRib5EHk9GOiyK8Vg+14= +github.com/Crocmagnon/fatcontext v0.7.2/go.mod h1:OAZCUteH59eiddbJZ9/bF4ppC140jYD/hepU2FDkFk4= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 h1:Sz1JIXEcSfhz7fUi7xHnhpIE0thVASYjvosApmHuD2k= @@ -77,8 +77,8 @@ github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMz github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/chroma/v2 v2.14.0 h1:R3+wzpnUArGcQz7fCETQBzO5n9IMNi13iIs46aU4V9E= -github.com/alecthomas/chroma/v2 v2.14.0/go.mod h1:QolEbTfmUHIMVpBqxeDnNBj2uoeI4EbYP4i6n68SG4I= +github.com/alecthomas/chroma/v2 v2.16.0 h1:QC5ZMizk67+HzxFDjQ4ASjni5kWBTGiigRG1u23IGvA= +github.com/alecthomas/chroma/v2 v2.16.0/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk= github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU= github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= @@ -88,14 +88,14 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexkohler/nakedret/v2 v2.0.5 h1:fP5qLgtwbx9EJE8dGEERT02YwS8En4r9nnZ71RK+EVU= -github.com/alexkohler/nakedret/v2 v2.0.5/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= +github.com/alexkohler/nakedret/v2 v2.0.6 h1:ME3Qef1/KIKr3kWX3nti3hhgNxw6aqN5pZmQiFSsuzQ= +github.com/alexkohler/nakedret/v2 v2.0.6/go.mod h1:l3RKju/IzOMQHmsEvXwkqMDzHHvurNQfAgE1eVmT40Q= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= -github.com/alingse/nilnesserr v0.1.2 h1:Yf8Iwm3z2hUUrP4muWfW83DF4nE3r1xZ26fGWUKCZlo= -github.com/alingse/nilnesserr v0.1.2/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg= +github.com/alingse/nilnesserr v0.2.0 h1:raLem5KG7EFVb4UIDAXgrv3N2JIaffeKNtcEXkEWd/w= +github.com/alingse/nilnesserr v0.2.0/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg= github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= @@ -133,8 +133,8 @@ github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bombsimon/wsl/v4 v4.6.0 h1:ew2R/N42su553DKTYqt3HSxaQN+uHQPv4xZ2MBmwaW4= -github.com/bombsimon/wsl/v4 v4.6.0/go.mod h1:uV/+6BkffuzSAVYD+yGyld1AChO7/EuLrCF/8xTiapg= +github.com/bombsimon/wsl/v4 v4.7.0 h1:1Ilm9JBPRczjyUs6hvOPKvd7VL1Q++PL8M0SXBDf+jQ= +github.com/bombsimon/wsl/v4 v4.7.0/go.mod h1:uV/+6BkffuzSAVYD+yGyld1AChO7/EuLrCF/8xTiapg= github.com/breml/bidichk v0.3.3 h1:WSM67ztRusf1sMoqH6/c4OBCUlRVTKq+CbSeo0R17sE= github.com/breml/bidichk v0.3.3/go.mod h1:ISbsut8OnjB367j5NseXEGGgO/th206dVa427kR8YTE= github.com/breml/errchkjson v0.4.1 h1:keFSS8D7A2T0haP9kzZTi7o26r7kE3vymjZNeNDRDwg= @@ -142,8 +142,8 @@ github.com/breml/errchkjson v0.4.1/go.mod h1:a23OvR6Qvcl7DG/Z4o0el6BRAjKnaReoPQF github.com/bugsnag/bugsnag-go v1.0.5-0.20150529004307-13fd6b8acda0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/butuzov/ireturn v0.3.1 h1:mFgbEI6m+9W8oP/oDdfA34dLisRFCj2G6o/yiI1yZrY= -github.com/butuzov/ireturn v0.3.1/go.mod h1:ZfRp+E7eJLC0NQmk1Nrm1LOrn/gQlOykv+cVPdiXH5M= +github.com/butuzov/ireturn v0.4.0 h1:+s76bF/PfeKEdbG8b54aCocxXmi0wvYdOVsWxVO7n8E= +github.com/butuzov/ireturn v0.4.0/go.mod h1:ghI0FrCmap8pDWZwfPisFD1vEc56VKH4NpQUxDHta70= github.com/butuzov/mirror v1.3.0 h1:HdWCXzmwlQHdVhwvsfBb2Au0r3HyINry3bDWLYXiKoc= github.com/butuzov/mirror v1.3.0/go.mod h1:AEij0Z8YMALaq4yQj9CPPVYOyJQyiexpQEQgihajRfI= github.com/catenacyber/perfsprint v0.9.1 h1:5LlTp4RwTooQjJCvGEFV6XksZvWE7wCOUvjD2z0vls0= @@ -231,8 +231,8 @@ github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okeg github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= -github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= +github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/docker/cli v28.0.4+incompatible h1:pBJSJeNd9QeIWPjRcV91RVJihd/TXB77q1ef64XEu4A= @@ -281,8 +281,8 @@ github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4 github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= -github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= +github.com/firefart/nonamedreturns v1.0.6 h1:vmiBcKV/3EqKY3ZiPxCINmpS431OcE1S47AQUwhrg8E= +github.com/firefart/nonamedreturns v1.0.6/go.mod h1:R8NisJnSIpvPWheCq0mNRXJok6D8h7fagJTF8EMEwCo= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -297,8 +297,8 @@ github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3 github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= github.com/getsentry/sentry-go v0.32.0 h1:YKs+//QmwE3DcYtfKRH8/KyOOF/I6Qnx7qYGNHCGmCY= github.com/getsentry/sentry-go v0.32.0/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY= -github.com/ghostiam/protogetter v0.3.12 h1:xTPjH97iKph27vXRRKV0OCke5sAMoHPbVeVstdzmCLE= -github.com/ghostiam/protogetter v0.3.12/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= +github.com/ghostiam/protogetter v0.3.13 h1:T4qt1JU0xvx8+jO30+JaA49fngUd6YNajqwk0Rn3t1s= +github.com/ghostiam/protogetter v0.3.13/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-critic/go-critic v0.13.0 h1:kJzM7wzltQasSUXtYyTl6UaPVySO6GkaR1thFnJ6afY= @@ -417,8 +417,8 @@ github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUP github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY= -github.com/golangci/golangci-lint/v2 v2.0.2 h1:dMCC8ikPiLDvHMFy3+XypSAuGDBOLzwWqqamer+bWsY= -github.com/golangci/golangci-lint/v2 v2.0.2/go.mod h1:ptNNMeGBQrbves0Qq38xvfdJg18PzxmT+7KRCOpm6i8= +github.com/golangci/golangci-lint/v2 v2.1.1 h1:h0S97dn3HpK12QzzPjoPxgMUqweM7m34j/QNV6iVg5g= +github.com/golangci/golangci-lint/v2 v2.1.1/go.mod h1:zJJo4g7aGiCv5cRYa+YUaWVazNBRzn4Kg7hdEKV0iXU= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 h1:AkK+w9FZBXlU/xUmBtSJN1+tAI4FIvy5WtnUnY8e4p8= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95/go.mod h1:k9mmcyWKSTMcPPvQUCfRWWQ9VHJ1U9Dc0R7kaXAgtnQ= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= @@ -427,8 +427,8 @@ github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+ github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= github.com/golangci/revgrep v0.8.0 h1:EZBctwbVd0aMeRnNUsFogoyayvKHyxlV3CdUA46FX2s= github.com/golangci/revgrep v0.8.0/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= -github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNFP0hTEi1YKjB/ub8zkpaOqFFMApi2EAs= -github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= +github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e h1:gD6P7NEo7Eqtt0ssnqSJNNndxe69DOQ24A5h7+i3KpM= +github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e/go.mod h1:h+wZwLjUTJnm/P2rwlbJdRPZXOzaT36/FwnPnY2inzc= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/certificate-transparency-go v1.0.10-0.20180222191210-5ab67e519c93/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= @@ -576,8 +576,8 @@ github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= -github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jgautheron/goconst v1.8.1 h1:PPqCYp3K/xlOj5JmIe6O1Mj6r1DbkdbLtR3AJuZo414= +github.com/jgautheron/goconst v1.8.1/go.mod h1:A0oxgBCHy55NQn6sYpO7UdnA9p+h7cPtoOZUmvNIako= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo= @@ -627,8 +627,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= -github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= +github.com/kunwardeep/paralleltest v1.0.14 h1:wAkMoMeGX/kGfhQBPODT/BL8XhK23ol/nuQ3SwFaUw8= +github.com/kunwardeep/paralleltest v1.0.14/go.mod h1:di4moFqtfz3ToSKxhNjhOZL+696QtJGCFe132CbBLGk= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lasiar/canonicalheader v1.1.2 h1:vZ5uqwvDbyJCnMhmFYimgMZnJMjwljN5VGY0VKbMXb4= @@ -659,6 +659,8 @@ github.com/macabu/inamedparam v0.2.0/go.mod h1:+Pee9/YfGe5LJ62pYXqB89lJ+0k5bsR8W github.com/magiconair/properties v1.5.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/manuelarte/funcorder v0.2.1 h1:7QJsw3qhljoZ5rH0xapIvjw31EcQeFbF31/7kQ/xS34= +github.com/manuelarte/funcorder v0.2.1/go.mod h1:BQQ0yW57+PF9ZpjpeJDKOffEsQbxDFKW8F8zSMe/Zd0= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= @@ -686,8 +688,8 @@ github.com/mattn/go-sqlite3 v1.6.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOq github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mgechev/revive v1.7.0 h1:JyeQ4yO5K8aZhIKf5rec56u0376h8AlKNQEmjfkjKlY= -github.com/mgechev/revive v1.7.0/go.mod h1:qZnwcNhoguE58dfi96IJeSTPeZQejNeoMQLUZGi4SW4= +github.com/mgechev/revive v1.9.0 h1:8LaA62XIKrb8lM6VsBSQ92slt/o92z5+hTw3CmrvSrM= +github.com/mgechev/revive v1.9.0/go.mod h1:LAPq3+MgOf7GcL5PlWIkHb0PT7XH4NuC2LdWymhb9Mo= github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk= github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA= github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= @@ -752,16 +754,16 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU= -github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk= +github.com/onsi/ginkgo/v2 v2.23.3 h1:edHxnszytJ4lD9D5Jjc4tiDkPBZ3siDeJJkUZJJVkp0= +github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= -github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= +github.com/onsi/gomega v1.36.3 h1:hID7cr8t3Wp26+cYnfcjR6HpJ00fdogN6dqZ1t6IylU= +github.com/onsi/gomega v1.36.3/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -776,8 +778,8 @@ github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJ github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -792,8 +794,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.7.1 h1:RyLVXIbosq1gBdk/pChWA8zWYLsq9UEw7a1L5TVMCnA= -github.com/polyfloyd/go-errorlint v1.7.1/go.mod h1:aXjNb1x2TNhoLsk26iv1yl7a+zTnXPhwEMtEXukiLR8= +github.com/polyfloyd/go-errorlint v1.8.0 h1:DL4RestQqRLr8U4LygLw8g2DX6RN1eBJOpa2mzsrl1Q= +github.com/polyfloyd/go-errorlint v1.8.0/go.mod h1:G2W0Q5roxbLCt0ZQbdoxQxXktTjwNyDbEaj3n7jvl4s= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.0-pre1.0.20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -867,8 +869,8 @@ github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84d github.com/sashamelentyev/usestdlibvars v1.28.0 h1:jZnudE2zKCtYlGzLVreNp5pmCdOxXUzwsMDBkR21cyQ= github.com/sashamelentyev/usestdlibvars v1.28.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/securego/gosec/v2 v2.22.2 h1:IXbuI7cJninj0nRpZSLCUlotsj8jGusohfONMrHoF6g= -github.com/securego/gosec/v2 v2.22.2/go.mod h1:UEBGA+dSKb+VqM6TdehR7lnQtIIMorYJ4/9CW1KVQBE= +github.com/securego/gosec/v2 v2.22.3 h1:mRrCNmRF2NgZp4RJ8oJ6yPJ7G4x6OCiAXHd8x4trLRc= +github.com/securego/gosec/v2 v2.22.3/go.mod h1:42M9Xs0v1WseinaB/BmNGO8AVqG8vRfhC2686ACY48k= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= @@ -956,10 +958,10 @@ github.com/tidwall/jsonc v0.3.2 h1:ZTKrmejRlAJYdn0kcaFqRAKlxxFIC21pYq8vLa4p2Wc= github.com/tidwall/jsonc v0.3.2/go.mod h1:dw+3CIxqHi+t8eFSpzzMlcVYxKp08UP5CD8/uSFCyJE= github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk5r6+hJnar67cgpDIz/iyD+rfl5r2Vk= github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= -github.com/timonwong/loggercheck v0.10.1 h1:uVZYClxQFpw55eh+PIoqM7uAOHMrhVcDoWDery9R8Lg= -github.com/timonwong/loggercheck v0.10.1/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= -github.com/tomarrell/wrapcheck/v2 v2.10.0 h1:SzRCryzy4IrAH7bVGG4cK40tNUhmVmMDuJujy4XwYDg= -github.com/tomarrell/wrapcheck/v2 v2.10.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/timonwong/loggercheck v0.11.0 h1:jdaMpYBl+Uq9mWPXv1r8jc5fC3gyXx4/WGwTnnNKn4M= +github.com/timonwong/loggercheck v0.11.0/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= +github.com/tomarrell/wrapcheck/v2 v2.11.0 h1:BJSt36snX9+4WTIXeJ7nvHBQBcm1h2SjQMSlmQ6aFSU= +github.com/tomarrell/wrapcheck/v2 v2.11.0/go.mod h1:wFL9pDWDAbXhhPZZt+nG8Fu+h29TtnZ2MW6Lx4BRXIU= 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/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= @@ -1017,8 +1019,8 @@ go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE= go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM= -go-simpler.org/sloglint v0.9.0 h1:/40NQtjRx9txvsB/RN022KsUJU+zaaSb/9q9BSefSrE= -go-simpler.org/sloglint v0.9.0/go.mod h1:G/OrAF6uxj48sHahCzrbarVMptL2kjWTaUeC8+fOGww= +go-simpler.org/sloglint v0.11.0 h1:JlR1X4jkbeaffiyjLtymeqmGDKBDO1ikC6rjiuFAOco= +go-simpler.org/sloglint v0.11.0/go.mod h1:CFDO8R1i77dlciGfPEPvYke2ZMx4eyGiEIWkyeW2Pvw= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1089,8 +1091,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1185,8 +1187,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= -golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1210,8 +1212,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1306,13 +1308,13 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4= -golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= +golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1377,8 +1379,8 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= -golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= -golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= +golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= +golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1438,8 +1440,8 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA= google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:iK2jbkWL86DXjEx0qiHcRE9dE4/Ahua5k6V8OWFb//c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= 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= @@ -1467,8 +1469,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= -google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/cenkalti/backoff.v2 v2.2.1/go.mod h1:S0QdOvT2AlerfSBkp0O+dk+bbIMaNbEmVk876gPCthU= From f8d12cc2268d12854b9069be774e64fe56185547 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 05:41:33 +0000 Subject: [PATCH 042/359] chore(deps): bump github.com/go-git/go-git/v5 from 5.14.0 to 5.15.0 (#3437) Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.14.0 to 5.15.0. - [Release notes](https://github.com/go-git/go-git/releases) - [Commits](https://github.com/go-git/go-git/compare/v5.14.0...v5.15.0) --- updated-dependencies: - dependency-name: github.com/go-git/go-git/v5 dependency-version: 5.15.0 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 | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 064bfd90b..0d8bd6925 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/ecies/go/v2 v2.0.10 github.com/getsentry/sentry-go v0.32.0 github.com/go-errors/errors v1.5.1 - github.com/go-git/go-git/v5 v5.14.0 + github.com/go-git/go-git/v5 v5.15.0 github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golang-jwt/jwt/v5 v5.2.2 @@ -74,7 +74,7 @@ require ( github.com/Masterminds/semver/v3 v3.3.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect - github.com/ProtonMail/go-crypto v1.1.5 // indirect + github.com/ProtonMail/go-crypto v1.1.6 // indirect github.com/alecthomas/chroma/v2 v2.16.0 // indirect github.com/alecthomas/go-check-sumtype v0.3.1 // indirect github.com/alexkohler/nakedret/v2 v2.0.6 // indirect @@ -107,7 +107,7 @@ require ( github.com/charmbracelet/x/term v0.2.1 // indirect github.com/chavacava/garif v0.1.0 // indirect github.com/ckaznocha/intrange v0.3.1 // indirect - github.com/cloudflare/circl v1.6.0 // indirect + github.com/cloudflare/circl v1.6.1 // 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.57.2 // indirect diff --git a/go.sum b/go.sum index ec1f6404e..04ff0f4e1 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/Netflix/go-env v0.1.2 h1:0DRoLR9lECQ9Zqvkswuebm3jJ/2enaDX6Ei8/Z+EnK0= github.com/Netflix/go-env v0.1.2/go.mod h1:WlIhYi++8FlKNJtrop1mjXYAJMzv1f43K4MqCoh0yGE= github.com/OpenPeeDeeP/depguard/v2 v2.2.1 h1:vckeWVESWp6Qog7UZSARNqfu/cZqvki8zsuj3piCMx4= github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgzrVxUYBlgKNGquUo= -github.com/ProtonMail/go-crypto v1.1.5 h1:eoAQfK2dwL+tFSFpr7TbOaPNUbPiJj4fLYwwGE1FQO4= -github.com/ProtonMail/go-crypto v1.1.5/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw= +github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= @@ -188,8 +188,8 @@ github.com/ckaznocha/intrange v0.3.1 h1:j1onQyXvHUsPWujDH6WIjhyH26gkRt/txNlV7Lsp github.com/ckaznocha/intrange v0.3.1/go.mod h1:QVepyz1AkUoFQkpEqksSYpNpUo3c5W7nWh/s6SHIJJk= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= -github.com/cloudflare/circl v1.6.0 h1:cr5JKic4HI+LkINy2lg3W2jF8sHCVTBncJr5gIIq7qk= -github.com/cloudflare/circl v1.6.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= +github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= +github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= 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= @@ -311,8 +311,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60= -github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k= +github.com/go-git/go-git/v5 v5.15.0 h1:f5Qn0W0F7ry1iN0ZwIU5m/n7/BKB4hiZfc+zlZx7ly0= +github.com/go-git/go-git/v5 v5.15.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From fd96e1970298f26bdba434bf274dc7d5d6d7444e Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Mon, 14 Apr 2025 00:38:24 +0800 Subject: [PATCH 043/359] chore: refactor import map constructor --- internal/utils/deno.go | 27 ++++------------- internal/utils/deno_test.go | 7 +++-- pkg/function/deploy.go | 58 ++++++++++++++++++++----------------- 3 files changed, 42 insertions(+), 50 deletions(-) diff --git a/internal/utils/deno.go b/internal/utils/deno.go index ee6ac5de4..403152639 100644 --- a/internal/utils/deno.go +++ b/internal/utils/deno.go @@ -209,29 +209,12 @@ func CopyDenoScripts(ctx context.Context, fsys afero.Fs) (*DenoScriptDir, error) return &sd, nil } -func newImportMap(relJsonPath string, fsys afero.Fs) (function.ImportMap, error) { - var result function.ImportMap - if len(relJsonPath) == 0 { - return result, nil - } - data, err := afero.ReadFile(fsys, relJsonPath) - if err != nil { - return result, errors.Errorf("failed to load import map: %w", err) - } - if err := result.Parse(data); err != nil { - return result, err - } - unixPath := filepath.ToSlash(relJsonPath) - if err := result.Resolve(unixPath, afero.NewIOFS(fsys)); err != nil { - return result, err - } - return result, nil -} - func BindHostModules(cwd, relEntrypointPath, relImportMapPath string, fsys afero.Fs) ([]string, error) { - importMap, err := newImportMap(relImportMapPath, fsys) - if err != nil { - return nil, err + importMap := function.ImportMap{} + if imPath := filepath.ToSlash(relImportMapPath); len(imPath) > 0 { + if err := importMap.Load(imPath, afero.NewIOFS(fsys)); err != nil { + return nil, err + } } var modules []string // Resolving all Import Graph diff --git a/internal/utils/deno_test.go b/internal/utils/deno_test.go index 32f6b42c7..0cbe1ef79 100644 --- a/internal/utils/deno_test.go +++ b/internal/utils/deno_test.go @@ -8,6 +8,7 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/supabase/cli/pkg/function" ) func TestResolveImports(t *testing.T) { @@ -31,7 +32,8 @@ func TestResolveImports(t *testing.T) { require.NoError(t, fsys.Mkdir(filepath.Join(cwd, DbTestsDir), 0755)) require.NoError(t, fsys.Mkdir(filepath.Join(cwd, FunctionsDir, "child"), 0755)) // Run test - resolved, err := newImportMap(jsonPath, fsys) + resolved := function.ImportMap{} + err = resolved.Load(jsonPath, afero.NewIOFS(fsys)) // Check error assert.NoError(t, err) assert.Equal(t, "/tmp/", resolved.Imports["abs/"]) @@ -53,7 +55,8 @@ func TestResolveImports(t *testing.T) { fsys := afero.NewMemMapFs() require.NoError(t, afero.WriteFile(fsys, FallbackImportMapPath, importMap, 0644)) // Run test - resolved, err := newImportMap(FallbackImportMapPath, fsys) + resolved := function.ImportMap{} + err := resolved.Load(FallbackImportMapPath, afero.NewIOFS(fsys)) // Check error assert.NoError(t, err) assert.Equal(t, "https://deno.land", resolved.Scopes["my-scope"]["my-mod"]) diff --git a/pkg/function/deploy.go b/pkg/function/deploy.go index c44155ca9..2bc17eecb 100644 --- a/pkg/function/deploy.go +++ b/pkg/function/deploy.go @@ -143,6 +143,17 @@ func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs. if err := enc.Encode(meta); err != nil { return errors.Errorf("failed to encode metadata: %w", err) } + uploadAsset := func(srcPath string, r io.Reader) error { + fmt.Fprintf(os.Stderr, "Uploading asset (%s): %s\n", *meta.Name, srcPath) + f, err := form.CreateFormFile("file", srcPath) + if err != nil { + return errors.Errorf("failed to create map: %w", err) + } + if _, err := io.Copy(f, r); err != nil { + return errors.Errorf("failed to write form: %w", err) + } + return nil + } addFile := func(srcPath string, w io.Writer) error { f, err := fsys.Open(filepath.FromSlash(srcPath)) if err != nil { @@ -154,39 +165,15 @@ func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs. } else if fi.IsDir() { return errors.New("file path is a directory: " + srcPath) } - fmt.Fprintf(os.Stderr, "Uploading asset (%s): %s\n", *meta.Name, srcPath) r := io.TeeReader(f, w) - dst, err := form.CreateFormFile("file", srcPath) - if err != nil { - return errors.Errorf("failed to create form: %w", err) - } - if _, err := io.Copy(dst, r); err != nil { - return errors.Errorf("failed to write form: %w", err) - } - return nil + return uploadAsset(srcPath, r) } // Add import map importMap := ImportMap{} if imPath := cast.Val(meta.ImportMapPath, ""); len(imPath) > 0 { - data, err := fs.ReadFile(fsys, filepath.FromSlash(imPath)) - if err != nil { - return errors.Errorf("failed to load import map: %w", err) - } - if err := importMap.Parse(data); err != nil { - return err - } - if err := importMap.Resolve(imPath, fsys); err != nil { + if err := importMap.Load(imPath, fsys, uploadAsset); err != nil { return err } - // TODO: replace with addFile once edge runtime supports jsonc - fmt.Fprintf(os.Stderr, "Uploading asset (%s): %s\n", *meta.Name, imPath) - f, err := form.CreateFormFile("file", imPath) - if err != nil { - return errors.Errorf("failed to create import map: %w", err) - } - if _, err := f.Write(data); err != nil { - return errors.Errorf("failed to write import map: %w", err) - } } // Add static files patterns := config.Glob(cast.Val(meta.StaticPatterns, []string{})) @@ -207,6 +194,25 @@ type ImportMap struct { Scopes map[string]map[string]string `json:"scopes"` } +func (m *ImportMap) Load(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error { + data, err := fs.ReadFile(fsys, filepath.FromSlash(imPath)) + if err != nil { + return errors.Errorf("failed to load import map: %w", err) + } + if err := m.Parse(data); err != nil { + return err + } + if err := m.Resolve(imPath, fsys); err != nil { + return err + } + for _, apply := range opts { + if err := apply(imPath, bytes.NewReader(data)); err != nil { + return err + } + } + return nil +} + func (m *ImportMap) Parse(data []byte) error { data = jsonc.ToJSONInPlace(data) decoder := json.NewDecoder(bytes.NewReader(data)) From d9b38381a364ae79f4cea66e5d4629b2ad61b75c Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Mon, 14 Apr 2025 01:36:00 +0800 Subject: [PATCH 044/359] feat: load import map reference in deno config --- internal/functions/deploy/bundle.go | 7 ------- internal/utils/deno.go | 10 ++++++++-- pkg/function/deploy.go | 22 +++++++++++++++++++++- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index 436321493..fa47b22fb 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -127,13 +127,6 @@ func GetBindMounts(cwd, hostFuncDir, hostOutputDir, hostEntrypointPath, hostImpo if err != nil { return nil, err } - if len(hostImportMapPath) > 0 { - if !filepath.IsAbs(hostImportMapPath) { - hostImportMapPath = filepath.Join(cwd, hostImportMapPath) - } - dockerImportMapPath := utils.ToDockerPath(hostImportMapPath) - modules = append(modules, hostImportMapPath+":"+dockerImportMapPath+":ro") - } // Remove any duplicate mount points for _, mod := range modules { hostPath := strings.Split(mod, ":")[0] diff --git a/internal/utils/deno.go b/internal/utils/deno.go index 403152639..5bece3a5a 100644 --- a/internal/utils/deno.go +++ b/internal/utils/deno.go @@ -210,13 +210,19 @@ func CopyDenoScripts(ctx context.Context, fsys afero.Fs) (*DenoScriptDir, error) } func BindHostModules(cwd, relEntrypointPath, relImportMapPath string, fsys afero.Fs) ([]string, error) { + var modules []string + bindModule := func(srcPath string, r io.Reader) error { + hostPath := filepath.Join(cwd, filepath.FromSlash(srcPath)) + dockerPath := ToDockerPath(hostPath) + modules = append(modules, hostPath+":"+dockerPath+":ro") + return nil + } importMap := function.ImportMap{} if imPath := filepath.ToSlash(relImportMapPath); len(imPath) > 0 { - if err := importMap.Load(imPath, afero.NewIOFS(fsys)); err != nil { + if err := importMap.LoadAsDeno(imPath, afero.NewIOFS(fsys), bindModule); err != nil { return nil, err } } - var modules []string // Resolving all Import Graph addModule := func(unixPath string, w io.Writer) error { hostPath := filepath.FromSlash(unixPath) diff --git a/pkg/function/deploy.go b/pkg/function/deploy.go index 2bc17eecb..a419fc3c3 100644 --- a/pkg/function/deploy.go +++ b/pkg/function/deploy.go @@ -171,7 +171,7 @@ func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs. // Add import map importMap := ImportMap{} if imPath := cast.Val(meta.ImportMapPath, ""); len(imPath) > 0 { - if err := importMap.Load(imPath, fsys, uploadAsset); err != nil { + if err := importMap.LoadAsDeno(imPath, fsys, uploadAsset); err != nil { return err } } @@ -192,6 +192,26 @@ func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs. type ImportMap struct { Imports map[string]string `json:"imports"` Scopes map[string]map[string]string `json:"scopes"` + // Fallback reference for deno.json + ImportMap string `json:"importMap"` +} + +func (m *ImportMap) LoadAsDeno(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error { + if err := m.Load(imPath, fsys, opts...); err != nil { + return err + } + if strings.EqualFold(path.Base(imPath), "deno.json") && m.IsReference() { + imPath = path.Join(path.Dir(imPath), m.ImportMap) + if err := m.Load(imPath, fsys, opts...); err != nil { + return err + } + } + return nil +} + +func (m *ImportMap) IsReference() bool { + // Ref: https://github.com/denoland/deno/blob/main/cli/schemas/config-file.v1.json#L273 + return len(m.Imports) == 0 && len(m.Scopes) == 0 && len(m.ImportMap) > 0 } func (m *ImportMap) Load(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error { From b91727b6b25bd2e35a09fbdcb07da36db4b39f2a Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Mon, 14 Apr 2025 02:14:18 +0800 Subject: [PATCH 045/359] chore: add unit tests --- internal/utils/deno_test.go | 55 ---------- pkg/function/deno.go | 180 ++++++++++++++++++++++++++++++++ pkg/function/deno_test.go | 201 ++++++++++++++++++++++++++++++++++++ pkg/function/deploy.go | 163 ----------------------------- pkg/function/deploy_test.go | 80 -------------- 5 files changed, 381 insertions(+), 298 deletions(-) create mode 100644 pkg/function/deno.go create mode 100644 pkg/function/deno_test.go diff --git a/internal/utils/deno_test.go b/internal/utils/deno_test.go index 0cbe1ef79..a20b3acac 100644 --- a/internal/utils/deno_test.go +++ b/internal/utils/deno_test.go @@ -1,68 +1,13 @@ package utils import ( - "os" - "path/filepath" "testing" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/supabase/cli/pkg/function" ) -func TestResolveImports(t *testing.T) { - t.Run("resolves relative directory", func(t *testing.T) { - importMap := []byte(`{ - "imports": { - "abs/": "/tmp/", - "root": "../../common", - "parent": "../tests", - "child": "child/", - "missing": "../missing" - } -}`) - // Setup in-memory fs - fsys := afero.NewMemMapFs() - cwd, err := os.Getwd() - require.NoError(t, err) - jsonPath := filepath.Join(cwd, FallbackImportMapPath) - require.NoError(t, afero.WriteFile(fsys, jsonPath, importMap, 0644)) - require.NoError(t, fsys.Mkdir(filepath.Join(cwd, "common"), 0755)) - require.NoError(t, fsys.Mkdir(filepath.Join(cwd, DbTestsDir), 0755)) - require.NoError(t, fsys.Mkdir(filepath.Join(cwd, FunctionsDir, "child"), 0755)) - // Run test - resolved := function.ImportMap{} - err = resolved.Load(jsonPath, afero.NewIOFS(fsys)) - // Check error - assert.NoError(t, err) - assert.Equal(t, "/tmp/", resolved.Imports["abs/"]) - assert.Equal(t, cwd+"/common", resolved.Imports["root"]) - assert.Equal(t, cwd+"/supabase/tests", resolved.Imports["parent"]) - assert.Equal(t, cwd+"/supabase/functions/child/", resolved.Imports["child"]) - assert.Equal(t, "../missing", resolved.Imports["missing"]) - }) - - t.Run("resolves parent scopes", func(t *testing.T) { - importMap := []byte(`{ - "scopes": { - "my-scope": { - "my-mod": "https://deno.land" - } - } -}`) - // Setup in-memory fs - fsys := afero.NewMemMapFs() - require.NoError(t, afero.WriteFile(fsys, FallbackImportMapPath, importMap, 0644)) - // Run test - resolved := function.ImportMap{} - err := resolved.Load(FallbackImportMapPath, afero.NewIOFS(fsys)) - // Check error - assert.NoError(t, err) - assert.Equal(t, "https://deno.land", resolved.Scopes["my-scope"]["my-mod"]) - }) -} - func TestBindModules(t *testing.T) { t.Run("binds docker imports", func(t *testing.T) { fsys := afero.NewMemMapFs() diff --git a/pkg/function/deno.go b/pkg/function/deno.go new file mode 100644 index 000000000..bcc77a3de --- /dev/null +++ b/pkg/function/deno.go @@ -0,0 +1,180 @@ +package function + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/fs" + "os" + "path" + "path/filepath" + "regexp" + "strings" + + "github.com/go-errors/errors" + "github.com/tidwall/jsonc" +) + +type ImportMap struct { + Imports map[string]string `json:"imports"` + Scopes map[string]map[string]string `json:"scopes"` + // Fallback reference for deno.json + ImportMap string `json:"importMap"` +} + +func (m *ImportMap) LoadAsDeno(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error { + if err := m.Load(imPath, fsys, opts...); err != nil { + return err + } + if name := path.Base(imPath); isDeno(name) && m.IsReference() { + imPath = path.Join(path.Dir(imPath), m.ImportMap) + if err := m.Load(imPath, fsys, opts...); err != nil { + return err + } + } + return nil +} + +func isDeno(name string) bool { + return strings.EqualFold(name, "deno.json") || + strings.EqualFold(name, "deno.jsonc") +} + +func (m *ImportMap) IsReference() bool { + // Ref: https://github.com/denoland/deno/blob/main/cli/schemas/config-file.v1.json#L273 + return len(m.Imports) == 0 && len(m.Scopes) == 0 && len(m.ImportMap) > 0 +} + +func (m *ImportMap) Load(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error { + data, err := fs.ReadFile(fsys, filepath.FromSlash(imPath)) + if err != nil { + return errors.Errorf("failed to load import map: %w", err) + } + if err := m.Parse(data); err != nil { + return err + } + if err := m.Resolve(imPath, fsys); err != nil { + return err + } + for _, apply := range opts { + if err := apply(imPath, bytes.NewReader(data)); err != nil { + return err + } + } + return nil +} + +func (m *ImportMap) Parse(data []byte) error { + data = jsonc.ToJSONInPlace(data) + decoder := json.NewDecoder(bytes.NewReader(data)) + if err := decoder.Decode(&m); err != nil { + return errors.Errorf("failed to parse import map: %w", err) + } + return nil +} + +func (m *ImportMap) Resolve(imPath string, fsys fs.FS) error { + // Resolve all paths relative to current file + for k, v := range m.Imports { + m.Imports[k] = resolveHostPath(imPath, v, fsys) + } + for module, mapping := range m.Scopes { + for k, v := range mapping { + m.Scopes[module][k] = resolveHostPath(imPath, v, fsys) + } + } + return nil +} + +func resolveHostPath(jsonPath, hostPath string, fsys fs.FS) string { + // Leave absolute paths unchanged + if path.IsAbs(hostPath) { + return hostPath + } + resolved := path.Join(path.Dir(jsonPath), hostPath) + if _, err := fs.Stat(fsys, filepath.FromSlash(resolved)); err != nil { + // Leave URLs unchanged + return hostPath + } + // Directory imports need to be suffixed with / + // Ref: https://deno.com/manual@v1.33.0/basics/import_maps + if strings.HasSuffix(hostPath, "/") { + resolved += "/" + } + // Relative imports must be prefixed with ./ or ../ + if !path.IsAbs(resolved) { + resolved = "./" + resolved + } + return resolved +} + +// Ref: https://regex101.com/r/DfBdJA/1 +var importPathPattern = regexp.MustCompile(`(?i)(?:import|export)\s+(?:{[^{}]+}|.*?)\s*(?:from)?\s*['"](.*?)['"]|import\(\s*['"](.*?)['"]\)`) + +func (importMap *ImportMap) WalkImportPaths(srcPath string, readFile func(curr string, w io.Writer) error) error { + seen := map[string]struct{}{} + // DFS because it's more efficient to pop from end of array + q := make([]string, 1) + q[0] = srcPath + for len(q) > 0 { + curr := q[len(q)-1] + q = q[:len(q)-1] + // Assume no file is symlinked + if _, ok := seen[curr]; ok { + continue + } + seen[curr] = struct{}{} + // Read into memory for regex match later + var buf bytes.Buffer + if err := readFile(curr, &buf); errors.Is(err, os.ErrNotExist) { + fmt.Fprintln(os.Stderr, "WARN:", err) + continue + } else if err != nil { + return err + } + // Traverse all modules imported by the current source file + for _, matches := range importPathPattern.FindAllStringSubmatch(buf.String(), -1) { + if len(matches) < 3 { + continue + } + // Matches 'from' clause if present, else fallback to 'import' + mod := matches[1] + if len(mod) == 0 { + mod = matches[2] + } + mod = strings.TrimSpace(mod) + // Substitute kv from import map + substituted := false + for k, v := range importMap.Imports { + if strings.HasPrefix(mod, k) { + mod = v + mod[len(k):] + substituted = true + } + } + // Ignore URLs and directories, assuming no sloppy imports + // https://github.com/denoland/deno/issues/2506#issuecomment-2727635545 + if len(path.Ext(mod)) == 0 { + continue + } + // Deno import path must begin with one of these prefixes + if !isRelPath(mod) && !isAbsPath(mod) { + continue + } + if isRelPath(mod) && !substituted { + mod = path.Join(path.Dir(curr), mod) + } + // Cleans import path to help detect duplicates + q = append(q, path.Clean(mod)) + } + } + return nil +} + +func isRelPath(mod string) bool { + return strings.HasPrefix(mod, "./") || strings.HasPrefix(mod, "../") +} + +func isAbsPath(mod string) bool { + return strings.HasPrefix(mod, "/") +} diff --git a/pkg/function/deno_test.go b/pkg/function/deno_test.go new file mode 100644 index 000000000..efa08c08d --- /dev/null +++ b/pkg/function/deno_test.go @@ -0,0 +1,201 @@ +package function + +import ( + "embed" + "io" + "os" + "testing" + fs "testing/fstest" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +//go:embed testdata +var testImports embed.FS + +type MockFS struct { + mock.Mock +} + +func (m *MockFS) ReadFile(srcPath string, w io.Writer) error { + _ = m.Called(srcPath) + data, err := testImports.ReadFile(srcPath) + if err != nil { + return err + } + if _, err := w.Write(data); err != nil { + return err + } + return nil +} + +func TestImportPaths(t *testing.T) { + t.Run("iterates all import paths", func(t *testing.T) { + // Setup in-memory fs + fsys := MockFS{} + fsys.On("ReadFile", "/modules/my-module.ts").Once() + fsys.On("ReadFile", "testdata/modules/imports.ts").Once() + fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() + // Run test + im := ImportMap{} + err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) + // Check error + assert.NoError(t, err) + fsys.AssertExpectations(t) + }) + + t.Run("iterates with import map", func(t *testing.T) { + // Setup in-memory fs + fsys := MockFS{} + fsys.On("ReadFile", "/modules/my-module.ts").Once() + fsys.On("ReadFile", "testdata/modules/imports.ts").Once() + fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() + fsys.On("ReadFile", "testdata/shared/whatever.ts").Once() + fsys.On("ReadFile", "testdata/shared/mod.ts").Once() + fsys.On("ReadFile", "testdata/nested/index.ts").Once() + // Setup deno.json + im := ImportMap{Imports: map[string]string{ + "module-name/": "../shared/", + }} + assert.NoError(t, im.Resolve("testdata/modules/deno.json", testImports)) + // Run test + err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) + // Check error + assert.NoError(t, err) + fsys.AssertExpectations(t) + }) + + t.Run("resolves legacy import map", func(t *testing.T) { + // Setup in-memory fs + fsys := MockFS{} + fsys.On("ReadFile", "/modules/my-module.ts").Once() + fsys.On("ReadFile", "testdata/modules/imports.ts").Once() + fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() + fsys.On("ReadFile", "testdata/shared/whatever.ts").Once() + fsys.On("ReadFile", "testdata/shared/mod.ts").Once() + fsys.On("ReadFile", "testdata/nested/index.ts").Once() + // Setup legacy import map + im := ImportMap{Imports: map[string]string{ + "module-name/": "./shared/", + }} + assert.NoError(t, im.Resolve("testdata/import_map.json", testImports)) + // Run test + err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) + // Check error + assert.NoError(t, err) + fsys.AssertExpectations(t) + }) +} + +func TestResolveImports(t *testing.T) { + t.Run("resolves relative directory", func(t *testing.T) { + imPath := "supabase/functions/import_map.json" + // Setup in-memory fs + fsys := fs.MapFS{ + imPath: &fs.MapFile{Data: []byte(`{ + "imports": { + "abs/": "/tmp/", + "root": "../../common", + "parent": "../tests", + "child": "child/", + "missing": "../missing" + } + }`)}, + "/tmp/": &fs.MapFile{}, + "common": &fs.MapFile{}, + "supabase/tests": &fs.MapFile{}, + "supabase/functions/child": &fs.MapFile{}, + } + // Run test + resolved := ImportMap{} + err := resolved.Load(imPath, fsys) + // Check error + assert.NoError(t, err) + assert.Equal(t, "/tmp/", resolved.Imports["abs/"]) + assert.Equal(t, "./common", resolved.Imports["root"]) + assert.Equal(t, "./supabase/tests", resolved.Imports["parent"]) + assert.Equal(t, "./supabase/functions/child/", resolved.Imports["child"]) + assert.Equal(t, "../missing", resolved.Imports["missing"]) + }) + + t.Run("resolves parent scopes", func(t *testing.T) { + imPath := "supabase/functions/import_map.json" + // Setup in-memory fs + fsys := fs.MapFS{ + imPath: &fs.MapFile{Data: []byte(`{ + "scopes": { + "my-scope": { + "my-mod": "https://deno.land" + } + } + }`)}, + } + // Run test + resolved := ImportMap{} + err := resolved.Load(imPath, fsys) + // Check error + assert.NoError(t, err) + assert.Equal(t, "https://deno.land", resolved.Scopes["my-scope"]["my-mod"]) + }) +} + +func TestResolveDeno(t *testing.T) { + t.Run("resolves deno.json", func(t *testing.T) { + imPath := "supabase/functions/slug/deno.json" + // Setup in-memory fs + fsys := fs.MapFS{ + imPath: &fs.MapFile{Data: []byte(`{ + "imports": { + "@mod": "./mod.ts" + }, + "importMap": "../../import_map.json" + }`)}, + "supabase/functions/slug/mod.ts": &fs.MapFile{}, + } + // Run test + resolved := ImportMap{} + err := resolved.LoadAsDeno(imPath, fsys) + // Check error + assert.NoError(t, err) + assert.Equal(t, "./supabase/functions/slug/mod.ts", resolved.Imports["@mod"]) + }) + + t.Run("resolves fallback imports", func(t *testing.T) { + imPath := "supabase/functions/slug/deno.json" + // Setup in-memory fs + fsys := fs.MapFS{ + imPath: &fs.MapFile{Data: []byte(`{ + "importMap": "../../import_map.json" + }`)}, + "supabase/import_map.json": &fs.MapFile{Data: []byte(`{ + "imports": { + "my-mod": "https://deno.land" + } + }`)}, + } + // Run test + resolved := ImportMap{} + err := resolved.LoadAsDeno(imPath, fsys) + // Check error + assert.NoError(t, err) + assert.Equal(t, "https://deno.land", resolved.Imports["my-mod"]) + }) + + t.Run("throws error on missing import", func(t *testing.T) { + imPath := "supabase/functions/slug/deno.jsonc" + // Setup in-memory fs + fsys := fs.MapFS{ + imPath: &fs.MapFile{Data: []byte(`{ + "importMap": "../../import_map.json" + }`)}, + } + // Run test + resolved := ImportMap{} + err := resolved.LoadAsDeno(imPath, fsys) + // Check error + assert.ErrorIs(t, err, os.ErrNotExist) + assert.Empty(t, resolved.Imports) + assert.Empty(t, resolved.Scopes) + }) +} diff --git a/pkg/function/deploy.go b/pkg/function/deploy.go index a419fc3c3..becf6929d 100644 --- a/pkg/function/deploy.go +++ b/pkg/function/deploy.go @@ -1,7 +1,6 @@ package function import ( - "bytes" "context" "encoding/json" "fmt" @@ -9,17 +8,13 @@ import ( "io/fs" "mime/multipart" "os" - "path" "path/filepath" - "regexp" - "strings" "github.com/go-errors/errors" "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/config" "github.com/supabase/cli/pkg/queue" - "github.com/tidwall/jsonc" ) var ErrNoDeploy = errors.New("All Functions are up to date.") @@ -188,161 +183,3 @@ func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs. } return importMap.WalkImportPaths(meta.EntrypointPath, addFile) } - -type ImportMap struct { - Imports map[string]string `json:"imports"` - Scopes map[string]map[string]string `json:"scopes"` - // Fallback reference for deno.json - ImportMap string `json:"importMap"` -} - -func (m *ImportMap) LoadAsDeno(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error { - if err := m.Load(imPath, fsys, opts...); err != nil { - return err - } - if strings.EqualFold(path.Base(imPath), "deno.json") && m.IsReference() { - imPath = path.Join(path.Dir(imPath), m.ImportMap) - if err := m.Load(imPath, fsys, opts...); err != nil { - return err - } - } - return nil -} - -func (m *ImportMap) IsReference() bool { - // Ref: https://github.com/denoland/deno/blob/main/cli/schemas/config-file.v1.json#L273 - return len(m.Imports) == 0 && len(m.Scopes) == 0 && len(m.ImportMap) > 0 -} - -func (m *ImportMap) Load(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error { - data, err := fs.ReadFile(fsys, filepath.FromSlash(imPath)) - if err != nil { - return errors.Errorf("failed to load import map: %w", err) - } - if err := m.Parse(data); err != nil { - return err - } - if err := m.Resolve(imPath, fsys); err != nil { - return err - } - for _, apply := range opts { - if err := apply(imPath, bytes.NewReader(data)); err != nil { - return err - } - } - return nil -} - -func (m *ImportMap) Parse(data []byte) error { - data = jsonc.ToJSONInPlace(data) - decoder := json.NewDecoder(bytes.NewReader(data)) - if err := decoder.Decode(&m); err != nil { - return errors.Errorf("failed to parse import map: %w", err) - } - return nil -} - -func (m *ImportMap) Resolve(imPath string, fsys fs.FS) error { - // Resolve all paths relative to current file - for k, v := range m.Imports { - m.Imports[k] = resolveHostPath(imPath, v, fsys) - } - for module, mapping := range m.Scopes { - for k, v := range mapping { - m.Scopes[module][k] = resolveHostPath(imPath, v, fsys) - } - } - return nil -} - -func resolveHostPath(jsonPath, hostPath string, fsys fs.FS) string { - // Leave absolute paths unchanged - if path.IsAbs(hostPath) { - return hostPath - } - resolved := path.Join(path.Dir(jsonPath), hostPath) - if _, err := fs.Stat(fsys, filepath.FromSlash(resolved)); err != nil { - // Leave URLs unchanged - return hostPath - } - // Directory imports need to be suffixed with / - // Ref: https://deno.com/manual@v1.33.0/basics/import_maps - if strings.HasSuffix(hostPath, "/") { - resolved += "/" - } - // Relative imports must be prefixed with ./ or ../ - if !path.IsAbs(resolved) { - resolved = "./" + resolved - } - return resolved -} - -// Ref: https://regex101.com/r/DfBdJA/1 -var importPathPattern = regexp.MustCompile(`(?i)(?:import|export)\s+(?:{[^{}]+}|.*?)\s*(?:from)?\s*['"](.*?)['"]|import\(\s*['"](.*?)['"]\)`) - -func (importMap *ImportMap) WalkImportPaths(srcPath string, readFile func(curr string, w io.Writer) error) error { - seen := map[string]struct{}{} - // DFS because it's more efficient to pop from end of array - q := make([]string, 1) - q[0] = srcPath - for len(q) > 0 { - curr := q[len(q)-1] - q = q[:len(q)-1] - // Assume no file is symlinked - if _, ok := seen[curr]; ok { - continue - } - seen[curr] = struct{}{} - // Read into memory for regex match later - var buf bytes.Buffer - if err := readFile(curr, &buf); errors.Is(err, os.ErrNotExist) { - fmt.Fprintln(os.Stderr, "WARN:", err) - continue - } else if err != nil { - return err - } - // Traverse all modules imported by the current source file - for _, matches := range importPathPattern.FindAllStringSubmatch(buf.String(), -1) { - if len(matches) < 3 { - continue - } - // Matches 'from' clause if present, else fallback to 'import' - mod := matches[1] - if len(mod) == 0 { - mod = matches[2] - } - mod = strings.TrimSpace(mod) - // Substitute kv from import map - substituted := false - for k, v := range importMap.Imports { - if strings.HasPrefix(mod, k) { - mod = v + mod[len(k):] - substituted = true - } - } - // Ignore URLs and directories, assuming no sloppy imports - // https://github.com/denoland/deno/issues/2506#issuecomment-2727635545 - if len(path.Ext(mod)) == 0 { - continue - } - // Deno import path must begin with one of these prefixes - if !isRelPath(mod) && !isAbsPath(mod) { - continue - } - if isRelPath(mod) && !substituted { - mod = path.Join(path.Dir(curr), mod) - } - // Cleans import path to help detect duplicates - q = append(q, path.Clean(mod)) - } - } - return nil -} - -func isRelPath(mod string) bool { - return strings.HasPrefix(mod, "./") || strings.HasPrefix(mod, "../") -} - -func isAbsPath(mod string) bool { - return strings.HasPrefix(mod, "/") -} diff --git a/pkg/function/deploy_test.go b/pkg/function/deploy_test.go index dbbb44b45..5655697fa 100644 --- a/pkg/function/deploy_test.go +++ b/pkg/function/deploy_test.go @@ -3,9 +3,7 @@ package function import ( "bytes" "context" - "embed" "errors" - "io" "mime/multipart" "net/http" "os" @@ -15,90 +13,12 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/config" ) -//go:embed testdata -var testImports embed.FS - -type MockFS struct { - mock.Mock -} - -func (m *MockFS) ReadFile(srcPath string, w io.Writer) error { - _ = m.Called(srcPath) - data, err := testImports.ReadFile(srcPath) - if err != nil { - return err - } - if _, err := w.Write(data); err != nil { - return err - } - return nil -} - -func TestImportPaths(t *testing.T) { - t.Run("iterates all import paths", func(t *testing.T) { - // Setup in-memory fs - fsys := MockFS{} - fsys.On("ReadFile", "/modules/my-module.ts").Once() - fsys.On("ReadFile", "testdata/modules/imports.ts").Once() - fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() - // Run test - im := ImportMap{} - err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) - // Check error - assert.NoError(t, err) - fsys.AssertExpectations(t) - }) - - t.Run("iterates with import map", func(t *testing.T) { - // Setup in-memory fs - fsys := MockFS{} - fsys.On("ReadFile", "/modules/my-module.ts").Once() - fsys.On("ReadFile", "testdata/modules/imports.ts").Once() - fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() - fsys.On("ReadFile", "testdata/shared/whatever.ts").Once() - fsys.On("ReadFile", "testdata/shared/mod.ts").Once() - fsys.On("ReadFile", "testdata/nested/index.ts").Once() - // Setup deno.json - im := ImportMap{Imports: map[string]string{ - "module-name/": "../shared/", - }} - assert.NoError(t, im.Resolve("testdata/modules/deno.json", testImports)) - // Run test - err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) - // Check error - assert.NoError(t, err) - fsys.AssertExpectations(t) - }) - - t.Run("resolves legacy import map", func(t *testing.T) { - // Setup in-memory fs - fsys := MockFS{} - fsys.On("ReadFile", "/modules/my-module.ts").Once() - fsys.On("ReadFile", "testdata/modules/imports.ts").Once() - fsys.On("ReadFile", "testdata/geometries/Geometries.js").Once() - fsys.On("ReadFile", "testdata/shared/whatever.ts").Once() - fsys.On("ReadFile", "testdata/shared/mod.ts").Once() - fsys.On("ReadFile", "testdata/nested/index.ts").Once() - // Setup legacy import map - im := ImportMap{Imports: map[string]string{ - "module-name/": "./shared/", - }} - assert.NoError(t, im.Resolve("testdata/import_map.json", testImports)) - // Run test - err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) - // Check error - assert.NoError(t, err) - fsys.AssertExpectations(t) - }) -} - func assertFormEqual(t *testing.T, actual []byte) { snapshot := path.Join("testdata", path.Base(t.Name())+".form") expected, err := testImports.ReadFile(snapshot) From 4b6489e0148dc233e088c7619e4cc93bf5173a41 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Mon, 14 Apr 2025 02:25:59 +0800 Subject: [PATCH 046/359] chore: correct typo --- pkg/function/deploy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/function/deploy.go b/pkg/function/deploy.go index becf6929d..ed105b668 100644 --- a/pkg/function/deploy.go +++ b/pkg/function/deploy.go @@ -142,7 +142,7 @@ func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs. fmt.Fprintf(os.Stderr, "Uploading asset (%s): %s\n", *meta.Name, srcPath) f, err := form.CreateFormFile("file", srcPath) if err != nil { - return errors.Errorf("failed to create map: %w", err) + return errors.Errorf("failed to create form: %w", err) } if _, err := io.Copy(f, r); err != nil { return errors.Errorf("failed to write form: %w", err) From ce740505d0712e4c2b90fac150307530319c110d Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 14 Apr 2025 23:23:14 +0800 Subject: [PATCH 047/359] fix: log url only for debugging http requests (#3200) fix: log url only for debugging http --- cmd/root.go | 4 ++- internal/debug/http.go | 24 ++++++++++++++++++ internal/utils/api.go | 56 ------------------------------------------ 3 files changed, 27 insertions(+), 57 deletions(-) create mode 100644 internal/debug/http.go diff --git a/cmd/root.go b/cmd/root.go index 1e50cf8fb..54d88b0b8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "net" + "net/http" "net/url" "os" "os/signal" @@ -15,6 +16,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/supabase/cli/internal/debug" "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/internal/utils/flags" "golang.org/x/mod/semver" @@ -114,7 +116,7 @@ var ( } // Prepare context if viper.GetBool("DEBUG") { - ctx = utils.WithTraceContext(ctx) + http.DefaultTransport = debug.NewTransport() fmt.Fprintln(os.Stderr, cmd.Root().Short) } cmd.SetContext(ctx) diff --git a/internal/debug/http.go b/internal/debug/http.go new file mode 100644 index 000000000..b22f6bbc8 --- /dev/null +++ b/internal/debug/http.go @@ -0,0 +1,24 @@ +package debug + +import ( + "log" + "net/http" + "os" +) + +type debugTransport struct { + http.RoundTripper + logger *log.Logger +} + +func (t *debugTransport) RoundTrip(req *http.Request) (*http.Response, error) { + t.logger.Printf("%s: %s\n", req.Method, req.URL) + return t.RoundTripper.RoundTrip(req) +} + +func NewTransport() http.RoundTripper { + return &debugTransport{ + http.DefaultTransport, + log.New(os.Stderr, "HTTP ", log.LstdFlags|log.Lmsgprefix), + } +} diff --git a/internal/utils/api.go b/internal/utils/api.go index 32b199b69..ac8cbc024 100644 --- a/internal/utils/api.go +++ b/internal/utils/api.go @@ -2,14 +2,11 @@ package utils import ( "context" - "crypto/tls" "encoding/json" "fmt" "log" "net" "net/http" - "net/http/httptrace" - "net/textproto" "sync" "github.com/go-errors/errors" @@ -79,59 +76,6 @@ func ResolveCNAME(ctx context.Context, host string) (string, error) { return "", errors.Errorf("failed to locate appropriate CNAME record for %s; resolves to %+v", host, serialized) } -func WithTraceContext(ctx context.Context) context.Context { - trace := &httptrace.ClientTrace{ - DNSStart: func(info httptrace.DNSStartInfo) { - log.Printf("DNS Start: %+v\n", info) - }, - DNSDone: func(info httptrace.DNSDoneInfo) { - if info.Err != nil { - log.Println("DNS Error:", info.Err) - } else { - log.Printf("DNS Done: %+v\n", info) - } - }, - ConnectStart: func(network, addr string) { - log.Println("Connect Start:", network, addr) - }, - ConnectDone: func(network, addr string, err error) { - if err != nil { - log.Println("Connect Error:", network, addr, err) - } else { - log.Println("Connect Done:", network, addr) - } - }, - TLSHandshakeStart: func() { - log.Println("TLS Start") - }, - TLSHandshakeDone: func(cs tls.ConnectionState, err error) { - if err != nil { - log.Println("TLS Error:", err) - } else { - log.Printf("TLS Done: %+v\n", cs) - } - }, - WroteHeaderField: func(key string, value []string) { - log.Println("Sent Header:", key, value) - }, - WroteRequest: func(wr httptrace.WroteRequestInfo) { - if wr.Err != nil { - log.Println("Send Error:", wr.Err) - } else { - log.Println("Send Done") - } - }, - Got1xxResponse: func(code int, header textproto.MIMEHeader) error { - log.Println("Recv 1xx:", code, header) - return nil - }, - GotFirstResponseByte: func() { - log.Println("Recv First Byte") - }, - } - return httptrace.WithClientTrace(ctx, trace) -} - type DialContextFunc func(context.Context, string, string) (net.Conn, error) // Wraps a DialContext with DNS-over-HTTPS as fallback resolver From 08ce4e48f91653af24cd05205442bdd08ea8f398 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 04:12:11 +0000 Subject: [PATCH 048/359] chore(deps): bump github.com/ecies/go/v2 from 2.0.10 to 2.0.11 (#3441) Bumps [github.com/ecies/go/v2](https://github.com/ecies/go) from 2.0.10 to 2.0.11. - [Release notes](https://github.com/ecies/go/releases) - [Commits](https://github.com/ecies/go/compare/v2.0.10...v2.0.11) --- updated-dependencies: - dependency-name: github.com/ecies/go/v2 dependency-version: 2.0.11 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 | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 0d8bd6925..9014d8103 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/docker/docker v28.0.4+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 - github.com/ecies/go/v2 v2.0.10 + github.com/ecies/go/v2 v2.0.11 github.com/getsentry/sentry-go v0.32.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.15.0 @@ -117,7 +117,7 @@ require ( github.com/danieljoos/wincred v1.2.2 // indirect github.com/dave/dst v0.27.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect @@ -128,7 +128,7 @@ require ( github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect github.com/emirpasic/gods v1.18.1 // indirect - github.com/ethereum/go-ethereum v1.14.13 // indirect + github.com/ethereum/go-ethereum v1.15.8 // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fatih/structtag v1.2.0 // indirect diff --git a/go.sum b/go.sum index 04ff0f4e1..cbe22a918 100644 --- a/go.sum +++ b/go.sum @@ -224,8 +224,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= @@ -260,8 +260,8 @@ github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960/go.mod h1:9HQzr9D/ github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aTknUK9w6DHLDox2r2M3DI4i2pnd3w= github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936/go.mod h1:ttYvX5qlB+mlV1okblJqcSMtR4c52UKxDiX9GRBS8+Q= github.com/dvsekhvalnov/jose2go v0.0.0-20170216131308-f21a8cedbbae/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= -github.com/ecies/go/v2 v2.0.10 h1:AaLxGio0MLLbvWur4rKnLzw+K9zI+wMScIDAtqCqOtU= -github.com/ecies/go/v2 v2.0.10/go.mod h1:N73OyuR6tuKznit2LhXjrZ0XAQ234uKbzYz8pEPYzlI= +github.com/ecies/go/v2 v2.0.11 h1:xYhtMdLiqNi02oLirFmLyNbVXw6250h3WM6zJryQdiM= +github.com/ecies/go/v2 v2.0.11/go.mod h1:LPRzoefP0Tam+1uesQOq3Gtb6M2OwlFUnXBTtBAKfDQ= github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -271,8 +271,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= -github.com/ethereum/go-ethereum v1.14.13 h1:L81Wmv0OUP6cf4CW6wtXsr23RUrDhKs2+Y9Qto+OgHU= -github.com/ethereum/go-ethereum v1.14.13/go.mod h1:RAC2gVMWJ6FkxSPESfbshrcKpIokgQKsVKmAuqdekDY= +github.com/ethereum/go-ethereum v1.15.8 h1:H6NilvRXFVoHiXZ3zkuTqKW5XcxjLZniV5UjxJt1GJU= +github.com/ethereum/go-ethereum v1.15.8/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= From 2e8a095c9d64f9353d3085a66d7eda84350210a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 04:17:28 +0000 Subject: [PATCH 049/359] chore(deps): bump github.com/go-git/go-git/v5 from 5.15.0 to 5.16.0 (#3442) Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.15.0 to 5.16.0. - [Release notes](https://github.com/go-git/go-git/releases) - [Commits](https://github.com/go-git/go-git/compare/v5.15.0...v5.16.0) --- updated-dependencies: - dependency-name: github.com/go-git/go-git/v5 dependency-version: 5.16.0 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 9014d8103..d36b821db 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/ecies/go/v2 v2.0.11 github.com/getsentry/sentry-go v0.32.0 github.com/go-errors/errors v1.5.1 - github.com/go-git/go-git/v5 v5.15.0 + github.com/go-git/go-git/v5 v5.16.0 github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golang-jwt/jwt/v5 v5.2.2 diff --git a/go.sum b/go.sum index cbe22a918..1c76a1ad1 100644 --- a/go.sum +++ b/go.sum @@ -311,8 +311,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.15.0 h1:f5Qn0W0F7ry1iN0ZwIU5m/n7/BKB4hiZfc+zlZx7ly0= -github.com/go-git/go-git/v5 v5.15.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= +github.com/go-git/go-git/v5 v5.16.0 h1:k3kuOEpkc0DeY7xlL6NaaNg39xdgQbtH5mwCafHO9AQ= +github.com/go-git/go-git/v5 v5.16.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 7612323132743f1044f67a78321bff1ed0a46f9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 04:22:34 +0000 Subject: [PATCH 050/359] chore(deps): bump github.com/golangci/golangci-lint/v2 from 2.1.1 to 2.1.2 (#3443) chore(deps): bump github.com/golangci/golangci-lint/v2 Bumps [github.com/golangci/golangci-lint/v2](https://github.com/golangci/golangci-lint) from 2.1.1 to 2.1.2. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/main/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v2.1.1...v2.1.2) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint/v2 dependency-version: 2.1.2 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 | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index d36b821db..2e1a9633b 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golang-jwt/jwt/v5 v5.2.2 - github.com/golangci/golangci-lint/v2 v2.1.1 + github.com/golangci/golangci-lint/v2 v2.1.2 github.com/google/go-github/v62 v62.0.0 github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 @@ -138,7 +138,7 @@ require ( github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/getkin/kin-openapi v0.127.0 // indirect - github.com/ghostiam/protogetter v0.3.13 // indirect + github.com/ghostiam/protogetter v0.3.15 // indirect github.com/go-critic/go-critic v0.13.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.2 // indirect @@ -204,11 +204,11 @@ require ( github.com/kulti/thelper v0.6.3 // indirect github.com/kunwardeep/paralleltest v1.0.14 // indirect github.com/lasiar/canonicalheader v1.1.2 // indirect - github.com/ldez/exptostd v0.4.2 // indirect + github.com/ldez/exptostd v0.4.3 // indirect github.com/ldez/gomoddirectives v0.6.1 // indirect github.com/ldez/grignotin v0.9.0 // indirect github.com/ldez/tagliatelle v0.7.1 // indirect - github.com/ldez/usetesting v0.4.2 // indirect + github.com/ldez/usetesting v0.4.3 // 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 @@ -337,6 +337,6 @@ require ( gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect honnef.co/go/tools v0.6.1 // indirect - mvdan.cc/gofumpt v0.7.0 // indirect + mvdan.cc/gofumpt v0.8.0 // indirect mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect ) diff --git a/go.sum b/go.sum index 1c76a1ad1..fbcfde32c 100644 --- a/go.sum +++ b/go.sum @@ -297,8 +297,8 @@ github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3 github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= github.com/getsentry/sentry-go v0.32.0 h1:YKs+//QmwE3DcYtfKRH8/KyOOF/I6Qnx7qYGNHCGmCY= github.com/getsentry/sentry-go v0.32.0/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY= -github.com/ghostiam/protogetter v0.3.13 h1:T4qt1JU0xvx8+jO30+JaA49fngUd6YNajqwk0Rn3t1s= -github.com/ghostiam/protogetter v0.3.13/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= +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= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-critic/go-critic v0.13.0 h1:kJzM7wzltQasSUXtYyTl6UaPVySO6GkaR1thFnJ6afY= @@ -417,8 +417,8 @@ github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUP github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY= -github.com/golangci/golangci-lint/v2 v2.1.1 h1:h0S97dn3HpK12QzzPjoPxgMUqweM7m34j/QNV6iVg5g= -github.com/golangci/golangci-lint/v2 v2.1.1/go.mod h1:zJJo4g7aGiCv5cRYa+YUaWVazNBRzn4Kg7hdEKV0iXU= +github.com/golangci/golangci-lint/v2 v2.1.2 h1:bcOB+jVr4EYEgOEIskQIhtdxOpIGl+iOCwliG/hNPXw= +github.com/golangci/golangci-lint/v2 v2.1.2/go.mod h1:ApmXnYUmWDGu1CUZRkT3yzzFATmaViCY7BEtytG2AiU= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 h1:AkK+w9FZBXlU/xUmBtSJN1+tAI4FIvy5WtnUnY8e4p8= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95/go.mod h1:k9mmcyWKSTMcPPvQUCfRWWQ9VHJ1U9Dc0R7kaXAgtnQ= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= @@ -633,16 +633,16 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lasiar/canonicalheader v1.1.2 h1:vZ5uqwvDbyJCnMhmFYimgMZnJMjwljN5VGY0VKbMXb4= github.com/lasiar/canonicalheader v1.1.2/go.mod h1:qJCeLFS0G/QlLQ506T+Fk/fWMa2VmBUiEI2cuMK4djI= -github.com/ldez/exptostd v0.4.2 h1:l5pOzHBz8mFOlbcifTxzfyYbgEmoUqjxLFHZkjlbHXs= -github.com/ldez/exptostd v0.4.2/go.mod h1:iZBRYaUmcW5jwCR3KROEZ1KivQQp6PHXbDPk9hqJKCQ= +github.com/ldez/exptostd v0.4.3 h1:Ag1aGiq2epGePuRJhez2mzOpZ8sI9Gimcb4Sb3+pk9Y= +github.com/ldez/exptostd v0.4.3/go.mod h1:iZBRYaUmcW5jwCR3KROEZ1KivQQp6PHXbDPk9hqJKCQ= github.com/ldez/gomoddirectives v0.6.1 h1:Z+PxGAY+217f/bSGjNZr/b2KTXcyYLgiWI6geMBN2Qc= github.com/ldez/gomoddirectives v0.6.1/go.mod h1:cVBiu3AHR9V31em9u2kwfMKD43ayN5/XDgr+cdaFaKs= github.com/ldez/grignotin v0.9.0 h1:MgOEmjZIVNn6p5wPaGp/0OKWyvq42KnzAt/DAb8O4Ow= github.com/ldez/grignotin v0.9.0/go.mod h1:uaVTr0SoZ1KBii33c47O1M8Jp3OP3YDwhZCmzT9GHEk= github.com/ldez/tagliatelle v0.7.1 h1:bTgKjjc2sQcsgPiT902+aadvMjCeMHrY7ly2XKFORIk= github.com/ldez/tagliatelle v0.7.1/go.mod h1:3zjxUpsNB2aEZScWiZTHrAXOl1x25t3cRmzfK1mlo2I= -github.com/ldez/usetesting v0.4.2 h1:J2WwbrFGk3wx4cZwSMiCQQ00kjGR0+tuuyW0Lqm4lwA= -github.com/ldez/usetesting v0.4.2/go.mod h1:eEs46T3PpQ+9RgN9VjpY6qWdiw2/QmfiDeWmdZdrjIQ= +github.com/ldez/usetesting v0.4.3 h1:pJpN0x3fMupdTf/IapYjnkhiY1nSTN+pox1/GyBRw3k= +github.com/ldez/usetesting v0.4.3/go.mod h1:eEs46T3PpQ+9RgN9VjpY6qWdiw2/QmfiDeWmdZdrjIQ= 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= @@ -1515,8 +1515,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI= honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4= -mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= -mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= +mvdan.cc/gofumpt v0.8.0 h1:nZUCeC2ViFaerTcYKstMmfysj6uhQrA2vJe+2vwGU6k= +mvdan.cc/gofumpt v0.8.0/go.mod h1:vEYnSzyGPmjvFkqJWtXkh79UwPWP9/HMxQdGEXZHjpg= mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 h1:WjUu4yQoT5BHT1w8Zu56SP8367OuBV5jvo+4Ulppyf8= mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4/go.mod h1:rthT7OuvRbaGcd5ginj6dA2oLE7YNlta9qhBNNdCaLE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From d0f2d97d7e21e2f46993f3f9a24b6cf01ccab377 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 05:22:22 +0000 Subject: [PATCH 051/359] chore(deps): bump supabase/postgres-meta from v0.88.8 to v0.88.9 in /pkg/config/templates (#3446) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.88.8 to v0.88.9. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.88.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 419930136..5d5ce2989 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.015 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.8 AS postgrest -FROM supabase/postgres-meta:v0.88.8 AS pgmeta +FROM supabase/postgres-meta:v0.88.9 AS pgmeta FROM supabase/studio:2025.04.11-43cba0d AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From f246c67f31758d12be41238716e6868e69a30701 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 05:27:08 +0000 Subject: [PATCH 052/359] chore(deps): bump supabase/gotrue from v2.170.0 to v2.171.0 in /pkg/config/templates (#3445) chore(deps): bump supabase/gotrue in /pkg/config/templates Bumps supabase/gotrue from v2.170.0 to v2.171.0. --- updated-dependencies: - dependency-name: supabase/gotrue dependency-version: v2.171.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5d5ce2989..e0cd52f4c 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -10,7 +10,7 @@ FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.0 AS supavisor -FROM supabase/gotrue:v2.170.0 AS gotrue +FROM supabase/gotrue:v2.171.0 AS gotrue FROM supabase/realtime:v2.34.46 AS realtime FROM supabase/storage-api:v1.22.3 AS storage FROM supabase/logflare:1.12.0 AS logflare From 8740a089c745510947da62a120c9de499aa58ef5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 05:31:52 +0000 Subject: [PATCH 053/359] chore(deps): bump supabase/realtime from v2.34.46 to v2.34.47 in /pkg/config/templates (#3444) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.34.46 to v2.34.47. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.34.47 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e0cd52f4c..2086369a8 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.0 AS supavisor FROM supabase/gotrue:v2.171.0 AS gotrue -FROM supabase/realtime:v2.34.46 AS realtime +FROM supabase/realtime:v2.34.47 AS realtime FROM supabase/storage-api:v1.22.3 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From 0252986951ee897f8b2e5df6216984e254f35c86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 05:24:44 +0000 Subject: [PATCH 054/359] chore(deps): bump supabase/postgres from 17.4.1.015 to 17.4.1.016 in /pkg/config/templates (#3449) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.015 to 17.4.1.016. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.016 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 2086369a8..dbd820b1c 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.015 AS pg +FROM supabase/postgres:17.4.1.016 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From d9ee0ded5123d078a6166c70b2b6d2908c0bcc4e Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 17 Apr 2025 16:24:21 +0800 Subject: [PATCH 055/359] fix: bump studio to latest release (#3450) --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index dbd820b1c..bb51eaab3 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.8 AS postgrest FROM supabase/postgres-meta:v0.88.9 AS pgmeta -FROM supabase/studio:2025.04.11-43cba0d AS studio +FROM supabase/studio:2025.04.17-sha-c0bddbb AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From d1aad8ace391ab5a0e754a6346494baa9a5b77d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 08:29:10 +0000 Subject: [PATCH 056/359] chore(deps): bump postgrest/postgrest from v12.2.8 to v12.2.9 in /pkg/config/templates (#3448) chore(deps): bump postgrest/postgrest in /pkg/config/templates Bumps postgrest/postgrest from v12.2.8 to v12.2.9. --- updated-dependencies: - dependency-name: postgrest/postgrest dependency-version: v12.2.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index bb51eaab3..eee592333 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -3,7 +3,7 @@ FROM supabase/postgres:17.4.1.016 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit -FROM postgrest/postgrest:v12.2.8 AS postgrest +FROM postgrest/postgrest:v12.2.9 AS postgrest FROM supabase/postgres-meta:v0.88.9 AS pgmeta FROM supabase/studio:2025.04.17-sha-c0bddbb AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy From 6dcd61b141ca3b151b9f3f747b8d0b0bf5d7e3b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Apr 2025 04:43:01 +0000 Subject: [PATCH 057/359] chore(deps): bump github.com/docker/docker from 28.0.4+incompatible to 28.1.0+incompatible (#3451) chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.0.4+incompatible to 28.1.0+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v28.0.4...v28.1.0) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-version: 28.1.0+incompatible 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 | 3 ++- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2e1a9633b..0c76bc805 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/containers/common v0.62.3 github.com/docker/cli v28.0.4+incompatible - github.com/docker/docker v28.0.4+incompatible + github.com/docker/docker v28.1.0+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.11 @@ -228,6 +228,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moby/sys/atomicwriter v0.1.0 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/term v0.5.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect diff --git a/go.sum b/go.sum index fbcfde32c..c33da846e 100644 --- a/go.sum +++ b/go.sum @@ -240,8 +240,8 @@ github.com/docker/cli v28.0.4+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 v28.0.4+incompatible h1:JNNkBctYKurkw6FrHfKqY0nKIDf5nrbxjVBtS+cdcok= -github.com/docker/docker v28.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.1.0+incompatible h1:4iqpcWQCt3Txcz7iWIb1U3SZ/n9ffo4U+ryY5/3eOp0= +github.com/docker/docker v28.1.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= @@ -702,6 +702,8 @@ github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/z github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= +github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= From 7b8c01d1e8f004043254d97582b5239c24e22fb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Apr 2025 04:50:04 +0000 Subject: [PATCH 058/359] chore(deps): bump github.com/docker/cli from 28.0.4+incompatible to 28.1.0+incompatible (#3452) chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.0.4+incompatible to 28.1.0+incompatible. - [Commits](https://github.com/docker/cli/compare/v28.0.4...v28.1.0) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-version: 28.1.0+incompatible 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 | 6 +----- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 0c76bc805..1e5a90dfd 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 github.com/containers/common v0.62.3 - github.com/docker/cli v28.0.4+incompatible + github.com/docker/cli v28.1.0+incompatible github.com/docker/docker v28.1.0+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 @@ -109,7 +109,6 @@ require ( github.com/ckaznocha/intrange v0.3.1 // indirect github.com/cloudflare/circl v1.6.1 // 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.57.2 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect @@ -122,10 +121,8 @@ require ( github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect github.com/dnephin/pflag v1.0.7 // indirect - github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/go-metrics v0.0.1 // indirect - github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/ethereum/go-ethereum v1.15.8 // indirect @@ -171,7 +168,6 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gorilla/css v1.0.1 // indirect - github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.5.0 // indirect diff --git a/go.sum b/go.sum index c33da846e..f3dc9013d 100644 --- a/go.sum +++ b/go.sum @@ -235,8 +235,8 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v28.0.4+incompatible h1:pBJSJeNd9QeIWPjRcV91RVJihd/TXB77q1ef64XEu4A= -github.com/docker/cli v28.0.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.1.0+incompatible h1:WiJhUBbuIH/BsJtth+C1hPwra4P0nsKJiWy9ie5My5s= +github.com/docker/cli v28.1.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= @@ -254,7 +254,6 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4= github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960/go.mod h1:9HQzr9D/0PGwMEbC3d5AB7oi67+h4TsQqItC1GVYG58= github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aTknUK9w6DHLDox2r2M3DI4i2pnd3w= From a7bd6125df2e191c7da67e897fb00bcd618071ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Apr 2025 05:11:15 +0000 Subject: [PATCH 059/359] chore(deps): bump supabase/supavisor from 2.5.0 to 2.5.1 in /pkg/config/templates (#3454) chore(deps): bump supabase/supavisor in /pkg/config/templates Bumps supabase/supavisor from 2.5.0 to 2.5.1. --- updated-dependencies: - dependency-name: supabase/supavisor dependency-version: 2.5.1 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index eee592333..d574b3f51 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -9,7 +9,7 @@ FROM supabase/studio:2025.04.17-sha-c0bddbb AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector -FROM supabase/supavisor:2.5.0 AS supavisor +FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.171.0 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime FROM supabase/storage-api:v1.22.3 AS storage From 84d2adb24fa498b411a58d72a49b6230ac51a6ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 05:28:38 +0000 Subject: [PATCH 060/359] chore(deps): bump github.com/docker/docker from 28.1.0+incompatible to 28.1.1+incompatible (#3458) chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.1.0+incompatible to 28.1.1+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v28.1.0...v28.1.1) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-version: 28.1.1+incompatible 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 1e5a90dfd..f058518dc 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/containers/common v0.62.3 github.com/docker/cli v28.1.0+incompatible - github.com/docker/docker v28.1.0+incompatible + github.com/docker/docker v28.1.1+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.11 diff --git a/go.sum b/go.sum index f3dc9013d..d5a5984f8 100644 --- a/go.sum +++ b/go.sum @@ -240,8 +240,8 @@ github.com/docker/cli v28.1.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 v28.1.0+incompatible h1:4iqpcWQCt3Txcz7iWIb1U3SZ/n9ffo4U+ryY5/3eOp0= -github.com/docker/docker v28.1.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I= +github.com/docker/docker v28.1.1+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 8423f08efefbcc9460d98a9fd0d85518ca417e32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 05:35:30 +0000 Subject: [PATCH 061/359] chore(deps): bump github.com/docker/cli from 28.1.0+incompatible to 28.1.1+incompatible (#3459) chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.1.0+incompatible to 28.1.1+incompatible. - [Commits](https://github.com/docker/cli/compare/v28.1.0...v28.1.1) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-version: 28.1.1+incompatible 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 f058518dc..94c3e5e50 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 github.com/containers/common v0.62.3 - github.com/docker/cli v28.1.0+incompatible + github.com/docker/cli v28.1.1+incompatible github.com/docker/docker v28.1.1+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 diff --git a/go.sum b/go.sum index d5a5984f8..908028565 100644 --- a/go.sum +++ b/go.sum @@ -235,8 +235,8 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v28.1.0+incompatible h1:WiJhUBbuIH/BsJtth+C1hPwra4P0nsKJiWy9ie5My5s= -github.com/docker/cli v28.1.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k= +github.com/docker/cli v28.1.1+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= From 38126ba42827785a7eefbe35393226d9b4f5b00e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 06:50:59 +0000 Subject: [PATCH 062/359] chore(deps): bump supabase/studio from 2025.04.17-sha-c0bddbb to 2025.04.21-sha-173cc56 in /pkg/config/templates (#3462) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.04.17-sha-c0bddbb to 2025.04.21-sha-173cc56. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.04.21-sha-173cc56 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index d574b3f51..c513d0bbe 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.9 AS postgrest FROM supabase/postgres-meta:v0.88.9 AS pgmeta -FROM supabase/studio:2025.04.17-sha-c0bddbb AS studio +FROM supabase/studio:2025.04.21-sha-173cc56 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From eb21295489a1719485ad40d0d11d0544b0a6adc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 15:42:55 +0800 Subject: [PATCH 063/359] chore(deps): bump google.golang.org/grpc from 1.71.1 to 1.72.0 (#3460) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.71.1 to 1.72.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.71.1...v1.72.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.72.0 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 94c3e5e50..368ff3059 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( golang.org/x/mod v0.24.0 golang.org/x/oauth2 v0.29.0 golang.org/x/term v0.31.0 - google.golang.org/grpc v1.71.1 + google.golang.org/grpc v1.72.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.1 ) @@ -328,7 +328,7 @@ require ( golang.org/x/sys v0.32.0 // indirect golang.org/x/text v0.24.0 // indirect golang.org/x/tools v0.32.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 908028565..762c1c575 100644 --- a/go.sum +++ b/go.sum @@ -1439,8 +1439,8 @@ 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-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA= -google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:iK2jbkWL86DXjEx0qiHcRE9dE4/Ahua5k6V8OWFb//c= google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.0.5/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1456,8 +1456,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.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI= -google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= +google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= 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 7b70058e65cfa235c03728ad56207b814076885b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 15:56:23 +0800 Subject: [PATCH 064/359] chore(deps): bump supabase/postgres from 17.4.1.016 to 17.4.1.017 in /pkg/config/templates (#3466) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.016 to 17.4.1.017. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.017 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index c513d0bbe..309b0a629 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.016 AS pg +FROM supabase/postgres:17.4.1.017 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 0840653f8672f3941411ea6e5c1acbd5f36e051d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 08:01:28 +0000 Subject: [PATCH 065/359] chore(deps): bump postgrest/postgrest from v12.2.9 to v12.2.10 in /pkg/config/templates (#3463) chore(deps): bump postgrest/postgrest in /pkg/config/templates Bumps postgrest/postgrest from v12.2.9 to v12.2.10. --- updated-dependencies: - dependency-name: postgrest/postgrest dependency-version: v12.2.10 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 309b0a629..bcee3a0bc 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -3,7 +3,7 @@ FROM supabase/postgres:17.4.1.017 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit -FROM postgrest/postgrest:v12.2.9 AS postgrest +FROM postgrest/postgrest:v12.2.10 AS postgrest FROM supabase/postgres-meta:v0.88.9 AS pgmeta FROM supabase/studio:2025.04.21-sha-173cc56 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy From 1bcbc45e7bbd13b642b1ff2011f10534ed65936e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 16:02:57 +0800 Subject: [PATCH 066/359] chore(deps): bump github.com/containers/common from 0.62.3 to 0.63.0 (#3461) Bumps [github.com/containers/common](https://github.com/containers/common) from 0.62.3 to 0.63.0. - [Release notes](https://github.com/containers/common/releases) - [Commits](https://github.com/containers/common/compare/v0.62.3...v0.63.0) --- updated-dependencies: - dependency-name: github.com/containers/common dependency-version: 0.63.0 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> Co-authored-by: Han Qiao --- go.mod | 16 ++++++++-------- go.sum | 53 ++++++++++++++++++++++++++--------------------------- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/go.mod b/go.mod index 368ff3059..7f4bf61a0 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/charmbracelet/bubbletea v0.25.0 github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 - github.com/containers/common v0.62.3 + github.com/containers/common v0.63.0 github.com/docker/cli v28.1.1+incompatible github.com/docker/docker v28.1.1+incompatible github.com/docker/go-connections v0.5.0 @@ -109,7 +109,7 @@ require ( github.com/ckaznocha/intrange v0.3.1 // indirect github.com/cloudflare/circl v1.6.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect - github.com/containers/storage v1.57.2 // indirect + github.com/containers/storage v1.58.0 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/daixiang0/gci v0.13.6 // indirect @@ -121,7 +121,7 @@ require ( github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect github.com/dnephin/pflag v1.0.7 // indirect - github.com/docker/docker-credential-helpers v0.8.2 // indirect + github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect github.com/emirpasic/gods v1.18.1 // indirect @@ -131,7 +131,7 @@ require ( github.com/fatih/structtag v1.2.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/firefart/nonamedreturns v1.0.6 // indirect - github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/getkin/kin-openapi v0.127.0 // indirect @@ -142,7 +142,7 @@ require ( github.com/go-logr/logr v1.4.2 // indirect 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-openapi/swag v0.23.1 // 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 @@ -209,7 +209,7 @@ require ( github.com/lib/pq v1.10.9 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/macabu/inamedparam v0.2.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/mailru/easyjson v0.9.0 // indirect github.com/manuelarte/funcorder v0.2.1 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.1 // indirect @@ -239,7 +239,7 @@ require ( github.com/nunnatsa/ginkgolinter v0.19.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0 // indirect + github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pjbgf/sha1cd v0.3.2 // indirect @@ -328,7 +328,7 @@ require ( golang.org/x/sys v0.32.0 // indirect golang.org/x/text v0.24.0 // indirect golang.org/x/tools v0.32.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 762c1c575..b6e257b91 100644 --- a/go.sum +++ b/go.sum @@ -197,10 +197,10 @@ github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2 github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/containers/common v0.62.3 h1:aOGryqXfW6aKBbHbqOveH7zB+ihavUN03X/2pUSvWFI= -github.com/containers/common v0.62.3/go.mod h1:3R8kDox2prC9uj/a2hmXj/YjZz5sBEUNrcDiw51S0Lo= -github.com/containers/storage v1.57.2 h1:2roCtTyE9pzIaBDHibK72DTnYkPmwWaq5uXxZdaWK4U= -github.com/containers/storage v1.57.2/go.mod h1:i/Hb4lu7YgFr9G0K6BMjqW0BLJO1sFsnWQwj2UoWCUM= +github.com/containers/common v0.63.0 h1:ox6vgUYX5TSvt4W+bE36sYBVz/aXMAfRGVAgvknSjBg= +github.com/containers/common v0.63.0/go.mod h1:+3GCotSqNdIqM3sPs152VvW7m5+Mg8Kk+PExT3G9hZw= +github.com/containers/storage v1.58.0 h1:Q7SyyCCjqgT3wYNgRNIL8o/wUS92heIj2/cc8Sewvcc= +github.com/containers/storage v1.58.0/go.mod h1:w7Jl6oG+OpeLGLzlLyOZPkmUso40kjpzgrHUk5tyBlo= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -242,8 +242,8 @@ github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBi github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I= github.com/docker/docker v28.1.1+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/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= +github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= @@ -286,8 +286,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= -github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= @@ -328,8 +328,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= 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-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU= +github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0= 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= @@ -461,8 +461,8 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= -github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= @@ -656,8 +656,8 @@ github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i github.com/macabu/inamedparam v0.2.0 h1:VyPYpOc10nkhI2qeNUdh3Zket4fcZjEWe35poddBCpE= github.com/macabu/inamedparam v0.2.0/go.mod h1:+Pee9/YfGe5LJ62pYXqB89lJ+0k5bsR8Wgz/C0Zlq3U= github.com/magiconair/properties v1.5.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= +github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/manuelarte/funcorder v0.2.1 h1:7QJsw3qhljoZ5rH0xapIvjw31EcQeFbF31/7kQ/xS34= github.com/manuelarte/funcorder v0.2.1/go.mod h1:BQQ0yW57+PF9ZpjpeJDKOffEsQbxDFKW8F8zSMe/Zd0= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= @@ -755,22 +755,22 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.23.3 h1:edHxnszytJ4lD9D5Jjc4tiDkPBZ3siDeJJkUZJJVkp0= -github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM= +github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus= +github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.36.3 h1:hID7cr8t3Wp26+cYnfcjR6HpJ00fdogN6dqZ1t6IylU= -github.com/onsi/gomega v1.36.3/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= +github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= +github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= -github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= @@ -1104,8 +1104,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 h1:9kj3STMvgqy3YA4VQXBrN7925ICMxD5wzMRcgA30588= -golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac h1:TSSpLIG4v+p0rPv1pNOQtl1I8knsO4S9trOxNMOLVP4= @@ -1439,8 +1439,8 @@ 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-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= -google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= +google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950= +google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg= google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:iK2jbkWL86DXjEx0qiHcRE9dE4/Ahua5k6V8OWFb//c= google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.0.5/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1502,11 +1502,10 @@ gopkg.in/yaml.v3 v3.0.0-20191026110619-0b21df46bc1d/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/gotestsum v1.12.1 h1:dvcxFBTFR1QsQmrCQa4k/vDXow9altdYz4CjdW+XeBE= gotest.tools/gotestsum v1.12.1/go.mod h1:mwDmLbx9DIvr09dnAoGgQPLaSXszNpXpWo2bsQge5BE= -gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= -gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From dc88d7c4b1f0a89d1a5a857e2f6fa120c1bfce12 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 21 Apr 2025 16:41:19 +0800 Subject: [PATCH 067/359] fix: move services command to local dev group (#3465) --- cmd/services.go | 2 +- internal/services/services.go | 2 +- internal/utils/access_token.go | 4 ---- internal/utils/api.go | 3 ++- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cmd/services.go b/cmd/services.go index fe298cb43..955f6bc2b 100644 --- a/cmd/services.go +++ b/cmd/services.go @@ -8,7 +8,7 @@ import ( var ( servicesCmd = &cobra.Command{ - GroupID: groupManagementAPI, + GroupID: groupLocalDev, Use: "services", Short: "Show versions of all Supabase services", RunE: func(cmd *cobra.Command, args []string) error { diff --git a/internal/services/services.go b/internal/services/services.go index ebc08efca..588dedfbc 100644 --- a/internal/services/services.go +++ b/internal/services/services.go @@ -19,7 +19,7 @@ func Run(ctx context.Context, fsys afero.Fs) error { 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) { + if err := flags.LoadConfig(fsys); err != nil { fmt.Fprintln(os.Stderr, err) } diff --git a/internal/utils/access_token.go b/internal/utils/access_token.go index f7ef90a01..26b3dfddb 100644 --- a/internal/utils/access_token.go +++ b/internal/utils/access_token.go @@ -20,10 +20,6 @@ var ( const AccessTokenKey = "access-token" -func LoadAccessToken() (string, error) { - return LoadAccessTokenFS(afero.NewOsFs()) -} - func LoadAccessTokenFS(fsys afero.Fs) (string, error) { accessToken, err := loadAccessToken(fsys) if err != nil { diff --git a/internal/utils/api.go b/internal/utils/api.go index ac8cbc024..c67252b6b 100644 --- a/internal/utils/api.go +++ b/internal/utils/api.go @@ -10,6 +10,7 @@ import ( "sync" "github.com/go-errors/errors" + "github.com/spf13/afero" "github.com/spf13/viper" "github.com/supabase/cli/internal/utils/cloudflare" supabase "github.com/supabase/cli/pkg/api" @@ -116,7 +117,7 @@ func withFallbackDNS(dialContext DialContextFunc) DialContextFunc { func GetSupabase() *supabase.ClientWithResponses { clientOnce.Do(func() { - token, err := LoadAccessToken() + token, err := LoadAccessTokenFS(afero.NewOsFs()) if err != nil { log.Fatalln(err) } From ed28dfaebfca78837c06091f670842f290d651f5 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 22 Apr 2025 11:20:55 +0800 Subject: [PATCH 068/359] fix: race condition when deploying from concurrent jobs (#3469) --- pkg/function/batch.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/function/batch.go b/pkg/function/batch.go index ada209519..102d74c5b 100644 --- a/pkg/function/batch.go +++ b/pkg/function/batch.go @@ -6,6 +6,8 @@ import ( "fmt" "io" "os" + "strings" + "time" "github.com/cenkalti/backoff/v4" "github.com/docker/go-units" @@ -32,6 +34,7 @@ func (s *EdgeRuntimeAPI) UpsertFunctions(ctx context.Context, functionConfig con for _, f := range result { exists[f.Slug] = struct{}{} } + policy := backoff.WithContext(backoff.WithMaxRetries(backoff.NewExponentialBackOff(), maxRetries), ctx) var toUpdate []api.BulkUpdateFunctionBody OUTER: for slug, function := range functionConfig { @@ -59,12 +62,16 @@ OUTER: } functionSize := units.HumanSize(float64(body.Len())) fmt.Fprintf(os.Stderr, "Deploying Function: %s (script size: %s)\n", slug, functionSize) - policy := backoff.WithContext(backoff.WithMaxRetries(backoff.NewExponentialBackOff(), maxRetries), ctx) - result, err := backoff.RetryWithData(upsert, policy) + result, err := backoff.RetryNotifyWithData(upsert, policy, func(err error, d time.Duration) { + if strings.Contains(err.Error(), "Duplicated function slug") { + exists[slug] = struct{}{} + } + }) if err != nil { return err } toUpdate = append(toUpdate, result) + policy.Reset() } if len(toUpdate) > 1 { if resp, err := s.client.V1BulkUpdateFunctionsWithResponse(ctx, s.project, toUpdate); err != nil { From 0216048cd965520997f6ab24f51011d5fd5a7503 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 05:25:28 +0000 Subject: [PATCH 069/359] chore(deps): bump postgrest/postgrest from v12.2.10 to v12.2.11 in /pkg/config/templates (#3471) chore(deps): bump postgrest/postgrest in /pkg/config/templates Bumps postgrest/postgrest from v12.2.10 to v12.2.11. --- updated-dependencies: - dependency-name: postgrest/postgrest dependency-version: v12.2.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index bcee3a0bc..e93840b6b 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -3,7 +3,7 @@ FROM supabase/postgres:17.4.1.017 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit -FROM postgrest/postgrest:v12.2.10 AS postgrest +FROM postgrest/postgrest:v12.2.11 AS postgrest FROM supabase/postgres-meta:v0.88.9 AS pgmeta FROM supabase/studio:2025.04.21-sha-173cc56 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy From 7bcb4cc69d39b7b76f040f278b7a12b0eae8b49d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 05:08:03 +0000 Subject: [PATCH 070/359] chore(deps): bump supabase/storage-api from v1.22.3 to v1.22.5 in /pkg/config/templates (#3473) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.3 to v1.22.5. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e93840b6b..9f423f424 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.171.0 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.3 AS storage +FROM supabase/storage-api:v1.22.5 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 4165aa973449f979c28ef9cabe8e2e0442be9fd7 Mon Sep 17 00:00:00 2001 From: Nyannyacha Date: Thu, 24 Apr 2025 08:25:36 +0900 Subject: [PATCH 071/359] fix: decorator flag is missing when running bundle command --- internal/functions/deploy/bundle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index fa47b22fb..974838374 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -50,7 +50,7 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap } hostOutputPath := filepath.Join(hostOutputDir, "output.eszip") // Create exec command - cmd := []string{"bundle", "--entrypoint", utils.ToDockerPath(entrypoint), "--output", utils.ToDockerPath(hostOutputPath)} + cmd := []string{"bundle", "--entrypoint", utils.ToDockerPath(entrypoint), "--output", utils.ToDockerPath(hostOutputPath), "--decorator", "tc39"} if len(importMap) > 0 { cmd = append(cmd, "--import-map", utils.ToDockerPath(importMap)) } From fca7fd0ab8dfc946e66f460fbc513365f5e82658 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 24 Apr 2025 14:35:33 +0800 Subject: [PATCH 072/359] fix: pin storage migration instead of version (#3475) --- internal/db/start/start.go | 1 + internal/link/link.go | 27 +++++++++-------- internal/link/link_test.go | 48 ++++++++++++++++++++----------- internal/start/start.go | 13 ++------- internal/start/templates/kong.yml | 7 ----- pkg/config/config.go | 9 ++++-- pkg/config/storage.go | 1 + pkg/config/templates/Dockerfile | 2 +- 8 files changed, 56 insertions(+), 52 deletions(-) diff --git a/internal/db/start/start.go b/internal/db/start/start.go index 608e5ca61..bb3a97d67 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -305,6 +305,7 @@ func initStorageJob(host string) utils.DockerJob { Image: utils.Config.Storage.Image, Env: []string{ "DB_INSTALL_ROLES=false", + "DB_MIGRATIONS_FREEZE_AT=" + utils.Config.Storage.TargetMigration, "ANON_KEY=" + utils.Config.Auth.AnonKey.Value, "SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value, "PGRST_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, diff --git a/internal/link/link.go b/internal/link/link.go index d35321e2e..17d930605 100644 --- a/internal/link/link.go +++ b/internal/link/link.go @@ -45,7 +45,7 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func( // 2. Check database connection config := flags.GetDbConfigOptionalPassword(projectRef) if len(config.Password) > 0 { - if err := linkDatabase(ctx, config, options...); err != nil { + if err := linkDatabase(ctx, config, fsys, options...); err != nil { return err } // Save database password @@ -76,7 +76,7 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func( func LinkServices(ctx context.Context, projectRef, anonKey string, fsys afero.Fs) { // Ignore non-fatal errors linking services var wg sync.WaitGroup - wg.Add(8) + wg.Add(7) go func() { defer wg.Done() if err := linkDatabaseSettings(ctx, projectRef); err != nil && viper.GetBool("DEBUG") { @@ -120,12 +120,6 @@ func LinkServices(ctx context.Context, projectRef, anonKey string, fsys afero.Fs fmt.Fprintln(os.Stderr, err) } }() - go func() { - defer wg.Done() - if err := linkStorageVersion(ctx, api, fsys); err != nil && viper.GetBool("DEBUG") { - fmt.Fprintln(os.Stderr, err) - } - }() wg.Wait() } @@ -178,12 +172,14 @@ func linkStorage(ctx context.Context, projectRef string) error { return nil } -func linkStorageVersion(ctx context.Context, api tenant.TenantAPI, fsys afero.Fs) error { - version, err := api.GetStorageVersion(ctx) - if err != nil { - return err +const GET_LATEST_STORAGE_MIGRATION = "SELECT name FROM storage.migrations ORDER BY id DESC LIMIT 1" + +func linkStorageVersion(ctx context.Context, conn *pgx.Conn, fsys afero.Fs) error { + var name string + if err := conn.QueryRow(ctx, GET_LATEST_STORAGE_MIGRATION).Scan(&name); err != nil { + return errors.Errorf("failed to fetch storage migration: %w", err) } - return utils.WriteFile(utils.StorageVersionPath, []byte(version), fsys) + return utils.WriteFile(utils.StorageVersionPath, []byte(name), fsys) } func linkDatabaseSettings(ctx context.Context, projectRef string) error { @@ -197,13 +193,16 @@ func linkDatabaseSettings(ctx context.Context, projectRef string) error { return nil } -func linkDatabase(ctx context.Context, config pgconn.Config, options ...func(*pgx.ConnConfig)) error { +func linkDatabase(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { conn, err := utils.ConnectByConfig(ctx, config, options...) if err != nil { return err } defer conn.Close(context.Background()) updatePostgresConfig(conn) + if err := linkStorageVersion(ctx, conn, fsys); err != nil { + fmt.Fprintln(os.Stderr, err) + } // If `schema_migrations` doesn't exist on the remote database, create it. if err := migration.CreateMigrationTable(ctx, conn); err != nil { return err diff --git a/internal/link/link_test.go b/internal/link/link_test.go index 18c090ad3..03c33f4bc 100644 --- a/internal/link/link_test.go +++ b/internal/link/link_test.go @@ -46,6 +46,8 @@ func TestLinkCommand(t *testing.T) { // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) + conn.Query(GET_LATEST_STORAGE_MIGRATION). + Reply("SELECT 1", []interface{}{"custom-metadata"}) helper.MockMigrationHistory(conn) helper.MockSeedHistory(conn) // Flush pending mocks after test execution @@ -98,10 +100,6 @@ func TestLinkCommand(t *testing.T) { Get("/rest/v1/"). Reply(200). JSON(rest) - gock.New("https://" + utils.GetSupabaseHost(project)). - Get("/storage/v1/version"). - Reply(200). - BodyString("0.40.4") // Run test err := Run(context.Background(), project, fsys, conn.Intercept) // Check error @@ -163,9 +161,6 @@ func TestLinkCommand(t *testing.T) { gock.New("https://" + utils.GetSupabaseHost(project)). Get("/rest/v1/"). ReplyError(errors.New("network error")) - gock.New("https://" + utils.GetSupabaseHost(project)). - Get("/storage/v1/version"). - ReplyError(errors.New("network error")) // Run test err := Run(context.Background(), project, fsys, func(cc *pgx.ConnConfig) { cc.LookupFunc = func(ctx context.Context, host string) (addrs []string, err error) { @@ -217,9 +212,6 @@ func TestLinkCommand(t *testing.T) { gock.New("https://" + utils.GetSupabaseHost(project)). Get("/rest/v1/"). ReplyError(errors.New("network error")) - gock.New("https://" + utils.GetSupabaseHost(project)). - Get("/storage/v1/version"). - ReplyError(errors.New("network error")) gock.New(utils.DefaultApiHost). Get("/v1/projects"). ReplyError(errors.New("network error")) @@ -237,6 +229,8 @@ func TestLinkCommand(t *testing.T) { func TestStatusCheck(t *testing.T) { project := "test-project" + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) t.Run("updates postgres version when healthy", func(t *testing.T) { // Setup in-memory fs @@ -372,50 +366,69 @@ func TestLinkPostgrest(t *testing.T) { func TestLinkDatabase(t *testing.T) { t.Run("throws error on connect failure", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.NewMemMapFs() // Run test - err := linkDatabase(context.Background(), pgconn.Config{}) + err := linkDatabase(context.Background(), pgconn.Config{}, fsys) // Check error assert.ErrorContains(t, err, "invalid port (outside range)") }) t.Run("ignores missing server version", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.NewMemMapFs() // Setup mock postgres conn := pgtest.NewWithStatus(map[string]string{ "standard_conforming_strings": "on", }) defer conn.Close(t) + conn.Query(GET_LATEST_STORAGE_MIGRATION). + Reply("SELECT 1", []interface{}{"custom-metadata"}) helper.MockMigrationHistory(conn) helper.MockSeedHistory(conn) // Run test - err := linkDatabase(context.Background(), dbConfig, conn.Intercept) + err := linkDatabase(context.Background(), dbConfig, fsys, conn.Intercept) // Check error assert.NoError(t, err) + version, err := afero.ReadFile(fsys, utils.StorageVersionPath) + assert.NoError(t, err) + assert.Equal(t, "custom-metadata", string(version)) }) t.Run("updates config to newer db version", func(t *testing.T) { utils.Config.Db.MajorVersion = 14 + // Setup in-memory fs + fsys := afero.NewMemMapFs() // Setup mock postgres conn := pgtest.NewWithStatus(map[string]string{ "standard_conforming_strings": "on", "server_version": "15.0", }) defer conn.Close(t) + conn.Query(GET_LATEST_STORAGE_MIGRATION). + Reply("SELECT 1", []interface{}{"custom-metadata"}) helper.MockMigrationHistory(conn) helper.MockSeedHistory(conn) // Run test - err := linkDatabase(context.Background(), dbConfig, conn.Intercept) + err := linkDatabase(context.Background(), dbConfig, fsys, conn.Intercept) // Check error assert.NoError(t, err) - utils.Config.Db.MajorVersion = 15 assert.Equal(t, uint(15), utils.Config.Db.MajorVersion) + version, err := afero.ReadFile(fsys, utils.StorageVersionPath) + assert.NoError(t, err) + assert.Equal(t, "custom-metadata", string(version)) }) t.Run("throws error on query failure", func(t *testing.T) { utils.Config.Db.MajorVersion = 14 + // Setup in-memory fs + fsys := afero.NewMemMapFs() // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(migration.SET_LOCK_TIMEOUT). + conn.Query(GET_LATEST_STORAGE_MIGRATION). + ReplyError(pgerrcode.InsufficientPrivilege, "permission denied for relation migrations"). + Query(migration.SET_LOCK_TIMEOUT). Query(migration.CREATE_VERSION_SCHEMA). Reply("CREATE SCHEMA"). Query(migration.CREATE_VERSION_TABLE). @@ -423,8 +436,11 @@ func TestLinkDatabase(t *testing.T) { Query(migration.ADD_STATEMENTS_COLUMN). Query(migration.ADD_NAME_COLUMN) // Run test - err := linkDatabase(context.Background(), dbConfig, conn.Intercept) + err := linkDatabase(context.Background(), dbConfig, fsys, conn.Intercept) // Check error assert.ErrorContains(t, err, "ERROR: permission denied for relation supabase_migrations (SQLSTATE 42501)") + exists, err := afero.Exists(fsys, utils.StorageVersionPath) + assert.NoError(t, err) + assert.False(t, exists) }) } diff --git a/internal/start/start.go b/internal/start/start.go index 4f31306b7..b13f88965 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -31,7 +31,6 @@ import ( "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/internal/utils/flags" "github.com/supabase/cli/pkg/config" - "golang.org/x/mod/semver" ) func Run(ctx context.Context, fsys afero.Fs, excludedContainers []string, ignoreHealthCheck bool) error { @@ -90,18 +89,10 @@ type kongConfig struct { ApiPort uint16 } -// TODO: deprecate after removing storage headers from kong -func StorageVersionBelow(target string) bool { - parts := strings.Split(utils.Config.Storage.Image, ":v") - return semver.Compare(parts[len(parts)-1], target) < 0 -} - var ( //go:embed templates/kong.yml kongConfigEmbed string - kongConfigTemplate = template.Must(template.New("kongConfig").Funcs(template.FuncMap{ - "StorageVersionBelow": StorageVersionBelow, - }).Parse(kongConfigEmbed)) + kongConfigTemplate = template.Must(template.New("kongConfig").Parse(kongConfigEmbed)) //go:embed templates/custom_nginx.template nginxConfigEmbed string @@ -838,6 +829,7 @@ EOF container.Config{ Image: utils.Config.Storage.Image, Env: []string{ + "DB_MIGRATIONS_FREEZE_AT=" + utils.Config.Storage.TargetMigration, "ANON_KEY=" + utils.Config.Auth.AnonKey.Value, "SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value, "AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, @@ -856,7 +848,6 @@ EOF "S3_PROTOCOL_ACCESS_KEY_ID=" + utils.Config.Storage.S3Credentials.AccessKeyId, "S3_PROTOCOL_ACCESS_KEY_SECRET=" + utils.Config.Storage.S3Credentials.SecretAccessKey, "S3_PROTOCOL_PREFIX=/storage/v1", - fmt.Sprintf("S3_ALLOW_FORWARDED_HEADER=%v", StorageVersionBelow("1.10.1")), "UPLOAD_FILE_SIZE_LIMIT=52428800000", "UPLOAD_FILE_SIZE_LIMIT_STANDARD=5242880000", }, diff --git a/internal/start/templates/kong.yml b/internal/start/templates/kong.yml index 8f1d28fd8..71f045344 100644 --- a/internal/start/templates/kong.yml +++ b/internal/start/templates/kong.yml @@ -119,13 +119,6 @@ services: - /storage/v1/ plugins: - name: cors -{{if StorageVersionBelow "1.10.1" }} - - name: request-transformer - config: - add: - headers: - - "Forwarded: host={{ .ApiHost }}:{{ .ApiPort }};proto=http" -{{end}} - name: pg-meta _comment: "pg-meta: /pg/* -> http://pg-meta:8080/*" url: http://{{ .PgmetaId }}:8080/ diff --git a/pkg/config/config.go b/pkg/config/config.go index 5471ca4e4..7fcf1cf88 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -615,13 +615,16 @@ func (c *config) Load(path string, fsys fs.FS) error { if version, err := fs.ReadFile(fsys, builder.RestVersionPath); err == nil && len(version) > 0 { c.Api.Image = replaceImageTag(Images.Postgrest, string(version)) } - if version, err := fs.ReadFile(fsys, builder.StorageVersionPath); err == nil && len(version) > 0 { - c.Storage.Image = replaceImageTag(Images.Storage, string(version)) - } if version, err := fs.ReadFile(fsys, builder.GotrueVersionPath); err == nil && len(version) > 0 { c.Auth.Image = replaceImageTag(Images.Gotrue, string(version)) } } + if version, err := fs.ReadFile(fsys, builder.StorageVersionPath); err == nil && len(version) > 0 { + // For backwards compatibility, exclude all strings that look like semver + if v := strings.TrimSpace(string(version)); !semver.IsValid(v) { + c.Storage.TargetMigration = v + } + } if version, err := fs.ReadFile(fsys, builder.EdgeRuntimeVersionPath); err == nil && len(version) > 0 { c.EdgeRuntime.Image = replaceImageTag(Images.EdgeRuntime, string(version)) } diff --git a/pkg/config/storage.go b/pkg/config/storage.go index 9b82ac6e9..fdb3b27ff 100644 --- a/pkg/config/storage.go +++ b/pkg/config/storage.go @@ -10,6 +10,7 @@ type ( storage struct { Enabled bool `toml:"enabled"` Image string `toml:"-"` + TargetMigration string `toml:"-"` ImgProxyImage string `toml:"-"` FileSizeLimit sizeInBytes `toml:"file_size_limit"` ImageTransformation *imageTransformation `toml:"image_transformation"` diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 9f423f424..88a090f2c 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.171.0 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.5 AS storage +FROM supabase/storage-api:v1.22.6 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 16ceb0a6f8310a94f6d9acdef0823d19ef028518 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 06:41:00 +0000 Subject: [PATCH 073/359] chore(deps): bump supabase/storage-api from v1.22.5 to v1.22.7 in /pkg/config/templates (#3477) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.5 to v1.22.7. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 88a090f2c..d3a028ba2 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.171.0 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.6 AS storage +FROM supabase/storage-api:v1.22.7 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 1669e83826cd010027ce38648ce4850b5c57a2eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 06:47:08 +0000 Subject: [PATCH 074/359] chore(deps): bump supabase/postgres from 17.4.1.017 to 17.4.1.019 in /pkg/config/templates (#3479) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.017 to 17.4.1.019. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.019 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index d3a028ba2..15e2e96a2 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.017 AS pg +FROM supabase/postgres:17.4.1.019 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From cfd7f06d6a6ae6acaf6796e745e77ff121bdb97e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 04:10:06 +0000 Subject: [PATCH 075/359] chore(deps): bump github.com/golangci/golangci-lint/v2 from 2.1.2 to 2.1.5 (#3482) chore(deps): bump github.com/golangci/golangci-lint/v2 Bumps [github.com/golangci/golangci-lint/v2](https://github.com/golangci/golangci-lint) from 2.1.2 to 2.1.5. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/main/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v2.1.2...v2.1.5) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint/v2 dependency-version: 2.1.5 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 | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 7f4bf61a0..96c41c447 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golang-jwt/jwt/v5 v5.2.2 - github.com/golangci/golangci-lint/v2 v2.1.2 + github.com/golangci/golangci-lint/v2 v2.1.5 github.com/google/go-github/v62 v62.0.0 github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 @@ -68,7 +68,6 @@ require ( github.com/Antonboom/nilnil v1.1.0 // indirect github.com/Antonboom/testifylint v1.6.1 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect - github.com/Crocmagnon/fatcontext v0.7.2 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect github.com/Masterminds/semver/v3 v3.3.1 // indirect @@ -306,6 +305,7 @@ require ( gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.13.0 // indirect go-simpler.org/sloglint v0.11.0 // indirect + go.augendre.info/fatcontext v0.8.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect diff --git a/go.sum b/go.sum index b6e257b91..b0a84118b 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Crocmagnon/fatcontext v0.7.2 h1:BY5/dUhs2kuD3sDn7vZrgOneRib5EHk9GOiyK8Vg+14= -github.com/Crocmagnon/fatcontext v0.7.2/go.mod h1:OAZCUteH59eiddbJZ9/bF4ppC140jYD/hepU2FDkFk4= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 h1:Sz1JIXEcSfhz7fUi7xHnhpIE0thVASYjvosApmHuD2k= @@ -416,8 +414,8 @@ github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUP github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY= -github.com/golangci/golangci-lint/v2 v2.1.2 h1:bcOB+jVr4EYEgOEIskQIhtdxOpIGl+iOCwliG/hNPXw= -github.com/golangci/golangci-lint/v2 v2.1.2/go.mod h1:ApmXnYUmWDGu1CUZRkT3yzzFATmaViCY7BEtytG2AiU= +github.com/golangci/golangci-lint/v2 v2.1.5 h1:zDcxV8s7kgQW3cpQiVA633CZJnKN/0iEXibPDWO8sZo= +github.com/golangci/golangci-lint/v2 v2.1.5/go.mod h1:RGcjZLyl9fSVLqxdKMrknPlspC3TYETLoKXyRG06RDo= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 h1:AkK+w9FZBXlU/xUmBtSJN1+tAI4FIvy5WtnUnY8e4p8= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95/go.mod h1:k9mmcyWKSTMcPPvQUCfRWWQ9VHJ1U9Dc0R7kaXAgtnQ= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= @@ -1022,6 +1020,8 @@ go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE= go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM= go-simpler.org/sloglint v0.11.0 h1:JlR1X4jkbeaffiyjLtymeqmGDKBDO1ikC6rjiuFAOco= go-simpler.org/sloglint v0.11.0/go.mod h1:CFDO8R1i77dlciGfPEPvYke2ZMx4eyGiEIWkyeW2Pvw= +go.augendre.info/fatcontext v0.8.0 h1:2dfk6CQbDGeu1YocF59Za5Pia7ULeAM6friJ3LP7lmk= +go.augendre.info/fatcontext v0.8.0/go.mod h1:oVJfMgwngMsHO+KB2MdgzcO+RvtNdiCEOlWvSFtax/s= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= From fc12a4013fb9fd84680f960107489429a7e912f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 04:58:28 +0000 Subject: [PATCH 076/359] chore(deps): bump supabase/postgres from 17.4.1.019 to 17.4.1.020 in /pkg/config/templates (#3484) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.019 to 17.4.1.020. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.020 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 15e2e96a2..252e808c9 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.019 AS pg +FROM supabase/postgres:17.4.1.020 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 58ad8686b68468c4d8d03e9abec6965c27fdb317 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 25 Apr 2025 23:16:51 +0800 Subject: [PATCH 077/359] fix: reuse flags for native bundler (#3485) --- internal/functions/deploy/bundle.go | 3 ++- pkg/function/bundle.go | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index 974838374..1bdc23fb9 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -50,7 +50,7 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap } hostOutputPath := filepath.Join(hostOutputDir, "output.eszip") // Create exec command - cmd := []string{"bundle", "--entrypoint", utils.ToDockerPath(entrypoint), "--output", utils.ToDockerPath(hostOutputPath), "--decorator", "tc39"} + cmd := []string{"bundle", "--entrypoint", utils.ToDockerPath(entrypoint), "--output", utils.ToDockerPath(hostOutputPath)} if len(importMap) > 0 { cmd = append(cmd, "--import-map", utils.ToDockerPath(importMap)) } @@ -60,6 +60,7 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap if viper.GetBool("DEBUG") { cmd = append(cmd, "--verbose") } + cmd = append(cmd, function.BundleFlags...) env := []string{} if custom_registry := os.Getenv("NPM_CONFIG_REGISTRY"); custom_registry != "" { diff --git a/pkg/function/bundle.go b/pkg/function/bundle.go index 486bd4be6..27e4d7660 100644 --- a/pkg/function/bundle.go +++ b/pkg/function/bundle.go @@ -29,8 +29,13 @@ func NewNativeBundler(tempDir string, fsys fs.FS) EszipBundler { } } -// Use a package private variable to allow testing without gosec complaining about G204 -var edgeRuntimeBin = "edge-runtime" +var ( + // Use a package private variable to allow testing without gosec complaining about G204 + edgeRuntimeBin = "edge-runtime" + BundleFlags = []string{ + "--decorator", "tc39", + } +) func (b *nativeBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (api.FunctionDeployMetadata, error) { meta := NewMetadata(slug, entrypoint, importMap, staticFiles) @@ -43,6 +48,7 @@ func (b *nativeBundler) Bundle(ctx context.Context, slug, entrypoint, importMap for _, staticFile := range staticFiles { args = append(args, "--static", staticFile) } + args = append(args, BundleFlags...) cmd := exec.CommandContext(ctx, edgeRuntimeBin, args...) cmd.Stderr = os.Stderr cmd.Stdout = os.Stdout From d745c729d4f8b77d4956b21cedf47c02813de892 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sat, 26 Apr 2025 01:53:05 +0800 Subject: [PATCH 078/359] fix: skip storage version when linking (#3488) --- internal/services/services.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/services/services.go b/internal/services/services.go index 588dedfbc..0d31891ac 100644 --- a/internal/services/services.go +++ b/internal/services/services.go @@ -80,7 +80,7 @@ func listRemoteImages(ctx context.Context, projectRef string) map[string]string return linked } api := tenant.NewTenantAPI(ctx, projectRef, keys.Anon) - wg.Add(3) + wg.Add(2) go func() { defer wg.Done() if version, err := api.GetGotrueVersion(ctx); err == nil { @@ -93,12 +93,6 @@ func listRemoteImages(ctx context.Context, projectRef string) map[string]string linked[utils.Config.Api.Image] = version } }() - go func() { - defer wg.Done() - if version, err := api.GetStorageVersion(ctx); err == nil { - linked[utils.Config.Storage.Image] = version - } - }() wg.Wait() return linked } From 27ca207b3924d25c8c83c235c7d89e96565d49dd Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sun, 27 Apr 2025 20:12:58 +0800 Subject: [PATCH 079/359] fix: retry on error listing functions (#3490) * fix: retry on error listing functions * chore: update unit tests --- pkg/function/batch.go | 26 ++++++++++++++++++-------- pkg/function/batch_test.go | 18 +++++++----------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/pkg/function/batch.go b/pkg/function/batch.go index 102d74c5b..32dbd7587 100644 --- a/pkg/function/batch.go +++ b/pkg/function/batch.go @@ -5,6 +5,7 @@ import ( "context" "fmt" "io" + "net/http" "os" "strings" "time" @@ -22,19 +23,28 @@ const ( ) func (s *EdgeRuntimeAPI) UpsertFunctions(ctx context.Context, functionConfig config.FunctionConfig, filter ...func(string) bool) error { - var result []api.FunctionResponse - if resp, err := s.client.V1ListAllFunctionsWithResponse(ctx, s.project); err != nil { - return errors.Errorf("failed to list functions: %w", err) - } else if resp.JSON200 == nil { - return errors.Errorf("unexpected list functions status %d: %s", resp.StatusCode(), string(resp.Body)) - } else { - result = *resp.JSON200 + policy := backoff.WithContext(backoff.WithMaxRetries(backoff.NewExponentialBackOff(), maxRetries), ctx) + result, err := backoff.RetryWithData(func() ([]api.FunctionResponse, error) { + resp, err := s.client.V1ListAllFunctionsWithResponse(ctx, s.project) + if err != nil { + return nil, errors.Errorf("failed to list functions: %w", err) + } else if resp.JSON200 == nil { + err = errors.Errorf("unexpected list functions status %d: %s", resp.StatusCode(), string(resp.Body)) + if resp.StatusCode() < http.StatusInternalServerError { + err = &backoff.PermanentError{Err: err} + } + return nil, err + } + return *resp.JSON200, nil + }, policy) + if err != nil { + return err } + policy.Reset() exists := make(map[string]struct{}, len(result)) for _, f := range result { exists[f.Slug] = struct{}{} } - policy := backoff.WithContext(backoff.WithMaxRetries(backoff.NewExponentialBackOff(), maxRetries), ctx) var toUpdate []api.BulkUpdateFunctionBody OUTER: for slug, function := range functionConfig { diff --git a/pkg/function/batch_test.go b/pkg/function/batch_test.go index f92bbf335..3830f4100 100644 --- a/pkg/function/batch_test.go +++ b/pkg/function/batch_test.go @@ -10,6 +10,7 @@ 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/pkg/api" "github.com/supabase/cli/pkg/config" ) @@ -41,28 +42,23 @@ func TestUpsertFunctions(t *testing.T) { era.eszip = &MockBundler{} }) - t.Run("throws error on network failure", func(t *testing.T) { + t.Run("retries on network failure", func(t *testing.T) { // Setup mock api defer gock.OffAll() gock.New(mockApiHost). Get("/v1/projects/" + mockProject + "/functions"). ReplyError(errors.New("network error")) - // Run test - err := client.UpsertFunctions(context.Background(), nil) - // Check error - assert.ErrorContains(t, err, "network error") - }) - - t.Run("throws error on service unavailable", func(t *testing.T) { - // Setup mock api - defer gock.OffAll() gock.New(mockApiHost). Get("/v1/projects/" + mockProject + "/functions"). Reply(http.StatusServiceUnavailable) + gock.New(mockApiHost). + Get("/v1/projects/" + mockProject + "/functions"). + Reply(http.StatusBadRequest) // Run test err := client.UpsertFunctions(context.Background(), nil) // Check error - assert.ErrorContains(t, err, "unexpected list functions status 503:") + assert.ErrorContains(t, err, "unexpected list functions status 400:") + assert.Empty(t, apitest.ListUnmatchedRequests()) }) t.Run("retries on create failure", func(t *testing.T) { From bd05f59c8b77c82d2ffd55d350e7b364e82dff2d Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sun, 27 Apr 2025 20:54:05 +0800 Subject: [PATCH 080/359] fix: retry bulk update endpoint on error (#3492) --- pkg/function/batch.go | 13 +++++--- pkg/function/batch_test.go | 61 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/pkg/function/batch.go b/pkg/function/batch.go index 32dbd7587..8cb902bdb 100644 --- a/pkg/function/batch.go +++ b/pkg/function/batch.go @@ -84,10 +84,15 @@ OUTER: policy.Reset() } if len(toUpdate) > 1 { - if resp, err := s.client.V1BulkUpdateFunctionsWithResponse(ctx, s.project, toUpdate); err != nil { - return errors.Errorf("failed to bulk update: %w", err) - } else if resp.JSON200 == nil { - return errors.Errorf("unexpected bulk update status %d: %s", resp.StatusCode(), string(resp.Body)) + if err := backoff.Retry(func() error { + if resp, err := s.client.V1BulkUpdateFunctionsWithResponse(ctx, s.project, toUpdate); err != nil { + return errors.Errorf("failed to bulk update: %w", err) + } else if resp.JSON200 == nil { + return errors.Errorf("unexpected bulk update status %d: %s", resp.StatusCode(), string(resp.Body)) + } + return nil + }, policy); err != nil { + return err } } return nil diff --git a/pkg/function/batch_test.go b/pkg/function/batch_test.go index 3830f4100..81e151e8a 100644 --- a/pkg/function/batch_test.go +++ b/pkg/function/batch_test.go @@ -42,6 +42,65 @@ func TestUpsertFunctions(t *testing.T) { era.eszip = &MockBundler{} }) + t.Run("deploys with bulk update", func(t *testing.T) { + // Setup mock api + defer gock.OffAll() + gock.New(mockApiHost). + Get("/v1/projects/" + mockProject + "/functions"). + Reply(http.StatusOK). + JSON([]api.FunctionResponse{{Slug: "test-a"}}) + gock.New(mockApiHost). + Patch("/v1/projects/" + mockProject + "/functions/test-a"). + Reply(http.StatusOK). + JSON(api.FunctionResponse{Slug: "test-a"}) + gock.New(mockApiHost). + Post("/v1/projects/" + mockProject + "/functions/test-b"). + Reply(http.StatusOK). + JSON(api.FunctionResponse{Slug: "test-b"}) + gock.New(mockApiHost). + Put("/v1/projects/" + mockProject + "/functions"). + ReplyError(errors.New("network error")) + gock.New(mockApiHost). + Put("/v1/projects/" + mockProject + "/functions"). + Reply(http.StatusServiceUnavailable) + gock.New(mockApiHost). + Put("/v1/projects/" + mockProject + "/functions"). + Reply(http.StatusOK). + JSON(api.V1BulkUpdateFunctionsResponse{}) + // Run test + err := client.UpsertFunctions(context.Background(), config.FunctionConfig{ + "test-a": {}, + "test-b": {}, + }) + // Check error + assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles concurrent deploy", func(t *testing.T) { + // Setup mock api + defer gock.OffAll() + gock.New(mockApiHost). + Get("/v1/projects/" + mockProject + "/functions"). + Reply(http.StatusOK). + JSON([]api.FunctionResponse{}) + gock.New(mockApiHost). + Post("/v1/projects/" + mockProject + "/functions"). + Reply(http.StatusBadRequest). + BodyString("Duplicated function slug") + gock.New(mockApiHost). + Patch("/v1/projects/" + mockProject + "/functions/test"). + Reply(http.StatusOK). + JSON(api.FunctionResponse{Slug: "test"}) + // Run test + err := client.UpsertFunctions(context.Background(), config.FunctionConfig{ + "test": {}, + }) + // Check error + assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + t.Run("retries on network failure", func(t *testing.T) { // Setup mock api defer gock.OffAll() @@ -84,6 +143,7 @@ func TestUpsertFunctions(t *testing.T) { }) // Check error assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) }) t.Run("retries on update failure", func(t *testing.T) { @@ -109,5 +169,6 @@ func TestUpsertFunctions(t *testing.T) { }) // Check error assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) }) } From aea419c1185edfedd5b9717bbca1f4bee224b6f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 04:50:14 +0000 Subject: [PATCH 081/359] chore(deps): bump supabase/studio from 2025.04.21-sha-173cc56 to 2025.04.28-sha-dd03625 in /pkg/config/templates (#3494) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.04.21-sha-173cc56 to 2025.04.28-sha-dd03625. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.04.28-sha-dd03625 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 252e808c9..f4ba73434 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.11 AS postgrest FROM supabase/postgres-meta:v0.88.9 AS pgmeta -FROM supabase/studio:2025.04.21-sha-173cc56 AS studio +FROM supabase/studio:2025.04.28-sha-dd03625 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 1b59e5ca4298d1c535e1ea14c8f25e1adf6a36b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 04:55:55 +0000 Subject: [PATCH 082/359] chore(deps): bump supabase/postgres from 17.4.1.020 to 17.4.1.021 in /pkg/config/templates (#3495) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.020 to 17.4.1.021. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.021 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index f4ba73434..db289eac2 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.020 AS pg +FROM supabase/postgres:17.4.1.021 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 5f46c77f4bcc447f2dfc052e4f2bb20658f57c5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 04:55:36 +0000 Subject: [PATCH 083/359] chore(deps): bump supabase/storage-api from v1.22.7 to v1.22.8 in /pkg/config/templates (#3497) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.7 to v1.22.8. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index db289eac2..2fe49cec3 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.171.0 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.7 AS storage +FROM supabase/storage-api:v1.22.8 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 730c0c5b4ddf09397d2fdd1c31d2614148ce9d2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 05:00:25 +0000 Subject: [PATCH 084/359] chore(deps): bump supabase/postgres from 17.4.1.021 to 17.4.1.022 in /pkg/config/templates (#3498) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.021 to 17.4.1.022. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.022 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 2fe49cec3..01f1054e8 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.021 AS pg +FROM supabase/postgres:17.4.1.022 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From dc8dddbf2296343ee6aecd0964cb7c015afb7db9 Mon Sep 17 00:00:00 2001 From: Lenny Date: Tue, 29 Apr 2025 12:50:07 -0400 Subject: [PATCH 085/359] fix: use correct env var name to pass auth jwks to storage container (#3502) --- internal/start/start.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/start/start.go b/internal/start/start.go index b13f88965..609c39518 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -833,7 +833,7 @@ EOF "ANON_KEY=" + utils.Config.Auth.AnonKey.Value, "SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value, "AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, - fmt.Sprintf("AUTH_JWT_JWKS=%s", jwks), + fmt.Sprintf("JWT_JWKS=%s", jwks), fmt.Sprintf("DATABASE_URL=postgresql://supabase_storage_admin:%s@%s:%d/%s", dbConfig.Password, dbConfig.Host, dbConfig.Port, dbConfig.Database), fmt.Sprintf("FILE_SIZE_LIMIT=%v", utils.Config.Storage.FileSizeLimit), "STORAGE_BACKEND=file", From cb77a674e84300605d65c17c01692075af5dae01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 04:40:20 +0000 Subject: [PATCH 086/359] chore(deps): bump supabase/storage-api from v1.22.8 to v1.22.9 in /pkg/config/templates (#3503) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.8 to v1.22.9. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 01f1054e8..5cbd6f0d4 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.171.0 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.8 AS storage +FROM supabase/storage-api:v1.22.9 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From fdf87062b7085f99951496d590cfcf07b8bce967 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 04:37:30 +0000 Subject: [PATCH 087/359] chore(deps): bump supabase/storage-api from v1.22.9 to v1.22.11 in /pkg/config/templates (#3506) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.9 to v1.22.11. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5cbd6f0d4..cd3600a99 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.171.0 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.9 AS storage +FROM supabase/storage-api:v1.22.11 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 1e43131950d4d5a6d69432dc1bd942fa61352a49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 04:34:20 +0000 Subject: [PATCH 088/359] chore(deps): bump supabase/postgres from 17.4.1.022 to 17.4.1.026 in /pkg/config/templates (#3508) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.022 to 17.4.1.026. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.026 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index cd3600a99..fb6a7ea86 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.022 AS pg +FROM supabase/postgres:17.4.1.026 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 0bfa100c5bc3b2e5f09a69ccdd15c056c2650669 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 04:39:09 +0000 Subject: [PATCH 089/359] chore(deps): bump postgrest/postgrest from v12.2.11 to v12.2.12 in /pkg/config/templates (#3509) chore(deps): bump postgrest/postgrest in /pkg/config/templates Bumps postgrest/postgrest from v12.2.11 to v12.2.12. --- updated-dependencies: - dependency-name: postgrest/postgrest dependency-version: v12.2.12 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index fb6a7ea86..3ea4f8294 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -3,7 +3,7 @@ FROM supabase/postgres:17.4.1.026 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit -FROM postgrest/postgrest:v12.2.11 AS postgrest +FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.88.9 AS pgmeta FROM supabase/studio:2025.04.28-sha-dd03625 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy From a2da52792da44583b143dd4a04bbdb683234f4f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 12:54:07 +0800 Subject: [PATCH 090/359] chore(deps): bump golangci/golangci-lint-action from 7 to 8 (#3515) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 7 to 8. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v7...v8) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7cf2b30b..21ea80182 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: # Linter requires no cache cache: false - - uses: golangci/golangci-lint-action@v7 + - uses: golangci/golangci-lint-action@v8 with: args: --timeout 3m --verbose From 0b283072af45a34ebc6fdff1d489c77562177903 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 05:34:32 +0000 Subject: [PATCH 091/359] chore(deps): bump supabase/studio from 2025.04.28-sha-dd03625 to 2025.05.05-sha-3c3fe9b in /pkg/config/templates (#3518) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.04.28-sha-dd03625 to 2025.05.05-sha-3c3fe9b. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.05.05-sha-3c3fe9b dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 3ea4f8294..b343f6dcb 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.88.9 AS pgmeta -FROM supabase/studio:2025.04.28-sha-dd03625 AS studio +FROM supabase/studio:2025.05.05-sha-3c3fe9b AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 0759b2f614f131f0cf1b0bd9c6c8d7a80536ffad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 05:39:39 +0000 Subject: [PATCH 092/359] chore(deps): bump supabase/postgres from 17.4.1.026 to 17.4.1.027 in /pkg/config/templates (#3519) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.026 to 17.4.1.027. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.027 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index b343f6dcb..21196ea0f 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.026 AS pg +FROM supabase/postgres:17.4.1.027 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 776e47a1f9a75898833e6b9da5145e6ca2892e4c Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 5 May 2025 14:13:38 +0800 Subject: [PATCH 093/359] chore: remove keyring mock (#3517) * chore: remove keyring mock * chore: include files without tests in coverage --- .github/workflows/ci.yml | 5 +- internal/logout/logout_test.go | 2 +- internal/utils/credentials/store_mock.go | 68 ------------------------ 3 files changed, 4 insertions(+), 71 deletions(-) delete mode 100644 internal/utils/credentials/store_mock.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21ea80182..73a9b684d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,9 @@ jobs: # Required by: internal/utils/credentials/keyring_test.go - uses: t1m0thyj/unlock-keyring@v1 - run: | - go run gotest.tools/gotestsum -- -race -v -count=1 -coverprofile=coverage.out \ - `go list ./... | grep -Ev 'cmd|docs|examples|pkg/api|tools'` + pkgs=$(go list ./pkg/... | grep -Ev 'pkg/api' | paste -sd ',' -) + go run gotest.tools/gotestsum -- -race -v -count=1 ./... \ + -coverpkg="./cmd/...,./internal/...,${pkgs}" -coverprofile=coverage.out - uses: coverallsapp/github-action@v2 with: diff --git a/internal/logout/logout_test.go b/internal/logout/logout_test.go index 42f9f8ead..943f25bed 100644 --- a/internal/logout/logout_test.go +++ b/internal/logout/logout_test.go @@ -34,7 +34,7 @@ func TestLogoutCommand(t *testing.T) { }) t.Run("removes all Supabase CLI credentials", func(t *testing.T) { - t.Cleanup(credentials.MockInit()) + keyring.MockInit() require.NoError(t, credentials.StoreProvider.Set(utils.AccessTokenKey, token)) require.NoError(t, credentials.StoreProvider.Set("project1", "password1")) require.NoError(t, credentials.StoreProvider.Set("project2", "password2")) diff --git a/internal/utils/credentials/store_mock.go b/internal/utils/credentials/store_mock.go deleted file mode 100644 index 32715fc37..000000000 --- a/internal/utils/credentials/store_mock.go +++ /dev/null @@ -1,68 +0,0 @@ -package credentials - -import ( - "github.com/zalando/go-keyring" -) - -type mockProvider struct { - mockStore map[string]map[string]string - mockError error -} - -// Get retrieves the password for a project from the mock store. -func (m *mockProvider) Get(project string) (string, error) { - if m.mockError != nil { - return "", m.mockError - } - if pass, ok := m.mockStore[namespace][project]; ok { - return pass, nil - } - return "", keyring.ErrNotFound -} - -// Set stores the password for a project in the mock store. -func (m *mockProvider) Set(project, password string) error { - if m.mockError != nil { - return m.mockError - } - if m.mockStore == nil { - m.mockStore = make(map[string]map[string]string) - } - if m.mockStore[namespace] == nil { - m.mockStore[namespace] = make(map[string]string) - } - m.mockStore[namespace][project] = password - return nil -} - -// Delete removes the password for a project from the mock store. -func (m *mockProvider) Delete(project string) error { - if m.mockError != nil { - return m.mockError - } - if _, ok := m.mockStore[namespace][project]; ok { - delete(m.mockStore[namespace], project) - return nil - } - return keyring.ErrNotFound -} - -// DeleteAll removes all passwords from the mock store. -func (m *mockProvider) DeleteAll() error { - if m.mockError != nil { - return m.mockError - } - delete(m.mockStore, namespace) - return nil -} - -func MockInit() func() { - oldStore := StoreProvider - teardown := func() { - StoreProvider = oldStore - } - StoreProvider = &mockProvider{ - mockStore: map[string]map[string]string{}, - } - return teardown -} From 5d1fa9c5889fba2d85ef7c3a6a49a6bdffbb617a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 14:27:19 +0800 Subject: [PATCH 094/359] chore(deps): bump github.com/golangci/golangci-lint/v2 from 2.1.5 to 2.1.6 (#3516) chore(deps): bump github.com/golangci/golangci-lint/v2 Bumps [github.com/golangci/golangci-lint/v2](https://github.com/golangci/golangci-lint) from 2.1.5 to 2.1.6. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/main/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v2.1.5...v2.1.6) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint/v2 dependency-version: 2.1.6 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 | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 96c41c447..193d1f07b 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golang-jwt/jwt/v5 v5.2.2 - github.com/golangci/golangci-lint/v2 v2.1.5 + github.com/golangci/golangci-lint/v2 v2.1.6 github.com/google/go-github/v62 v62.0.0 github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 @@ -74,7 +74,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect github.com/ProtonMail/go-crypto v1.1.6 // indirect - github.com/alecthomas/chroma/v2 v2.16.0 // indirect + github.com/alecthomas/chroma/v2 v2.17.2 // indirect github.com/alecthomas/go-check-sumtype v0.3.1 // indirect github.com/alexkohler/nakedret/v2 v2.0.6 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect @@ -280,7 +280,7 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tdakkota/asciicheck v0.4.1 // indirect - github.com/tetafro/godot v1.5.0 // indirect + github.com/tetafro/godot v1.5.1 // indirect github.com/theupdateframework/notary v0.7.0 // indirect github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect github.com/timonwong/loggercheck v0.11.0 // indirect @@ -303,7 +303,7 @@ require ( github.com/yuin/goldmark v1.7.8 // indirect github.com/yuin/goldmark-emoji v1.0.5 // indirect gitlab.com/bosi/decorder v0.4.2 // indirect - go-simpler.org/musttag v0.13.0 // indirect + go-simpler.org/musttag v0.13.1 // indirect go-simpler.org/sloglint v0.11.0 // indirect go.augendre.info/fatcontext v0.8.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect diff --git a/go.sum b/go.sum index b0a84118b..62d3f9c73 100644 --- a/go.sum +++ b/go.sum @@ -75,8 +75,8 @@ github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMz github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/chroma/v2 v2.16.0 h1:QC5ZMizk67+HzxFDjQ4ASjni5kWBTGiigRG1u23IGvA= -github.com/alecthomas/chroma/v2 v2.16.0/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk= +github.com/alecthomas/chroma/v2 v2.17.2 h1:Rm81SCZ2mPoH+Q8ZCc/9YvzPUN/E7HgPiPJD8SLV6GI= +github.com/alecthomas/chroma/v2 v2.17.2/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk= github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU= github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= @@ -414,8 +414,8 @@ github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUP github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY= -github.com/golangci/golangci-lint/v2 v2.1.5 h1:zDcxV8s7kgQW3cpQiVA633CZJnKN/0iEXibPDWO8sZo= -github.com/golangci/golangci-lint/v2 v2.1.5/go.mod h1:RGcjZLyl9fSVLqxdKMrknPlspC3TYETLoKXyRG06RDo= +github.com/golangci/golangci-lint/v2 v2.1.6 h1:LXqShFfAGM5BDzEOWD2SL1IzJAgUOqES/HRBsfKjI+w= +github.com/golangci/golangci-lint/v2 v2.1.6/go.mod h1:EPj+fgv4TeeBq3TcqaKZb3vkiV5dP4hHHKhXhEhzci8= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 h1:AkK+w9FZBXlU/xUmBtSJN1+tAI4FIvy5WtnUnY8e4p8= github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95/go.mod h1:k9mmcyWKSTMcPPvQUCfRWWQ9VHJ1U9Dc0R7kaXAgtnQ= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= @@ -949,8 +949,8 @@ github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.5.0 h1:aNwfVI4I3+gdxjMgYPus9eHmoBeJIbnajOyqZYStzuw= -github.com/tetafro/godot v1.5.0/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetafro/godot v1.5.1 h1:PZnjCol4+FqaEzvZg5+O8IY2P3hfY9JzRBNPv1pEDS4= +github.com/tetafro/godot v1.5.1/go.mod h1:cCdPtEndkmqqrhiCfkmxDodMQJ/f3L1BCNskCUZdTwk= github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c= github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw= github.com/tidwall/jsonc v0.3.2 h1:ZTKrmejRlAJYdn0kcaFqRAKlxxFIC21pYq8vLa4p2Wc= @@ -1016,8 +1016,8 @@ gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= -go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE= -go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM= +go-simpler.org/musttag v0.13.1 h1:lw2sJyu7S1X8lc8zWUAdH42y+afdcCnHhWpnkWvd6vU= +go-simpler.org/musttag v0.13.1/go.mod h1:8r450ehpMLQgvpb6sg+hV5Ur47eH6olp/3yEanfG97k= go-simpler.org/sloglint v0.11.0 h1:JlR1X4jkbeaffiyjLtymeqmGDKBDO1ikC6rjiuFAOco= go-simpler.org/sloglint v0.11.0/go.mod h1:CFDO8R1i77dlciGfPEPvYke2ZMx4eyGiEIWkyeW2Pvw= go.augendre.info/fatcontext v0.8.0 h1:2dfk6CQbDGeu1YocF59Za5Pia7ULeAM6friJ3LP7lmk= From 679f87301fa95f892d71accf62d3fa1cca8fe898 Mon Sep 17 00:00:00 2001 From: egor <58992960+egor-romanov@users.noreply.github.com> Date: Mon, 5 May 2025 12:19:34 +0100 Subject: [PATCH 095/359] chore: add some utils tests (#3514) * chore: add parse db url tests * chore: add cloudflare basic tests * chore: add cred store tests * chore: add some tenant keys tests * chore: more utils tests * chore: add utils misc tests * chore: rm some files from coverage * chore: lint fixes * Update .github/workflows/ci.yml * chore: update unit tests * fix race in test * chore: rm wsl tests --------- Co-authored-by: Han Qiao Co-authored-by: Qiao Han --- internal/utils/cloudflare/dns_test.go | 128 +++++++++++++++++ internal/utils/config_test.go | 168 ++++++++++++++++++++++ internal/utils/container_output_test.go | 171 +++++++++++++++++++++++ internal/utils/credentials/store_test.go | 99 +++++++++++++ internal/utils/deno_test.go | 111 +++++++++++++++ internal/utils/flags/db_url_test.go | 118 ++++++++++++++++ internal/utils/misc_test.go | 111 +++++++++++++++ internal/utils/output_test.go | 141 +++++++++++++++++++ internal/utils/slice_test.go | 54 ++++++- internal/utils/tenant/client_test.go | 151 ++++++++++++++++++++ internal/utils/tenant/database_test.go | 88 ++++++++++++ 11 files changed, 1338 insertions(+), 2 deletions(-) create mode 100644 internal/utils/cloudflare/dns_test.go create mode 100644 internal/utils/config_test.go create mode 100644 internal/utils/container_output_test.go create mode 100644 internal/utils/credentials/store_test.go create mode 100644 internal/utils/flags/db_url_test.go create mode 100644 internal/utils/output_test.go create mode 100644 internal/utils/tenant/client_test.go create mode 100644 internal/utils/tenant/database_test.go diff --git a/internal/utils/cloudflare/dns_test.go b/internal/utils/cloudflare/dns_test.go new file mode 100644 index 000000000..ee4d00c29 --- /dev/null +++ b/internal/utils/cloudflare/dns_test.go @@ -0,0 +1,128 @@ +package cloudflare + +import ( + "context" + "net/http" + "testing" + + "github.com/h2non/gock" + "github.com/stretchr/testify/assert" + "github.com/supabase/cli/internal/testing/apitest" +) + +func TestDNSQuery(t *testing.T) { + t.Run("successfully queries A records", func(t *testing.T) { + api := NewCloudflareAPI() + defer gock.OffAll() + gock.New("https://1.1.1.1"). + Get("/dns-query"). + MatchParam("name", "example.com"). + MatchHeader("accept", "application/dns-json"). + Reply(http.StatusOK). + JSON(DNSResponse{ + Answer: []DNSAnswer{ + { + Name: "example.com", + Type: TypeA, + Ttl: 300, + Data: "93.184.216.34", + }, + }, + }) + + resp, err := api.DNSQuery(context.Background(), DNSParams{ + Name: "example.com", + }) + + assert.NoError(t, err) + assert.Len(t, resp.Answer, 1) + assert.Equal(t, "93.184.216.34", resp.Answer[0].Data) + assert.Equal(t, TypeA, resp.Answer[0].Type) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("successfully queries specific DNS type", func(t *testing.T) { + api := NewCloudflareAPI() + dnsType := TypeCNAME + defer gock.OffAll() + gock.New("https://1.1.1.1"). + Get("/dns-query"). + MatchParam("name", "www.example.com"). + MatchParam("type", "5"). // TypeCNAME = 5 + MatchHeader("accept", "application/dns-json"). + Reply(http.StatusOK). + JSON(DNSResponse{ + Answer: []DNSAnswer{ + { + Name: "www.example.com", + Type: TypeCNAME, + Ttl: 3600, + Data: "example.com", + }, + }, + }) + + resp, err := api.DNSQuery(context.Background(), DNSParams{ + Name: "www.example.com", + Type: &dnsType, + }) + + assert.NoError(t, err) + assert.Len(t, resp.Answer, 1) + assert.Equal(t, "example.com", resp.Answer[0].Data) + assert.Equal(t, TypeCNAME, resp.Answer[0].Type) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles network error", func(t *testing.T) { + api := NewCloudflareAPI() + defer gock.OffAll() + gock.New("https://1.1.1.1"). + Get("/dns-query"). + MatchParam("name", "example.com"). + ReplyError(gock.ErrCannotMatch) + + resp, err := api.DNSQuery(context.Background(), DNSParams{ + Name: "example.com", + }) + + assert.Error(t, err) + assert.Empty(t, resp.Answer) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles service unavailable", func(t *testing.T) { + api := NewCloudflareAPI() + defer gock.OffAll() + gock.New("https://1.1.1.1"). + Get("/dns-query"). + MatchParam("name", "example.com"). + Reply(http.StatusServiceUnavailable) + + resp, err := api.DNSQuery(context.Background(), DNSParams{ + Name: "example.com", + }) + + assert.ErrorContains(t, err, "status 503") + assert.Empty(t, resp.Answer) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles malformed response", func(t *testing.T) { + api := NewCloudflareAPI() + defer gock.OffAll() + gock.New("https://1.1.1.1"). + Get("/dns-query"). + MatchParam("name", "example.com"). + Reply(http.StatusOK). + JSON("invalid json") + + resp, err := api.DNSQuery(context.Background(), DNSParams{ + Name: "example.com", + }) + + assert.ErrorContains(t, err, "failed to parse") + assert.Empty(t, resp.Answer) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) +} diff --git a/internal/utils/config_test.go b/internal/utils/config_test.go new file mode 100644 index 000000000..9ac835170 --- /dev/null +++ b/internal/utils/config_test.go @@ -0,0 +1,168 @@ +package utils + +import ( + "os" + "testing" + + "github.com/spf13/afero" + "github.com/spf13/viper" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestGetId(t *testing.T) { + t.Run("generates container id", func(t *testing.T) { + Config.ProjectId = "test-project" + name := "test-service" + + id := GetId(name) + + assert.Equal(t, "supabase_test-service_test-project", id) + }) +} + +func TestUpdateDockerIds(t *testing.T) { + t.Run("updates all container ids", func(t *testing.T) { + Config.ProjectId = "test-project" + viper.Set("network-id", "custom-network") + defer viper.Reset() + + UpdateDockerIds() + + assert.Equal(t, "custom-network", NetId) + assert.Equal(t, "supabase_db_test-project", DbId) + assert.Equal(t, "supabase_kong_test-project", KongId) + assert.Equal(t, "supabase_auth_test-project", GotrueId) + assert.Equal(t, "supabase_inbucket_test-project", InbucketId) + assert.Equal(t, "supabase_realtime_test-project", RealtimeId) + assert.Equal(t, "supabase_rest_test-project", RestId) + assert.Equal(t, "supabase_storage_test-project", StorageId) + assert.Equal(t, "supabase_imgproxy_test-project", ImgProxyId) + assert.Equal(t, "supabase_differ_test-project", DifferId) + assert.Equal(t, "supabase_pg_meta_test-project", PgmetaId) + assert.Equal(t, "supabase_studio_test-project", StudioId) + assert.Equal(t, "supabase_edge_runtime_test-project", EdgeRuntimeId) + assert.Equal(t, "supabase_analytics_test-project", LogflareId) + assert.Equal(t, "supabase_vector_test-project", VectorId) + assert.Equal(t, "supabase_pooler_test-project", PoolerId) + }) + + t.Run("generates network id if not set", func(t *testing.T) { + Config.ProjectId = "test-project" + viper.Reset() + + UpdateDockerIds() + + assert.Equal(t, "supabase_network_test-project", NetId) + }) +} + +func TestInitConfig(t *testing.T) { + t.Run("creates new config file", func(t *testing.T) { + fsys := afero.NewMemMapFs() + params := InitParams{ + ProjectId: "test-project", + } + + err := InitConfig(params, fsys) + + assert.NoError(t, err) + exists, err := afero.Exists(fsys, ConfigPath) + assert.NoError(t, err) + assert.True(t, exists) + }) + + t.Run("creates config with orioledb", func(t *testing.T) { + fsys := afero.NewMemMapFs() + params := InitParams{ + ProjectId: "test-project", + UseOrioleDB: true, + } + + err := InitConfig(params, fsys) + + assert.NoError(t, err) + content, err := afero.ReadFile(fsys, ConfigPath) + assert.NoError(t, err) + assert.Contains(t, string(content), "15.1.0.150") + }) + + t.Run("fails if config exists and no overwrite", func(t *testing.T) { + fsys := afero.NewMemMapFs() + err := afero.WriteFile(fsys, ConfigPath, []byte("existing"), 0644) + require.NoError(t, err) + params := InitParams{ + ProjectId: "test-project", + } + + err = InitConfig(params, fsys) + + assert.ErrorIs(t, err, os.ErrExist) + }) + + t.Run("overwrites existing config when specified", func(t *testing.T) { + fsys := afero.NewMemMapFs() + err := afero.WriteFile(fsys, ConfigPath, []byte("existing"), 0644) + require.NoError(t, err) + params := InitParams{ + ProjectId: "test-project", + Overwrite: true, + } + + err = InitConfig(params, fsys) + + assert.NoError(t, err) + content, err := afero.ReadFile(fsys, ConfigPath) + assert.NoError(t, err) + assert.NotEqual(t, "existing", string(content)) + }) +} + +func TestGetApiUrl(t *testing.T) { + t.Run("returns external url when configured", func(t *testing.T) { + Config.Api.ExternalUrl = "https://api.example.com" + + url := GetApiUrl("/test") + + assert.Equal(t, "https://api.example.com/test", url) + }) + + t.Run("builds url from hostname and port", func(t *testing.T) { + Config.Hostname = "localhost" + Config.Api.Port = 8000 + Config.Api.ExternalUrl = "" + + url := GetApiUrl("/test") + + assert.Equal(t, "http://localhost:8000/test", url) + }) +} + +func TestRootFS(t *testing.T) { + t.Run("opens file from root fs", func(t *testing.T) { + fsys := afero.NewMemMapFs() + content := []byte("test content") + err := afero.WriteFile(fsys, "/test.txt", content, 0644) + require.NoError(t, err) + + rootfs := NewRootFS(fsys) + f, err := rootfs.Open("/test.txt") + assert.NoError(t, err) + defer f.Close() + + buf := make([]byte, len(content)) + n, err := f.Read(buf) + assert.NoError(t, err) + assert.Equal(t, len(content), n) + assert.Equal(t, content, buf) + }) + + t.Run("returns error for non-existent file", func(t *testing.T) { + fsys := afero.NewMemMapFs() + rootfs := NewRootFS(fsys) + + _, err := rootfs.Open("/non-existent.txt") + + assert.Error(t, err) + }) +} diff --git a/internal/utils/container_output_test.go b/internal/utils/container_output_test.go new file mode 100644 index 000000000..cf3e529bb --- /dev/null +++ b/internal/utils/container_output_test.go @@ -0,0 +1,171 @@ +package utils + +import ( + "bytes" + "encoding/json" + "io" + "sync" + "testing" + + tea "github.com/charmbracelet/bubbletea" + "github.com/docker/docker/pkg/jsonmessage" + "github.com/docker/docker/pkg/stdcopy" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestProcessDiffOutput(t *testing.T) { + t.Run("processes valid diff entries", func(t *testing.T) { + input := []DiffEntry{ + { + Type: "table", + Status: "Different", + DiffDdl: "ALTER TABLE test;", + GroupName: "public", + }, + { + Type: "extension", + Status: "Different", + DiffDdl: "CREATE EXTENSION test;", + GroupName: "public", + }, + } + inputBytes, err := json.Marshal(input) + require.NoError(t, err) + + output, err := ProcessDiffOutput(inputBytes) + + assert.NoError(t, err) + assert.Contains(t, string(output), "ALTER TABLE test;") + assert.Contains(t, string(output), "CREATE EXTENSION test;") + }) + + t.Run("filters out internal schemas", func(t *testing.T) { + input := []DiffEntry{ + { + Type: "table", + Status: "Different", + DiffDdl: "ALTER TABLE test;", + GroupName: "auth", + }, + { + Type: "extension", + Status: "Different", + DiffDdl: "CREATE EXTENSION test;", + GroupName: "auth", + }, + } + inputBytes, err := json.Marshal(input) + require.NoError(t, err) + + output, err := ProcessDiffOutput(inputBytes) + + assert.NoError(t, err) + assert.Nil(t, output) + }) +} + +func TestProcessPsqlOutput(t *testing.T) { + t.Run("processes psql output", func(t *testing.T) { + var buf bytes.Buffer + writer := stdcopy.NewStdWriter(&buf, stdcopy.Stdout) + _, err := writer.Write([]byte("test output\n")) + require.NoError(t, err) + + var lastLine *string + p := NewMockProgram(func(msg tea.Msg) { + if m, ok := msg.(PsqlMsg); ok { + lastLine = m + } + }) + + err = ProcessPsqlOutput(&buf, p) + + assert.NoError(t, err) + assert.Nil(t, lastLine) + }) + + t.Run("handles stderr output", func(t *testing.T) { + var buf bytes.Buffer + writer := stdcopy.NewStdWriter(&buf, stdcopy.Stderr) + _, err := writer.Write([]byte("error message\n")) + require.NoError(t, err) + + p := NewMockProgram(nil) + + err = ProcessPsqlOutput(&buf, p) + + assert.Error(t, err) + assert.Contains(t, err.Error(), "error message") + }) +} + +func TestProcessPullOutput(t *testing.T) { + t.Run("processes docker pull messages", func(t *testing.T) { + messages := []jsonmessage.JSONMessage{ + {Status: "Pulling from library/postgres"}, + {ID: "layer1", Status: "Pulling fs layer"}, + {ID: "layer1", Status: "Downloading", Progress: &jsonmessage.JSONProgress{Current: 50, Total: 100}}, + {ID: "layer2", Status: "Pulling fs layer"}, + {ID: "layer2", Status: "Downloading", Progress: &jsonmessage.JSONProgress{Current: 75, Total: 100}}, + } + + // Create a pipe to write messages + r, w := io.Pipe() + enc := json.NewEncoder(w) + go func() { + for _, msg := range messages { + err := enc.Encode(msg) + assert.Nil(t, err) + } + w.Close() + }() + + var status string + var progressFirst *float64 + var progress *float64 + p := NewMockProgram(func(msg tea.Msg) { + switch m := msg.(type) { + case StatusMsg: + status = string(m) + case ProgressMsg: + progress = m + if progressFirst == nil { + progressFirst = m + } + } + }) + + err := ProcessPullOutput(r, p) + + assert.NoError(t, err) + assert.Equal(t, "Pulling from library/postgres...", status) + assert.Equal(t, *progressFirst, 0.5) + assert.Nil(t, progress) + }) +} + +type MockProgram struct { + handler func(tea.Msg) + mu sync.Mutex // Add mutex for thread safety +} + +func NewMockProgram(handler func(tea.Msg)) *MockProgram { + return &MockProgram{ + handler: handler, + } +} + +func (m *MockProgram) Send(msg tea.Msg) { + if m.handler != nil { + m.mu.Lock() + m.handler(msg) + m.mu.Unlock() + } +} + +func (m *MockProgram) Start() error { + return nil +} + +func (m *MockProgram) Quit() {} diff --git a/internal/utils/credentials/store_test.go b/internal/utils/credentials/store_test.go new file mode 100644 index 000000000..4bb62f658 --- /dev/null +++ b/internal/utils/credentials/store_test.go @@ -0,0 +1,99 @@ +package credentials + +import ( + "testing" + + "github.com/go-errors/errors" + "github.com/stretchr/testify/assert" + "github.com/zalando/go-keyring" +) + +func TestKeyringStore(t *testing.T) { + t.Run("stores and retrieves password", func(t *testing.T) { + keyring.MockInit() + project := "test-project" + password := "test-password" + + err := StoreProvider.Set(project, password) + assert.NoError(t, err) + + retrieved, err := StoreProvider.Get(project) + assert.NoError(t, err) + assert.Equal(t, password, retrieved) + }) + + t.Run("returns error for non-existent project", func(t *testing.T) { + keyring.MockInit() + project := "non-existent" + + retrieved, err := StoreProvider.Get(project) + assert.ErrorIs(t, err, keyring.ErrNotFound) + assert.Empty(t, retrieved) + }) + + t.Run("deletes specific project password", func(t *testing.T) { + keyring.MockInit() + project := "test-project" + password := "test-password" + + err := StoreProvider.Set(project, password) + assert.NoError(t, err) + err = StoreProvider.Delete(project) + assert.NoError(t, err) + + _, err = StoreProvider.Get(project) + assert.ErrorIs(t, err, keyring.ErrNotFound) + }) + + t.Run("deletes all project passwords", func(t *testing.T) { + keyring.MockInit() + projects := []string{"project1", "project2"} + + for _, project := range projects { + err := StoreProvider.Set(project, "password") + assert.NoError(t, err) + } + + err := StoreProvider.DeleteAll() + assert.NoError(t, err) + + for _, project := range projects { + _, err := StoreProvider.Get(project) + assert.ErrorIs(t, err, keyring.ErrNotFound) + } + }) +} + +func TestKeyringErrors(t *testing.T) { + t.Run("handles Get error", func(t *testing.T) { + mockErr := errors.New("mock error") + keyring.MockInitWithError(mockErr) + + _, err := StoreProvider.Get("test") + assert.ErrorIs(t, err, mockErr) + }) + + t.Run("handles Set error", func(t *testing.T) { + mockErr := errors.New("mock error") + keyring.MockInitWithError(mockErr) + + err := StoreProvider.Set("test", "pass") + assert.ErrorIs(t, err, mockErr) + }) + + t.Run("handles Delete error", func(t *testing.T) { + mockErr := errors.New("mock error") + keyring.MockInitWithError(mockErr) + + err := StoreProvider.Delete("test") + assert.ErrorIs(t, err, mockErr) + }) + + t.Run("handles DeleteAll error", func(t *testing.T) { + mockErr := errors.New("mock error") + keyring.MockInitWithError(mockErr) + + err := StoreProvider.DeleteAll() + assert.ErrorIs(t, err, mockErr) + }) +} diff --git a/internal/utils/deno_test.go b/internal/utils/deno_test.go index a20b3acac..c5b140a8f 100644 --- a/internal/utils/deno_test.go +++ b/internal/utils/deno_test.go @@ -1,6 +1,10 @@ package utils import ( + "context" + "os" + "path/filepath" + "runtime" "testing" "github.com/spf13/afero" @@ -34,3 +38,110 @@ import "./child/index.ts"` }) }) } + +func TestGetDenoPath(t *testing.T) { + t.Run("returns override path when set", func(t *testing.T) { + override := "/custom/path/to/deno" + DenoPathOverride = override + defer func() { DenoPathOverride = "" }() + + path, err := GetDenoPath() + + assert.NoError(t, err) + assert.Equal(t, override, path) + }) + + t.Run("returns default path", func(t *testing.T) { + home, err := os.UserHomeDir() + require.NoError(t, err) + expected := filepath.Join(home, ".supabase", "deno") + if runtime.GOOS == "windows" { + expected += ".exe" + } + + path, err := GetDenoPath() + + assert.NoError(t, err) + assert.Equal(t, expected, path) + }) +} + +func TestIsScriptModified(t *testing.T) { + t.Run("detects modified script", func(t *testing.T) { + fsys := afero.NewMemMapFs() + destPath := "/path/to/script.ts" + original := []byte("original content") + modified := []byte("modified content") + require.NoError(t, afero.WriteFile(fsys, destPath, modified, 0644)) + + isModified, err := isScriptModified(fsys, destPath, original) + + assert.NoError(t, err) + assert.True(t, isModified) + }) + + t.Run("detects unmodified script", func(t *testing.T) { + fsys := afero.NewMemMapFs() + destPath := "/path/to/script.ts" + content := []byte("test content") + require.NoError(t, afero.WriteFile(fsys, destPath, content, 0644)) + + isModified, err := isScriptModified(fsys, destPath, content) + + assert.NoError(t, err) + assert.False(t, isModified) + }) + + t.Run("handles non-existent script", func(t *testing.T) { + fsys := afero.NewMemMapFs() + destPath := "/path/to/script.ts" + content := []byte("test content") + + isModified, err := isScriptModified(fsys, destPath, content) + + assert.NoError(t, err) + assert.True(t, isModified) + }) +} + +func TestCopyDenoScripts(t *testing.T) { + t.Run("copies deno scripts", func(t *testing.T) { + fsys := afero.NewMemMapFs() + home, err := os.UserHomeDir() + require.NoError(t, err) + denoDir := filepath.Join(home, ".supabase") + require.NoError(t, fsys.MkdirAll(denoDir, 0755)) + + scripts, err := CopyDenoScripts(context.Background(), fsys) + + assert.NoError(t, err) + assert.NotNil(t, scripts) + extractExists, err := afero.Exists(fsys, scripts.ExtractPath) + assert.NoError(t, err) + assert.True(t, extractExists) + }) + + t.Run("skips copying unmodified scripts", func(t *testing.T) { + fsys := afero.NewMemMapFs() + home, err := os.UserHomeDir() + require.NoError(t, err) + scriptDir := filepath.Join(home, ".supabase", "denos") + require.NoError(t, fsys.MkdirAll(scriptDir, 0755)) + + scripts1, err := CopyDenoScripts(context.Background(), fsys) + require.NoError(t, err) + stat1, err := fsys.Stat(scripts1.ExtractPath) + require.NoError(t, err) + modTime1 := stat1.ModTime() + + // Second copy + scripts2, err := CopyDenoScripts(context.Background(), fsys) + require.NoError(t, err) + stat2, err := fsys.Stat(scripts2.ExtractPath) + require.NoError(t, err) + modTime2 := stat2.ModTime() + + // Verify file wasn't rewritten + assert.Equal(t, modTime1, modTime2) + }) +} diff --git a/internal/utils/flags/db_url_test.go b/internal/utils/flags/db_url_test.go new file mode 100644 index 000000000..ba9676b5f --- /dev/null +++ b/internal/utils/flags/db_url_test.go @@ -0,0 +1,118 @@ +package flags + +import ( + "os" + "testing" + + "github.com/spf13/afero" + "github.com/spf13/pflag" + "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" +) + +func TestParseDatabaseConfig(t *testing.T) { + t.Run("parses direct connection from db-url flag", func(t *testing.T) { + flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) + flagSet.String("db-url", "postgres://postgres:password@localhost:5432/postgres", "") + err := flagSet.Set("db-url", "postgres://admin:secret@db.example.com:6432/app") + assert.Nil(t, err) + + fsys := afero.NewMemMapFs() + + err = ParseDatabaseConfig(flagSet, fsys) + + assert.NoError(t, err) + assert.Equal(t, "db.example.com", DbConfig.Host) + assert.Equal(t, uint16(6432), DbConfig.Port) + assert.Equal(t, "admin", DbConfig.User) + assert.Equal(t, "secret", DbConfig.Password) + assert.Equal(t, "app", DbConfig.Database) + }) + + t.Run("parses local connection", func(t *testing.T) { + flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) + flagSet.Bool("local", false, "") + err := flagSet.Set("local", "true") + assert.Nil(t, err) + + fsys := afero.NewMemMapFs() + + utils.Config.Hostname = "localhost" + utils.Config.Db.Port = 54322 + utils.Config.Db.Password = "local-password" + + err = ParseDatabaseConfig(flagSet, fsys) + + assert.NoError(t, err) + assert.Equal(t, "localhost", DbConfig.Host) + assert.Equal(t, uint16(54322), DbConfig.Port) + assert.Equal(t, "postgres", DbConfig.User) + assert.Equal(t, "local-password", DbConfig.Password) + assert.Equal(t, "postgres", DbConfig.Database) + }) + + t.Run("parses linked connection", func(t *testing.T) { + flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) + flagSet.Bool("linked", false, "") + err := flagSet.Set("linked", "true") + assert.Nil(t, err) + + fsys := afero.NewMemMapFs() + + project := apitest.RandomProjectRef() + err = afero.WriteFile(fsys, utils.ProjectRefPath, []byte(project), 0644) + require.NoError(t, err) + + err = ParseDatabaseConfig(flagSet, fsys) + + assert.NoError(t, err) + assert.Equal(t, utils.GetSupabaseDbHost(project), DbConfig.Host) + }) +} + +func TestPromptPassword(t *testing.T) { + t.Run("returns user input when provided", func(t *testing.T) { + r, w, err := os.Pipe() + require.NoError(t, err) + defer r.Close() + go func() { + defer w.Close() + _, err := w.Write([]byte("test-password")) + assert.Nil(t, err) + }() + + password := PromptPassword(r) + + assert.Equal(t, "test-password", password) + }) + + t.Run("generates password when input is empty", func(t *testing.T) { + r, w, err := os.Pipe() + require.NoError(t, err) + defer r.Close() + go func() { + defer w.Close() + _, err := w.Write([]byte("")) + assert.Nil(t, err) + }() + + password := PromptPassword(r) + + assert.Len(t, password, PASSWORD_LENGTH) + assert.NotEqual(t, "", password) + }) +} + +func TestGetDbConfigOptionalPassword(t *testing.T) { + t.Run("uses environment variable when available", func(t *testing.T) { + viper.Set("DB_PASSWORD", "env-password") + projectRef := apitest.RandomProjectRef() + + config := GetDbConfigOptionalPassword(projectRef) + + assert.Equal(t, "env-password", config.Password) + }) +} diff --git a/internal/utils/misc_test.go b/internal/utils/misc_test.go index 6472c2145..b12d68c78 100644 --- a/internal/utils/misc_test.go +++ b/internal/utils/misc_test.go @@ -75,3 +75,114 @@ func TestProjectRoot(t *testing.T) { assert.Equal(t, cwd, path) }) } + +func TestShortContainerImageName(t *testing.T) { + t.Run("extracts short name from image", func(t *testing.T) { + input := "registry.supabase.com/postgres:15.1.0.99" + expected := "postgres" + + result := ShortContainerImageName(input) + + assert.Equal(t, expected, result) + }) +} + +func TestIsBranchNameReserved(t *testing.T) { + t.Run("identifies reserved names", func(t *testing.T) { + reserved := []string{"_current_branch", "main"} + for _, name := range reserved { + assert.True(t, IsBranchNameReserved(name), "Expected %s to be reserved", name) + } + }) + + t.Run("allows custom names", func(t *testing.T) { + allowed := []string{"my-feature", "test-branch-123"} + for _, name := range allowed { + assert.False(t, IsBranchNameReserved(name), "Expected %s to be allowed", name) + } + }) +} + +func TestValidateFunctionSlug(t *testing.T) { + t.Run("validates correct slugs", func(t *testing.T) { + valid := []string{ + "my-function", + "MyFunction", + "function_1", + "a123", + } + for _, slug := range valid { + err := ValidateFunctionSlug(slug) + assert.NoError(t, err, "Expected %s to be valid", slug) + } + }) + + t.Run("rejects invalid slugs", func(t *testing.T) { + invalid := []string{ + "1function", + "my function", + "function!", + "", + "-function", + "_function", + } + for _, slug := range invalid { + err := ValidateFunctionSlug(slug) + assert.ErrorIs(t, err, ErrInvalidSlug, "Expected %s to be invalid", slug) + } + }) +} + +func TestAssertProjectRefIsValid(t *testing.T) { + t.Run("validates correct refs", func(t *testing.T) { + validRef := "abcdefghijklmnopqrst" + err := AssertProjectRefIsValid(validRef) + assert.NoError(t, err) + }) + + t.Run("rejects invalid refs", func(t *testing.T) { + invalid := []string{ + "tooshort", + "toolongabcdefghijklmnopqrst", + "UPPERCASE", + "special-chars", + "123", + "", + } + for _, ref := range invalid { + err := AssertProjectRefIsValid(ref) + assert.ErrorIs(t, err, ErrInvalidRef, "Expected %s to be invalid", ref) + } + }) +} + +func TestWriteFile(t *testing.T) { + t.Run("writes file with directories", func(t *testing.T) { + fsys := afero.NewMemMapFs() + path := filepath.Join("deep", "nested", "dir", "file.txt") + content := []byte("test content") + + err := WriteFile(path, content, fsys) + + assert.NoError(t, err) + + written, err := afero.ReadFile(fsys, path) + assert.NoError(t, err) + assert.Equal(t, content, written) + }) + + t.Run("overwrites existing file", func(t *testing.T) { + fsys := afero.NewMemMapFs() + path := "test.txt" + original := []byte("original") + updated := []byte("updated") + require.NoError(t, afero.WriteFile(fsys, path, original, 0644)) + + err := WriteFile(path, updated, fsys) + + assert.NoError(t, err) + written, err := afero.ReadFile(fsys, path) + assert.NoError(t, err) + assert.Equal(t, updated, written) + }) +} diff --git a/internal/utils/output_test.go b/internal/utils/output_test.go new file mode 100644 index 000000000..088136eba --- /dev/null +++ b/internal/utils/output_test.go @@ -0,0 +1,141 @@ +package utils + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestEncodeOutput(t *testing.T) { + t.Run("encodes env format", func(t *testing.T) { + input := map[string]string{ + "DATABASE_URL": "postgres://user:pass@host:5432/db", + "API_KEY": "secret-key", + } + var buf bytes.Buffer + err := EncodeOutput(OutputEnv, &buf, input) + assert.NoError(t, err) + expected := "API_KEY=\"secret-key\"\nDATABASE_URL=\"postgres://user:pass@host:5432/db\"\n" + assert.Equal(t, expected, buf.String()) + }) + + t.Run("fails env format with invalid type", func(t *testing.T) { + input := map[string]int{"FOO": 123} + var buf bytes.Buffer + err := EncodeOutput(OutputEnv, &buf, input) + assert.ErrorContains(t, err, "value is not a map[string]string") + }) + + t.Run("encodes json format", func(t *testing.T) { + input := map[string]interface{}{ + "name": "test", + "config": map[string]interface{}{ + "port": 5432, + "enabled": true, + }, + } + var buf bytes.Buffer + err := EncodeOutput(OutputJson, &buf, input) + assert.NoError(t, err) + expected := `{ + "config": { + "enabled": true, + "port": 5432 + }, + "name": "test" +} +` + assert.Equal(t, expected, buf.String()) + }) + + t.Run("encodes yaml format", func(t *testing.T) { + input := map[string]interface{}{ + "name": "test", + "config": map[string]interface{}{ + "port": 5432, + "enabled": true, + }, + } + var buf bytes.Buffer + err := EncodeOutput(OutputYaml, &buf, input) + assert.NoError(t, err) + expected := `config: + enabled: true + port: 5432 +name: test +` + assert.Equal(t, expected, buf.String()) + }) + + t.Run("encodes toml format", func(t *testing.T) { + input := map[string]interface{}{ + "name": "test", + "config": map[string]interface{}{ + "port": 5432, + "enabled": true, + }, + } + var buf bytes.Buffer + err := EncodeOutput(OutputToml, &buf, input) + assert.NoError(t, err) + expected := `name = "test" + +[config] + enabled = true + port = 5432 +` + assert.Equal(t, expected, buf.String()) + }) + + t.Run("fails with unsupported format", func(t *testing.T) { + var buf bytes.Buffer + err := EncodeOutput("invalid", &buf, nil) + assert.ErrorContains(t, err, `Unsupported output encoding "invalid"`) + }) + + t.Run("handles complex nested structures", func(t *testing.T) { + input := map[string]interface{}{ + "database": map[string]interface{}{ + "connections": []map[string]interface{}{ + { + "host": "localhost", + "port": 5432, + }, + { + "host": "remote", + "port": 6543, + }, + }, + "settings": map[string]interface{}{ + "max_connections": 100, + "ssl_enabled": true, + }, + }, + } + var buf bytes.Buffer + err := EncodeOutput(OutputJson, &buf, input) + require.NoError(t, err) + expected := `{ + "database": { + "connections": [ + { + "host": "localhost", + "port": 5432 + }, + { + "host": "remote", + "port": 6543 + } + ], + "settings": { + "max_connections": 100, + "ssl_enabled": true + } + } +} +` + assert.Equal(t, expected, buf.String()) + }) +} diff --git a/internal/utils/slice_test.go b/internal/utils/slice_test.go index 81642c73f..47bdea171 100644 --- a/internal/utils/slice_test.go +++ b/internal/utils/slice_test.go @@ -7,9 +7,59 @@ import ( ) func TestSliceEqual(t *testing.T) { - assert.False(t, SliceEqual([]string{"a"}, []string{"b"})) + t.Run("different slices", func(t *testing.T) { + assert.False(t, SliceEqual([]string{"a"}, []string{"b"})) + }) + + t.Run("different lengths", func(t *testing.T) { + assert.False(t, SliceEqual([]string{"a"}, []string{"a", "b"})) + assert.False(t, SliceEqual([]string{"a", "b"}, []string{"a"})) + }) + + t.Run("equal slices", func(t *testing.T) { + assert.True(t, SliceEqual([]string{"a", "b"}, []string{"a", "b"})) + assert.True(t, SliceEqual([]int{1, 2, 3}, []int{1, 2, 3})) + }) + + t.Run("empty slices", func(t *testing.T) { + assert.True(t, SliceEqual([]string{}, []string{})) + }) } func TestSliceContains(t *testing.T) { - assert.False(t, SliceContains([]string{"a"}, "b")) + t.Run("not contains element", func(t *testing.T) { + assert.False(t, SliceContains([]string{"a"}, "b")) + }) + + t.Run("contains element", func(t *testing.T) { + assert.True(t, SliceContains([]string{"a", "b", "c"}, "b")) + assert.True(t, SliceContains([]int{1, 2, 3}, 2)) + }) + + t.Run("empty slice", func(t *testing.T) { + assert.False(t, SliceContains([]string{}, "a")) + }) +} + +func TestRemoveDuplicates(t *testing.T) { + t.Run("string slice", func(t *testing.T) { + input := []string{"a", "b", "a", "c", "b", "d"} + expected := []string{"a", "b", "c", "d"} + assert.Equal(t, expected, RemoveDuplicates(input)) + }) + + t.Run("int slice", func(t *testing.T) { + input := []int{1, 2, 2, 3, 1, 4, 3, 5} + expected := []int{1, 2, 3, 4, 5} + assert.Equal(t, expected, RemoveDuplicates(input)) + }) + + t.Run("empty slice", func(t *testing.T) { + assert.Empty(t, RemoveDuplicates([]string{})) + }) + + t.Run("no duplicates", func(t *testing.T) { + input := []int{1, 2, 3, 4, 5} + assert.Equal(t, input, RemoveDuplicates(input)) + }) } diff --git a/internal/utils/tenant/client_test.go b/internal/utils/tenant/client_test.go new file mode 100644 index 000000000..6057f502f --- /dev/null +++ b/internal/utils/tenant/client_test.go @@ -0,0 +1,151 @@ +package tenant + +import ( + "context" + "net/http" + "testing" + + "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" +) + +func TestApiKey(t *testing.T) { + t.Run("creates api key from response", func(t *testing.T) { + resp := []api.ApiKeyResponse{ + {Name: "anon", ApiKey: "anon-key"}, + {Name: "service_role", ApiKey: "service-key"}, + } + + keys := NewApiKey(resp) + + assert.Equal(t, "anon-key", keys.Anon) + assert.Equal(t, "service-key", keys.ServiceRole) + assert.False(t, keys.IsEmpty()) + }) + + t.Run("handles empty response", func(t *testing.T) { + resp := []api.ApiKeyResponse{} + + keys := NewApiKey(resp) + + assert.Empty(t, keys.Anon) + assert.Empty(t, keys.ServiceRole) + assert.True(t, keys.IsEmpty()) + }) + + t.Run("handles partial response", func(t *testing.T) { + resp := []api.ApiKeyResponse{ + {Name: "anon", ApiKey: "anon-key"}, + } + + keys := NewApiKey(resp) + + assert.Equal(t, "anon-key", keys.Anon) + assert.Empty(t, keys.ServiceRole) + assert.False(t, keys.IsEmpty()) + }) +} + +func TestGetApiKeys(t *testing.T) { + t.Run("retrieves api keys successfully", func(t *testing.T) { + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + + defer gock.OffAll() + projectRef := apitest.RandomProjectRef() + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + projectRef + "/api-keys"). + Reply(http.StatusOK). + JSON([]api.ApiKeyResponse{ + {Name: "anon", ApiKey: "anon-key"}, + {Name: "service_role", ApiKey: "service-key"}, + }) + + keys, err := GetApiKeys(context.Background(), projectRef) + + assert.NoError(t, err) + assert.Equal(t, "anon-key", keys.Anon) + assert.Equal(t, "service-key", keys.ServiceRole) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles network error", func(t *testing.T) { + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + + defer gock.OffAll() + projectRef := apitest.RandomProjectRef() + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + projectRef + "/api-keys"). + ReplyError(gock.ErrCannotMatch) + + keys, err := GetApiKeys(context.Background(), projectRef) + + assert.Error(t, err) + assert.Contains(t, err.Error(), "failed to get api keys") + assert.True(t, keys.IsEmpty()) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles unauthorized error", func(t *testing.T) { + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + + defer gock.OffAll() + projectRef := apitest.RandomProjectRef() + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + projectRef + "/api-keys"). + Reply(http.StatusUnauthorized). + JSON(map[string]string{"message": "unauthorized"}) + + keys, err := GetApiKeys(context.Background(), projectRef) + + assert.ErrorIs(t, err, ErrAuthToken) + assert.True(t, keys.IsEmpty()) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles missing anon key", func(t *testing.T) { + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + + defer gock.OffAll() + projectRef := apitest.RandomProjectRef() + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + projectRef + "/api-keys"). + Reply(http.StatusOK). + JSON([]api.ApiKeyResponse{}) // should this error if response has only service_role key? + + keys, err := GetApiKeys(context.Background(), projectRef) + + assert.ErrorIs(t, err, errMissingKey) + assert.True(t, keys.IsEmpty()) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) +} + +func TestNewTenantAPI(t *testing.T) { + t.Run("creates tenant api client", func(t *testing.T) { + projectRef := apitest.RandomProjectRef() + anonKey := "test-key" + + api := NewTenantAPI(context.Background(), projectRef, anonKey) + + assert.NotNil(t, api.Fetcher) + + defer gock.OffAll() + gock.New("https://"+utils.GetSupabaseHost(projectRef)). + Get("/test"). + MatchHeader("apikey", anonKey). + MatchHeader("User-Agent", "SupabaseCLI/"+utils.Version). + Reply(http.StatusOK) + + _, err := api.Send(context.Background(), http.MethodGet, "/test", nil) + + assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) +} diff --git a/internal/utils/tenant/database_test.go b/internal/utils/tenant/database_test.go new file mode 100644 index 000000000..c6680f2b7 --- /dev/null +++ b/internal/utils/tenant/database_test.go @@ -0,0 +1,88 @@ +package tenant + +import ( + "context" + "net/http" + "testing" + + "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" +) + +func TestGetDatabaseVersion(t *testing.T) { + t.Run("retrieves database version successfully", func(t *testing.T) { + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + + defer gock.OffAll() + projectRef := apitest.RandomProjectRef() + gock.New(utils.DefaultApiHost). + Get("/v1/projects"). + Reply(http.StatusOK). + JSON([]api.V1ProjectWithDatabaseResponse{ + { + Id: projectRef, + Database: api.V1DatabaseResponse{ + Version: "14.1.0.99", + }, + }, + }) + + version, err := GetDatabaseVersion(context.Background(), projectRef) + + assert.NoError(t, err) + assert.Equal(t, "14.1.0.99", version) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles project not found", func(t *testing.T) { + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + + defer gock.OffAll() + projectRef := apitest.RandomProjectRef() + gock.New(utils.DefaultApiHost). + Get("/v1/projects"). + Reply(http.StatusOK). + JSON([]api.V1ProjectWithDatabaseResponse{ + { + Id: "different-project", + Database: api.V1DatabaseResponse{ + Version: "14.1.0.99", + }, + }, + }) + + version, err := GetDatabaseVersion(context.Background(), projectRef) + + assert.ErrorIs(t, err, errDatabaseVersion) + assert.Empty(t, version) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles empty database version", func(t *testing.T) { + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + + defer gock.OffAll() + projectRef := apitest.RandomProjectRef() + gock.New(utils.DefaultApiHost). + Get("/v1/projects"). + Reply(http.StatusOK). + JSON([]api.V1ProjectWithDatabaseResponse{ + { + Id: projectRef, + Database: api.V1DatabaseResponse{}, + }, + }) + + version, err := GetDatabaseVersion(context.Background(), projectRef) + + assert.ErrorIs(t, err, errDatabaseVersion) + assert.Empty(t, version) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) +} From 032c2cb8840252d739e21083f76fd40a44bc9ed5 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 5 May 2025 21:06:38 +0800 Subject: [PATCH 096/359] fix: remove deprecated remote changes and commit (#3520) --- cmd/db.go | 10 +-- internal/db/remote/changes/changes.go | 47 ------------ internal/db/remote/commit/commit.go | 106 -------------------------- 3 files changed, 5 insertions(+), 158 deletions(-) delete mode 100644 internal/db/remote/changes/changes.go delete mode 100644 internal/db/remote/commit/commit.go diff --git a/cmd/db.go b/cmd/db.go index bcc7ac5e7..948f77beb 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -18,8 +18,6 @@ import ( "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" @@ -175,7 +173,7 @@ var ( Short: "Show changes on the remote database", Long: "Show changes on the remote database since last migration.", RunE: func(cmd *cobra.Command, args []string) error { - return changes.Run(cmd.Context(), schema, flags.DbConfig, afero.NewOsFs()) + return diff.Run(cmd.Context(), schema, file, flags.DbConfig, diff.DiffSchemaMigra, afero.NewOsFs()) }, } @@ -184,7 +182,7 @@ var ( Use: "commit", Short: "Commit remote changes as a new migration", RunE: func(cmd *cobra.Command, args []string) error { - return commit.Run(cmd.Context(), schema, flags.DbConfig, afero.NewOsFs()) + return pull.Run(cmd.Context(), schema, flags.DbConfig, "remote_commit", afero.NewOsFs()) }, } @@ -304,10 +302,12 @@ func init() { dbCmd.AddCommand(dbPullCmd) // Build remote command remoteFlags := dbRemoteCmd.PersistentFlags() + remoteFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "Comma separated list of schema to include.") remoteFlags.String("db-url", "", "Connect using the specified Postgres URL (must be percent-encoded).") + remoteFlags.Bool("linked", true, "Connect to the linked project.") + dbRemoteCmd.MarkFlagsMutuallyExclusive("db-url", "linked") remoteFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.") cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", remoteFlags.Lookup("password"))) - remoteFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "Comma separated list of schema to include.") dbRemoteCmd.AddCommand(dbRemoteChangesCmd) dbRemoteCmd.AddCommand(dbRemoteCommitCmd) dbCmd.AddCommand(dbRemoteCmd) diff --git a/internal/db/remote/changes/changes.go b/internal/db/remote/changes/changes.go deleted file mode 100644 index 12c39288b..000000000 --- a/internal/db/remote/changes/changes.go +++ /dev/null @@ -1,47 +0,0 @@ -package changes - -import ( - "context" - "io" - - "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" -) - -var output string - -func Run(ctx context.Context, schema []string, config pgconn.Config, fsys afero.Fs) error { - if err := utils.RunProgram(ctx, func(p utils.Program, ctx context.Context) error { - return run(p, ctx, schema, config, fsys) - }); err != nil { - return err - } - return diff.SaveDiff(output, "", fsys) -} - -func run(p utils.Program, ctx context.Context, schema []string, config pgconn.Config, fsys afero.Fs) (err error) { - // 1. Assert `supabase/migrations` and `schema_migrations` are in sync. - w := utils.StatusWriter{Program: p} - if len(schema) == 0 { - schema, err = loadSchema(ctx, config, w) - if err != nil { - return err - } - } - - // 2. Diff remote db (source) & shadow db (target) and print it. - output, err = diff.DiffDatabase(ctx, schema, config, w, fsys, diff.DiffSchemaMigra) - return err -} - -func loadSchema(ctx context.Context, config pgconn.Config, w io.Writer) ([]string, error) { - conn, err := utils.ConnectByConfigStream(ctx, config, w) - if err != nil { - return nil, err - } - defer conn.Close(context.Background()) - return migration.ListUserSchemas(ctx, conn) -} diff --git a/internal/db/remote/commit/commit.go b/internal/db/remote/commit/commit.go deleted file mode 100644 index 3e49346f6..000000000 --- a/internal/db/remote/commit/commit.go +++ /dev/null @@ -1,106 +0,0 @@ -package commit - -import ( - "context" - _ "embed" - "fmt" - "path/filepath" - - "github.com/go-errors/errors" - "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" -) - -func Run(ctx context.Context, schema []string, config pgconn.Config, fsys afero.Fs) error { - if err := utils.RunProgram(ctx, func(p utils.Program, ctx context.Context) error { - return run(p, ctx, schema, config, fsys) - }); err != nil { - return err - } - fmt.Println("Finished " + utils.Aqua("supabase db remote commit") + ".") - return nil -} - -func run(p utils.Program, ctx context.Context, schema []string, config pgconn.Config, fsys afero.Fs) error { - // 1. Assert `supabase/migrations` and `schema_migrations` are in sync. - w := utils.StatusWriter{Program: p} - conn, err := utils.ConnectByConfigStream(ctx, config, w) - if err != nil { - return err - } - defer conn.Close(context.Background()) - if err := assertRemoteInSync(ctx, conn, fsys); err != nil { - return err - } - - // 2. Fetch remote schema changes - if len(schema) == 0 { - schema, err = migration.ListUserSchemas(ctx, conn) - if err != nil { - return err - } - } - timestamp := utils.GetCurrentTimestamp() - if err := fetchRemote(p, ctx, schema, timestamp, config, fsys); err != nil { - return err - } - - // 3. Insert a row to `schema_migrations` - return repair.UpdateMigrationTable(ctx, conn, []string{timestamp}, repair.Applied, false, fsys) -} - -func fetchRemote(p utils.Program, ctx context.Context, schema []string, timestamp string, config pgconn.Config, fsys afero.Fs) error { - path := filepath.Join(utils.MigrationsDir, timestamp+"_remote_commit.sql") - // Special case if this is the first migration - if migrations, err := migration.ListLocalMigrations(utils.MigrationsDir, afero.NewIOFS(fsys)); err != nil { - return err - } else if len(migrations) == 0 { - p.Send(utils.StatusMsg("Committing initial migration on remote database...")) - return dump.Run(ctx, path, config, nil, nil, false, false, false, false, false, fsys) - } - - w := utils.StatusWriter{Program: p} - // Diff remote db (source) & shadow db (target) and write it as a new migration. - output, err := diff.DiffDatabase(ctx, schema, config, w, fsys, diff.DiffSchemaMigra) - if err != nil { - return err - } - if len(output) == 0 { - return errors.New("No schema changes found") - } - return utils.WriteFile(path, []byte(output), fsys) -} - -func assertRemoteInSync(ctx context.Context, conn *pgx.Conn, fsys afero.Fs) error { - remoteMigrations, err := migration.ListRemoteMigrations(ctx, conn) - if err != nil { - return err - } - localMigrations, err := list.LoadLocalVersions(fsys) - if err != nil { - return err - } - - conflictErr := errors.New("The remote database's migration history is not in sync with the contents of " + utils.Bold(utils.MigrationsDir) + `. Resolve this by: -- Updating the project from version control to get the latest ` + utils.Bold(utils.MigrationsDir) + `, -- Pushing unapplied migrations with ` + utils.Aqua("supabase db push") + `, -- Or failing that, manually editing supabase_migrations.schema_migrations table with ` + utils.Aqua("supabase migration repair") + ".") - if len(remoteMigrations) != len(localMigrations) { - return conflictErr - } - - for i, remoteTimestamp := range remoteMigrations { - if localMigrations[i] != remoteTimestamp { - return conflictErr - } - } - - return nil -} From 4960d233298cc12824be2974af026073a1bd6dfe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 04:23:33 +0000 Subject: [PATCH 097/359] chore(deps): bump gotest.tools/gotestsum from 1.12.1 to 1.12.2 (#3525) Bumps [gotest.tools/gotestsum](https://github.com/gotestyourself/gotestsum) from 1.12.1 to 1.12.2. - [Release notes](https://github.com/gotestyourself/gotestsum/releases) - [Commits](https://github.com/gotestyourself/gotestsum/compare/v1.12.1...v1.12.2) --- updated-dependencies: - dependency-name: gotest.tools/gotestsum dependency-version: 1.12.2 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 193d1f07b..542b80828 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( golang.org/x/term v0.31.0 google.golang.org/grpc v1.72.0 gopkg.in/yaml.v3 v3.0.1 - gotest.tools/gotestsum v1.12.1 + gotest.tools/gotestsum v1.12.2 ) require ( diff --git a/go.sum b/go.sum index 62d3f9c73..9e2587198 100644 --- a/go.sum +++ b/go.sum @@ -1502,8 +1502,8 @@ gopkg.in/yaml.v3 v3.0.0-20191026110619-0b21df46bc1d/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/gotestsum v1.12.1 h1:dvcxFBTFR1QsQmrCQa4k/vDXow9altdYz4CjdW+XeBE= -gotest.tools/gotestsum v1.12.1/go.mod h1:mwDmLbx9DIvr09dnAoGgQPLaSXszNpXpWo2bsQge5BE= +gotest.tools/gotestsum v1.12.2 h1:eli4tu9Q2D/ogDsEGSr8XfQfl7mT0JsGOG6DFtUiZ/Q= +gotest.tools/gotestsum v1.12.2/go.mod h1:kjRtCglPZVsSU0hFHX3M5VWBM6Y63emHuB14ER1/sow= gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 6025185184262fdb4a86e237435da2722a73d6be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 12:43:37 +0800 Subject: [PATCH 098/359] chore(deps): bump golang.org/x/term from 0.31.0 to 0.32.0 (#3524) --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 542b80828..438ca88cf 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( go.opentelemetry.io/otel v1.35.0 golang.org/x/mod v0.24.0 golang.org/x/oauth2 v0.29.0 - golang.org/x/term v0.31.0 + golang.org/x/term v0.32.0 google.golang.org/grpc v1.72.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.2 @@ -325,7 +325,7 @@ require ( golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect golang.org/x/net v0.39.0 // indirect golang.org/x/sync v0.13.0 // indirect - golang.org/x/sys v0.32.0 // indirect + golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.24.0 // indirect golang.org/x/tools v0.32.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect diff --git a/go.sum b/go.sum index 9e2587198..730f6ce39 100644 --- a/go.sum +++ b/go.sum @@ -1281,8 +1281,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 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= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1293,8 +1293,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= -golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= +golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= 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 02304dab60fcf3d4fec7e08d89e95f8c6de2d590 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 05:03:49 +0000 Subject: [PATCH 099/359] chore(deps): bump supabase/gotrue from v2.171.0 to v2.172.1 in /pkg/config/templates (#3527) chore(deps): bump supabase/gotrue in /pkg/config/templates Bumps supabase/gotrue from v2.171.0 to v2.172.1. --- updated-dependencies: - dependency-name: supabase/gotrue dependency-version: v2.172.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 21196ea0f..e9a0e307e 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -10,7 +10,7 @@ FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor -FROM supabase/gotrue:v2.171.0 AS gotrue +FROM supabase/gotrue:v2.172.1 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime FROM supabase/storage-api:v1.22.11 AS storage FROM supabase/logflare:1.12.0 AS logflare From fc1926ea8402f1aa151a703302c7f733e006a06f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 05:09:11 +0000 Subject: [PATCH 100/359] chore(deps): bump supabase/postgres from 17.4.1.027 to 17.4.1.028 in /pkg/config/templates (#3528) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.027 to 17.4.1.028. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.028 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e9a0e307e..2fed835ee 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.027 AS pg +FROM supabase/postgres:17.4.1.028 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 668c9bccd2be377c9c7c1b287cbc825e5078b456 Mon Sep 17 00:00:00 2001 From: Andrew Valleteau Date: Tue, 6 May 2025 12:23:26 +0200 Subject: [PATCH 101/359] fix(config): sanitize dotenv errors avoiding data leaking (#3529) * fix(config): sanitize dotenv errors avoiding data leaking * fix(config): add comment for newline error handling fallback * Apply suggestions from code review Co-authored-by: Han Qiao * Update config_test.go --------- Co-authored-by: Han Qiao --- pkg/config/config.go | 28 +++++++++++- pkg/config/config_test.go | 90 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 7fcf1cf88..ddd38edef 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -929,7 +929,33 @@ func loadDefaultEnv(env string) error { func loadEnvIfExists(path string) error { if err := godotenv.Load(path); err != nil && !errors.Is(err, os.ErrNotExist) { - return errors.Errorf("failed to load %s: %w", ".env", err) + // If DEBUG=1, return the error as is for full debugability + if viper.GetBool("DEBUG") { + return errors.Errorf("failed to load %s: %w", path, err) + } + msg := err.Error() + switch { + case strings.HasPrefix(msg, "unexpected character"): + // Try to extract the character, fallback to generic + start := strings.Index(msg, "unexpected character \"") + if start != -1 { + start += len("unexpected character \"") + end := strings.Index(msg[start:], "\"") + if end != -1 { + char := msg[start : start+end] + return errors.Errorf("failed to parse environment file: %s (unexpected character '%s' in variable name)", path, char) + } + } + return errors.Errorf("failed to parse environment file: %s (unexpected character in variable name)", path) + case strings.HasPrefix(msg, "unterminated quoted value"): + return errors.Errorf("failed to parse environment file: %s (unterminated quoted value)", path) + // If the error message contains newlines, there is a high chance that the actual content of the + // dotenv file is being leaked. In such cases, we return a generic error to avoid unwanted leaks in the logs + case strings.Contains(msg, "\n"): + return errors.Errorf("failed to parse environment file: %s (syntax error)", path) + default: + return errors.Errorf("failed to load %s: %w", path, err) + } } return nil } diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 54278862c..9d8e2c359 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -3,12 +3,15 @@ package config import ( "bytes" _ "embed" + "fmt" + "os" "path" "strings" "testing" fs "testing/fstest" "github.com/BurntSushi/toml" + "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -525,3 +528,90 @@ func TestLoadFunctionErrorMessageParsing(t *testing.T) { assert.ErrorContains(t, err, `'functions[verify_jwt]' expected a map, got 'bool'`) }) } + +func TestLoadEnvIfExists(t *testing.T) { + t.Run("returns nil when file does not exist", func(t *testing.T) { + err := loadEnvIfExists("nonexistent.env") + assert.NoError(t, err) + }) + + t.Run("returns raw error when file exists but is malformed and DEBUG=1", func(t *testing.T) { + // Set DEBUG=1 + t.Setenv("DEBUG", "1") + viper.AutomaticEnv() + + // Create a temporary file with malformed content + tmpFile, err := os.CreateTemp("", "test-*.env") + require.NoError(t, err) + defer os.Remove(tmpFile.Name()) + + // Write malformed content + _, err = tmpFile.WriteString("[invalid]\nvalue=secret_value\n") + require.NoError(t, err) + require.NoError(t, tmpFile.Close()) + + // Test loading the malformed file + err = loadEnvIfExists(tmpFile.Name()) + // Should contain the raw error, including the secret value + assert.ErrorContains(t, err, "unexpected character") + assert.ErrorContains(t, err, "secret_value") + }) + + t.Run("returns error when file exists but is malformed invalid character", func(t *testing.T) { + // Create a temporary file with malformed content + tmpFile, err := os.CreateTemp("", "test-*.env") + require.NoError(t, err) + defer os.Remove(tmpFile.Name()) + + // Write malformed content + _, err = tmpFile.WriteString("[invalid]\nvalue=secret_value\n") + require.NoError(t, err) + require.NoError(t, tmpFile.Close()) + + // Test loading the malformed file + err = loadEnvIfExists(tmpFile.Name()) + assert.ErrorContains(t, err, fmt.Sprintf("failed to parse environment file: %s (unexpected character '[' in variable name)", tmpFile.Name())) + assert.NotContains(t, err.Error(), "secret_value") + }) + + t.Run("returns error when file exists but is malformed unterminated quotes", func(t *testing.T) { + // Create a temporary file with malformed content + tmpFile, err := os.CreateTemp("", "test-*.env") + require.NoError(t, err) + defer os.Remove(tmpFile.Name()) + + // Write malformed content + _, err = tmpFile.WriteString("value=\"secret_value\n") + require.NoError(t, err) + require.NoError(t, tmpFile.Close()) + + // Test loading the malformed file + err = loadEnvIfExists(tmpFile.Name()) + assert.ErrorContains(t, err, fmt.Sprintf("failed to parse environment file: %s (unterminated quoted value)", tmpFile.Name())) + assert.NotContains(t, err.Error(), "secret_value") + }) + + t.Run("loads valid env file successfully", func(t *testing.T) { + // Create a temporary file with valid content + tmpFile, err := os.CreateTemp("", "test-*.env") + require.NoError(t, err) + defer os.Remove(tmpFile.Name()) + + // Write valid content + _, err = tmpFile.WriteString("TEST_KEY=test_value\nANOTHER_KEY=another_value") + require.NoError(t, err) + require.NoError(t, tmpFile.Close()) + + // Test loading the valid file + err = loadEnvIfExists(tmpFile.Name()) + assert.NoError(t, err) + + // Verify environment variables were loaded + assert.Equal(t, "test_value", os.Getenv("TEST_KEY")) + assert.Equal(t, "another_value", os.Getenv("ANOTHER_KEY")) + + // Clean up environment variables + os.Unsetenv("TEST_KEY") + os.Unsetenv("ANOTHER_KEY") + }) +} From 49fb4f42491f2cdb64329d04da452705e950ece7 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Tue, 6 May 2025 13:37:37 -0400 Subject: [PATCH 102/359] docs: moved command descriptions from docs repo (#3533) docs: add long descriptions to some commands for documentation Descriptions were added for some of these commands over in the [docs repo](https://github.com/supabase/supabase/pull/35490/files), but the spec auto-generation will overwrite them there. Adding to the command description here instead. --- docs/supabase/config/push.md | 5 +++++ docs/supabase/functions.md | 9 +++++++++ docs/supabase/functions/new.md | 7 +++++++ docs/supabase/gen.md | 9 +++++++++ docs/supabase/projects.md | 7 +++++++ docs/supabase/secrets.md | 11 +++++++++++ 6 files changed, 48 insertions(+) create mode 100644 docs/supabase/config/push.md create mode 100644 docs/supabase/functions.md create mode 100644 docs/supabase/functions/new.md create mode 100644 docs/supabase/gen.md create mode 100644 docs/supabase/projects.md create mode 100644 docs/supabase/secrets.md diff --git a/docs/supabase/config/push.md b/docs/supabase/config/push.md new file mode 100644 index 000000000..859d340ad --- /dev/null +++ b/docs/supabase/config/push.md @@ -0,0 +1,5 @@ +# supabase-config-push + +Updates the configurations of a linked Supabase project with the local `supabase/config.toml` file. + +This command allows you to manage project configuration as code by defining settings locally and then pushing them to your remote project. diff --git a/docs/supabase/functions.md b/docs/supabase/functions.md new file mode 100644 index 000000000..d0a08de06 --- /dev/null +++ b/docs/supabase/functions.md @@ -0,0 +1,9 @@ +## supabase-functions + +Manage Supabase Edge Functions. + +Supabase Edge Functions are server-less functions that run close to your users. + +Edge Functions allow you to execute custom server-side code without deploying or scaling a traditional server. They're ideal for handling webhooks, custom API endpoints, data validation, and serving personalized content. + +Edge Functions are written in TypeScript and run on Deno compatible edge runtime, which is a secure runtime with no package management needed, fast cold starts, and built-in security. diff --git a/docs/supabase/functions/new.md b/docs/supabase/functions/new.md new file mode 100644 index 000000000..cfe689ae0 --- /dev/null +++ b/docs/supabase/functions/new.md @@ -0,0 +1,7 @@ +## supabase-functions-new + +Creates a new Edge Function with boilerplate code in the `supabase/functions` directory. + +This command generates a starter TypeScript file with the necessary Deno imports and a basic function structure. The function is created as a new directory with the name you specify, containing an `index.ts` file with the function code. + +After creating the function, you can edit it locally and then use `supabase functions serve` to test it before deploying with `supabase functions deploy`. diff --git a/docs/supabase/gen.md b/docs/supabase/gen.md new file mode 100644 index 000000000..f88cbf8c9 --- /dev/null +++ b/docs/supabase/gen.md @@ -0,0 +1,9 @@ +## supabase-gen + +Automatically generates type definitions based on your Postgres database schema. + +This command connects to your database (local or remote) and generates typed definitions that match your database tables, views, and stored procedures. By default, it generates TypeScript definitions, but also supports Go and Swift. + +Generated types give you type safety and autocompletion when working with your database in code, helping prevent runtime errors and improving developer experience. + +The types respect relationships, constraints, and custom types defined in your database schema. diff --git a/docs/supabase/projects.md b/docs/supabase/projects.md new file mode 100644 index 000000000..d01c49ed6 --- /dev/null +++ b/docs/supabase/projects.md @@ -0,0 +1,7 @@ +## supabase-projects + +Provides tools for creating and managing your Supabase projects. + +This command group allows you to list all projects in your organizations, create new projects, delete existing projects, and retrieve API keys. These operations help you manage your Supabase infrastructure programmatically without using the dashboard. + +Project management via CLI is especially useful for automation scripts and when you need to provision environments in a repeatable way. diff --git a/docs/supabase/secrets.md b/docs/supabase/secrets.md new file mode 100644 index 000000000..82541c9d0 --- /dev/null +++ b/docs/supabase/secrets.md @@ -0,0 +1,11 @@ +## supabase-secrets + +Provides tools for managing environment variables and secrets for your Supabase project. + +This command group allows you to set, unset, and list secrets that are securely stored and made available to Edge Functions as environment variables. + +Secrets management through the CLI is useful for: +- Setting environment-specific configuration +- Managing sensitive credentials securely + +Secrets can be set individually or loaded from .env files for convenience. From 5dc283d3fd428ee5c823d104be9739e6d6117903 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 04:18:58 +0000 Subject: [PATCH 103/359] chore(deps): bump aws-actions/configure-aws-credentials from 4.1.0 to 4.2.0 (#3539) chore(deps): bump aws-actions/configure-aws-credentials Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases) - [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/v4.1.0...v4.2.0) --- updated-dependencies: - dependency-name: aws-actions/configure-aws-credentials dependency-version: 4.2.0 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> --- .github/workflows/mirror-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror-image.yml b/.github/workflows/mirror-image.yml index fb0bfd5db..48fb50030 100644 --- a/.github/workflows/mirror-image.yml +++ b/.github/workflows/mirror-image.yml @@ -26,7 +26,7 @@ jobs: TAG=${{ inputs.image }} echo "image=${TAG##*/}" >> $GITHUB_OUTPUT - name: configure aws credentials - uses: aws-actions/configure-aws-credentials@v4.1.0 + uses: aws-actions/configure-aws-credentials@v4.2.0 with: role-to-assume: ${{ secrets.PROD_AWS_ROLE }} aws-region: us-east-1 From 6e3f8f8ffb889ca3af66b7d8601b545077b6e3b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 May 2025 04:43:55 +0000 Subject: [PATCH 104/359] chore(deps): bump supabase/storage-api from v1.22.11 to v1.22.13 in /pkg/config/templates (#3544) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.11 to v1.22.13. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.13 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 2fed835ee..06a9fb1c1 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.172.1 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.11 AS storage +FROM supabase/storage-api:v1.22.13 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From bf039546bb6bbceab7e47bef6ae1376eb25a59d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 04:45:25 +0000 Subject: [PATCH 105/359] chore(deps): bump supabase/postgres-meta from v0.88.9 to v0.89.0 in /pkg/config/templates (#3548) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.88.9 to v0.89.0. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.89.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 06a9fb1c1..de7f74765 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.028 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.88.9 AS pgmeta +FROM supabase/postgres-meta:v0.89.0 AS pgmeta FROM supabase/studio:2025.05.05-sha-3c3fe9b AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From 2c8a36a5bf17ac88274fa74af05513df8be293ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=83=A5=EB=83=90=EC=B1=A0?= Date: Sun, 11 May 2025 00:30:41 +0900 Subject: [PATCH 106/359] fix: bump edge-runtime to 1.68.0-develop.14 (#3540) --- 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 28f61b208..ba7173cc6 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -12,7 +12,7 @@ const ( pg13 = "supabase/postgres:13.3.0" pg14 = "supabase/postgres:14.1.0.89" pg15 = "supabase/postgres:15.8.1.069" - deno2 = "supabase/edge-runtime:v1.68.0-develop.13" + deno2 = "supabase/edge-runtime:v1.68.0-develop.14" ) type images struct { From 61910ddd52e1c08f9bc9661779614151edeb20a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 23:31:03 +0800 Subject: [PATCH 107/359] chore(deps): bump golang.org/x/oauth2 from 0.29.0 to 0.30.0 (#3538) Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.29.0 to 0.30.0. - [Commits](https://github.com/golang/oauth2/compare/v0.29.0...v0.30.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-version: 0.30.0 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 438ca88cf..6f10d7c06 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( github.com/zalando/go-keyring v0.2.6 go.opentelemetry.io/otel v1.35.0 golang.org/x/mod v0.24.0 - golang.org/x/oauth2 v0.29.0 + golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.32.0 google.golang.org/grpc v1.72.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 730f6ce39..ea999a7d0 100644 --- a/go.sum +++ b/go.sum @@ -1196,8 +1196,8 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98= -golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= +golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 98f627870b744ee68bc933cbb78688907e113595 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sun, 11 May 2025 00:30:55 +0800 Subject: [PATCH 108/359] fix: do not restart auth sequence on reset (#3552) --- pkg/config/constants.go | 2 +- pkg/migration/queries/drop.sql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/config/constants.go b/pkg/config/constants.go index ba7173cc6..ad0c71d2d 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -11,7 +11,7 @@ import ( const ( pg13 = "supabase/postgres:13.3.0" pg14 = "supabase/postgres:14.1.0.89" - pg15 = "supabase/postgres:15.8.1.069" + pg15 = "supabase/postgres:15.8.1.085" deno2 = "supabase/edge-runtime:v1.68.0-develop.14" ) diff --git a/pkg/migration/queries/drop.sql b/pkg/migration/queries/drop.sql index a153891fe..4aacc641d 100644 --- a/pkg/migration/queries/drop.sql +++ b/pkg/migration/queries/drop.sql @@ -42,7 +42,7 @@ begin execute format('drop materialized view if exists %I.%I cascade', rec.relnamespace::regnamespace::name, rec.relname); end loop; - -- tables (cascade to views) + -- tables (cascade to dependent objects) for rec in select * from pg_class c @@ -65,7 +65,7 @@ begin or c.relnamespace::regnamespace::name = 'supabase_migrations') and c.relkind = 'r' loop - execute format('truncate %I.%I restart identity cascade', rec.relnamespace::regnamespace::name, rec.relname); + execute format('truncate %I.%I cascade', rec.relnamespace::regnamespace::name, rec.relname); end loop; -- sequences From b346bf0aa9d4b64299cf047a067fc67305f9811e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 04:55:02 +0000 Subject: [PATCH 109/359] chore(deps): bump supabase/studio from 2025.05.05-sha-3c3fe9b to 2025.05.12-sha-07a8d23 in /pkg/config/templates (#3555) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.05.05-sha-3c3fe9b to 2025.05.12-sha-07a8d23. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.05.12-sha-07a8d23 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index de7f74765..63f322155 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.0 AS pgmeta -FROM supabase/studio:2025.05.05-sha-3c3fe9b AS studio +FROM supabase/studio:2025.05.12-sha-07a8d23 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 3005bf87300cd196e5da10a3f57017f190be1d41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 04:59:46 +0000 Subject: [PATCH 110/359] chore(deps): bump supabase/storage-api from v1.22.13 to v1.22.15 in /pkg/config/templates (#3560) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.13 to v1.22.15. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.15 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 63f322155..48a8d9a52 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.172.1 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.13 AS storage +FROM supabase/storage-api:v1.22.15 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From e052003a8e96126a717357f8f6ddbd2bf9a99caa Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 13 May 2025 14:48:24 +0800 Subject: [PATCH 111/359] fix: session timeout uses hour unit (#3561) --- pkg/config/auth.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 4cf2a31b8..43b175bf2 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -486,13 +486,13 @@ func (m *mfa) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { } func (s sessions) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { - body.SessionsTimebox = cast.Ptr(int(s.Timebox.Seconds())) - body.SessionsInactivityTimeout = cast.Ptr(int(s.InactivityTimeout.Seconds())) + body.SessionsTimebox = cast.Ptr(int(s.Timebox.Hours())) + body.SessionsInactivityTimeout = cast.Ptr(int(s.InactivityTimeout.Hours())) } func (s *sessions) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { - s.Timebox = time.Duration(cast.Val(remoteConfig.SessionsTimebox, 0)) * time.Second - s.InactivityTimeout = time.Duration(cast.Val(remoteConfig.SessionsInactivityTimeout, 0)) * time.Second + s.Timebox = time.Duration(cast.Val(remoteConfig.SessionsTimebox, 0)) * time.Hour + s.InactivityTimeout = time.Duration(cast.Val(remoteConfig.SessionsInactivityTimeout, 0)) * time.Hour } func (e email) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { From be6681d58ff031105994bf6655478c9df77b2a91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 05:19:26 +0000 Subject: [PATCH 112/359] chore(deps): bump supabase/storage-api from v1.22.15 to v1.22.16 in /pkg/config/templates (#3563) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.15 to v1.22.16. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.16 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 48a8d9a52..e9794ef12 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.172.1 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.15 AS storage +FROM supabase/storage-api:v1.22.16 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From a6d881d26d4dccfeb27f936f4bac000acf621280 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 04:09:43 +0000 Subject: [PATCH 113/359] chore(deps): bump google.golang.org/grpc from 1.72.0 to 1.72.1 (#3567) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.72.0 to 1.72.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.72.0...v1.72.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.72.1 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 6f10d7c06..460e8704c 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( golang.org/x/mod v0.24.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.32.0 - google.golang.org/grpc v1.72.0 + google.golang.org/grpc v1.72.1 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.2 ) diff --git a/go.sum b/go.sum index ea999a7d0..5f257b042 100644 --- a/go.sum +++ b/go.sum @@ -1456,8 +1456,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.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= -google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.72.1 h1:HR03wO6eyZ7lknl75XlxABNVLLFc2PAb6mHlYh756mA= +google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= 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 1a70f265817c84d8fa25b58b1720bbcc07bd17bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 04:54:28 +0000 Subject: [PATCH 114/359] chore(deps): bump supabase/storage-api from v1.22.16 to v1.22.17 in /pkg/config/templates (#3569) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.16 to v1.22.17. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.22.17 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e9794ef12..5e70ecd81 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.172.1 AS gotrue FROM supabase/realtime:v2.34.47 AS realtime -FROM supabase/storage-api:v1.22.16 AS storage +FROM supabase/storage-api:v1.22.17 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From cf9c74b0f38f5a4ef7938ead39b07a76b6965ba9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 04:59:15 +0000 Subject: [PATCH 115/359] chore(deps): bump supabase/postgres from 17.4.1.028 to 17.4.1.029 in /pkg/config/templates (#3572) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.028 to 17.4.1.029. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.029 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5e70ecd81..334593901 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.028 AS pg +FROM supabase/postgres:17.4.1.029 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 08083360527340257ea2361137aebb36d8b3ec65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 05:04:18 +0000 Subject: [PATCH 116/359] chore(deps): bump supabase/realtime from v2.34.47 to v2.35.3 in /pkg/config/templates (#3571) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.34.47 to v2.35.3. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.35.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 334593901..d61ca7bc4 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.172.1 AS gotrue -FROM supabase/realtime:v2.34.47 AS realtime +FROM supabase/realtime:v2.35.3 AS realtime FROM supabase/storage-api:v1.22.17 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From af9584b2ee424f3f3b9636956a4d3e737cfd8ff2 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 15 May 2025 19:14:31 +0800 Subject: [PATCH 117/359] feat: unban ipv6 address (#3573) * feat: unban ipv6 address * chore: update unit tests --- internal/bans/update/update.go | 12 ++++-------- internal/bans/update/update_test.go | 13 +++++++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/internal/bans/update/update.go b/internal/bans/update/update.go index dfb31d8cf..d89fa08f2 100644 --- a/internal/bans/update/update.go +++ b/internal/bans/update/update.go @@ -13,9 +13,8 @@ import ( func validateIps(ips []string) error { for _, ip := range ips { - ip := net.ParseIP(ip) - if ip.To4() == nil { - return errors.Errorf("only IPv4 supported at the moment: %s", ip) + if net.ParseIP(ip) == nil { + return errors.Errorf("invalid IP address: %s", ip) } } return nil @@ -23,11 +22,8 @@ func validateIps(ips []string) error { func Run(ctx context.Context, projectRef string, dbIpsToUnban []string, fsys afero.Fs) error { // 1. sanity checks - { - err := validateIps(dbIpsToUnban) - if err != nil { - return err - } + if err := validateIps(dbIpsToUnban); err != nil { + return err } // 2. remove bans diff --git a/internal/bans/update/update_test.go b/internal/bans/update/update_test.go index 8e488fe42..2a40be2a4 100644 --- a/internal/bans/update/update_test.go +++ b/internal/bans/update/update_test.go @@ -8,10 +8,15 @@ import ( func TestPrivateSubnet(t *testing.T) { err := validateIps([]string{"12.3.4.5", "10.0.0.0", "1.2.3.1"}) - assert.Nil(t, err) + assert.NoError(t, err) } -func TestIpv4(t *testing.T) { - err := validateIps([]string{"12.3.4.5", "2001:db8:abcd:0012::0", "1.2.3.1"}) - assert.ErrorContains(t, err, "only IPv4 supported at the moment: 2001:db8:abcd:12::") +func TestIPv6(t *testing.T) { + err := validateIps([]string{"2001:db8:abcd:0012::0", "::0"}) + assert.NoError(t, err) +} + +func TestInvalidAddress(t *testing.T) { + err := validateIps([]string{"12.3.4"}) + assert.ErrorContains(t, err, "invalid IP address: 12.3.4") } From 74374b1bef275f286ed48482e7f1859912810ea7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 11:19:24 +0000 Subject: [PATCH 118/359] chore(deps): bump aws-actions/configure-aws-credentials from 4.2.0 to 4.2.1 (#3568) chore(deps): bump aws-actions/configure-aws-credentials Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases) - [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/v4.2.0...v4.2.1) --- updated-dependencies: - dependency-name: aws-actions/configure-aws-credentials dependency-version: 4.2.1 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> Co-authored-by: Han Qiao --- .github/workflows/mirror-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror-image.yml b/.github/workflows/mirror-image.yml index 48fb50030..d49eaea6c 100644 --- a/.github/workflows/mirror-image.yml +++ b/.github/workflows/mirror-image.yml @@ -26,7 +26,7 @@ jobs: TAG=${{ inputs.image }} echo "image=${TAG##*/}" >> $GITHUB_OUTPUT - name: configure aws credentials - uses: aws-actions/configure-aws-credentials@v4.2.0 + uses: aws-actions/configure-aws-credentials@v4.2.1 with: role-to-assume: ${{ secrets.PROD_AWS_ROLE }} aws-region: us-east-1 From dabc8d62d04551580421cab366397c314baf359b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 04:36:43 +0000 Subject: [PATCH 119/359] chore(deps): bump supabase/postgres from 17.4.1.029 to 17.4.1.030 in /pkg/config/templates (#3576) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.029 to 17.4.1.030. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.030 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index d61ca7bc4..cf98274fa 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.029 AS pg +FROM supabase/postgres:17.4.1.030 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From c055838f950df784af821be9a94733123df0a48f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 04:41:48 +0000 Subject: [PATCH 120/359] chore(deps): bump supabase/studio from 2025.05.12-sha-07a8d23 to 2025.05.15-sha-cbafd4d in /pkg/config/templates (#3577) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.05.12-sha-07a8d23 to 2025.05.15-sha-cbafd4d. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.05.15-sha-cbafd4d dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index cf98274fa..9558eb017 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.0 AS pgmeta -FROM supabase/studio:2025.05.12-sha-07a8d23 AS studio +FROM supabase/studio:2025.05.15-sha-cbafd4d AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From f08b86af910f19c94a4d7340bbe4d9bc65ae72eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 16:40:04 +0800 Subject: [PATCH 121/359] chore(deps): bump github.com/getsentry/sentry-go from 0.32.0 to 0.33.0 (#3578) Bumps [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) from 0.32.0 to 0.33.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.32.0...v0.33.0) --- updated-dependencies: - dependency-name: github.com/getsentry/sentry-go dependency-version: 0.33.0 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 460e8704c..c7aa87db2 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.11 - github.com/getsentry/sentry-go v0.32.0 + github.com/getsentry/sentry-go v0.33.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.16.0 github.com/go-viper/mapstructure/v2 v2.2.1 diff --git a/go.sum b/go.sum index 5f257b042..9e033a390 100644 --- a/go.sum +++ b/go.sum @@ -292,8 +292,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.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY= github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= -github.com/getsentry/sentry-go v0.32.0 h1:YKs+//QmwE3DcYtfKRH8/KyOOF/I6Qnx7qYGNHCGmCY= -github.com/getsentry/sentry-go v0.32.0/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY= +github.com/getsentry/sentry-go v0.33.0 h1:YWyDii0KGVov3xOaamOnF0mjOrqSjBqwv48UEzn7QFg= +github.com/getsentry/sentry-go v0.33.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= From 7cc76f1b47cd7b113b85931d4310c068001ced3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 16:41:14 +0800 Subject: [PATCH 122/359] chore(deps): bump github.com/getkin/kin-openapi from 0.127.0 to 0.131.0 (#3574) Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.127.0 to 0.131.0. - [Release notes](https://github.com/getkin/kin-openapi/releases) - [Commits](https://github.com/getkin/kin-openapi/compare/v0.127.0...v0.131.0) --- updated-dependencies: - dependency-name: github.com/getkin/kin-openapi dependency-version: 0.131.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao --- go.mod | 5 +++-- go.sum | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index c7aa87db2..8282e5e45 100644 --- a/go.mod +++ b/go.mod @@ -133,7 +133,7 @@ require ( github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/getkin/kin-openapi v0.127.0 // indirect + github.com/getkin/kin-openapi v0.131.0 // indirect github.com/ghostiam/protogetter v0.3.15 // indirect github.com/go-critic/go-critic v0.13.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect @@ -179,7 +179,6 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/invopop/yaml v0.3.1 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect @@ -236,6 +235,8 @@ require ( github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.19.1 // indirect + github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect + github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect diff --git a/go.sum b/go.sum index 9e033a390..325985bf6 100644 --- a/go.sum +++ b/go.sum @@ -290,8 +290,8 @@ 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/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY= -github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= +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.33.0 h1:YWyDii0KGVov3xOaamOnF0mjOrqSjBqwv48UEzn7QFg= github.com/getsentry/sentry-go v0.33.0/go.mod h1:C55omcY9ChRQIUcVcGcs+Zdy4ZpQGvNJ7JYHIoSWOtE= github.com/ghostiam/protogetter v0.3.15 h1:1KF5sXel0HE48zh1/vn0Loiw25A9ApyseLzQuif1mLY= @@ -517,8 +517,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= -github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -744,6 +742,10 @@ github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 h1:ykgG34472DWey7TSjd8vIfNykXgjOg github.com/oapi-codegen/oapi-codegen/v2 v2.4.1/go.mod h1:N5+lY1tiTDV3V1BeHtOxeWXHoPVeApvsvjJqegfoaz8= github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= +github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY= +github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw= +github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c= +github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= From 100ae60b493ac18a58574f614085c49e1681c063 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 16 May 2025 16:54:37 +0800 Subject: [PATCH 123/359] fix: do not override collation on pg 15.8 (#3579) --- internal/db/start/start.go | 3 ++- pkg/config/config.go | 21 ++++++++++++++++++--- pkg/config/config_test.go | 25 +++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/internal/db/start/start.go b/internal/db/start/start.go index bb3a97d67..ac71b973a 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -24,6 +24,7 @@ import ( "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/pkg/migration" "github.com/supabase/cli/pkg/vault" ) @@ -75,7 +76,7 @@ func NewContainerConfig() container.Config { "S3_ACCESS_KEY="+utils.Config.Experimental.S3AccessKey, "S3_SECRET_KEY="+utils.Config.Experimental.S3SecretKey, ) - } else { + } else if config.VersionCompare(utils.Config.Db.Image, "15.8.1.005") < 0 { env = append(env, "POSTGRES_INITDB_ARGS=--lc-collate=C.UTF-8") } config := container.Config{ diff --git a/pkg/config/config.go b/pkg/config/config.go index ddd38edef..49053381b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -607,9 +607,8 @@ func (c *config) Load(path string, fsys fs.FS) error { if c.Db.MajorVersion > 14 { if version, err := fs.ReadFile(fsys, builder.PostgresVersionPath); err == nil { // Only replace image if postgres version is above 15.1.0.55 - if strings.HasPrefix(string(version), fmt.Sprintf("%d.", c.Db.MajorVersion)) && - (c.Db.MajorVersion != 15 || semver.Compare(string(version[3:]), "1.0.55") >= 0) { - c.Db.Image = replaceImageTag(pg15, string(version)) + if VersionCompare(c.Db.Image, "15.1.0.55") >= 0 { + c.Db.Image = replaceImageTag(Images.Pg, string(version)) } } if version, err := fs.ReadFile(fsys, builder.RestVersionPath); err == nil && len(version) > 0 { @@ -647,6 +646,22 @@ func (c *config) Load(path string, fsys fs.FS) error { return c.Validate(fsys) } +func VersionCompare(a, b string) int { + var pA, pB string + if vA := strings.Split(a, "."); len(vA) > 3 { + a = strings.Join(vA[:3], ".") + pA = strings.Join(vA[3:], ".") + } + if vB := strings.Split(b, "."); len(vB) > 3 { + b = strings.Join(vB[:3], ".") + pB = strings.Join(vB[3:], ".") + } + if r := semver.Compare("v"+a, "v"+b); r != 0 { + return r + } + return semver.Compare("v"+pA, "v"+pB) +} + func (c *baseConfig) resolve(builder pathBuilder, fsys fs.FS) error { // Update content paths for name, tmpl := range c.Auth.Email.Template { diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 9d8e2c359..2d69c0510 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -615,3 +615,28 @@ func TestLoadEnvIfExists(t *testing.T) { os.Unsetenv("ANOTHER_KEY") }) } + +func TestVersionCompare(t *testing.T) { + var testcase = []struct { + a string + b string + r int + }{ + {"15.1.0.55", "15.1.0.55", 0}, + {"15.8.1.085", "15.1.0.55", 1}, + {"15.1.0.55", "15.8.1.085", -1}, + {"15.8.1", "15.8.1", 0}, + {"17", "15.8", 1}, + {"14", "15.8", -1}, + {"oriole-17", "oriole-17", 0}, + {"17", "oriole-17", 1}, + {"oriole-17", "17", -1}, + } + + for _, tt := range testcase { + t.Run(fmt.Sprintf("%s vs %s", tt.a, tt.b), func(t *testing.T) { + result := VersionCompare(tt.a, tt.b) + assert.Equal(t, tt.r, result) + }) + } +} From 29b9dac3ce9901df577aab6bed5d16601748ba19 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 19 May 2025 10:25:40 +0800 Subject: [PATCH 124/359] fix: version compare missing cases (#3581) --- internal/db/start/start.go | 2 +- pkg/config/config.go | 6 +++--- pkg/config/config_test.go | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/db/start/start.go b/internal/db/start/start.go index ac71b973a..790e565c9 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -76,7 +76,7 @@ func NewContainerConfig() container.Config { "S3_ACCESS_KEY="+utils.Config.Experimental.S3AccessKey, "S3_SECRET_KEY="+utils.Config.Experimental.S3SecretKey, ) - } else if config.VersionCompare(utils.Config.Db.Image, "15.8.1.005") < 0 { + } else if i := strings.IndexByte(utils.Config.Db.Image, ':'); config.VersionCompare(utils.Config.Db.Image[i+1:], "15.8.1.005") < 0 { env = append(env, "POSTGRES_INITDB_ARGS=--lc-collate=C.UTF-8") } config := container.Config{ diff --git a/pkg/config/config.go b/pkg/config/config.go index 49053381b..04142d783 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -607,7 +607,7 @@ func (c *config) Load(path string, fsys fs.FS) error { if c.Db.MajorVersion > 14 { if version, err := fs.ReadFile(fsys, builder.PostgresVersionPath); err == nil { // Only replace image if postgres version is above 15.1.0.55 - if VersionCompare(c.Db.Image, "15.1.0.55") >= 0 { + if i := strings.IndexByte(c.Db.Image, ':'); VersionCompare(c.Db.Image[i+1:], "15.1.0.55") >= 0 { c.Db.Image = replaceImageTag(Images.Pg, string(version)) } } @@ -650,11 +650,11 @@ func VersionCompare(a, b string) int { var pA, pB string if vA := strings.Split(a, "."); len(vA) > 3 { a = strings.Join(vA[:3], ".") - pA = strings.Join(vA[3:], ".") + pA = strings.TrimLeft(strings.Join(vA[3:], "."), "0") } if vB := strings.Split(b, "."); len(vB) > 3 { b = strings.Join(vB[:3], ".") - pB = strings.Join(vB[3:], ".") + pB = strings.TrimLeft(strings.Join(vB[3:], "."), "0") } if r := semver.Compare("v"+a, "v"+b); r != 0 { return r diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 2d69c0510..fca80ad2d 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -625,6 +625,9 @@ func TestVersionCompare(t *testing.T) { {"15.1.0.55", "15.1.0.55", 0}, {"15.8.1.085", "15.1.0.55", 1}, {"15.1.0.55", "15.8.1.085", -1}, + {"17.4.1.005", "17.4.1.005", 0}, + {"17.4.1.030", "17.4.1.005", 1}, + {"17.4.1.005", "17.4.1.030", -1}, {"15.8.1", "15.8.1", 0}, {"17", "15.8", 1}, {"14", "15.8", -1}, From 971f6fd9def08f600f838a4e6deaa901272e025a Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 19 May 2025 12:53:48 +0800 Subject: [PATCH 125/359] fix: convert timeout fields to string (#3582) fix: timeout must be typed as string --- internal/postgresConfig/update/update.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/postgresConfig/update/update.go b/internal/postgresConfig/update/update.go index 94632d486..f031b3378 100644 --- a/internal/postgresConfig/update/update.go +++ b/internal/postgresConfig/update/update.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/json" + "fmt" "strconv" "strings" @@ -53,6 +54,12 @@ func Run(ctx context.Context, projectRef string, values []string, replaceOverrid if noRestart { finalOverrides["restart_database"] = false } + // statement_timeout and wal_sender_timeout must be typed as string + for k, v := range finalOverrides { + if _, ok := v.(string); strings.HasSuffix(k, "_timeout") && !ok { + finalOverrides[k] = fmt.Sprintf("%v", v) + } + } bts, err := json.Marshal(finalOverrides) if err != nil { return errors.Errorf("failed to serialize config overrides: %w", err) From 4031bc41ddeac707ef138026fb40ced1f936a91a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 05:02:59 +0000 Subject: [PATCH 126/359] chore(deps): bump supabase/postgres from 17.4.1.030 to 17.4.1.031 in /pkg/config/templates (#3583) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.030 to 17.4.1.031. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.031 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 9558eb017..3c4f0c029 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.030 AS pg +FROM supabase/postgres:17.4.1.031 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 8cb9780e018e3db2e470968f5e26dbe5d47468de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 05:08:23 +0000 Subject: [PATCH 127/359] chore(deps): bump supabase/studio from 2025.05.15-sha-cbafd4d to 2025.05.19-sha-3487831 in /pkg/config/templates (#3584) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.05.15-sha-cbafd4d to 2025.05.19-sha-3487831. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.05.19-sha-3487831 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 3c4f0c029..77a1045a5 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.0 AS pgmeta -FROM supabase/studio:2025.05.15-sha-cbafd4d AS studio +FROM supabase/studio:2025.05.19-sha-3487831 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 712e942aae978eaa4044d8e5a328aa89d17a182f Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 20 May 2025 10:52:28 +0800 Subject: [PATCH 128/359] fix: exclude pgsodium and vault from data dump (#3585) --- internal/db/dump/dump.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/db/dump/dump.go b/internal/db/dump/dump.go index 6c668f5bd..d9cd2af7c 100644 --- a/internal/db/dump/dump.go +++ b/internal/db/dump/dump.go @@ -82,8 +82,8 @@ func dumpData(ctx context.Context, config pgconn.Config, schema, excludeTable [] "graphql_public", // "net", // "pgmq", - // "pgsodium", - // "pgsodium_masks", + "pgsodium", + "pgsodium_masks", "pgtle", "repack", "tiger", @@ -91,7 +91,7 @@ func dumpData(ctx context.Context, config pgconn.Config, schema, excludeTable [] "timescaledb_*", "_timescaledb_*", "topology", - // "vault", + "vault", // Managed by Supabase // "auth", "extensions", From f0d5eb63dba367b3391f4842343222300672aebd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 04:55:28 +0000 Subject: [PATCH 129/359] chore(deps): bump supabase/postgres from 17.4.1.031 to 17.4.1.034 in /pkg/config/templates (#3589) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.031 to 17.4.1.034. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.034 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 77a1045a5..ab373c852 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.031 AS pg +FROM supabase/postgres:17.4.1.034 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 4ac919b7a9c3a4037b182530a9399d7c350a865e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 05:00:37 +0000 Subject: [PATCH 130/359] chore(deps): bump supabase/gotrue from v2.172.1 to v2.173.0 in /pkg/config/templates (#3588) chore(deps): bump supabase/gotrue in /pkg/config/templates Bumps supabase/gotrue from v2.172.1 to v2.173.0. --- updated-dependencies: - dependency-name: supabase/gotrue dependency-version: v2.173.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index ab373c852..8ecf9c141 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -10,7 +10,7 @@ FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor -FROM supabase/gotrue:v2.172.1 AS gotrue +FROM supabase/gotrue:v2.173.0 AS gotrue FROM supabase/realtime:v2.35.3 AS realtime FROM supabase/storage-api:v1.22.17 AS storage FROM supabase/logflare:1.12.0 AS logflare From e59304e46c8aefb54b0a47c590d61803c168a7d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 05:05:36 +0000 Subject: [PATCH 131/359] chore(deps): bump supabase/postgres-meta from v0.89.0 to v0.89.1 in /pkg/config/templates (#3587) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.89.0 to v0.89.1. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.89.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 8ecf9c141..b26020a37 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.034 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.89.0 AS pgmeta +FROM supabase/postgres-meta:v0.89.1 AS pgmeta FROM supabase/studio:2025.05.19-sha-3487831 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From 5474044372b5d80af5358e72989fafa92748e2d4 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 20 May 2025 16:43:29 +0800 Subject: [PATCH 132/359] fix: escape underscore in sql like syntax (#3586) --- internal/db/diff/diff_test.go | 2 +- internal/db/push/push_test.go | 2 +- pkg/migration/file.go | 8 +++++++- pkg/migration/file_test.go | 2 +- pkg/migration/queries/drop.sql | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/internal/db/diff/diff_test.go b/internal/db/diff/diff_test.go index 71b03223e..498c88da1 100644 --- a/internal/db/diff/diff_test.go +++ b/internal/db/diff/diff_test.go @@ -268,7 +268,7 @@ func TestDiffDatabase(t *testing.T) { // Check error assert.Empty(t, diff) assert.ErrorContains(t, err, `ERROR: schema "public" already exists (SQLSTATE 42P06) -At statement 0: +At statement: 0 create schema public`) assert.Empty(t, apitest.ListUnmatchedRequests()) }) diff --git a/internal/db/push/push_test.go b/internal/db/push/push_test.go index f25ba2090..9bc1baf58 100644 --- a/internal/db/push/push_test.go +++ b/internal/db/push/push_test.go @@ -105,7 +105,7 @@ func TestMigrationPush(t *testing.T) { err := Run(context.Background(), false, false, false, false, dbConfig, fsys, conn.Intercept) // Check error assert.ErrorContains(t, err, `ERROR: null value in column "version" of relation "schema_migrations" (SQLSTATE 23502)`) - assert.ErrorContains(t, err, "At statement 0:\n"+migration.INSERT_MIGRATION_VERSION) + assert.ErrorContains(t, err, "At statement: 0\n"+migration.INSERT_MIGRATION_VERSION) }) } diff --git a/pkg/migration/file.go b/pkg/migration/file.go index 8dd254326..fbd4a3b7f 100644 --- a/pkg/migration/file.go +++ b/pkg/migration/file.go @@ -5,6 +5,7 @@ import ( "context" "crypto/sha256" "encoding/hex" + "fmt" "io" "io/fs" "path/filepath" @@ -88,11 +89,16 @@ func (m *MigrationFile) ExecBatch(ctx context.Context, conn *pgx.Conn) error { if i < len(m.Statements) { stat = m.Statements[i] } + var msg []string var pgErr *pgconn.PgError if errors.As(err, &pgErr) { stat = markError(stat, int(pgErr.Position)) + if len(pgErr.Detail) > 0 { + msg = append(msg, pgErr.Detail) + } } - return errors.Errorf("%w\nAt statement %d:\n%s", err, i, stat) + msg = append(msg, fmt.Sprintf("At statement: %d", i), stat) + return errors.Errorf("%w\n%s", err, strings.Join(msg, "\n")) } return nil } diff --git a/pkg/migration/file_test.go b/pkg/migration/file_test.go index 15bd5c751..45bee71b6 100644 --- a/pkg/migration/file_test.go +++ b/pkg/migration/file_test.go @@ -75,6 +75,6 @@ func TestMigrationFile(t *testing.T) { err := migration.ExecBatch(context.Background(), conn.MockClient(t)) // Check error assert.ErrorContains(t, err, "ERROR: schema \"public\" already exists (SQLSTATE 42P06)") - assert.ErrorContains(t, err, "At statement 0:\ncreate schema public") + assert.ErrorContains(t, err, "At statement: 0\ncreate schema public") }) } diff --git a/pkg/migration/queries/drop.sql b/pkg/migration/queries/drop.sql index 4aacc641d..ff2f1b22b 100644 --- a/pkg/migration/queries/drop.sql +++ b/pkg/migration/queries/drop.sql @@ -103,7 +103,7 @@ begin select * from pg_publication p where - p.pubname not like 'supabase_realtime%' and p.pubname not like 'realtime_messages%' + not p.pubname like any(array['supabase\_realtime%', 'realtime\_messages%']) loop execute format('drop publication if exists %I', rec.pubname); end loop; From 0b5b87359dbc61349299033bf7277efa135d791a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 May 2025 04:54:37 +0000 Subject: [PATCH 133/359] chore(deps): bump supabase/postgres from 17.4.1.034 to 17.4.1.035 in /pkg/config/templates (#3591) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.034 to 17.4.1.035. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.035 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index b26020a37..4c13ec0b4 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.034 AS pg +FROM supabase/postgres:17.4.1.035 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 27a6977619cb23ce9d48a4ffd543176f949b4e95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 May 2025 04:59:51 +0000 Subject: [PATCH 134/359] chore(deps): bump supabase/postgres-meta from v0.89.1 to v0.89.2 in /pkg/config/templates (#3590) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.89.1 to v0.89.2. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.89.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 4c13ec0b4..e62f8d5f3 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.035 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.89.1 AS pgmeta +FROM supabase/postgres-meta:v0.89.2 AS pgmeta FROM supabase/studio:2025.05.19-sha-3487831 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From 7543b4c7df9c01fed1aed791104428e7a789cd21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 04:16:37 +0000 Subject: [PATCH 135/359] chore(deps): bump go.opentelemetry.io/otel from 1.35.0 to 1.36.0 (#3596) Bumps [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) from 1.35.0 to 1.36.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.35.0...v1.36.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel dependency-version: 1.36.0 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 | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 8282e5e45..927e66604 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/tidwall/jsonc v0.3.2 github.com/withfig/autocomplete-tools/packages/cobra v1.2.0 github.com/zalando/go-keyring v0.2.6 - go.opentelemetry.io/otel v1.35.0 + go.opentelemetry.io/otel v1.36.0 golang.org/x/mod v0.24.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.32.0 @@ -313,10 +313,10 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect - go.opentelemetry.io/otel/metric v1.35.0 // indirect + go.opentelemetry.io/otel/metric v1.36.0 // indirect go.opentelemetry.io/otel/sdk v1.34.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect - go.opentelemetry.io/otel/trace v1.35.0 // indirect + go.opentelemetry.io/otel/trace v1.36.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // 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 325985bf6..44f0a5440 100644 --- a/go.sum +++ b/go.sum @@ -1033,8 +1033,8 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I= -go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= -go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= +go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= +go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 h1:ajl4QczuJVA2TU9W9AGw++86Xga/RKt//16z/yxPgdk= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0/go.mod h1:Vn3/rlOJ3ntf/Q3zAI0V5lDnTbHGaUsNUeF6nZmm7pA= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= @@ -1043,14 +1043,14 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0u go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 h1:BEj3SPM81McUZHYjRS5pEgNgnmzGJ5tRpU5krWnV8Bs= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0/go.mod h1:9cKLGBDzI/F3NoHLQGm4ZrYdIHsvGt6ej6hUowxY0J4= -go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= -go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= +go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= +go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= -go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= +go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= +go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= From 18e8c513e48ce3cfdf7fe0c582cf443e1efb88d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 04:54:44 +0000 Subject: [PATCH 136/359] chore(deps): bump supabase/postgres from 17.4.1.035 to 17.4.1.036 in /pkg/config/templates (#3598) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.035 to 17.4.1.036. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.036 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e62f8d5f3..cef0f7401 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.035 AS pg +FROM supabase/postgres:17.4.1.036 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From c60317902a5b30cfa35fc426c90cc2a10a9a3021 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 04:59:49 +0000 Subject: [PATCH 137/359] chore(deps): bump supabase/studio from 2025.05.19-sha-3487831 to 2025.05.21-sha-c9ee6bc in /pkg/config/templates (#3597) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.05.19-sha-3487831 to 2025.05.21-sha-c9ee6bc. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.05.21-sha-c9ee6bc dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index cef0f7401..4be71bb73 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.2 AS pgmeta -FROM supabase/studio:2025.05.19-sha-3487831 AS studio +FROM supabase/studio:2025.05.21-sha-c9ee6bc AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From ce6afd0e3f1ada14871fc9ac95cfb9055b444c6d Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 23 May 2025 12:45:05 +0800 Subject: [PATCH 138/359] fix: unset git branch when name is provided (#3603) --- internal/branches/create/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/branches/create/create.go b/internal/branches/create/create.go index bf2931b68..6fce6be01 100644 --- a/internal/branches/create/create.go +++ b/internal/branches/create/create.go @@ -22,8 +22,8 @@ func Run(ctx context.Context, body api.CreateBranchBody, fsys afero.Fs) error { return errors.New(context.Canceled) } body.BranchName = gitBranch + body.GitBranch = &gitBranch } - body.GitBranch = &gitBranch resp, err := utils.GetSupabase().V1CreateABranchWithResponse(ctx, flags.ProjectRef, body) if err != nil { From cae4a037d9e780aa222a001fde37e9be136502cf Mon Sep 17 00:00:00 2001 From: Philip Andrew Wee De Wang <41712275+PhilipWee@users.noreply.github.com> Date: Fri, 23 May 2025 22:27:48 +0800 Subject: [PATCH 139/359] fix: early fail on non-exposed docker daemon (#3592) * fix: early fail on non-exposed docker daemon * Removed redundant check and removed vector from start check on windows * Update internal/start/start.go --------- Co-authored-by: Han Qiao --- internal/start/start.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/start/start.go b/internal/start/start.go index 609c39518..d97d72f56 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -280,7 +280,8 @@ EOF } env = append(env, "DOCKER_HOST="+dindHost.String()) case "npipe": - fmt.Fprintln(os.Stderr, utils.Yellow("WARNING:"), "analytics requires docker daemon exposed on tcp://localhost:2375") + const dockerDaemonNeededErr = "Analytics on Windows requires Docker daemon exposed on tcp://localhost:2375.\nSee https://supabase.com/docs/guides/local-development/cli/getting-started?queryGroups=platform&platform=windows#running-supabase-locally for more details." + fmt.Fprintln(os.Stderr, utils.Yellow("WARNING:"), dockerDaemonNeededErr) env = append(env, "DOCKER_HOST="+dindHost.String()) case "unix": if dindHost, err = client.ParseHostURL(client.DefaultDockerHost); err != nil { @@ -328,7 +329,9 @@ EOF ); err != nil { return err } - started = append(started, utils.VectorId) + if parsed.Scheme != "npipe" { + started = append(started, utils.VectorId) + } } // Start Kong. From 09d48700439e4887c04a4349abdfb1c9f33bae33 Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Sat, 24 May 2025 02:47:08 +1200 Subject: [PATCH 140/359] chore: explicit permission in actions (#3411) * ci: explicit permission in actions * fix: pnpm allow build flag * chore: add comment --------- Co-authored-by: Qiao Han --- .github/workflows/ci.yml | 3 +++ .github/workflows/deploy-check.yml | 5 ++++- .github/workflows/install.yml | 6 +++++- .github/workflows/mirror-image.yml | 3 +++ .github/workflows/mirror.yml | 3 +++ .github/workflows/pg-prove.yml | 3 +++ .github/workflows/publish-migra.yml | 9 ++++++--- .github/workflows/release-beta.yml | 3 +++ .github/workflows/release.yml | 4 ++++ .github/workflows/tag-npm.yml | 3 +++ 10 files changed, 37 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73a9b684d..d29506a6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: branches: - develop +permissions: + contents: read + jobs: test: name: Test diff --git a/.github/workflows/deploy-check.yml b/.github/workflows/deploy-check.yml index 44c2806ec..3715958a0 100644 --- a/.github/workflows/deploy-check.yml +++ b/.github/workflows/deploy-check.yml @@ -1,7 +1,7 @@ name: Check Deploy on: - pull_request_target: + pull_request: types: - opened - reopened @@ -10,6 +10,9 @@ on: branches: - main +permissions: + contents: read + jobs: check: if: github.head_ref != 'develop' diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index e9bcd30b1..ee7c3e5ca 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -14,6 +14,9 @@ on: - 'package.json' - 'scripts/**' +permissions: + contents: write + jobs: pack: runs-on: ubuntu-latest @@ -99,7 +102,8 @@ jobs: - run: npm install -g pnpm - run: pnpm init - - run: pnpm i --save-dev ./supabase-1.28.0.tgz + # https://github.com/pnpm/pnpm/issues/9124#issuecomment-2663021284 + - run: pnpm i --save-dev ./supabase-1.28.0.tgz --allow-build=supabase - run: pnpm supabase --version bun: diff --git a/.github/workflows/mirror-image.yml b/.github/workflows/mirror-image.yml index d49eaea6c..82f1bc395 100644 --- a/.github/workflows/mirror-image.yml +++ b/.github/workflows/mirror-image.yml @@ -13,6 +13,9 @@ on: required: true type: string +permissions: + contents: read + jobs: mirror: runs-on: ubuntu-latest diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 0eb46d868..126949ac0 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -19,6 +19,9 @@ on: - submitted workflow_dispatch: +permissions: + contents: read + jobs: setup: runs-on: ubuntu-latest diff --git a/.github/workflows/pg-prove.yml b/.github/workflows/pg-prove.yml index 9844d7e61..052ac6583 100644 --- a/.github/workflows/pg-prove.yml +++ b/.github/workflows/pg-prove.yml @@ -3,6 +3,9 @@ name: Publish pg_prove on: workflow_dispatch: +permissions: + contents: read + jobs: settings: runs-on: ubuntu-latest diff --git a/.github/workflows/publish-migra.yml b/.github/workflows/publish-migra.yml index e3db68cb6..b4a2625c5 100644 --- a/.github/workflows/publish-migra.yml +++ b/.github/workflows/publish-migra.yml @@ -3,6 +3,9 @@ name: Publish migra on: workflow_dispatch: +permissions: + contents: read + jobs: settings: runs-on: ubuntu-latest @@ -70,9 +73,9 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Merge multi-arch manifests run: | - docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ - ${{ needs.settings.outputs.image_tag }}_amd64 \ - ${{ needs.settings.outputs.image_tag }}_arm64 + docker buildx imagetools create -t "${{ needs.settings.outputs.image_tag }}" \ + "${{ needs.settings.outputs.image_tag }}_amd64" \ + "${{ needs.settings.outputs.image_tag }}_arm64" publish: needs: diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index bc2601c0d..e658a7614 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -6,6 +6,9 @@ on: - develop workflow_dispatch: +permissions: + contents: write + jobs: release: name: semantic-release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ef8b4383..369f0de89 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,10 @@ on: - main workflow_call: +permissions: + contents: write + packages: write + jobs: settings: runs-on: ubuntu-latest diff --git a/.github/workflows/tag-npm.yml b/.github/workflows/tag-npm.yml index 9eda44cba..578756261 100644 --- a/.github/workflows/tag-npm.yml +++ b/.github/workflows/tag-npm.yml @@ -13,6 +13,9 @@ on: required: true type: string +permissions: + contents: read + jobs: tag: name: Move latest tag From 48a3378d5e16a5001d61ba79707b3071c49d1c60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 04:32:28 +0000 Subject: [PATCH 141/359] chore(deps): bump supabase/studio from 2025.05.21-sha-c9ee6bc to 2025.05.26-sha-bd7334d in /pkg/config/templates (#3610) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.05.21-sha-c9ee6bc to 2025.05.26-sha-bd7334d. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.05.26-sha-bd7334d dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 4be71bb73..10bcecb95 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.2 AS pgmeta -FROM supabase/studio:2025.05.21-sha-c9ee6bc AS studio +FROM supabase/studio:2025.05.26-sha-bd7334d AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 27801f02fb74fe3b8eb0538a32850548bd68acd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 04:20:46 +0000 Subject: [PATCH 142/359] chore(deps): bump google.golang.org/grpc from 1.72.1 to 1.72.2 (#3618) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.72.1 to 1.72.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.72.1...v1.72.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.72.2 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 927e66604..5f215c1ea 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( golang.org/x/mod v0.24.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.32.0 - google.golang.org/grpc v1.72.1 + google.golang.org/grpc v1.72.2 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.2 ) diff --git a/go.sum b/go.sum index 44f0a5440..939e656d3 100644 --- a/go.sum +++ b/go.sum @@ -1458,8 +1458,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.72.1 h1:HR03wO6eyZ7lknl75XlxABNVLLFc2PAb6mHlYh756mA= -google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8= +google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= 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 ab3ae0a49385f15fb18727c9ae6669c1f399ae10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 04:42:31 +0000 Subject: [PATCH 143/359] chore(deps): bump supabase/realtime from v2.35.3 to v2.35.4 in /pkg/config/templates (#3619) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.35.3 to v2.35.4. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.35.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 10bcecb95..42e1f7d12 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.173.0 AS gotrue -FROM supabase/realtime:v2.35.3 AS realtime +FROM supabase/realtime:v2.35.4 AS realtime FROM supabase/storage-api:v1.22.17 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From 9a2a740058fd05f49288bdaeda4a647e7968eafd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 14:14:41 +0800 Subject: [PATCH 144/359] chore(deps): bump github.com/slack-go/slack from 0.16.0 to 0.17.0 (#3611) Bumps [github.com/slack-go/slack](https://github.com/slack-go/slack) from 0.16.0 to 0.17.0. - [Release notes](https://github.com/slack-go/slack/releases) - [Changelog](https://github.com/slack-go/slack/blob/master/history.go) - [Commits](https://github.com/slack-go/slack/compare/v0.16.0...v0.17.0) --- updated-dependencies: - dependency-name: github.com/slack-go/slack dependency-version: 0.17.0 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 | 15 ++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 5f215c1ea..338374769 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 github.com/oapi-codegen/runtime v1.1.1 - github.com/slack-go/slack v0.16.0 + github.com/slack-go/slack v0.17.0 github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 @@ -167,7 +167,7 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gorilla/css v1.0.1 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.5.0 // indirect github.com/gostaticanalysis/forcetypeassert v0.2.0 // indirect diff --git a/go.sum b/go.sum index 939e656d3..728858f7c 100644 --- a/go.sum +++ b/go.sum @@ -336,9 +336,8 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8Wd github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= -github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= +github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= @@ -440,7 +439,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= @@ -475,9 +473,8 @@ github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= @@ -892,8 +889,8 @@ github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+W github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= -github.com/slack-go/slack v0.16.0 h1:khp/WCFv+Hb/B/AJaAwvcxKun0hM6grN0bUZ8xG60P8= -github.com/slack-go/slack v0.16.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= +github.com/slack-go/slack v0.17.0 h1:Vqd4GGIcwwgEu80GBs3cXoPPho5bkDGSFnuZbSG0NhA= +github.com/slack-go/slack v0.17.0/go.mod h1:X+UqOufi3LYQHDnMG1vxf0J8asC6+WllXrVrhl8/Prk= github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= From 2ac3b73239ad0751542f6b6760ce89c2d00345bf Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 27 May 2025 20:52:41 +0800 Subject: [PATCH 145/359] fix: use new api types (#3621) * chore: update api spec * fix: use new api types --- api/beta.yaml | 4201 ++++++++++++----- cmd/branches.go | 2 +- cmd/projects.go | 41 +- internal/bootstrap/bootstrap.go | 6 +- internal/branches/delete/delete.go | 7 +- internal/branches/get/get.go | 9 +- internal/branches/update/update.go | 7 +- internal/functions/deploy/bundle.go | 3 +- internal/link/link.go | 2 +- internal/link/link_test.go | 29 +- internal/projects/create/create.go | 8 +- internal/projects/create/create_test.go | 4 +- internal/secrets/set/set.go | 8 +- internal/secrets/set/set_test.go | 12 +- internal/ssl_enforcement/update/update.go | 8 +- internal/sso/create/create.go | 21 +- internal/sso/get/get.go | 16 +- internal/sso/internal/render/render.go | 31 +- internal/sso/internal/saml/files.go | 14 +- internal/sso/internal/saml/files_test.go | 30 +- internal/sso/list/list.go | 2 +- internal/sso/remove/remove.go | 15 +- internal/sso/update/update.go | 32 +- internal/utils/tenant/database_test.go | 31 +- pkg/api/client.gen.go | 5250 ++++++++++++++------- pkg/api/types.gen.go | 3011 ++++++++---- pkg/config/api.go | 4 +- pkg/config/auth.go | 14 +- pkg/config/storage.go | 14 +- pkg/config/updater_test.go | 21 +- pkg/function/api.go | 10 +- pkg/function/batch.go | 16 +- pkg/function/batch_test.go | 4 +- pkg/function/bundle.go | 7 +- pkg/function/deploy.go | 12 +- pkg/function/deploy_test.go | 6 +- 36 files changed, 8858 insertions(+), 4050 deletions(-) diff --git a/api/beta.yaml b/api/beta.yaml index be28b6c21..11ea9f55a 100644 --- a/api/beta.yaml +++ b/api/beta.yaml @@ -11,6 +11,7 @@ paths: in: path description: Branch ID schema: + format: uuid type: string responses: '200': @@ -35,6 +36,7 @@ paths: in: path description: Branch ID schema: + format: uuid type: string requestBody: required: true @@ -65,6 +67,7 @@ paths: in: path description: Branch ID schema: + format: uuid type: string responses: '200': @@ -90,7 +93,14 @@ paths: in: path description: Branch ID schema: + format: uuid type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BranchActionBody' responses: '201': description: '' @@ -104,6 +114,38 @@ paths: - Environments security: - bearer: [] + /v1/branches/{branch_id}/merge: + post: + operationId: v1-merge-a-branch + summary: Merges a database branch + description: Merges the specified database branch + parameters: + - name: branch_id + required: true + in: path + description: Branch ID + schema: + format: uuid + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BranchActionBody' + responses: + '201': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/BranchUpdateResponse' + '500': + description: Failed to merge database branch + tags: + - Environments + security: + - bearer: [] /v1/branches/{branch_id}/reset: post: operationId: v1-reset-a-branch @@ -115,7 +157,14 @@ paths: in: path description: Branch ID schema: + format: uuid type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BranchActionBody' responses: '201': description: '' @@ -157,7 +206,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/V1CreateProjectBodyDto' + $ref: '#/components/schemas/V1CreateProjectBody' responses: '201': description: '' @@ -199,7 +248,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateOrganizationV1Dto' + $ref: '#/components/schemas/CreateOrganizationV1' responses: '201': description: '' @@ -222,6 +271,7 @@ paths: required: true in: query schema: + format: uuid type: string - name: response_type required: true @@ -267,7 +317,7 @@ paths: - S256 type: string responses: - '303': + '204': description: '' tags: - OAuth @@ -307,7 +357,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OAuthRevokeTokenBodyDto' + $ref: '#/components/schemas/OAuthRevokeTokenBody' responses: '204': description: '' @@ -321,6 +371,15 @@ paths: operationId: v1-list-all-snippets summary: Lists SQL snippets for the logged in user parameters: + - name: project_ref + required: false + in: query + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string - name: cursor required: false in: query @@ -349,11 +408,6 @@ paths: - asc - desc type: string - - name: project_ref - required: false - in: query - schema: - type: string responses: '200': description: '' @@ -403,10 +457,12 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: reveal - required: true + required: false in: query + description: Boolean string, true or false schema: type: boolean responses: @@ -418,6 +474,8 @@ paths: type: array items: $ref: '#/components/schemas/ApiKeyResponse' + '403': + description: '' tags: - Secrets security: @@ -433,10 +491,12 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: reveal - required: true + required: false in: query + description: Boolean string, true or false schema: type: boolean requestBody: @@ -452,6 +512,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiKeyResponse' + '403': + description: '' tags: - Secrets security: @@ -468,15 +530,18 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: id required: true in: path schema: + format: uuid type: string - name: reveal - required: true + required: false in: query + description: Boolean string, true or false schema: type: boolean requestBody: @@ -492,6 +557,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiKeyResponse' + '403': + description: '' tags: - Secrets security: @@ -507,15 +574,18 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: id required: true in: path schema: + format: uuid type: string - name: reveal - required: true + required: false in: query + description: Boolean string, true or false schema: type: boolean responses: @@ -525,6 +595,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiKeyResponse' + '403': + description: '' tags: - Secrets security: @@ -540,15 +612,18 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: id required: true in: path schema: + format: uuid type: string - name: reveal - required: true + required: false in: query + description: Boolean string, true or false schema: type: boolean responses: @@ -577,6 +652,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -587,6 +663,8 @@ paths: type: array items: $ref: '#/components/schemas/BranchResponse' + '403': + description: '' '500': description: Failed to retrieve database branches tags: @@ -605,6 +683,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -619,6 +698,8 @@ paths: application/json: schema: $ref: '#/components/schemas/BranchResponse' + '403': + description: '' '500': description: Failed to create database branch tags: @@ -637,10 +718,13 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': description: '' + '403': + description: '' '500': description: Failed to disable preview branching tags: @@ -659,6 +743,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -686,6 +771,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -710,6 +796,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -746,6 +833,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '201': @@ -774,6 +862,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '201': @@ -802,6 +891,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '201': @@ -818,6 +908,37 @@ paths: - Projects security: - bearer: [] + /v1/projects/{ref}/network-bans/retrieve/enriched: + post: + operationId: v1-list-all-network-bans-enriched + summary: >- + [Beta] Gets project's network bans with additional information about + which databases they affect + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '201': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkBanResponseEnriched' + '403': + description: '' + '500': + description: Failed to retrieve project's enriched network bans + tags: + - Projects + security: + - bearer: [] /v1/projects/{ref}/network-bans: delete: operationId: v1-delete-network-bans @@ -830,6 +951,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -860,6 +982,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -888,6 +1011,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -922,6 +1046,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -951,6 +1076,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -985,6 +1111,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1012,13 +1139,14 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdatePostgrestConfigBody' + $ref: '#/components/schemas/V1UpdatePostgrestConfigBody' responses: '200': description: '' @@ -1046,6 +1174,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1054,6 +1183,8 @@ paths: application/json: schema: $ref: '#/components/schemas/V1ProjectWithDatabaseResponse' + '403': + description: '' '500': description: Failed to retrieve project tags: @@ -1071,6 +1202,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1098,6 +1230,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1128,15 +1261,14 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/CreateSecretBody' + $ref: '#/components/schemas/CreateSecretBody' responses: '201': description: '' @@ -1160,6 +1292,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1172,10 +1305,6 @@ paths: responses: '200': description: '' - content: - application/json: - schema: - type: object '403': description: '' '500': @@ -1196,6 +1325,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1223,6 +1353,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1264,6 +1395,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1292,6 +1424,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1319,6 +1452,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1343,6 +1477,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1377,6 +1512,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1411,6 +1547,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1445,6 +1582,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1473,6 +1611,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: tracking_id required: false @@ -1506,6 +1645,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1514,6 +1654,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ReadOnlyStatusResponse' + '403': + description: '' '500': description: Failed to get project readonly mode status tags: @@ -1532,10 +1674,13 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '201': description: '' + '403': + description: '' '500': description: Failed to disable project's readonly mode tags: @@ -1554,6 +1699,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1584,6 +1730,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1614,21 +1761,14 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - - name: timeout_ms - required: false - in: query - schema: - minimum: 0 - maximum: 10000 - type: integer - name: services required: true in: query schema: type: array items: - type: string enum: - auth - db @@ -1636,6 +1776,13 @@ paths: - realtime - rest - storage + - name: timeout_ms + required: false + in: query + schema: + minimum: 0 + maximum: 10000 + type: integer responses: '200': description: '' @@ -1653,10 +1800,10 @@ paths: - Projects security: - bearer: [] - /v1/projects/{ref}/config/storage: - get: - operationId: v1-get-storage-config - summary: Gets project's storage config + /v1/projects/{ref}/config/auth/signing-keys: + post: + operationId: createSigningKeyForProject + summary: '[Alpha] Create a new signing key for the project in standby status' parameters: - name: ref required: true @@ -1665,25 +1812,30 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSigningKeyBody' responses: - '200': + '201': description: '' content: application/json: schema: - $ref: '#/components/schemas/StorageConfigResponse' + $ref: '#/components/schemas/SigningKeyResponse' '403': description: '' - '500': - description: Failed to retrieve project's storage config tags: - - Storage + - Auth security: - bearer: [] - patch: - operationId: v1-update-storage-config - summary: Updates project's storage config + get: + operationId: listSigningKeysForProject + summary: '[Alpha] List all signing keys for the project' parameters: - name: ref required: true @@ -1692,29 +1844,32 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateStorageConfigBody' responses: '200': description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/SigningKeysResponse' '403': description: '' - '500': - description: Failed to update project's storage config tags: - - Storage + - Auth security: - bearer: [] - /v1/projects/{ref}/config/database/postgres: + /v1/projects/{ref}/config/auth/signing-keys/{id}: get: - operationId: v1-get-postgres-config - summary: Gets project's Postgres config + operationId: getSigningKeyForProject + summary: '[Alpha] Get information about a signing key' parameters: + - name: id + required: true + in: path + schema: + format: uuid + type: string - name: ref required: true in: path @@ -1722,6 +1877,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1729,17 +1885,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PostgresConfigResponse' - '500': - description: Failed to retrieve project's Postgres config + $ref: '#/components/schemas/SigningKeyResponse' + '403': + description: '' tags: - - Database + - Auth security: - bearer: [] - put: - operationId: v1-update-postgres-config - summary: Updates project's Postgres config + delete: + operationId: deleteSigningKey + summary: >- + [Alpha] Remove a signing key from a project, where the status is + previously_used parameters: + - name: id + required: true + in: path + schema: + format: uuid + type: string - name: ref required: true in: path @@ -1747,33 +1911,31 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePostgresConfigBody' responses: '200': description: '' content: application/json: schema: - $ref: '#/components/schemas/PostgresConfigResponse' + $ref: '#/components/schemas/SigningKeyResponse' '403': description: '' - '500': - description: Failed to update project's Postgres config tags: - - Database + - Auth security: - bearer: [] - /v1/projects/{ref}/config/database/pgbouncer: - get: - operationId: v1-get-project-pgbouncer-config - summary: Get project's pgbouncer config + patch: + operationId: patchSigningKey + summary: '[Alpha] Update a signing key, mainly its status' parameters: + - name: id + required: true + in: path + schema: + format: uuid + type: string - name: ref required: true in: path @@ -1781,22 +1943,31 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSigningKeyBody' responses: '200': description: '' content: application/json: schema: - $ref: '#/components/schemas/V1PgbouncerConfigResponse' - '500': - description: Failed to retrieve project's pgbouncer config + $ref: '#/components/schemas/SigningKeyResponse' + '403': + description: '' tags: - - Database - /v1/projects/{ref}/config/database/pooler: + - Auth + security: + - bearer: [] + /v1/projects/{ref}/config/storage: get: - operationId: v1-get-supavisor-config - summary: Gets project's supavisor config + operationId: v1-get-storage-config + summary: Gets project's storage config parameters: - name: ref required: true @@ -1805,6 +1976,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1812,18 +1984,18 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/SupavisorConfigResponse' + $ref: '#/components/schemas/StorageConfigResponse' + '403': + description: '' '500': - description: Failed to retrieve project's supavisor config + description: Failed to retrieve project's storage config tags: - - Database + - Storage security: - bearer: [] patch: - operationId: v1-update-supavisor-config - summary: Updates project's supavisor config + operationId: v1-update-storage-config + summary: Updates project's storage config parameters: - name: ref required: true @@ -1832,24 +2004,174 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateSupavisorConfigBody' + $ref: '#/components/schemas/UpdateStorageConfigBody' responses: '200': description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSupavisorConfigResponse' '403': description: '' '500': - description: Failed to update project's supavisor config + description: Failed to update project's storage config + tags: + - Storage + security: + - bearer: [] + /v1/projects/{ref}/config/database/postgres: + get: + operationId: v1-get-postgres-config + summary: Gets project's Postgres config + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PostgresConfigResponse' + '403': + description: '' + '500': + description: Failed to retrieve project's Postgres config + tags: + - Database + security: + - bearer: [] + put: + operationId: v1-update-postgres-config + summary: Updates project's Postgres config + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePostgresConfigBody' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PostgresConfigResponse' + '403': + description: '' + '500': + description: Failed to update project's Postgres config + tags: + - Database + security: + - bearer: [] + /v1/projects/{ref}/config/database/pgbouncer: + get: + operationId: v1-get-project-pgbouncer-config + summary: Get project's pgbouncer config + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/V1PgbouncerConfigResponse' + '403': + description: '' + '500': + description: Failed to retrieve project's pgbouncer config + tags: + - Database + /v1/projects/{ref}/config/database/pooler: + get: + operationId: v1-get-pooler-config + summary: Gets project's supavisor config + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SupavisorConfigResponse' + '500': + description: Failed to retrieve project's supavisor config + tags: + - Database + security: + - bearer: [] + patch: + operationId: v1-update-pooler-config + summary: Updates project's supavisor config + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSupavisorConfigBody' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSupavisorConfigResponse' + '403': + description: '' + '500': + description: Failed to update project's supavisor config tags: - Database security: @@ -1866,6 +2188,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1893,6 +2216,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1927,6 +2251,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -1949,7 +2274,7 @@ paths: - bearer: [] get: operationId: listTPAForProject - summary: '[Alpha] Lists all third-party auth integrations' + summary: Lists all third-party auth integrations parameters: - name: ref required: true @@ -1958,6 +2283,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -1977,7 +2303,7 @@ paths: /v1/projects/{ref}/config/auth/third-party-auth/{tpa_id}: delete: operationId: deleteTPAForProject - summary: '[Alpha] Removes a third-party auth integration' + summary: Removes a third-party auth integration parameters: - name: ref required: true @@ -1986,11 +2312,13 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: tpa_id required: true in: path schema: + format: uuid type: string responses: '200': @@ -2007,7 +2335,7 @@ paths: - bearer: [] get: operationId: getTPAForProject - summary: '[Alpha] Get a third-party integration' + summary: Get a third-party integration parameters: - name: ref required: true @@ -2016,11 +2344,13 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: tpa_id required: true in: path schema: + format: uuid type: string responses: '200': @@ -2047,6 +2377,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2065,7 +2396,11 @@ paths: - name: ref required: true in: path + description: Project ref schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2088,14 +2423,12 @@ paths: - name: ref required: true in: path + description: Project ref schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RestoreProjectBodyDto' responses: '200': description: '' @@ -2113,7 +2446,11 @@ paths: - name: ref required: true in: path + description: Project ref schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2124,30 +2461,19 @@ paths: - Projects security: - bearer: [] - /v1/projects/{ref}/analytics/endpoints/logs.all: + /v1/projects/{ref}/billing/addons: get: - operationId: getLogs - summary: Gets project's logs + operationId: v1-list-project-addons + summary: Lists project addons parameters: - - name: iso_timestamp_end - required: false - in: query - schema: - type: string - - name: iso_timestamp_start - required: false - in: query - schema: - type: string - - name: sql - required: false - in: query - schema: - type: string - name: ref required: true in: path + description: Project ref schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2155,17 +2481,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/V1AnalyticsResponse' + $ref: '#/components/schemas/ListProjectAddonsResponse' '403': description: '' - tags: - - Analytics + '500': + description: Failed to list project addons security: - bearer: [] - /v1/projects/{ref}/database/query: - post: - operationId: v1-run-a-query - summary: '[Beta] Run sql query' + patch: + operationId: v1-apply-project-addon + summary: Applies project addon parameters: - name: ref required: true @@ -2174,32 +2499,27 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/V1RunQueryBody' + $ref: '#/components/schemas/ApplyProjectAddonBody' responses: - '201': + '200': description: '' - content: - application/json: - schema: - type: object '403': description: '' '500': - description: Failed to run sql query - tags: - - Database + description: Failed to apply project addon security: - bearer: [] - /v1/projects/{ref}/database/webhooks/enable: - post: - operationId: v1-enable-database-webhook - summary: '[Beta] Enables Database Webhooks on the project' + /v1/projects/{ref}/billing/addons/{addon_variant}: + delete: + operationId: v1-remove-project-addon + summary: Removes project addon parameters: - name: ref required: true @@ -2208,22 +2528,57 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string + - name: addon_variant + required: true + in: path + oneOf: + - type: string + enum: + - ci_micro + - ci_small + - ci_medium + - ci_large + - ci_xlarge + - ci_2xlarge + - ci_4xlarge + - ci_8xlarge + - ci_12xlarge + - ci_16xlarge + - ci_24xlarge + - ci_24xlarge_optimized_cpu + - ci_24xlarge_optimized_memory + - ci_24xlarge_high_memory + - ci_48xlarge + - ci_48xlarge_optimized_cpu + - ci_48xlarge_optimized_memory + - ci_48xlarge_high_memory + - type: string + enum: + - cd_default + - type: string + enum: + - pitr_7 + - pitr_14 + - pitr_28 + - type: string + enum: + - ipv4_default + schema: {} responses: - '201': + '200': description: '' '403': description: '' '500': - description: Failed to enable Database Webhooks on the project - tags: - - Database + description: Failed to remove project addon security: - bearer: [] - /v1/projects/{ref}/database/context: + /v1/projects/{ref}/advisors/performance: get: - operationId: getDatabaseMetadata - summary: Gets database metadata for the given project. + operationId: getPerformanceAdvisors + summary: Gets project performance advisors. description: >- This is an **experimental** endpoint. It is subject to change or removal in future versions. Use it with caution, as it may not remain supported @@ -2233,7 +2588,11 @@ paths: - name: ref required: true in: path + description: Project ref schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2241,18 +2600,22 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GetProjectDbMetadataResponseDto' + $ref: '#/components/schemas/V1ProjectAdvisorsResponse' '403': description: '' tags: - - Database + - Projects Advisors security: - bearer: [] - /v1/projects/{ref}/functions: + /v1/projects/{ref}/advisors/security: get: - operationId: v1-list-all-functions - summary: List all functions - description: Returns all functions you've previously added to the specified project. + operationId: getSecurityAdvisors + summary: Gets project security advisors. + description: >- + This is an **experimental** endpoint. It is subject to change or removal + in future versions. Use it with caution, as it may not remain supported + or stable. + deprecated: true parameters: - name: ref required: true @@ -2261,6 +2624,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2268,21 +2632,30 @@ paths: content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/FunctionResponse' + $ref: '#/components/schemas/V1ProjectAdvisorsResponse' '403': description: '' - '500': - description: Failed to retrieve project's functions tags: - - Edge Functions + - Projects Advisors security: - bearer: [] - post: - operationId: v1-create-a-function - summary: Create a function - description: Creates a function and adds it to the specified project. + /v1/projects/{ref}/analytics/endpoints/logs.all: + get: + operationId: getLogs + summary: Gets project's logs + description: > + Executes a SQL query on the project's logs. + + + Either the 'iso_timestamp_start' and 'iso_timestamp_end' parameters must + be provided. + + If both are not provided, only the last 1 minute of logs will be + queried. + + The timestamp range must be no more than 24 hours and is rounded to the + nearest minute. If the range is more than 24 hours, a validation error + will be thrown. parameters: - name: ref required: true @@ -2291,14 +2664,318 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - - name: slug + - name: sql required: false in: query schema: - pattern: /^[A-Za-z0-9_-]+$/ type: string - - name: name + - name: iso_timestamp_start + required: false + in: query + schema: + format: date-time + type: string + - name: iso_timestamp_end + required: false + in: query + schema: + format: date-time + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsResponse' + '403': + description: '' + tags: + - Analytics + security: + - bearer: [] + /v1/projects/{ref}/analytics/endpoints/usage.api-counts: + get: + operationId: getApiCounts + summary: Gets project's usage api counts + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + - name: interval + required: false + in: query + schema: + enum: + - 15min + - 30min + - 1hr + - 3hr + - 1day + - 3day + - 7day + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsResponse' + '403': + description: '' + '500': + description: Failed to get project's usage api counts + tags: + - Projects Analytics + security: + - bearer: [] + /v1/projects/{ref}/analytics/endpoints/usage.api-requests-count: + get: + operationId: getApiRequestsCount + summary: Gets project's usage api requests count + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsResponse' + '500': + description: Failed to get project's usage api requests count + tags: + - Projects Analytics + security: + - bearer: [] + /v1/projects/{ref}/database/migrations: + get: + operationId: v1-list-migration-history + summary: '[Beta] List applied migration versions' + description: Only available to selected partner OAuth apps + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/V1ListMigrationsResponse' + '403': + description: '' + '500': + description: Failed to list database migrations + tags: + - Database + security: + - bearer: [] + post: + operationId: v1-apply-a-migration + summary: '[Beta] Apply a database migration' + description: Only available to selected partner OAuth apps + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + - name: Idempotency-Key + required: false + in: header + description: A unique key to ensure the same migration is tracked only once. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/V1CreateMigrationBody' + responses: + '200': + description: '' + '403': + description: '' + '500': + description: Failed to apply database migration + tags: + - Database + security: + - bearer: [] + /v1/projects/{ref}/database/query: + post: + operationId: v1-run-a-query + summary: '[Beta] Run sql query' + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/V1RunQueryBody' + responses: + '201': + description: '' + '403': + description: '' + '500': + description: Failed to run sql query + tags: + - Database + security: + - bearer: [] + /v1/projects/{ref}/database/webhooks/enable: + post: + operationId: v1-enable-database-webhook + summary: '[Beta] Enables Database Webhooks on the project' + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '201': + description: '' + '403': + description: '' + '500': + description: Failed to enable Database Webhooks on the project + tags: + - Database + security: + - bearer: [] + /v1/projects/{ref}/database/context: + get: + operationId: getDatabaseMetadata + summary: Gets database metadata for the given project. + description: >- + This is an **experimental** endpoint. It is subject to change or removal + in future versions. Use it with caution, as it may not remain supported + or stable. + deprecated: true + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GetProjectDbMetadataResponse' + '403': + description: '' + tags: + - Database + security: + - bearer: [] + /v1/projects/{ref}/functions: + get: + operationId: v1-list-all-functions + summary: List all functions + description: Returns all functions you've previously added to the specified project. + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FunctionResponse' + '403': + description: '' + '500': + description: Failed to retrieve project's functions + tags: + - Edge Functions + security: + - bearer: [] + post: + operationId: v1-create-a-function + summary: Create a function + description: >- + This endpoint is deprecated - use the deploy endpoint. Creates a + function and adds it to the specified project. + deprecated: true + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + pattern: ^[a-z]+$ + type: string + - name: slug + required: false + in: query + schema: + pattern: ^[A-Za-z0-9_-]+$ + type: string + - name: name required: false in: query schema: @@ -2306,11 +2983,13 @@ paths: - name: verify_jwt required: false in: query + description: Boolean string, true or false schema: type: boolean - name: import_map required: false in: query + description: Boolean string, true or false schema: type: boolean - name: entrypoint_path @@ -2323,22 +3002,12 @@ paths: in: query schema: type: string - - name: compute_multiplier - required: false - in: query - schema: - minimum: 1 - maximum: 4 - type: number requestBody: required: true content: - application/json: - schema: - $ref: '#/components/schemas/V1CreateFunctionBody' application/vnd.denoland.eszip: - schema: - $ref: '#/components/schemas/V1CreateFunctionBody' + type: string + format: binary responses: '201': description: '' @@ -2369,15 +3038,14 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/BulkUpdateFunctionBody' + $ref: '#/components/schemas/BulkUpdateFunctionBody' responses: '200': description: '' @@ -2408,16 +3076,18 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: slug required: false in: query schema: - pattern: /^[A-Za-z0-9_-]+$/ + pattern: ^[A-Za-z0-9_-]+$ type: string - name: bundleOnly required: false in: query + description: Boolean string, true or false schema: type: boolean requestBody: @@ -2454,13 +3124,14 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: function_slug required: true in: path description: Function slug schema: - pattern: /^[A-Za-z0-9_-]+$/ + pattern: ^[A-Za-z0-9_-]+$ type: string responses: '200': @@ -2489,19 +3160,20 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: function_slug required: true in: path description: Function slug schema: - pattern: /^[A-Za-z0-9_-]+$/ + pattern: ^[A-Za-z0-9_-]+$ type: string - name: slug required: false in: query schema: - pattern: /^[A-Za-z0-9_-]+$/ + pattern: ^[A-Za-z0-9_-]+$ type: string - name: name required: false @@ -2511,11 +3183,13 @@ paths: - name: verify_jwt required: false in: query + description: Boolean string, true or false schema: type: boolean - name: import_map required: false in: query + description: Boolean string, true or false schema: type: boolean - name: entrypoint_path @@ -2528,13 +3202,6 @@ paths: in: query schema: type: string - - name: compute_multiplier - required: false - in: query - schema: - minimum: 1 - maximum: 4 - type: number requestBody: required: true content: @@ -2571,13 +3238,14 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: function_slug required: true in: path description: Function slug schema: - pattern: /^[A-Za-z0-9_-]+$/ + pattern: ^[A-Za-z0-9_-]+$ type: string responses: '200': @@ -2603,17 +3271,22 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: function_slug required: true in: path description: Function slug schema: - pattern: /^[A-Za-z0-9_-]+$/ + pattern: ^[A-Za-z0-9_-]+$ type: string responses: '200': description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/StreamableFile' '403': description: '' '500': @@ -2634,6 +3307,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2664,6 +3338,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -2697,6 +3372,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2725,11 +3401,13 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: provider_id required: true in: path schema: + format: uuid type: string responses: '200': @@ -2759,11 +3437,13 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: provider_id required: true in: path schema: + format: uuid type: string requestBody: required: true @@ -2799,11 +3479,13 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string - name: provider_id required: true in: path schema: + format: uuid type: string responses: '200': @@ -2834,6 +3516,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string responses: '200': @@ -2842,6 +3525,8 @@ paths: application/json: schema: $ref: '#/components/schemas/V1BackupsResponse' + '403': + description: '' '500': description: Failed to get backups tags: @@ -2860,6 +3545,7 @@ paths: schema: minLength: 20 maxLength: 20 + pattern: ^[a-z]+$ type: string requestBody: required: true @@ -2870,6 +3556,8 @@ paths: responses: '201': description: '' + '403': + description: '' tags: - Database security: @@ -2882,7 +3570,9 @@ paths: - name: slug required: true in: path + description: Organization slug schema: + pattern: ^[\w-]+$ type: string responses: '200': @@ -2893,6 +3583,8 @@ paths: type: array items: $ref: '#/components/schemas/V1OrganizationMemberResponse' + '403': + description: '' tags: - Organizations security: @@ -2905,7 +3597,9 @@ paths: - name: slug required: true in: path + description: Organization slug schema: + pattern: ^[\w-]+$ type: string responses: '200': @@ -2914,6 +3608,8 @@ paths: application/json: schema: $ref: '#/components/schemas/V1OrganizationSlugResponse' + '403': + description: '' tags: - Organizations security: @@ -2960,6 +3656,14 @@ components: BranchDetailResponse: type: object properties: + ref: + type: string + postgres_version: + type: string + postgres_engine: + type: string + release_channel: + type: string status: type: string enum: @@ -2978,18 +3682,10 @@ components: - RESTARTING - PAUSE_FAILED - RESIZING - db_port: - type: integer - ref: - type: string - postgres_version: - type: string - postgres_engine: - type: string - release_channel: - type: string db_host: type: string + db_port: + type: integer db_user: type: string db_pass: @@ -2997,26 +3693,26 @@ components: jwt_secret: type: string required: - - status - - db_port - ref - postgres_version - postgres_engine - release_channel + - status - db_host + - db_port UpdateBranchBody: type: object properties: + branch_name: + type: string + git_branch: + type: string reset_on_push: type: boolean - deprecated: true description: >- This field is deprecated and will be ignored. Use v1-reset-a-branch endpoint directly instead. - branch_name: - type: string - git_branch: - type: string + deprecated: true persistent: type: boolean status: @@ -3031,13 +3727,27 @@ components: BranchResponse: type: object properties: + id: + type: string + name: + type: string + project_ref: + type: string + parent_project_ref: + type: string + is_default: + type: boolean + git_branch: + type: string pr_number: type: integer format: int32 latest_check_run_id: type: number - deprecated: true description: This field is deprecated and will not be populated. + deprecated: true + persistent: + type: boolean status: type: string enum: @@ -3047,32 +3757,18 @@ components: - MIGRATIONS_FAILED - FUNCTIONS_DEPLOYED - FUNCTIONS_FAILED - id: - type: string - name: - type: string - project_ref: - type: string - parent_project_ref: - type: string - is_default: - type: boolean - git_branch: - type: string - persistent: - type: boolean created_at: type: string updated_at: type: string required: - - status - id - name - project_ref - parent_project_ref - is_default - persistent + - status - created_at - updated_at BranchDeleteResponse: @@ -3080,8 +3776,15 @@ components: properties: message: type: string + enum: + - ok required: - message + BranchActionBody: + type: object + properties: + migration_version: + type: string BranchUpdateResponse: type: object properties: @@ -3089,29 +3792,11 @@ components: type: string message: type: string + enum: + - ok required: - workflow_run_id - message - V1DatabaseResponse: - type: object - properties: - host: - type: string - description: Database host - version: - type: string - description: Database version - postgres_engine: - type: string - description: Database engine - release_channel: - type: string - description: Release channel - required: - - host - - version - - postgres_engine - - release_channel V1ProjectWithDatabaseResponse: type: object properties: @@ -3151,7 +3836,25 @@ components: - PAUSE_FAILED - RESIZING database: - $ref: '#/components/schemas/V1DatabaseResponse' + type: object + properties: + host: + type: string + description: Database host + version: + type: string + description: Database version + postgres_engine: + type: string + description: Database engine + release_channel: + type: string + description: Release channel + required: + - host + - version + - postgres_engine + - release_channel required: - id - organization_id @@ -3160,7 +3863,7 @@ components: - created_at - status - database - V1CreateProjectBodyDto: + V1CreateProjectBody: type: object properties: db_pass: @@ -3168,6 +3871,7 @@ components: description: Database password name: type: string + maxLength: 256 description: Name of your project organization_id: type: string @@ -3210,6 +3914,7 @@ components: desired_instance_size: type: string enum: + - pico - micro - small - medium @@ -3220,6 +3925,14 @@ components: - 8xlarge - 12xlarge - 16xlarge + - 24xlarge + - 24xlarge_optimized_memory + - 24xlarge_optimized_cpu + - 24xlarge_high_memory + - 48xlarge + - 48xlarge_optimized_memory + - 48xlarge_optimized_cpu + - 48xlarge_high_memory template_url: type: string format: uri @@ -3290,7 +4003,7 @@ components: required: - id - name - CreateOrganizationV1Dto: + CreateOrganizationV1: type: object properties: name: @@ -3302,12 +4015,13 @@ components: type: object properties: grant_type: + type: string enum: - authorization_code - refresh_token - type: string client_id: type: string + format: uuid client_secret: type: string code: @@ -3318,30 +4032,27 @@ components: type: string refresh_token: type: string - required: - - grant_type - - client_id - - client_secret + additionalProperties: false OAuthTokenResponse: type: object properties: + access_token: + type: string + refresh_token: + type: string expires_in: type: integer - format: int64 token_type: type: string enum: - Bearer - access_token: - type: string - refresh_token: - type: string required: - - expires_in - - token_type - access_token - refresh_token - OAuthRevokeTokenBodyDto: + - expires_in + - token_type + additionalProperties: false + OAuthRevokeTokenBody: type: object properties: client_id: @@ -3356,94 +4067,81 @@ components: - client_secret - refresh_token additionalProperties: false - SnippetProject: - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - required: - - id - - name - SnippetUser: - type: object - properties: - id: - type: integer - format: int64 - username: - type: string - required: - - id - - username - SnippetMeta: - type: object - properties: - id: - type: string - inserted_at: - type: string - updated_at: - type: string - type: - type: string - enum: - - sql - visibility: - type: string - enum: - - user - - project - - org - - public - name: - type: string - description: - type: string - nullable: true - project: - $ref: '#/components/schemas/SnippetProject' - owner: - $ref: '#/components/schemas/SnippetUser' - updated_by: - $ref: '#/components/schemas/SnippetUser' - required: - - id - - inserted_at - - updated_at - - type - - visibility - - name - - description - - project - - owner - - updated_by SnippetList: type: object properties: data: type: array items: - $ref: '#/components/schemas/SnippetMeta' + type: object + properties: + id: + type: string + inserted_at: + type: string + updated_at: + type: string + type: + type: string + enum: + - sql + visibility: + type: string + enum: + - user + - project + - org + - public + name: + type: string + description: + type: string + nullable: true + project: + type: object + properties: + id: + type: number + name: + type: string + required: + - id + - name + owner: + type: object + properties: + id: + type: number + username: + type: string + required: + - id + - username + updated_by: + type: object + properties: + id: + type: number + username: + type: string + required: + - id + - username + required: + - id + - inserted_at + - updated_at + - type + - visibility + - name + - description + - project + - owner + - updated_by cursor: type: string required: - data - SnippetContent: - type: object - properties: - favorite: - type: boolean - schema_version: - type: string - sql: - type: string - required: - - favorite - - schema_version - - sql SnippetResponse: type: object properties: @@ -3458,25 +4156,60 @@ components: enum: - sql visibility: + type: string enum: - user - project - org - public - type: string name: type: string description: type: string nullable: true project: - $ref: '#/components/schemas/SnippetProject' + type: object + properties: + id: + type: number + name: + type: string + required: + - id + - name owner: - $ref: '#/components/schemas/SnippetUser' + type: object + properties: + id: + type: number + username: + type: string + required: + - id + - username updated_by: - $ref: '#/components/schemas/SnippetUser' + type: object + properties: + id: + type: number + username: + type: string + required: + - id + - username content: - $ref: '#/components/schemas/SnippetContent' + type: object + properties: + favorite: + type: boolean + schema_version: + type: string + sql: + type: string + required: + - favorite + - schema_version + - sql required: - id - inserted_at @@ -3489,33 +4222,26 @@ components: - owner - updated_by - content - ApiKeySecretJWTTemplate: - type: object - properties: - role: - type: string - required: - - role ApiKeyResponse: type: object properties: - type: + api_key: + type: string + id: + type: string nullable: true + type: type: string enum: - publishable - secret - legacy - name: - type: string - api_key: - type: string - id: - type: string nullable: true prefix: type: string nullable: true + name: + type: string description: type: string nullable: true @@ -3523,201 +4249,228 @@ components: type: string nullable: true secret_jwt_template: + type: object + properties: + role: + type: string + minLength: 1 + required: + - role nullable: true - allOf: - - $ref: '#/components/schemas/ApiKeySecretJWTTemplate' inserted_at: type: string - nullable: true - updated_at: - type: string - nullable: true - required: - - name - - api_key - CreateApiKeyBody: - type: object - properties: - type: - enum: - - publishable - - secret - type: string - description: - type: string - nullable: true - secret_jwt_template: - nullable: true - allOf: - - $ref: '#/components/schemas/ApiKeySecretJWTTemplate' - required: - - type - UpdateApiKeyBody: - type: object - properties: - description: - type: string - nullable: true - secret_jwt_template: - nullable: true - allOf: - - $ref: '#/components/schemas/ApiKeySecretJWTTemplate' - DesiredInstanceSize: - type: string - enum: - - micro - - small - - medium - - large - - xlarge - - 2xlarge - - 4xlarge - - 8xlarge - - 12xlarge - - 16xlarge - ReleaseChannel: - type: string - enum: - - internal - - alpha - - beta - - ga - - withdrawn - - preview - PostgresEngine: - type: string - description: >- - Postgres engine version. If not provided, the latest version will be - used. - enum: - - '15' - - 17-oriole - CreateBranchBody: - type: object - properties: - desired_instance_size: - $ref: '#/components/schemas/DesiredInstanceSize' - release_channel: - $ref: '#/components/schemas/ReleaseChannel' - postgres_engine: - $ref: '#/components/schemas/PostgresEngine' - branch_name: - type: string - git_branch: - type: string - persistent: - type: boolean - region: - type: string - required: - - branch_name - ValidationRecord: - type: object - properties: - txt_name: - type: string - txt_value: - type: string - required: - - txt_name - - txt_value - ValidationError: - type: object - properties: - message: - type: string - required: - - message - SslValidation: - type: object - properties: - status: + format: date-time + nullable: true + updated_at: type: string - validation_records: - type: array - items: - $ref: '#/components/schemas/ValidationRecord' - validation_errors: - type: array - items: - $ref: '#/components/schemas/ValidationError' + format: date-time + nullable: true required: - - status - - validation_records - OwnershipVerification: + - api_key + - name + CreateApiKeyBody: type: object properties: type: type: string + enum: + - publishable + - secret name: type: string - value: + minLength: 4 + maxLength: 64 + pattern: ^[a-z_][a-z0-9_]+$ + description: type: string + nullable: true + secret_jwt_template: + type: object + properties: + role: + type: string + minLength: 1 + required: + - role + nullable: true required: - type - name - - value - CustomHostnameDetails: + UpdateApiKeyBody: type: object properties: - id: - type: string - hostname: - type: string - ssl: - $ref: '#/components/schemas/SslValidation' - ownership_verification: - $ref: '#/components/schemas/OwnershipVerification' - custom_origin_server: + name: type: string - verification_errors: - type: array - items: - type: string - status: + minLength: 4 + maxLength: 64 + pattern: ^[a-z_][a-z0-9_]+$ + description: type: string - required: - - id - - hostname - - ssl - - ownership_verification - - custom_origin_server - - status - CfResponse: + nullable: true + secret_jwt_template: + type: object + properties: + role: + type: string + minLength: 1 + required: + - role + nullable: true + CreateBranchBody: type: object properties: - success: + branch_name: + type: string + minLength: 1 + git_branch: + type: string + persistent: type: boolean - errors: - type: array - items: - type: object - messages: - type: array - items: - type: object - result: - $ref: '#/components/schemas/CustomHostnameDetails' + region: + type: string + desired_instance_size: + type: string + enum: + - pico + - nano + - micro + - small + - medium + - large + - xlarge + - 2xlarge + - 4xlarge + - 8xlarge + - 12xlarge + - 16xlarge + - 24xlarge + - 24xlarge_optimized_memory + - 24xlarge_optimized_cpu + - 24xlarge_high_memory + - 48xlarge + - 48xlarge_optimized_memory + - 48xlarge_optimized_cpu + - 48xlarge_high_memory + release_channel: + type: string + enum: + - internal + - alpha + - beta + - ga + - withdrawn + - preview + description: Release channel. If not provided, GA will be used. + postgres_engine: + type: string + enum: + - '15' + - '17' + - 17-oriole + description: >- + Postgres engine version. If not provided, the latest version will be + used. + secrets: + type: object + additionalProperties: + type: string required: - - success - - errors - - messages - - result + - branch_name UpdateCustomHostnameResponse: type: object properties: status: + type: string enum: - 1_not_started - 2_initiated - 3_challenge_verified - 4_origin_setup_completed - 5_services_reconfigured - type: string custom_hostname: type: string data: - $ref: '#/components/schemas/CfResponse' + type: object + properties: + success: + type: boolean + errors: + type: array + items: + description: Any JSON-serializable value + messages: + type: array + items: + description: Any JSON-serializable value + result: + type: object + properties: + id: + type: string + hostname: + type: string + ssl: + type: object + properties: + status: + type: string + validation_records: + type: array + items: + type: object + properties: + txt_name: + type: string + txt_value: + type: string + required: + - txt_name + - txt_value + validation_errors: + type: array + items: + type: object + properties: + message: + type: string + required: + - message + required: + - status + - validation_records + ownership_verification: + type: object + properties: + type: + type: string + name: + type: string + value: + type: string + required: + - type + - name + - value + custom_origin_server: + type: string + verification_errors: + type: array + items: + type: string + status: + type: string + required: + - id + - hostname + - ssl + - ownership_verification + - custom_origin_server + - status + required: + - success + - errors + - messages + - result required: - status - custom_hostname @@ -3738,47 +4491,96 @@ components: type: string required: - banned_ipv4_addresses - RemoveNetworkBanRequest: + NetworkBanResponseEnriched: type: object properties: - ipv4_addresses: + banned_ipv4_addresses: type: array items: - type: string + type: object + properties: + banned_address: + type: string + identifier: + type: string + type: + type: string + required: + - banned_address + - identifier + - type required: - - ipv4_addresses - NetworkRestrictionsRequest: + - banned_ipv4_addresses + RemoveNetworkBanRequest: type: object properties: - dbAllowedCidrs: - type: array - items: - type: string - dbAllowedCidrsV6: + ipv4_addresses: type: array items: type: string + identifier: + type: string + required: + - ipv4_addresses NetworkRestrictionsResponse: type: object properties: entitlement: + type: string enum: - disallowed - allowed - type: string config: - $ref: '#/components/schemas/NetworkRestrictionsRequest' + type: object + properties: + dbAllowedCidrs: + type: array + items: + type: string + dbAllowedCidrsV6: + type: array + items: + type: string + description: >- + At any given point in time, this is the config that the user has + requested be applied to their project. The `status` field indicates + if it has been applied to the project, or is pending. When an + updated config is received, the applied config is moved to + `old_config`. old_config: - $ref: '#/components/schemas/NetworkRestrictionsRequest' + type: object + properties: + dbAllowedCidrs: + type: array + items: + type: string + dbAllowedCidrsV6: + type: array + items: + type: string + description: >- + Populated when a new config has been received, but not registered as + successfully applied to a project. status: + type: string enum: - stored - applied - type: string required: - entitlement - config - status + NetworkRestrictionsRequest: + type: object + properties: + dbAllowedCidrs: + type: array + items: + type: string + dbAllowedCidrsV6: + type: array + items: + type: string PgsodiumConfigResponse: type: object properties: @@ -3796,28 +4598,32 @@ components: PostgrestConfigWithJWTSecretResponse: type: object properties: + db_schema: + type: string max_rows: type: integer + db_extra_search_path: + type: string db_pool: type: integer nullable: true description: >- If `null`, the value is automatically configured based on compute size. - db_schema: - type: string - db_extra_search_path: - type: string jwt_secret: type: string required: - - max_rows - - db_pool - db_schema + - max_rows - db_extra_search_path - UpdatePostgrestConfigBody: + - db_pool + V1UpdatePostgrestConfigBody: type: object properties: + db_extra_search_path: + type: string + db_schema: + type: string max_rows: type: integer minimum: 0 @@ -3826,36 +4632,31 @@ components: type: integer minimum: 0 maximum: 1000 - db_extra_search_path: - type: string - db_schema: - type: string V1PostgrestConfigResponse: type: object properties: + db_schema: + type: string max_rows: type: integer + db_extra_search_path: + type: string db_pool: type: integer nullable: true description: >- If `null`, the value is automatically configured based on compute size. - db_schema: - type: string - db_extra_search_path: - type: string required: - - max_rows - - db_pool - db_schema + - max_rows - db_extra_search_path + - db_pool V1ProjectRefResponse: type: object properties: id: type: integer - format: int64 ref: type: string name: @@ -3871,36 +4672,38 @@ components: type: string value: type: string - required: - - name - - value - CreateSecretBody: - type: object - properties: - name: - type: string - maxLength: 256 - pattern: /^(?!SUPABASE_).*/ - description: Secret name must not start with the SUPABASE_ prefix. - example: string - value: + updated_at: type: string - maxLength: 24576 required: - name - value - SslEnforcements: - type: object - properties: - database: - type: boolean - required: - - database + CreateSecretBody: + type: array + items: + type: object + properties: + name: + type: string + maxLength: 256 + pattern: ^(?!SUPABASE_).* + description: Secret name must not start with the SUPABASE_ prefix. + example: string + value: + type: string + maxLength: 24576 + required: + - name + - value SslEnforcementResponse: type: object properties: currentConfig: - $ref: '#/components/schemas/SslEnforcements' + type: object + properties: + database: + type: boolean + required: + - database appliedSuccessfully: type: boolean required: @@ -3910,7 +4713,12 @@ components: type: object properties: requestedConfig: - $ref: '#/components/schemas/SslEnforcements' + type: object + properties: + database: + type: boolean + required: + - database required: - requestedConfig TypescriptResponse: @@ -3924,11 +4732,11 @@ components: type: object properties: status: + type: string enum: - not-used - custom-domain-used - active - type: string custom_domain: type: string required: @@ -3957,12 +4765,18 @@ components: UpgradeDatabaseBody: type: object properties: - release_channel: - $ref: '#/components/schemas/ReleaseChannel' target_version: type: string + release_channel: + type: string + enum: + - internal + - alpha + - beta + - ga + - withdrawn + - preview required: - - release_channel - target_version ProjectUpgradeInitiateResponse: type: object @@ -3971,40 +4785,56 @@ components: type: string required: - tracking_id - ProjectVersion: - type: object - properties: - postgres_version: - $ref: '#/components/schemas/PostgresEngine' - release_channel: - $ref: '#/components/schemas/ReleaseChannel' - app_version: - type: string - required: - - postgres_version - - release_channel - - app_version ProjectUpgradeEligibilityResponse: type: object properties: - current_app_version_release_channel: - $ref: '#/components/schemas/ReleaseChannel' - duration_estimate_hours: - type: integer eligible: type: boolean current_app_version: type: string + current_app_version_release_channel: + type: string + enum: + - internal + - alpha + - beta + - ga + - withdrawn + - preview latest_app_version: type: string target_upgrade_versions: type: array items: - $ref: '#/components/schemas/ProjectVersion' + type: object + properties: + postgres_version: + type: string + enum: + - '15' + - '17' + - 17-oriole + release_channel: + type: string + enum: + - internal + - alpha + - beta + - ga + - withdrawn + - preview + app_version: + type: string + required: + - postgres_version + - release_channel + - app_version potential_breaking_changes: type: array items: type: string + duration_estimate_hours: + type: number legacy_auth_custom_roles: type: array items: @@ -4014,68 +4844,61 @@ components: items: type: string required: - - current_app_version_release_channel - - duration_estimate_hours - eligible - current_app_version + - current_app_version_release_channel - latest_app_version - target_upgrade_versions - potential_breaking_changes + - duration_estimate_hours - legacy_auth_custom_roles - extension_dependent_objects - DatabaseUpgradeStatus: - type: object - properties: - target_version: - type: integer - status: - enum: - - 0 - - 1 - - 2 - type: integer - initiated_at: - type: string - latest_status_at: - type: string - error: - type: string - enum: - - 1_upgraded_instance_launch_failed - - 2_volume_detachchment_from_upgraded_instance_failed - - 3_volume_attachment_to_original_instance_failed - - 4_data_upgrade_initiation_failed - - 5_data_upgrade_completion_failed - - 6_volume_detachchment_from_original_instance_failed - - 7_volume_attachment_to_upgraded_instance_failed - - 8_upgrade_completion_failed - - 9_post_physical_backup_failed - progress: - type: string - enum: - - 0_requested - - 1_started - - 2_launched_upgraded_instance - - 3_detached_volume_from_upgraded_instance - - 4_attached_volume_to_original_instance - - 5_initiated_data_upgrade - - 6_completed_data_upgrade - - 7_detached_volume_from_original_instance - - 8_attached_volume_to_upgraded_instance - - 9_completed_upgrade - - 10_completed_post_physical_backup - required: - - target_version - - status - - initiated_at - - latest_status_at DatabaseUpgradeStatusResponse: type: object properties: databaseUpgradeStatus: + type: object + properties: + initiated_at: + type: string + latest_status_at: + type: string + target_version: + type: number + error: + type: string + enum: + - 1_upgraded_instance_launch_failed + - 2_volume_detachchment_from_upgraded_instance_failed + - 3_volume_attachment_to_original_instance_failed + - 4_data_upgrade_initiation_failed + - 5_data_upgrade_completion_failed + - 6_volume_detachchment_from_original_instance_failed + - 7_volume_attachment_to_upgraded_instance_failed + - 8_upgrade_completion_failed + - 9_post_physical_backup_failed + progress: + type: string + enum: + - 0_requested + - 1_started + - 2_launched_upgraded_instance + - 3_detached_volume_from_upgraded_instance + - 4_attached_volume_to_original_instance + - 5_initiated_data_upgrade + - 6_completed_data_upgrade + - 7_detached_volume_from_original_instance + - 8_attached_volume_to_upgraded_instance + - 9_completed_upgrade + - 10_completed_post_physical_backup + status: + type: number + required: + - initiated_at + - latest_status_at + - target_version + - status nullable: true - allOf: - - $ref: '#/components/schemas/DatabaseUpgradeStatus' required: - databaseUpgradeStatus ReadOnlyStatusResponse: @@ -4126,30 +4949,11 @@ components: type: string required: - database_identifier - AuthHealthResponse: - type: object - properties: - name: - type: string - enum: - - GoTrue - required: - - name - RealtimeHealthResponse: - type: object - properties: - connected_cluster: - type: integer - required: - - connected_cluster V1ServiceHealthResponse: type: object properties: - info: - oneOf: - - $ref: '#/components/schemas/AuthHealthResponse' - - $ref: '#/components/schemas/RealtimeHealthResponse' name: + type: string enum: - auth - db @@ -4157,45 +4961,157 @@ components: - realtime - rest - storage - type: string healthy: type: boolean status: + type: string enum: - COMING_UP - ACTIVE_HEALTHY - UNHEALTHY - type: string + info: + oneOf: + - type: object + properties: + name: + type: string + enum: + - GoTrue + version: + type: string + description: + type: string + required: + - name + - version + - description + - type: object + properties: + healthy: + type: boolean + db_connected: + type: boolean + connected_cluster: + type: integer + required: + - healthy + - db_connected + - connected_cluster error: type: string required: - name - healthy - status - StorageFeatureImageTransformation: + CreateSigningKeyBody: type: object properties: - enabled: - type: boolean + algorithm: + type: string + enum: + - EdDSA + - ES256 + - RS256 + - HS256 + status: + type: string + enum: + - in_use + - standby required: - - enabled - StorageFeatureS3Protocol: + - algorithm + additionalProperties: false + SigningKeyResponse: type: object properties: - enabled: - type: boolean + id: + type: string + format: uuid + algorithm: + type: string + enum: + - EdDSA + - ES256 + - RS256 + - HS256 + status: + type: string + enum: + - in_use + - previously_used + - revoked + - standby + public_jwk: + nullable: true + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time required: - - enabled - StorageFeatures: + - id + - algorithm + - status + - created_at + - updated_at + additionalProperties: false + SigningKeysResponse: + type: object + properties: + keys: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + algorithm: + type: string + enum: + - EdDSA + - ES256 + - RS256 + - HS256 + status: + type: string + enum: + - in_use + - previously_used + - revoked + - standby + public_jwk: + nullable: true + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - algorithm + - status + - created_at + - updated_at + additionalProperties: false + required: + - keys + additionalProperties: false + UpdateSigningKeyBody: type: object properties: - imageTransformation: - $ref: '#/components/schemas/StorageFeatureImageTransformation' - s3Protocol: - $ref: '#/components/schemas/StorageFeatureS3Protocol' + status: + type: string + enum: + - in_use + - previously_used + - revoked + - standby required: - - imageTransformation - - s3Protocol + - status + additionalProperties: false StorageConfigResponse: type: object properties: @@ -4203,7 +5119,25 @@ components: type: integer format: int64 features: - $ref: '#/components/schemas/StorageFeatures' + type: object + properties: + imageTransformation: + type: object + properties: + enabled: + type: boolean + required: + - enabled + s3Protocol: + type: object + properties: + enabled: + type: boolean + required: + - enabled + required: + - imageTransformation + - s3Protocol required: - fileSizeLimit - features @@ -4216,7 +5150,25 @@ components: maximum: 53687091200 format: int64 features: - $ref: '#/components/schemas/StorageFeatures' + type: object + properties: + imageTransformation: + type: object + properties: + enabled: + type: boolean + required: + - enabled + s3Protocol: + type: object + properties: + enabled: + type: boolean + required: + - enabled + required: + - imageTransformation + - s3Protocol PostgresConfigResponse: type: object properties: @@ -4264,6 +5216,12 @@ components: type: integer minimum: 0 maximum: 262143 + session_replication_role: + type: string + enum: + - origin + - replica + - local shared_buffers: type: string statement_timeout: @@ -4276,12 +5234,6 @@ components: type: string work_mem: type: string - session_replication_role: - enum: - - origin - - replica - - local - type: string UpdatePostgresConfigBody: type: object properties: @@ -4329,6 +5281,12 @@ components: type: integer minimum: 0 maximum: 262143 + session_replication_role: + type: string + enum: + - origin + - replica + - local shared_buffers: type: string statement_timeout: @@ -4343,167 +5301,103 @@ components: type: string restart_database: type: boolean - session_replication_role: - enum: - - origin - - replica - - local - type: string V1PgbouncerConfigResponse: type: object properties: - pool_mode: - type: string - enum: - - transaction - - session - - statement default_pool_size: type: number ignore_startup_parameters: type: string max_client_conn: type: number + pool_mode: + type: string + enum: + - transaction + - session + - statement connection_string: type: string SupavisorConfigResponse: type: object properties: + identifier: + type: string database_type: type: string enum: - PRIMARY - READ_REPLICA - db_port: - type: integer - default_pool_size: - type: integer - nullable: true - max_client_conn: - type: integer - nullable: true - identifier: - type: string is_using_scram_auth: type: boolean db_user: type: string db_host: type: string + db_port: + type: integer db_name: type: string - connectionString: - type: string - pool_mode: - enum: - - transaction - - session + exclusiveMinimum: true + minimum: 0 + connection_string: type: string - required: - - database_type - - db_port - - default_pool_size - - max_client_conn - - identifier - - is_using_scram_auth - - db_user - - db_host - - db_name - - connectionString - - pool_mode - UpdateSupavisorConfigBody: - type: object - properties: default_pool_size: type: integer nullable: true - minimum: 0 - maximum: 1000 - pool_mode: - enum: - - transaction - - session - type: string - deprecated: true - description: This field is deprecated and is ignored in this request - UpdateSupavisorConfigResponse: - type: object - properties: - default_pool_size: + max_client_conn: type: integer nullable: true pool_mode: + type: string enum: - transaction - session - type: string - required: - - default_pool_size - - pool_mode - AuthConfigResponse: - type: object - properties: - api_max_request_duration: - type: integer - nullable: true - db_max_pool_size: - type: integer - nullable: true - jwt_exp: - type: integer - nullable: true - mailer_otp_exp: - type: integer - mailer_otp_length: - type: integer - nullable: true - mfa_max_enrolled_factors: - type: integer - nullable: true - mfa_phone_otp_length: - type: integer - mfa_phone_max_frequency: - type: integer - nullable: true - password_min_length: - type: integer - nullable: true - rate_limit_anonymous_users: - type: integer - nullable: true - rate_limit_email_sent: - type: integer - nullable: true - rate_limit_sms_sent: - type: integer - nullable: true - rate_limit_token_refresh: - type: integer - nullable: true - rate_limit_verify: - type: integer - nullable: true - rate_limit_otp: - type: integer - nullable: true - security_refresh_token_reuse_interval: - type: integer - nullable: true - sessions_inactivity_timeout: - type: integer - nullable: true - sessions_timebox: + required: + - identifier + - database_type + - is_using_scram_auth + - db_user + - db_host + - db_port + - db_name + - connection_string + - connectionString + - default_pool_size + - max_client_conn + - pool_mode + UpdateSupavisorConfigBody: + type: object + properties: + default_pool_size: type: integer + minimum: 0 + maximum: 3000 nullable: true - sms_max_frequency: + pool_mode: + type: string + enum: + - transaction + - session + description: Dedicated pooler mode for the project + UpdateSupavisorConfigResponse: + type: object + properties: + default_pool_size: type: integer nullable: true - sms_otp_exp: + pool_mode: + type: string + required: + - default_pool_size + - pool_mode + AuthConfigResponse: + type: object + properties: + api_max_request_duration: type: integer nullable: true - sms_otp_length: - type: integer - smtp_max_frequency: + db_max_pool_size: type: integer nullable: true disable_signup: @@ -4710,6 +5604,9 @@ components: external_workos_url: type: string nullable: true + external_web3_solana_enabled: + type: boolean + nullable: true external_zoom_client_id: type: string nullable: true @@ -4764,12 +5661,20 @@ components: hook_send_email_secrets: type: string nullable: true + jwt_exp: + type: integer + nullable: true mailer_allow_unverified_email_sign_ins: type: boolean nullable: true mailer_autoconfirm: type: boolean nullable: true + mailer_otp_exp: + type: integer + mailer_otp_length: + type: integer + nullable: true mailer_secure_email_change_enabled: type: boolean nullable: true @@ -4809,6 +5714,9 @@ components: mailer_templates_recovery_content: type: string nullable: true + mfa_max_enrolled_factors: + type: integer + nullable: true mfa_totp_enroll_enabled: type: boolean nullable: true @@ -4827,15 +5735,44 @@ components: mfa_web_authn_verify_enabled: type: boolean nullable: true + mfa_phone_otp_length: + type: integer mfa_phone_template: type: string nullable: true + mfa_phone_max_frequency: + type: integer + nullable: true password_hibp_enabled: type: boolean nullable: true + password_min_length: + type: integer + nullable: true password_required_characters: type: string nullable: true + rate_limit_anonymous_users: + type: integer + nullable: true + rate_limit_email_sent: + type: integer + nullable: true + rate_limit_sms_sent: + type: integer + nullable: true + rate_limit_token_refresh: + type: integer + nullable: true + rate_limit_verify: + type: integer + nullable: true + rate_limit_otp: + type: integer + nullable: true + rate_limit_web3: + type: integer + nullable: true refresh_token_rotation_enabled: type: boolean nullable: true @@ -4860,27 +5797,44 @@ components: security_manual_linking_enabled: type: boolean nullable: true + security_refresh_token_reuse_interval: + type: integer + nullable: true security_update_password_require_reauthentication: type: boolean nullable: true + sessions_inactivity_timeout: + type: integer + nullable: true sessions_single_per_user: type: boolean nullable: true sessions_tags: type: string nullable: true + sessions_timebox: + type: integer + nullable: true site_url: type: string nullable: true sms_autoconfirm: type: boolean nullable: true + sms_max_frequency: + type: integer + nullable: true sms_messagebird_access_key: type: string nullable: true sms_messagebird_originator: type: string nullable: true + sms_otp_exp: + type: integer + nullable: true + sms_otp_length: + type: integer sms_provider: type: string nullable: true @@ -4935,6 +5889,9 @@ components: smtp_host: type: string nullable: true + smtp_max_frequency: + type: integer + nullable: true smtp_pass: type: string nullable: true @@ -4953,26 +5910,6 @@ components: required: - api_max_request_duration - db_max_pool_size - - jwt_exp - - mailer_otp_exp - - mailer_otp_length - - mfa_max_enrolled_factors - - mfa_phone_otp_length - - mfa_phone_max_frequency - - password_min_length - - rate_limit_anonymous_users - - rate_limit_email_sent - - rate_limit_sms_sent - - rate_limit_token_refresh - - rate_limit_verify - - rate_limit_otp - - security_refresh_token_reuse_interval - - sessions_inactivity_timeout - - sessions_timebox - - sms_max_frequency - - sms_otp_exp - - sms_otp_length - - smtp_max_frequency - disable_signup - external_anonymous_users_enabled - external_apple_additional_client_ids @@ -5041,6 +5978,7 @@ components: - external_workos_enabled - external_workos_secret - external_workos_url + - external_web3_solana_enabled - external_zoom_client_id - external_zoom_enabled - external_zoom_secret @@ -5059,8 +5997,11 @@ components: - hook_send_email_enabled - hook_send_email_uri - hook_send_email_secrets + - jwt_exp - mailer_allow_unverified_email_sign_ins - mailer_autoconfirm + - mailer_otp_exp + - mailer_otp_length - mailer_secure_email_change_enabled - mailer_subjects_confirmation - mailer_subjects_email_change @@ -5074,213 +6015,251 @@ components: - mailer_templates_magic_link_content - mailer_templates_reauthentication_content - mailer_templates_recovery_content + - mfa_max_enrolled_factors - mfa_totp_enroll_enabled - mfa_totp_verify_enabled - mfa_phone_enroll_enabled - mfa_phone_verify_enabled - mfa_web_authn_enroll_enabled - mfa_web_authn_verify_enabled + - mfa_phone_otp_length - mfa_phone_template + - mfa_phone_max_frequency - password_hibp_enabled + - password_min_length - password_required_characters + - rate_limit_anonymous_users + - rate_limit_email_sent + - rate_limit_sms_sent + - rate_limit_token_refresh + - rate_limit_verify + - rate_limit_otp + - rate_limit_web3 - refresh_token_rotation_enabled - saml_enabled - - saml_external_url - - saml_allow_encrypted_assertions - - security_captcha_enabled - - security_captcha_provider - - security_captcha_secret - - security_manual_linking_enabled - - security_update_password_require_reauthentication - - sessions_single_per_user - - sessions_tags - - site_url - - sms_autoconfirm - - sms_messagebird_access_key - - sms_messagebird_originator - - sms_provider - - sms_template - - sms_test_otp - - sms_test_otp_valid_until - - sms_textlocal_api_key - - sms_textlocal_sender - - sms_twilio_account_sid - - sms_twilio_auth_token - - sms_twilio_content_sid - - sms_twilio_message_service_sid - - sms_twilio_verify_account_sid - - sms_twilio_verify_auth_token - - sms_twilio_verify_message_service_sid - - sms_vonage_api_key - - sms_vonage_api_secret - - sms_vonage_from - - smtp_admin_email - - smtp_host - - smtp_pass - - smtp_port - - smtp_sender_name - - smtp_user - - uri_allow_list - UpdateAuthConfigBody: - type: object - properties: - jwt_exp: - type: integer - minimum: 0 - maximum: 604800 - smtp_max_frequency: - type: integer - minimum: 0 - maximum: 32767 - mfa_max_enrolled_factors: - type: integer - minimum: 0 - maximum: 2147483647 - sessions_timebox: - type: integer - minimum: 0 - sessions_inactivity_timeout: - type: integer - minimum: 0 - rate_limit_anonymous_users: - type: integer - minimum: 1 - maximum: 2147483647 - rate_limit_email_sent: - type: integer - minimum: 1 - maximum: 2147483647 - rate_limit_sms_sent: - type: integer - minimum: 1 - maximum: 2147483647 - rate_limit_verify: - type: integer - minimum: 1 - maximum: 2147483647 - rate_limit_token_refresh: - type: integer - minimum: 1 - maximum: 2147483647 - rate_limit_otp: - type: integer - minimum: 1 - maximum: 2147483647 - password_min_length: - type: integer - minimum: 6 - maximum: 32767 - security_refresh_token_reuse_interval: - type: integer - minimum: 0 - maximum: 2147483647 - mailer_otp_exp: - type: integer - minimum: 0 - maximum: 2147483647 - mailer_otp_length: - type: integer - minimum: 6 - maximum: 10 - sms_max_frequency: - type: integer - minimum: 0 - maximum: 32767 - sms_otp_exp: - type: integer - minimum: 0 - maximum: 2147483647 - sms_otp_length: - type: integer - minimum: 0 - maximum: 32767 - db_max_pool_size: - type: integer - api_max_request_duration: - type: integer - mfa_phone_max_frequency: - type: integer - minimum: 0 - maximum: 32767 - mfa_phone_otp_length: - type: integer - minimum: 0 - maximum: 32767 + - saml_external_url + - saml_allow_encrypted_assertions + - security_captcha_enabled + - security_captcha_provider + - security_captcha_secret + - security_manual_linking_enabled + - security_refresh_token_reuse_interval + - security_update_password_require_reauthentication + - sessions_inactivity_timeout + - sessions_single_per_user + - sessions_tags + - sessions_timebox + - site_url + - sms_autoconfirm + - sms_max_frequency + - sms_messagebird_access_key + - sms_messagebird_originator + - sms_otp_exp + - sms_otp_length + - sms_provider + - sms_template + - sms_test_otp + - sms_test_otp_valid_until + - sms_textlocal_api_key + - sms_textlocal_sender + - sms_twilio_account_sid + - sms_twilio_auth_token + - sms_twilio_content_sid + - sms_twilio_message_service_sid + - sms_twilio_verify_account_sid + - sms_twilio_verify_auth_token + - sms_twilio_verify_message_service_sid + - sms_vonage_api_key + - sms_vonage_api_secret + - sms_vonage_from + - smtp_admin_email + - smtp_host + - smtp_max_frequency + - smtp_pass + - smtp_port + - smtp_sender_name + - smtp_user + - uri_allow_list + UpdateAuthConfigBody: + type: object + properties: site_url: type: string - pattern: /^[^,]+$/ + pattern: ^[^,]+$ + nullable: true disable_signup: type: boolean + nullable: true + jwt_exp: + type: integer + minimum: 0 + maximum: 604800 + nullable: true smtp_admin_email: type: string + nullable: true smtp_host: type: string + nullable: true smtp_port: type: string + nullable: true smtp_user: type: string + nullable: true smtp_pass: type: string + nullable: true + smtp_max_frequency: + type: integer + minimum: 0 + maximum: 32767 + nullable: true smtp_sender_name: type: string + nullable: true mailer_allow_unverified_email_sign_ins: type: boolean + nullable: true mailer_autoconfirm: type: boolean + nullable: true mailer_subjects_invite: type: string + nullable: true mailer_subjects_confirmation: type: string + nullable: true mailer_subjects_recovery: type: string + nullable: true mailer_subjects_email_change: type: string + nullable: true mailer_subjects_magic_link: type: string + nullable: true mailer_subjects_reauthentication: type: string + nullable: true mailer_templates_invite_content: type: string + nullable: true mailer_templates_confirmation_content: type: string + nullable: true mailer_templates_recovery_content: type: string + nullable: true mailer_templates_email_change_content: type: string + nullable: true mailer_templates_magic_link_content: type: string + nullable: true mailer_templates_reauthentication_content: type: string + nullable: true + mfa_max_enrolled_factors: + type: integer + minimum: 0 + maximum: 2147483647 + nullable: true uri_allow_list: type: string + nullable: true external_anonymous_users_enabled: type: boolean + nullable: true external_email_enabled: type: boolean + nullable: true external_phone_enabled: type: boolean + nullable: true saml_enabled: type: boolean + nullable: true saml_external_url: type: string - pattern: /^[^,]+$/ + pattern: ^[^,]+$ + nullable: true security_captcha_enabled: type: boolean + nullable: true security_captcha_provider: type: string + enum: + - turnstile + - hcaptcha + nullable: true security_captcha_secret: type: string + nullable: true + sessions_timebox: + type: integer + minimum: 0 + nullable: true + sessions_inactivity_timeout: + type: integer + minimum: 0 + nullable: true sessions_single_per_user: type: boolean + nullable: true sessions_tags: type: string - pattern: /^\s*([a-z0-9_-]+(\s*,+\s*)?)*\s*$/i + pattern: ^\s*([a-zA-Z0-9_-]+(\s*,+\s*)?)*\s*$ + nullable: true + rate_limit_anonymous_users: + type: integer + minimum: 1 + maximum: 2147483647 + nullable: true + rate_limit_email_sent: + type: integer + minimum: 1 + maximum: 2147483647 + nullable: true + rate_limit_sms_sent: + type: integer + minimum: 1 + maximum: 2147483647 + nullable: true + rate_limit_verify: + type: integer + minimum: 1 + maximum: 2147483647 + nullable: true + rate_limit_token_refresh: + type: integer + minimum: 1 + maximum: 2147483647 + nullable: true + rate_limit_otp: + type: integer + minimum: 1 + maximum: 2147483647 + nullable: true + rate_limit_web3: + type: integer + minimum: 1 + maximum: 2147483647 + nullable: true mailer_secure_email_change_enabled: type: boolean + nullable: true refresh_token_rotation_enabled: type: boolean + nullable: true password_hibp_enabled: type: boolean + nullable: true + password_min_length: + type: integer + minimum: 6 + maximum: 32767 + nullable: true password_required_characters: type: string enum: @@ -5288,227 +6267,392 @@ components: - abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789 - abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~ - '' + nullable: true security_manual_linking_enabled: type: boolean + nullable: true security_update_password_require_reauthentication: type: boolean + nullable: true + security_refresh_token_reuse_interval: + type: integer + minimum: 0 + maximum: 2147483647 + nullable: true + mailer_otp_exp: + type: integer + minimum: 0 + maximum: 2147483647 + mailer_otp_length: + type: integer + minimum: 6 + maximum: 10 + nullable: true sms_autoconfirm: type: boolean + nullable: true + sms_max_frequency: + type: integer + minimum: 0 + maximum: 32767 + nullable: true + sms_otp_exp: + type: integer + minimum: 0 + maximum: 2147483647 + nullable: true + sms_otp_length: + type: integer + minimum: 0 + maximum: 32767 sms_provider: type: string + enum: + - messagebird + - textlocal + - twilio + - twilio_verify + - vonage + nullable: true sms_messagebird_access_key: type: string + nullable: true sms_messagebird_originator: type: string + nullable: true sms_test_otp: type: string - pattern: /^([0-9]{1,15}=[0-9]+,?)*$/ + pattern: ^([0-9]{1,15}=[0-9]+,?)*$ + nullable: true sms_test_otp_valid_until: type: string + format: date-time + nullable: true sms_textlocal_api_key: type: string + nullable: true sms_textlocal_sender: type: string + nullable: true sms_twilio_account_sid: type: string + nullable: true sms_twilio_auth_token: type: string + nullable: true sms_twilio_content_sid: type: string + nullable: true sms_twilio_message_service_sid: type: string + nullable: true sms_twilio_verify_account_sid: type: string + nullable: true sms_twilio_verify_auth_token: type: string + nullable: true sms_twilio_verify_message_service_sid: type: string + nullable: true sms_vonage_api_key: type: string + nullable: true sms_vonage_api_secret: type: string + nullable: true sms_vonage_from: type: string + nullable: true sms_template: type: string + nullable: true hook_mfa_verification_attempt_enabled: type: boolean + nullable: true hook_mfa_verification_attempt_uri: type: string + nullable: true hook_mfa_verification_attempt_secrets: type: string + nullable: true hook_password_verification_attempt_enabled: type: boolean + nullable: true hook_password_verification_attempt_uri: type: string + nullable: true hook_password_verification_attempt_secrets: type: string + nullable: true hook_custom_access_token_enabled: type: boolean + nullable: true hook_custom_access_token_uri: type: string + nullable: true hook_custom_access_token_secrets: type: string + nullable: true hook_send_sms_enabled: type: boolean + nullable: true hook_send_sms_uri: type: string + nullable: true hook_send_sms_secrets: type: string + nullable: true hook_send_email_enabled: type: boolean + nullable: true hook_send_email_uri: type: string + nullable: true hook_send_email_secrets: type: string + nullable: true external_apple_enabled: type: boolean + nullable: true external_apple_client_id: type: string + nullable: true external_apple_secret: type: string + nullable: true external_apple_additional_client_ids: type: string + nullable: true external_azure_enabled: type: boolean + nullable: true external_azure_client_id: type: string + nullable: true external_azure_secret: type: string + nullable: true external_azure_url: type: string + nullable: true external_bitbucket_enabled: type: boolean + nullable: true external_bitbucket_client_id: type: string + nullable: true external_bitbucket_secret: type: string + nullable: true external_discord_enabled: type: boolean + nullable: true external_discord_client_id: type: string + nullable: true external_discord_secret: type: string + nullable: true external_facebook_enabled: type: boolean + nullable: true external_facebook_client_id: type: string + nullable: true external_facebook_secret: type: string + nullable: true external_figma_enabled: type: boolean + nullable: true external_figma_client_id: type: string + nullable: true external_figma_secret: type: string + nullable: true external_github_enabled: type: boolean + nullable: true external_github_client_id: type: string + nullable: true external_github_secret: type: string + nullable: true external_gitlab_enabled: type: boolean + nullable: true external_gitlab_client_id: type: string + nullable: true external_gitlab_secret: type: string + nullable: true external_gitlab_url: type: string + nullable: true external_google_enabled: type: boolean + nullable: true external_google_client_id: type: string + nullable: true external_google_secret: type: string + nullable: true external_google_additional_client_ids: type: string + nullable: true external_google_skip_nonce_check: type: boolean + nullable: true external_kakao_enabled: type: boolean + nullable: true external_kakao_client_id: type: string + nullable: true external_kakao_secret: type: string + nullable: true external_keycloak_enabled: type: boolean + nullable: true external_keycloak_client_id: type: string + nullable: true external_keycloak_secret: type: string + nullable: true external_keycloak_url: type: string + nullable: true external_linkedin_oidc_enabled: type: boolean + nullable: true external_linkedin_oidc_client_id: type: string + nullable: true external_linkedin_oidc_secret: type: string + nullable: true external_slack_oidc_enabled: type: boolean + nullable: true external_slack_oidc_client_id: type: string + nullable: true external_slack_oidc_secret: type: string + nullable: true external_notion_enabled: type: boolean + nullable: true external_notion_client_id: type: string + nullable: true external_notion_secret: type: string + nullable: true external_slack_enabled: type: boolean + nullable: true external_slack_client_id: type: string + nullable: true external_slack_secret: type: string + nullable: true external_spotify_enabled: type: boolean + nullable: true external_spotify_client_id: type: string + nullable: true external_spotify_secret: type: string + nullable: true external_twitch_enabled: type: boolean + nullable: true external_twitch_client_id: type: string + nullable: true external_twitch_secret: type: string + nullable: true external_twitter_enabled: type: boolean + nullable: true external_twitter_client_id: type: string + nullable: true external_twitter_secret: type: string + nullable: true external_workos_enabled: type: boolean + nullable: true external_workos_client_id: type: string + nullable: true external_workos_secret: type: string + nullable: true external_workos_url: type: string + nullable: true + external_web3_solana_enabled: + type: boolean + nullable: true external_zoom_enabled: type: boolean + nullable: true external_zoom_client_id: type: string + nullable: true external_zoom_secret: type: string + nullable: true + db_max_pool_size: + type: integer + nullable: true + api_max_request_duration: + type: integer + nullable: true mfa_totp_enroll_enabled: type: boolean + nullable: true mfa_totp_verify_enabled: type: boolean + nullable: true mfa_web_authn_enroll_enabled: type: boolean + nullable: true mfa_web_authn_verify_enabled: type: boolean + nullable: true mfa_phone_enroll_enabled: type: boolean + nullable: true mfa_phone_verify_enabled: type: boolean + nullable: true + mfa_phone_max_frequency: + type: integer + minimum: 0 + maximum: 32767 + nullable: true + mfa_phone_otp_length: + type: integer + minimum: 0 + maximum: 32767 + nullable: true mfa_phone_template: type: string + nullable: true CreateThirdPartyAuthBody: type: object properties: @@ -5516,13 +6660,13 @@ components: type: string jwks_url: type: string - custom_jwks: - type: object + custom_jwks: {} ThirdPartyAuth: type: object properties: id: type: string + format: uuid type: type: string oidc_issuer_url: @@ -5532,10 +6676,8 @@ components: type: string nullable: true custom_jwks: - type: object nullable: true resolved_jwks: - type: object nullable: true inserted_at: type: string @@ -5549,58 +6691,404 @@ components: - type - inserted_at - updated_at - ProjectAvailableRestoreVersion: + GetProjectAvailableRestoreVersionsResponse: type: object properties: - version: - type: string - release_channel: - type: string - enum: - - internal - - alpha - - beta - - ga - - withdrawn - - preview - postgres_engine: + available_versions: + type: array + items: + type: object + properties: + version: + type: string + release_channel: + type: string + enum: + - internal + - alpha + - beta + - ga + - withdrawn + - preview + postgres_engine: + type: string + enum: + - '13' + - '14' + - '15' + - '17' + - 17-oriole + required: + - version + - release_channel + - postgres_engine + required: + - available_versions + ListProjectAddonsResponse: + type: object + properties: + selected_addons: + type: array + items: + type: object + properties: + type: + type: string + enum: + - custom_domain + - compute_instance + - pitr + - ipv4 + - auth_mfa_phone + - auth_mfa_web_authn + - log_drain + variant: + type: object + properties: + id: + oneOf: + - type: string + enum: + - ci_micro + - ci_small + - ci_medium + - ci_large + - ci_xlarge + - ci_2xlarge + - ci_4xlarge + - ci_8xlarge + - ci_12xlarge + - ci_16xlarge + - ci_24xlarge + - ci_24xlarge_optimized_cpu + - ci_24xlarge_optimized_memory + - ci_24xlarge_high_memory + - ci_48xlarge + - ci_48xlarge_optimized_cpu + - ci_48xlarge_optimized_memory + - ci_48xlarge_high_memory + - type: string + enum: + - cd_default + - type: string + enum: + - pitr_7 + - pitr_14 + - pitr_28 + - type: string + enum: + - ipv4_default + - type: string + enum: + - auth_mfa_phone_default + - type: string + enum: + - auth_mfa_web_authn_default + - type: string + enum: + - log_drain_default + name: + type: string + price: + type: object + properties: + description: + type: string + type: + type: string + enum: + - fixed + - usage + interval: + type: string + enum: + - monthly + - hourly + amount: + type: number + required: + - description + - type + - interval + - amount + meta: + description: Any JSON-serializable value + required: + - id + - name + - price + required: + - type + - variant + available_addons: + type: array + items: + type: object + properties: + type: + type: string + enum: + - custom_domain + - compute_instance + - pitr + - ipv4 + - auth_mfa_phone + - auth_mfa_web_authn + - log_drain + name: + type: string + variants: + type: array + items: + type: object + properties: + id: + oneOf: + - type: string + enum: + - ci_micro + - ci_small + - ci_medium + - ci_large + - ci_xlarge + - ci_2xlarge + - ci_4xlarge + - ci_8xlarge + - ci_12xlarge + - ci_16xlarge + - ci_24xlarge + - ci_24xlarge_optimized_cpu + - ci_24xlarge_optimized_memory + - ci_24xlarge_high_memory + - ci_48xlarge + - ci_48xlarge_optimized_cpu + - ci_48xlarge_optimized_memory + - ci_48xlarge_high_memory + - type: string + enum: + - cd_default + - type: string + enum: + - pitr_7 + - pitr_14 + - pitr_28 + - type: string + enum: + - ipv4_default + - type: string + enum: + - auth_mfa_phone_default + - type: string + enum: + - auth_mfa_web_authn_default + - type: string + enum: + - log_drain_default + name: + type: string + price: + type: object + properties: + description: + type: string + type: + type: string + enum: + - fixed + - usage + interval: + type: string + enum: + - monthly + - hourly + amount: + type: number + required: + - description + - type + - interval + - amount + meta: + description: Any JSON-serializable value + required: + - id + - name + - price + required: + - type + - name + - variants + required: + - selected_addons + - available_addons + ApplyProjectAddonBody: + type: object + properties: + addon_variant: + oneOf: + - type: string + enum: + - ci_micro + - ci_small + - ci_medium + - ci_large + - ci_xlarge + - ci_2xlarge + - ci_4xlarge + - ci_8xlarge + - ci_12xlarge + - ci_16xlarge + - ci_24xlarge + - ci_24xlarge_optimized_cpu + - ci_24xlarge_optimized_memory + - ci_24xlarge_high_memory + - ci_48xlarge + - ci_48xlarge_optimized_cpu + - ci_48xlarge_optimized_memory + - ci_48xlarge_high_memory + - type: string + enum: + - cd_default + - type: string + enum: + - pitr_7 + - pitr_14 + - pitr_28 + - type: string + enum: + - ipv4_default + addon_type: type: string enum: - - '13' - - '14' - - '15' - - '17' - - 17-oriole + - custom_domain + - compute_instance + - pitr + - ipv4 + - auth_mfa_phone + - auth_mfa_web_authn + - log_drain required: - - version - - release_channel - - postgres_engine - GetProjectAvailableRestoreVersionsResponse: + - addon_variant + - addon_type + V1ProjectAdvisorsResponse: type: object properties: - available_versions: + lints: type: array items: - $ref: '#/components/schemas/ProjectAvailableRestoreVersion' + type: object + properties: + name: + type: string + enum: + - unindexed_foreign_keys + - auth_users_exposed + - auth_rls_initplan + - no_primary_key + - unused_index + - multiple_permissive_policies + - policy_exists_rls_disabled + - rls_enabled_no_policy + - duplicate_index + - security_definer_view + - function_search_path_mutable + - rls_disabled_in_public + - extension_in_public + - rls_references_user_metadata + - materialized_view_in_api + - foreign_table_in_api + - unsupported_reg_types + - auth_otp_long_expiry + - auth_otp_short_length + - ssl_not_enforced + - network_restrictions_not_set + - password_requirements_min_length + - pitr_not_enabled + - auth_leaked_password_protection + - auth_insufficient_mfa_options + - auth_password_policy_missing + - leaked_service_key + - no_backup_admin + title: + type: string + level: + type: string + enum: + - ERROR + - WARN + - INFO + facing: + type: string + enum: + - EXTERNAL + categories: + type: array + items: + type: string + enum: + - PERFORMANCE + - SECURITY + description: + type: string + detail: + type: string + remediation: + type: string + metadata: + type: object + properties: + schema: + type: string + name: + type: string + entity: + type: string + type: + type: string + enum: + - table + - view + - auth + - function + - extension + - compliance + fkey_name: + type: string + fkey_columns: + type: array + items: + type: number + cache_key: + type: string + required: + - name + - title + - level + - facing + - categories + - description + - detail + - remediation + - cache_key required: - - available_versions - RestoreProjectBodyDto: - type: object - properties: {} - hideDefinitions: - - release_channel - - postgres_engine - V1AnalyticsResponse: + - lints + AnalyticsResponse: type: object properties: + result: + type: array + items: {} error: oneOf: - - properties: + - type: string + - type: object + properties: code: type: number errors: type: array items: + type: object properties: domain: type: string @@ -5612,23 +7100,54 @@ components: type: string reason: type: string + required: + - domain + - location + - locationType + - message + - reason message: type: string status: type: string - - type: string - result: - type: array - items: - type: object + required: + - code + - errors + - message + - status + V1ListMigrationsResponse: + type: array + items: + type: object + properties: + version: + type: string + minLength: 1 + name: + type: string + required: + - version + V1CreateMigrationBody: + type: object + properties: + query: + type: string + minLength: 1 + name: + type: string + required: + - query V1RunQueryBody: type: object properties: query: type: string + minLength: 1 + read_only: + type: boolean required: - query - GetProjectDbMetadataResponseDto: + GetProjectDbMetadataResponse: type: object properties: databases: @@ -5657,14 +7176,6 @@ components: FunctionResponse: type: object properties: - version: - type: integer - created_at: - type: integer - format: int64 - updated_at: - type: integer - format: int64 id: type: string slug: @@ -5672,69 +7183,19 @@ components: name: type: string status: + type: string enum: - ACTIVE - REMOVED - THROTTLED - type: string - verify_jwt: - type: boolean - import_map: - type: boolean - entrypoint_path: - type: string - import_map_path: - type: string - compute_multiplier: - type: number - required: - - version - - created_at - - updated_at - - id - - slug - - name - - status - V1CreateFunctionBody: - type: object - properties: - slug: - type: string - pattern: /^[A-Za-z0-9_-]+$/ - name: - type: string - body: - type: string - verify_jwt: - type: boolean - compute_multiplier: - type: number - minimum: 1 - maximum: 4 - required: - - slug - - name - - body - BulkUpdateFunctionBody: - type: object - properties: version: type: integer created_at: type: integer format: int64 - id: - type: string - slug: - type: string - name: - type: string - status: - enum: - - ACTIVE - - REMOVED - - THROTTLED - type: string + updated_at: + type: integer + format: int64 verify_jwt: type: boolean import_map: @@ -5744,37 +7205,94 @@ components: import_map_path: type: string required: - - version - id - slug - name - status + - version + - created_at + - updated_at + BulkUpdateFunctionBody: + type: array + items: + type: object + properties: + id: + type: string + slug: + type: string + pattern: ^[A-Za-z0-9_-]+$ + name: + type: string + status: + type: string + enum: + - ACTIVE + - REMOVED + - THROTTLED + version: + type: integer + created_at: + type: integer + format: int64 + verify_jwt: + type: boolean + import_map: + type: boolean + entrypoint_path: + type: string + import_map_path: + type: string + required: + - id + - slug + - name + - status + - version BulkUpdateFunctionResponse: - type: object - properties: - functions: - type: array - items: - $ref: '#/components/schemas/FunctionResponse' - required: - - functions - FunctionDeployMetadata: - type: object - properties: - entrypoint_path: - type: string - import_map_path: - type: string - static_patterns: + type: object + properties: + functions: type: array items: - type: string - verify_jwt: - type: boolean - name: - type: string + type: object + properties: + id: + type: string + slug: + type: string + name: + type: string + status: + type: string + enum: + - ACTIVE + - REMOVED + - THROTTLED + version: + type: integer + created_at: + type: integer + updated_at: + type: integer + verify_jwt: + type: boolean + import_map: + type: boolean + entrypoint_path: + type: string + import_map_path: + type: string + required: + - id + - slug + - name + - status + - version + - created_at + - updated_at required: - - entrypoint_path + - functions FunctionDeployBody: type: object properties: @@ -5784,21 +7302,27 @@ components: type: string format: binary metadata: - $ref: '#/components/schemas/FunctionDeployMetadata' + type: object + properties: + entrypoint_path: + type: string + import_map_path: + type: string + static_patterns: + type: array + items: + type: string + verify_jwt: + type: boolean + name: + type: string + required: + - entrypoint_path required: - - file - metadata DeployFunctionResponse: type: object properties: - version: - type: integer - created_at: - type: integer - format: int64 - updated_at: - type: integer - format: int64 id: type: string slug: @@ -5806,11 +7330,19 @@ components: name: type: string status: + type: string enum: - ACTIVE - REMOVED - THROTTLED - type: string + version: + type: integer + created_at: + type: integer + format: int64 + updated_at: + type: integer + format: int64 verify_jwt: type: boolean import_map: @@ -5819,25 +7351,15 @@ components: type: string import_map_path: type: string - compute_multiplier: - type: number required: - - version - id - slug - name - status + - version FunctionSlugResponse: type: object properties: - version: - type: integer - created_at: - type: integer - format: int64 - updated_at: - type: integer - format: int64 id: type: string slug: @@ -5845,11 +7367,17 @@ components: name: type: string status: + type: string enum: - ACTIVE - REMOVED - THROTTLED - type: string + version: + type: integer + created_at: + type: integer + updated_at: + type: integer verify_jwt: type: boolean import_map: @@ -5858,16 +7386,17 @@ components: type: string import_map_path: type: string - compute_multiplier: - type: number required: - - version - - created_at - - updated_at - id - slug - name - status + - version + - created_at + - updated_at + StreamableFile: + type: object + properties: {} V1UpdateFunctionBody: type: object properties: @@ -5877,10 +7406,6 @@ components: type: string verify_jwt: type: boolean - compute_multiplier: - type: number - minimum: 1 - maximum: 4 V1StorageBucketResponse: type: object properties: @@ -5903,32 +7428,6 @@ components: - created_at - updated_at - public - AttributeValue: - type: object - properties: - default: - oneOf: - - type: object - - type: number - - type: string - - type: boolean - name: - type: string - names: - type: array - items: - type: string - array: - type: boolean - AttributeMapping: - type: object - properties: - keys: - type: object - additionalProperties: - $ref: '#/components/schemas/AttributeValue' - required: - - keys CreateProviderBody: type: object properties: @@ -5946,66 +7445,79 @@ components: items: type: string attribute_mapping: - $ref: '#/components/schemas/AttributeMapping' + type: object + properties: + keys: + type: object + additionalProperties: + type: object + properties: + name: + type: string + names: + type: array + items: + type: string + default: {} + array: + type: boolean + required: + - keys required: - type - SamlDescriptor: - type: object - properties: - id: - type: string - entity_id: - type: string - metadata_url: - type: string - metadata_xml: - type: string - attribute_mapping: - $ref: '#/components/schemas/AttributeMapping' - required: - - id - - entity_id - Domain: - type: object - properties: - id: - type: string - domain: - type: string - created_at: - type: string - updated_at: - type: string - required: - - id CreateProviderResponse: type: object properties: id: type: string saml: - $ref: '#/components/schemas/SamlDescriptor' - domains: - type: array - items: - $ref: '#/components/schemas/Domain' - created_at: - type: string - updated_at: - type: string - required: - - id - Provider: - type: object - properties: - id: - type: string - saml: - $ref: '#/components/schemas/SamlDescriptor' + type: object + properties: + id: + type: string + entity_id: + type: string + metadata_url: + type: string + metadata_xml: + type: string + attribute_mapping: + type: object + properties: + keys: + type: object + additionalProperties: + type: object + properties: + name: + type: string + names: + type: array + items: + type: string + default: {} + array: + type: boolean + required: + - keys + required: + - id + - entity_id domains: type: array items: - $ref: '#/components/schemas/Domain' + type: object + properties: + id: + type: string + domain: + type: string + created_at: + type: string + updated_at: + type: string + required: + - id created_at: type: string updated_at: @@ -6018,7 +7530,64 @@ components: items: type: array items: - $ref: '#/components/schemas/Provider' + type: object + properties: + id: + type: string + saml: + type: object + properties: + id: + type: string + entity_id: + type: string + metadata_url: + type: string + metadata_xml: + type: string + attribute_mapping: + type: object + properties: + keys: + type: object + additionalProperties: + type: object + properties: + name: + type: string + names: + type: array + items: + type: string + default: {} + array: + type: boolean + required: + - keys + required: + - id + - entity_id + domains: + type: array + items: + type: object + properties: + id: + type: string + domain: + type: string + created_at: + type: string + updated_at: + type: string + required: + - id + created_at: + type: string + updated_at: + type: string + required: + - id required: - items GetProviderResponse: @@ -6027,11 +7596,53 @@ components: id: type: string saml: - $ref: '#/components/schemas/SamlDescriptor' + type: object + properties: + id: + type: string + entity_id: + type: string + metadata_url: + type: string + metadata_xml: + type: string + attribute_mapping: + type: object + properties: + keys: + type: object + additionalProperties: + type: object + properties: + name: + type: string + names: + type: array + items: + type: string + default: {} + array: + type: boolean + required: + - keys + required: + - id + - entity_id domains: type: array items: - $ref: '#/components/schemas/Domain' + type: object + properties: + id: + type: string + domain: + type: string + created_at: + type: string + updated_at: + type: string + required: + - id created_at: type: string updated_at: @@ -6050,18 +7661,77 @@ components: items: type: string attribute_mapping: - $ref: '#/components/schemas/AttributeMapping' + type: object + properties: + keys: + type: object + additionalProperties: + type: object + properties: + name: + type: string + names: + type: array + items: + type: string + default: {} + array: + type: boolean + required: + - keys UpdateProviderResponse: type: object properties: id: type: string saml: - $ref: '#/components/schemas/SamlDescriptor' + type: object + properties: + id: + type: string + entity_id: + type: string + metadata_url: + type: string + metadata_xml: + type: string + attribute_mapping: + type: object + properties: + keys: + type: object + additionalProperties: + type: object + properties: + name: + type: string + names: + type: array + items: + type: string + default: {} + array: + type: boolean + required: + - keys + required: + - id + - entity_id domains: type: array items: - $ref: '#/components/schemas/Domain' + type: object + properties: + id: + type: string + domain: + type: string + created_at: + type: string + updated_at: + type: string + required: + - id created_at: type: string updated_at: @@ -6074,46 +7744,59 @@ components: id: type: string saml: - $ref: '#/components/schemas/SamlDescriptor' + type: object + properties: + id: + type: string + entity_id: + type: string + metadata_url: + type: string + metadata_xml: + type: string + attribute_mapping: + type: object + properties: + keys: + type: object + additionalProperties: + type: object + properties: + name: + type: string + names: + type: array + items: + type: string + default: {} + array: + type: boolean + required: + - keys + required: + - id + - entity_id domains: type: array items: - $ref: '#/components/schemas/Domain' + type: object + properties: + id: + type: string + domain: + type: string + created_at: + type: string + updated_at: + type: string + required: + - id created_at: type: string updated_at: type: string required: - id - V1Backup: - type: object - properties: - status: - type: string - enum: - - COMPLETED - - FAILED - - PENDING - - REMOVED - - ARCHIVED - - CANCELLED - is_physical_backup: - type: boolean - inserted_at: - type: string - required: - - status - - is_physical_backup - - inserted_at - V1PhysicalBackup: - type: object - properties: - earliest_physical_backup_date_unix: - type: integer - format: int64 - latest_physical_backup_date_unix: - type: integer - format: int64 V1BackupsResponse: type: object properties: @@ -6126,9 +7809,32 @@ components: backups: type: array items: - $ref: '#/components/schemas/V1Backup' + type: object + properties: + is_physical_backup: + type: boolean + status: + type: string + enum: + - COMPLETED + - FAILED + - PENDING + - REMOVED + - ARCHIVED + - CANCELLED + inserted_at: + type: string + required: + - is_physical_backup + - status + - inserted_at physical_backup_data: - $ref: '#/components/schemas/V1PhysicalBackup' + type: object + properties: + earliest_physical_backup_date_unix: + type: integer + latest_physical_backup_date_unix: + type: integer required: - region - walg_enabled @@ -6162,18 +7868,20 @@ components: - user_name - role_name - mfa_enabled - BillingPlanId: - type: string - enum: - - free - - pro - - team - - enterprise V1OrganizationSlugResponse: type: object properties: + id: + type: string + name: + type: string plan: - $ref: '#/components/schemas/BillingPlanId' + type: string + enum: + - free + - pro + - team + - enterprise opt_in_tags: type: array items: @@ -6183,13 +7891,16 @@ components: allowed_release_channels: type: array items: - $ref: '#/components/schemas/ReleaseChannel' - id: - type: string - name: - type: string + type: string + enum: + - internal + - alpha + - beta + - ga + - withdrawn + - preview required: - - opt_in_tags - - allowed_release_channels - id - name + - opt_in_tags + - allowed_release_channels diff --git a/cmd/branches.go b/cmd/branches.go index 1c093278b..481109bdf 100644 --- a/cmd/branches.go +++ b/cmd/branches.go @@ -48,7 +48,7 @@ var ( body.Region = &branchRegion.Value } if cmdFlags.Changed("size") { - body.DesiredInstanceSize = (*api.DesiredInstanceSize)(&size.Value) + body.DesiredInstanceSize = (*api.CreateBranchBodyDesiredInstanceSize)(&size.Value) } if cmdFlags.Changed("persistent") { body.Persistent = &persistent diff --git a/cmd/projects.go b/cmd/projects.go index c119e7171..9e0353265 100644 --- a/cmd/projects.go +++ b/cmd/projects.go @@ -32,22 +32,27 @@ var ( region = utils.EnumFlag{ Allowed: awsRegions(), } - plan = utils.EnumFlag{ - Allowed: []string{string(api.V1CreateProjectBodyDtoPlanFree), string(api.V1CreateProjectBodyDtoPlanPro)}, - Value: string(api.V1CreateProjectBodyDtoPlanFree), - } size = utils.EnumFlag{ Allowed: []string{ - string(api.DesiredInstanceSizeMicro), - string(api.DesiredInstanceSizeSmall), - string(api.DesiredInstanceSizeMedium), - string(api.DesiredInstanceSizeLarge), - string(api.DesiredInstanceSizeXlarge), - string(api.DesiredInstanceSizeN2xlarge), - string(api.DesiredInstanceSizeN4xlarge), - string(api.DesiredInstanceSizeN8xlarge), - string(api.DesiredInstanceSizeN12xlarge), - string(api.DesiredInstanceSizeN16xlarge), + string(api.V1CreateProjectBodyDesiredInstanceSizeLarge), + string(api.V1CreateProjectBodyDesiredInstanceSizeMedium), + string(api.V1CreateProjectBodyDesiredInstanceSizeMicro), + string(api.V1CreateProjectBodyDesiredInstanceSizeN12xlarge), + string(api.V1CreateProjectBodyDesiredInstanceSizeN16xlarge), + string(api.V1CreateProjectBodyDesiredInstanceSizeN24xlarge), + string(api.V1CreateProjectBodyDesiredInstanceSizeN24xlargeHighMemory), + string(api.V1CreateProjectBodyDesiredInstanceSizeN24xlargeOptimizedCpu), + string(api.V1CreateProjectBodyDesiredInstanceSizeN24xlargeOptimizedMemory), + string(api.V1CreateProjectBodyDesiredInstanceSizeN2xlarge), + string(api.V1CreateProjectBodyDesiredInstanceSizeN48xlarge), + string(api.V1CreateProjectBodyDesiredInstanceSizeN48xlargeHighMemory), + string(api.V1CreateProjectBodyDesiredInstanceSizeN48xlargeOptimizedCpu), + string(api.V1CreateProjectBodyDesiredInstanceSizeN48xlargeOptimizedMemory), + string(api.V1CreateProjectBodyDesiredInstanceSizeN4xlarge), + string(api.V1CreateProjectBodyDesiredInstanceSizeN8xlarge), + string(api.V1CreateProjectBodyDesiredInstanceSizePico), + string(api.V1CreateProjectBodyDesiredInstanceSizeSmall), + string(api.V1CreateProjectBodyDesiredInstanceSizeXlarge), }, } @@ -69,14 +74,14 @@ var ( if len(args) > 0 { projectName = args[0] } - body := api.V1CreateProjectBodyDto{ + body := api.V1CreateProjectBody{ Name: projectName, OrganizationId: orgId, DbPass: dbPassword, - Region: api.V1CreateProjectBodyDtoRegion(region.Value), + Region: api.V1CreateProjectBodyRegion(region.Value), } if cmd.Flags().Changed("size") { - body.DesiredInstanceSize = (*api.V1CreateProjectBodyDtoDesiredInstanceSize)(&size.Value) + body.DesiredInstanceSize = (*api.V1CreateProjectBodyDesiredInstanceSize)(&size.Value) } return create.Run(cmd.Context(), body, afero.NewOsFs()) }, @@ -133,7 +138,7 @@ func init() { createFlags.StringVar(&orgId, "org-id", "", "Organization ID to create the project in.") createFlags.StringVar(&dbPassword, "db-password", "", "Database password of the project.") createFlags.Var(®ion, "region", "Select a region close to you for the best performance.") - createFlags.Var(&plan, "plan", "Select a plan that suits your needs.") + createFlags.String("plan", "", "Select a plan that suits your needs.") cobra.CheckErr(createFlags.MarkHidden("plan")) createFlags.Var(&size, "size", "Select a desired instance size for your project.") cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", createFlags.Lookup("db-password"))) diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index 8310a82fb..d7a22b500 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -77,7 +77,7 @@ func Run(ctx context.Context, starter StarterTemplate, fsys afero.Fs, options .. return err } // 2. Create project - params := api.V1CreateProjectBodyDto{ + params := api.V1CreateProjectBody{ Name: filepath.Base(workdir), TemplateUrl: &starter.Url, } @@ -152,9 +152,7 @@ func suggestAppStart(cwd, command string) string { func checkProjectHealth(ctx context.Context) error { params := api.V1GetServicesHealthParams{ - Services: []api.V1GetServicesHealthParamsServices{ - api.V1GetServicesHealthParamsServicesDb, - }, + Services: []interface{}{"db"}, } resp, err := utils.GetSupabase().V1GetServicesHealthWithResponse(ctx, flags.ProjectRef, ¶ms) if err != nil { diff --git a/internal/branches/delete/delete.go b/internal/branches/delete/delete.go index b7fdd6671..9c7222c9e 100644 --- a/internal/branches/delete/delete.go +++ b/internal/branches/delete/delete.go @@ -6,11 +6,16 @@ import ( "net/http" "github.com/go-errors/errors" + "github.com/google/uuid" "github.com/supabase/cli/internal/utils" ) func Run(ctx context.Context, branchId string) error { - resp, err := utils.GetSupabase().V1DeleteABranchWithResponse(ctx, branchId) + parsed, err := uuid.Parse(branchId) + if err != nil { + return errors.Errorf("failed to parse branch ID: %w", err) + } + resp, err := utils.GetSupabase().V1DeleteABranchWithResponse(ctx, parsed) if err != nil { return errors.Errorf("failed to delete preview branch: %w", err) } diff --git a/internal/branches/get/get.go b/internal/branches/get/get.go index f13b75598..0a6c93d53 100644 --- a/internal/branches/get/get.go +++ b/internal/branches/get/get.go @@ -6,6 +6,7 @@ import ( "os" "github.com/go-errors/errors" + "github.com/google/uuid" "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/supabase/cli/internal/migration/list" @@ -52,7 +53,11 @@ func Run(ctx context.Context, branchId string, fsys afero.Fs) error { func getBranchDetail(ctx context.Context, branchId string) (api.BranchDetailResponse, error) { var result api.BranchDetailResponse - resp, err := utils.GetSupabase().V1GetABranchConfigWithResponse(ctx, branchId) + parsed, err := uuid.Parse(branchId) + if err != nil { + return result, errors.Errorf("failed to parse branch ID: %w", err) + } + resp, err := utils.GetSupabase().V1GetABranchConfigWithResponse(ctx, parsed) if err != nil { return result, errors.Errorf("failed to get branch: %w", err) } else if resp.JSON200 == nil { @@ -73,7 +78,7 @@ func getBranchDetail(ctx context.Context, branchId string) (api.BranchDetailResp func getPoolerConfig(ctx context.Context, ref string) (api.SupavisorConfigResponse, error) { var result api.SupavisorConfigResponse - resp, err := utils.GetSupabase().V1GetSupavisorConfigWithResponse(ctx, ref) + resp, err := utils.GetSupabase().V1GetPoolerConfigWithResponse(ctx, ref) if err != nil { return result, errors.Errorf("failed to get pooler: %w", err) } else if resp.JSON200 == nil { diff --git a/internal/branches/update/update.go b/internal/branches/update/update.go index 6c0f5fc4a..5b6957462 100644 --- a/internal/branches/update/update.go +++ b/internal/branches/update/update.go @@ -5,13 +5,18 @@ import ( "fmt" "github.com/go-errors/errors" + "github.com/google/uuid" "github.com/spf13/afero" "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 { - resp, err := utils.GetSupabase().V1UpdateABranchConfigWithResponse(ctx, branchId, body) + parsed, err := uuid.Parse(branchId) + if err != nil { + return errors.Errorf("failed to parse branch ID: %w", err) + } + resp, err := utils.GetSupabase().V1UpdateABranchConfigWithResponse(ctx, parsed, body) if err != nil { return errors.Errorf("failed to update preview branch: %w", err) } diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index 1bdc23fb9..f476bd31c 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -14,7 +14,6 @@ import ( "github.com/spf13/afero" "github.com/spf13/viper" "github.com/supabase/cli/internal/utils" - "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/function" ) @@ -26,7 +25,7 @@ func NewDockerBundler(fsys afero.Fs) function.EszipBundler { return &dockerBundler{fsys: fsys} } -func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (api.FunctionDeployMetadata, error) { +func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (function.FunctionDeployMetadata, error) { meta := function.NewMetadata(slug, entrypoint, importMap, staticFiles) fmt.Fprintln(os.Stderr, "Bundling Function:", utils.Bold(slug)) cwd, err := os.Getwd() diff --git a/internal/link/link.go b/internal/link/link.go index 17d930605..9228ef021 100644 --- a/internal/link/link.go +++ b/internal/link/link.go @@ -224,7 +224,7 @@ func updatePostgresConfig(conn *pgx.Conn) { } func linkPooler(ctx context.Context, projectRef string, fsys afero.Fs) error { - resp, err := utils.GetSupabase().V1GetSupavisorConfigWithResponse(ctx, projectRef) + resp, err := utils.GetSupabase().V1GetPoolerConfigWithResponse(ctx, projectRef) if err != nil { return errors.Errorf("failed to get pooler config: %w", err) } diff --git a/internal/link/link_test.go b/internal/link/link_test.go index 03c33f4bc..376886ff3 100644 --- a/internal/link/link_test.go +++ b/internal/link/link_test.go @@ -53,17 +53,15 @@ func TestLinkCommand(t *testing.T) { // Flush pending mocks after test execution defer gock.OffAll() // Mock project status - postgres := api.V1DatabaseResponse{ - Host: utils.GetSupabaseDbHost(project), - Version: "15.1.0.117", + mockPostgres := api.V1ProjectWithDatabaseResponse{ + Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY, } + mockPostgres.Database.Host = utils.GetSupabaseDbHost(project) + mockPostgres.Database.Version = "15.1.0.117" gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project). Reply(200). - JSON(api.V1ProjectWithDatabaseResponse{ - Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY, - Database: postgres, - }) + JSON(mockPostgres) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/api-keys"). Reply(200). @@ -117,7 +115,7 @@ func TestLinkCommand(t *testing.T) { assert.Equal(t, []byte(auth.Version), authVersion) postgresVersion, err := afero.ReadFile(fsys, utils.PostgresVersionPath) assert.NoError(t, err) - assert.Equal(t, []byte(postgres.Version), postgresVersion) + assert.Equal(t, []byte(mockPostgres.Database.Version), postgresVersion) }) t.Run("ignores error linking services", func(t *testing.T) { @@ -131,8 +129,7 @@ func TestLinkCommand(t *testing.T) { Get("/v1/projects/" + project). Reply(200). JSON(api.V1ProjectWithDatabaseResponse{ - Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY, - Database: api.V1DatabaseResponse{}, + Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY, }) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/api-keys"). @@ -182,8 +179,7 @@ func TestLinkCommand(t *testing.T) { Get("/v1/projects/" + project). Reply(200). JSON(api.V1ProjectWithDatabaseResponse{ - Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY, - Database: api.V1DatabaseResponse{}, + Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY, }) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/api-keys"). @@ -237,14 +233,15 @@ func TestStatusCheck(t *testing.T) { fsys := afero.NewMemMapFs() // Flush pending mocks after test execution defer gock.OffAll() + postgres := api.V1ProjectWithDatabaseResponse{ + Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY, + } + postgres.Database.Version = "15.6.1.139" // Mock project status gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project). Reply(http.StatusOK). - JSON(api.V1ProjectWithDatabaseResponse{ - Status: api.V1ProjectWithDatabaseResponseStatusACTIVEHEALTHY, - Database: api.V1DatabaseResponse{Version: "15.6.1.139"}, - }) + JSON(postgres) // Run test err := checkRemoteProjectStatus(context.Background(), project, fsys) // Check error diff --git a/internal/projects/create/create.go b/internal/projects/create/create.go index bfd461769..6d565bfcf 100644 --- a/internal/projects/create/create.go +++ b/internal/projects/create/create.go @@ -15,7 +15,7 @@ import ( "github.com/supabase/cli/pkg/api" ) -func Run(ctx context.Context, params api.V1CreateProjectBodyDto, fsys afero.Fs) error { +func Run(ctx context.Context, params api.V1CreateProjectBody, fsys afero.Fs) error { if err := promptMissingParams(ctx, ¶ms); err != nil { return err } @@ -50,7 +50,7 @@ func printKeyValue(key, value string) string { return key + ":" + spaces + value } -func promptMissingParams(ctx context.Context, body *api.V1CreateProjectBodyDto) error { +func promptMissingParams(ctx context.Context, body *api.V1CreateProjectBody) error { var err error if len(body.Name) == 0 { if body.Name, err = promptProjectName(ctx); err != nil { @@ -107,7 +107,7 @@ func promptOrgId(ctx context.Context) (string, error) { return choice.Details, nil } -func promptProjectRegion(ctx context.Context) (api.V1CreateProjectBodyDtoRegion, error) { +func promptProjectRegion(ctx context.Context) (api.V1CreateProjectBodyRegion, error) { title := "Which region do you want to host the project in?" items := make([]utils.PromptItem, len(utils.RegionMap)) i := 0 @@ -119,5 +119,5 @@ func promptProjectRegion(ctx context.Context) (api.V1CreateProjectBodyDtoRegion, if err != nil { return "", err } - return api.V1CreateProjectBodyDtoRegion(choice.Summary), nil + return api.V1CreateProjectBodyRegion(choice.Summary), nil } diff --git a/internal/projects/create/create_test.go b/internal/projects/create/create_test.go index 879421d72..c67c7a35e 100644 --- a/internal/projects/create/create_test.go +++ b/internal/projects/create/create_test.go @@ -14,11 +14,11 @@ import ( ) func TestProjectCreateCommand(t *testing.T) { - var params = api.V1CreateProjectBodyDto{ + var params = api.V1CreateProjectBody{ Name: "Test Project", OrganizationId: "combined-fuchsia-lion", DbPass: "redacted", - Region: api.V1CreateProjectBodyDtoRegionUsWest1, + Region: api.V1CreateProjectBodyRegionUsWest1, } t.Run("creates a new project", func(t *testing.T) { diff --git a/internal/secrets/set/set.go b/internal/secrets/set/set.go index 765599299..159a2b4e0 100644 --- a/internal/secrets/set/set.go +++ b/internal/secrets/set/set.go @@ -43,7 +43,7 @@ func Run(ctx context.Context, projectRef, envFilePath string, args []string, fsy return nil } -func ListSecrets(envFilePath string, fsys afero.Fs, envArgs ...string) ([]api.CreateSecretBody, error) { +func ListSecrets(envFilePath string, fsys afero.Fs, envArgs ...string) (api.CreateSecretBody, error) { envMap := map[string]string{} for name, secret := range utils.Config.EdgeRuntime.Secrets { if len(secret.SHA256) > 0 { @@ -64,17 +64,17 @@ func ListSecrets(envFilePath string, fsys afero.Fs, envArgs ...string) ([]api.Cr } envMap[name] = value } - var result []api.CreateSecretBody + var result api.CreateSecretBody for name, value := range envMap { // Lower case prefix is accepted by API if strings.HasPrefix(name, "SUPABASE_") { fmt.Fprintln(os.Stderr, "Env name cannot start with SUPABASE_, skipping: "+name) continue } - result = append(result, api.CreateSecretBody{ + result = append(result, api.CreateSecretBody{{ Name: name, Value: value, - }) + }}...) } return result, nil } diff --git a/internal/secrets/set/set_test.go b/internal/secrets/set/set_test.go index df18aa856..a99cfd8c8 100644 --- a/internal/secrets/set/set_test.go +++ b/internal/secrets/set/set_test.go @@ -16,8 +16,8 @@ import ( ) func TestSecretSetCommand(t *testing.T) { - dummy := api.CreateSecretBody{Name: "my_name", Value: "my_value"} - dummyEnv := dummy.Name + "=" + dummy.Value + dummy := api.CreateSecretBody{{Name: "my_name", Value: "my_value"}} + dummyEnv := dummy[0].Name + "=" + dummy[0].Value utils.CurrentDirAbs = "/tmp" t.Run("Sets secret via cli args", func(t *testing.T) { @@ -33,7 +33,7 @@ func TestSecretSetCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Post("/v1/projects/" + project + "/secrets"). MatchType("json"). - JSON(api.V1BulkCreateSecretsJSONRequestBody{dummy}). + JSON(dummy). Reply(http.StatusCreated) // Run test err := Run(context.Background(), project, "", []string{dummyEnv}, fsys) @@ -56,7 +56,7 @@ func TestSecretSetCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Post("/v1/projects/" + project + "/secrets"). MatchType("json"). - JSON(api.V1BulkCreateSecretsJSONRequestBody{dummy}). + JSON(dummy). Reply(http.StatusCreated) // Run test err := Run(context.Background(), project, "/tmp/.env", []string{}, fsys) @@ -106,7 +106,7 @@ func TestSecretSetCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Post("/v1/projects/" + project + "/secrets"). MatchType("json"). - JSON(api.V1BulkCreateSecretsJSONRequestBody{dummy}). + JSON(dummy). ReplyError(errors.New("network error")) // Run test err := Run(context.Background(), project, "", []string{dummyEnv}, fsys) @@ -128,7 +128,7 @@ func TestSecretSetCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Post("/v1/projects/" + project + "/secrets"). MatchType("json"). - JSON(api.V1BulkCreateSecretsJSONRequestBody{dummy}). + JSON(dummy). Reply(500). JSON(map[string]string{"message": "unavailable"}) // Run test diff --git a/internal/ssl_enforcement/update/update.go b/internal/ssl_enforcement/update/update.go index 51b0b6725..8f1b5f56d 100644 --- a/internal/ssl_enforcement/update/update.go +++ b/internal/ssl_enforcement/update/update.go @@ -14,11 +14,9 @@ func Run(ctx context.Context, projectRef string, enforceDbSsl bool, fsys afero.F // 1. sanity checks // 2. update restrictions { - resp, err := utils.GetSupabase().V1UpdateSslEnforcementConfigWithResponse(ctx, projectRef, api.V1UpdateSslEnforcementConfigJSONRequestBody{ - RequestedConfig: api.SslEnforcements{ - Database: enforceDbSsl, - }, - }) + body := api.V1UpdateSslEnforcementConfigJSONRequestBody{} + body.RequestedConfig.Database = enforceDbSsl + resp, err := utils.GetSupabase().V1UpdateSslEnforcementConfigWithResponse(ctx, projectRef, body) if err != nil { return errors.Errorf("failed to update ssl enforcement: %w", err) } diff --git a/internal/sso/create/create.go b/internal/sso/create/create.go index 802bbd05b..83cadd5fb 100644 --- a/internal/sso/create/create.go +++ b/internal/sso/create/create.go @@ -49,12 +49,17 @@ func Run(ctx context.Context, params RunParams) error { } if params.AttributeMapping != "" { - data, err := saml.ReadAttributeMappingFile(Fs, params.AttributeMapping) - if err != nil { + body.AttributeMapping = &struct { + Keys map[string]struct { + Array *bool "json:\"array,omitempty\"" + Default *interface{} "json:\"default,omitempty\"" + Name *string "json:\"name,omitempty\"" + Names *[]string "json:\"names,omitempty\"" + } "json:\"keys\"" + }{} + if err := saml.ReadAttributeMappingFile(Fs, params.AttributeMapping, body.AttributeMapping); err != nil { return err } - - body.AttributeMapping = data } if params.Domains != nil { @@ -76,13 +81,7 @@ func Run(ctx context.Context, params RunParams) error { switch params.Format { case utils.OutputPretty: - return render.SingleMarkdown(api.Provider{ - Id: resp.JSON201.Id, - Saml: resp.JSON201.Saml, - Domains: resp.JSON201.Domains, - CreatedAt: resp.JSON201.CreatedAt, - UpdatedAt: resp.JSON201.UpdatedAt, - }) + return render.SingleMarkdown(api.GetProviderResponse(*resp.JSON201)) case utils.OutputEnv: return nil default: diff --git a/internal/sso/get/get.go b/internal/sso/get/get.go index 75de6abcd..07e6251f7 100644 --- a/internal/sso/get/get.go +++ b/internal/sso/get/get.go @@ -7,13 +7,17 @@ import ( "os" "github.com/go-errors/errors" + "github.com/google/uuid" "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 { - resp, err := utils.GetSupabase().V1GetASsoProviderWithResponse(ctx, ref, providerId) + parsed, err := uuid.Parse(providerId) + if err != nil { + return errors.Errorf("failed to parse provider id: %w", err) + } + resp, err := utils.GetSupabase().V1GetASsoProviderWithResponse(ctx, ref, parsed) if err != nil { return err } @@ -31,13 +35,7 @@ func Run(ctx context.Context, ref, providerId, format string) error { _, err := fmt.Println(*resp.JSON200.Saml.MetadataXml) return err case utils.OutputPretty: - return render.SingleMarkdown(api.Provider{ - Id: resp.JSON200.Id, - Saml: resp.JSON200.Saml, - Domains: resp.JSON200.Domains, - CreatedAt: resp.JSON200.CreatedAt, - UpdatedAt: resp.JSON200.UpdatedAt, - }) + return render.SingleMarkdown(*resp.JSON200) case utils.OutputEnv: return errors.Errorf("--output env flag is not supported") default: diff --git a/internal/sso/internal/render/render.go b/internal/sso/internal/render/render.go index 3f3a03db1..e0af9497a 100644 --- a/internal/sso/internal/render/render.go +++ b/internal/sso/internal/render/render.go @@ -12,16 +12,16 @@ import ( "github.com/supabase/cli/pkg/api" ) -func formatProtocol(provider api.Provider) string { +func formatProtocol(provider api.GetProviderResponse) string { protocol := "SAML 2.0" - if provider.Saml == nil || *provider.Saml == (api.SamlDescriptor{}) { + if provider.Saml == nil { protocol = "unknown" } return protocol } -func formatMetadataSource(provider api.Provider) string { +func formatMetadataSource(provider api.GetProviderResponse) string { source := "FILE" if provider.Saml != nil && provider.Saml.MetadataUrl != nil && *provider.Saml.MetadataUrl != "" { source = *provider.Saml.MetadataUrl @@ -30,15 +30,6 @@ func formatMetadataSource(provider api.Provider) string { return source } -func formatAttributeMapping(attributeMapping *api.AttributeMapping) (string, error) { - data, err := json.MarshalIndent(attributeMapping, "", " ") - if err != nil { - return "", errors.Errorf("failed to marshal attribute mapping: %w", err) - } - - return string(data), nil -} - func formatTimestamp(timestamp *string) string { if timestamp == nil { return "" @@ -47,7 +38,7 @@ func formatTimestamp(timestamp *string) string { return utils.FormatTimestamp(*timestamp) } -func formatDomains(provider api.Provider) string { +func formatDomains(provider api.GetProviderResponse) string { var domains []string if provider.Domains != nil { @@ -66,7 +57,7 @@ func formatDomains(provider api.Provider) string { return domainsString } -func formatEntityID(provider api.Provider) string { +func formatEntityID(provider api.GetProviderResponse) string { entityID := "-" if provider.Saml != nil && provider.Saml.EntityId != "" { entityID = provider.Saml.EntityId @@ -75,12 +66,12 @@ func formatEntityID(provider api.Provider) string { return entityID } -func ListMarkdown(providers []api.Provider) error { +func ListMarkdown(providers api.ListProvidersResponse) error { markdownTable := []string{ "|TYPE|IDENTITY PROVIDER ID|DOMAINS|SAML 2.0 `EntityID`|CREATED AT (UTC)|UPDATED AT (UTC)|\n|-|-|-|-|-|-|\n", } - for _, item := range providers { + for _, item := range providers.Items { markdownTable = append(markdownTable, fmt.Sprintf( "|`%s`|`%s`|`%s`|`%s`|`%s`|`%s`|\n", formatProtocol(item), @@ -95,7 +86,7 @@ func ListMarkdown(providers []api.Provider) error { return list.RenderTable(strings.Join(markdownTable, "")) } -func SingleMarkdown(provider api.Provider) error { +func SingleMarkdown(provider api.GetProviderResponse) error { markdownTable := []string{ "|PROPERTY|VALUE|", "|-|-|", @@ -139,12 +130,12 @@ func SingleMarkdown(provider api.Provider) error { )) if provider.Saml != nil && provider.Saml.AttributeMapping != nil && len(provider.Saml.AttributeMapping.Keys) > 0 { - attributeMapping, err := formatAttributeMapping(provider.Saml.AttributeMapping) + attributeMapping, err := json.MarshalIndent(provider.Saml.AttributeMapping, "", " ") if err != nil { - return err + return errors.Errorf("failed to marshal attribute mapping: %w", err) } - markdownTable = append(markdownTable, "", "## Attribute Mapping", "```json", attributeMapping, "```") + markdownTable = append(markdownTable, "", "## Attribute Mapping", "```json", string(attributeMapping), "```") } if provider.Saml != nil && provider.Saml.MetadataXml != nil && *provider.Saml.MetadataXml != "" { diff --git a/internal/sso/internal/saml/files.go b/internal/sso/internal/saml/files.go index 62e0846e3..023fe0893 100644 --- a/internal/sso/internal/saml/files.go +++ b/internal/sso/internal/saml/files.go @@ -12,7 +12,6 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" - "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/fetcher" ) @@ -23,6 +22,7 @@ func ReadMetadataFile(fsys afero.Fs, path string) (string, error) { if err != nil { return "", errors.Errorf("failed to open metadata file: %w", err) } + defer file.Close() data, err := io.ReadAll(file) if err != nil { @@ -36,19 +36,19 @@ func ReadMetadataFile(fsys afero.Fs, path string) (string, error) { return string(data), nil } -func ReadAttributeMappingFile(fsys afero.Fs, path string) (*api.AttributeMapping, error) { +func ReadAttributeMappingFile(fsys afero.Fs, path string, mapping any) error { file, err := fsys.Open(path) if err != nil { - return nil, errors.Errorf("failed to open attribute mapping: %w", err) + return errors.Errorf("failed to open attribute mapping: %w", err) } + defer file.Close() - var mapping api.AttributeMapping dec := json.NewDecoder(file) - if err := dec.Decode(&mapping); err != nil { - return nil, errors.Errorf("failed to parse attribute mapping: %w", err) + if err := dec.Decode(mapping); err != nil { + return errors.Errorf("failed to parse attribute mapping: %w", err) } - return &mapping, nil + return nil } func ValidateMetadata(data []byte, source string) error { diff --git a/internal/sso/internal/saml/files_test.go b/internal/sso/internal/saml/files_test.go index ec7afe6de..320f2df13 100644 --- a/internal/sso/internal/saml/files_test.go +++ b/internal/sso/internal/saml/files_test.go @@ -8,28 +8,46 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" ) func TestReadAttributeMappingFile(t *testing.T) { t.Run("open file that does not exist", func(t *testing.T) { - _, err := ReadAttributeMappingFile(afero.NewMemMapFs(), "/does-not-exist") + err := ReadAttributeMappingFile(afero.NewMemMapFs(), "/does-not-exist", nil) assert.ErrorIs(t, err, os.ErrNotExist) }) t.Run("open file that is not valid JSON", func(t *testing.T) { fs := afero.NewMemMapFs() require.NoError(t, afero.WriteFile(fs, "/not-valid-json", []byte("not-valid-JSON"), 0755)) - - _, err := ReadAttributeMappingFile(fs, "/not-valid-json") + var body api.CreateProviderBody + err := ReadAttributeMappingFile(fs, "/not-valid-json", body.AttributeMapping) assert.ErrorContains(t, err, "failed to parse attribute mapping") }) t.Run("open valid file", func(t *testing.T) { fs := afero.NewMemMapFs() - require.NoError(t, afero.WriteFile(fs, "/valid-json", []byte(`{"keys":{"abc":{"names":["x","y","z"],"default":2,"name":"k"}}}`), 0755)) - - _, err := ReadAttributeMappingFile(fs, "/valid-json") + data := `{"keys":{"abc":{"names":["x","y","z"],"default":2,"name":"k"}}}` + require.NoError(t, afero.WriteFile(fs, "/valid-json", []byte(data), 0755)) + body := api.CreateProviderBody{ + AttributeMapping: &struct { + Keys map[string]struct { + Array *bool "json:\"array,omitempty\"" + Default *interface{} "json:\"default,omitempty\"" + Name *string "json:\"name,omitempty\"" + Names *[]string "json:\"names,omitempty\"" + } "json:\"keys\"" + }{}, + } + err := ReadAttributeMappingFile(fs, "/valid-json", body.AttributeMapping) assert.NoError(t, err) + assert.Len(t, body.AttributeMapping.Keys, 1) + value := body.AttributeMapping.Keys["abc"] + assert.Equal(t, cast.Ptr("k"), value.Name) + assert.Equal(t, &[]string{"x", "y", "z"}, value.Names) + assert.NotNil(t, value.Default) + assert.Equal(t, float64(2), *value.Default) }) } diff --git a/internal/sso/list/list.go b/internal/sso/list/list.go index efacb1a04..a517149be 100644 --- a/internal/sso/list/list.go +++ b/internal/sso/list/list.go @@ -26,7 +26,7 @@ func Run(ctx context.Context, ref, format string) error { switch format { case utils.OutputPretty: - return render.ListMarkdown(resp.JSON200.Items) + return render.ListMarkdown(*resp.JSON200) default: return utils.EncodeOutput(format, os.Stdout, map[string]any{ diff --git a/internal/sso/remove/remove.go b/internal/sso/remove/remove.go index 69bf5c4d0..9de49be3a 100644 --- a/internal/sso/remove/remove.go +++ b/internal/sso/remove/remove.go @@ -6,13 +6,18 @@ import ( "os" "github.com/go-errors/errors" + "github.com/google/uuid" "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 { - resp, err := utils.GetSupabase().V1DeleteASsoProviderWithResponse(ctx, ref, providerId) + parsed, err := uuid.Parse(providerId) + if err != nil { + return errors.Errorf("failed to parse provider ID: %w", err) + } + resp, err := utils.GetSupabase().V1DeleteASsoProviderWithResponse(ctx, ref, parsed) if err != nil { return errors.Errorf("failed to remove sso provider: %w", err) } @@ -27,13 +32,7 @@ func Run(ctx context.Context, ref, providerId, format string) error { switch format { case utils.OutputPretty: - return render.SingleMarkdown(api.Provider{ - Id: resp.JSON200.Id, - Saml: resp.JSON200.Saml, - Domains: resp.JSON200.Domains, - CreatedAt: resp.JSON200.CreatedAt, - UpdatedAt: resp.JSON200.UpdatedAt, - }) + return render.SingleMarkdown(api.GetProviderResponse(*resp.JSON200)) case utils.OutputEnv: return nil default: diff --git a/internal/sso/update/update.go b/internal/sso/update/update.go index 5729a64e7..f92357c70 100644 --- a/internal/sso/update/update.go +++ b/internal/sso/update/update.go @@ -6,6 +6,7 @@ import ( "os" "github.com/go-errors/errors" + "github.com/google/uuid" "github.com/spf13/afero" "github.com/supabase/cli/internal/sso/internal/render" "github.com/supabase/cli/internal/sso/internal/saml" @@ -31,14 +32,18 @@ type RunParams struct { } func Run(ctx context.Context, params RunParams) error { - getResp, err := utils.GetSupabase().V1GetASsoProviderWithResponse(ctx, params.ProjectRef, params.ProviderID) + parsed, err := uuid.Parse(params.ProviderID) + if err != nil { + return errors.Errorf("failed to parse provider ID: %w", err) + } + getResp, err := utils.GetSupabase().V1GetASsoProviderWithResponse(ctx, params.ProjectRef, parsed) if err != nil { return errors.Errorf("failed to get sso provider: %w", err) } if getResp.JSON200 == nil { if getResp.StatusCode() == http.StatusNotFound { - return errors.Errorf("An identity provider with ID %q could not be found.", params.ProviderID) + return errors.Errorf("An identity provider with ID %q could not be found.", parsed) } return errors.New("unexpected error fetching identity provider: " + string(getResp.Body)) @@ -64,12 +69,17 @@ func Run(ctx context.Context, params RunParams) error { } if params.AttributeMapping != "" { - data, err := saml.ReadAttributeMappingFile(Fs, params.AttributeMapping) - if err != nil { + body.AttributeMapping = &struct { + Keys map[string]struct { + Array *bool "json:\"array,omitempty\"" + Default *interface{} "json:\"default,omitempty\"" + Name *string "json:\"name,omitempty\"" + Names *[]string "json:\"names,omitempty\"" + } "json:\"keys\"" + }{} + if err := saml.ReadAttributeMappingFile(Fs, params.AttributeMapping, body.AttributeMapping); err != nil { return err } - - body.AttributeMapping = data } if len(params.Domains) != 0 { @@ -101,7 +111,7 @@ func Run(ctx context.Context, params RunParams) error { body.Domains = &domains } - putResp, err := utils.GetSupabase().V1UpdateASsoProviderWithResponse(ctx, params.ProjectRef, params.ProviderID, body) + putResp, err := utils.GetSupabase().V1UpdateASsoProviderWithResponse(ctx, params.ProjectRef, parsed, body) if err != nil { return errors.Errorf("failed to update sso provider: %w", err) } @@ -112,13 +122,7 @@ func Run(ctx context.Context, params RunParams) error { switch params.Format { case utils.OutputPretty: - return render.SingleMarkdown(api.Provider{ - Id: putResp.JSON200.Id, - Saml: putResp.JSON200.Saml, - Domains: putResp.JSON200.Domains, - CreatedAt: putResp.JSON200.CreatedAt, - UpdatedAt: putResp.JSON200.UpdatedAt, - }) + return render.SingleMarkdown(api.GetProviderResponse(*putResp.JSON200)) case utils.OutputEnv: return nil default: diff --git a/internal/utils/tenant/database_test.go b/internal/utils/tenant/database_test.go index c6680f2b7..d80ac5cba 100644 --- a/internal/utils/tenant/database_test.go +++ b/internal/utils/tenant/database_test.go @@ -19,17 +19,12 @@ func TestGetDatabaseVersion(t *testing.T) { defer gock.OffAll() projectRef := apitest.RandomProjectRef() + mockPostgres := api.V1ProjectWithDatabaseResponse{Id: projectRef} + mockPostgres.Database.Version = "14.1.0.99" gock.New(utils.DefaultApiHost). Get("/v1/projects"). Reply(http.StatusOK). - JSON([]api.V1ProjectWithDatabaseResponse{ - { - Id: projectRef, - Database: api.V1DatabaseResponse{ - Version: "14.1.0.99", - }, - }, - }) + JSON([]api.V1ProjectWithDatabaseResponse{mockPostgres}) version, err := GetDatabaseVersion(context.Background(), projectRef) @@ -44,17 +39,12 @@ func TestGetDatabaseVersion(t *testing.T) { defer gock.OffAll() projectRef := apitest.RandomProjectRef() + mockPostgres := api.V1ProjectWithDatabaseResponse{Id: "different-project"} + mockPostgres.Database.Version = "14.1.0.99" gock.New(utils.DefaultApiHost). Get("/v1/projects"). Reply(http.StatusOK). - JSON([]api.V1ProjectWithDatabaseResponse{ - { - Id: "different-project", - Database: api.V1DatabaseResponse{ - Version: "14.1.0.99", - }, - }, - }) + JSON([]api.V1ProjectWithDatabaseResponse{mockPostgres}) version, err := GetDatabaseVersion(context.Background(), projectRef) @@ -72,12 +62,9 @@ func TestGetDatabaseVersion(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects"). Reply(http.StatusOK). - JSON([]api.V1ProjectWithDatabaseResponse{ - { - Id: projectRef, - Database: api.V1DatabaseResponse{}, - }, - }) + JSON([]api.V1ProjectWithDatabaseResponse{{ + Id: projectRef, + }}) version, err := GetDatabaseVersion(context.Background(), projectRef) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index ed9093744..4ec88e1b5 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -91,21 +91,30 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { // V1DeleteABranch request - V1DeleteABranch(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*http.Response, error) + V1DeleteABranch(ctx context.Context, branchId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // V1GetABranchConfig request - V1GetABranchConfig(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*http.Response, error) + V1GetABranchConfig(ctx context.Context, branchId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // V1UpdateABranchConfigWithBody request with any body - V1UpdateABranchConfigWithBody(ctx context.Context, branchId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + V1UpdateABranchConfigWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - V1UpdateABranchConfig(ctx context.Context, branchId string, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + V1UpdateABranchConfig(ctx context.Context, branchId openapi_types.UUID, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1PushABranch request - V1PushABranch(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1MergeABranchWithBody request with any body + V1MergeABranchWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1ResetABranch request - V1ResetABranch(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*http.Response, error) + V1MergeABranch(ctx context.Context, branchId openapi_types.UUID, body V1MergeABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1PushABranchWithBody request with any body + V1PushABranchWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1PushABranch(ctx context.Context, branchId openapi_types.UUID, body V1PushABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1ResetABranchWithBody request with any body + V1ResetABranchWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1ResetABranch(ctx context.Context, branchId openapi_types.UUID, body V1ResetABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // V1AuthorizeUser request V1AuthorizeUser(ctx context.Context, params *V1AuthorizeUserParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -148,9 +157,21 @@ type ClientInterface interface { // V1GetProject request V1GetProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetPerformanceAdvisors request + GetPerformanceAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSecurityAdvisors request + GetSecurityAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetLogs request GetLogs(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetApiCounts request + GetApiCounts(ctx context.Context, ref string, params *GetApiCountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetApiRequestsCount request + GetApiRequestsCount(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectApiKeys request V1GetProjectApiKeys(ctx context.Context, ref string, params *V1GetProjectApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -160,15 +181,26 @@ type ClientInterface interface { CreateApiKey(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteApiKey request - DeleteApiKey(ctx context.Context, ref string, id string, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetApiKey request - GetApiKey(ctx context.Context, ref string, id string, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + GetApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateApiKeyWithBody request with any body - UpdateApiKeyWithBody(ctx context.Context, ref string, id string, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateApiKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateApiKey(ctx context.Context, ref string, id string, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1ListProjectAddons request + V1ListProjectAddons(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1ApplyProjectAddonWithBody request with any body + V1ApplyProjectAddonWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1ApplyProjectAddon(ctx context.Context, ref string, body V1ApplyProjectAddonJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1RemoveProjectAddon request + V1RemoveProjectAddon(ctx context.Context, ref string, addonVariant interface{}, reqEditors ...RequestEditorFn) (*http.Response, error) // V1DisablePreviewBranching request V1DisablePreviewBranching(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -189,6 +221,25 @@ type ClientInterface interface { V1UpdateAuthServiceConfig(ctx context.Context, ref string, body V1UpdateAuthServiceConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListSigningKeysForProject request + ListSigningKeysForProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateSigningKeyForProjectWithBody request with any body + CreateSigningKeyForProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateSigningKeyForProject(ctx context.Context, ref string, body CreateSigningKeyForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteSigningKey request + DeleteSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSigningKeyForProject request + GetSigningKeyForProject(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PatchSigningKeyWithBody request with any body + PatchSigningKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PatchSigningKey(ctx context.Context, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1ListAllSsoProvider request V1ListAllSsoProvider(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -198,15 +249,15 @@ type ClientInterface interface { V1CreateASsoProvider(ctx context.Context, ref string, body V1CreateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // V1DeleteASsoProvider request - V1DeleteASsoProvider(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*http.Response, error) + V1DeleteASsoProvider(ctx context.Context, ref string, providerId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // V1GetASsoProvider request - V1GetASsoProvider(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*http.Response, error) + V1GetASsoProvider(ctx context.Context, ref string, providerId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // V1UpdateASsoProviderWithBody request with any body - V1UpdateASsoProviderWithBody(ctx context.Context, ref string, providerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + V1UpdateASsoProviderWithBody(ctx context.Context, ref string, providerId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - V1UpdateASsoProvider(ctx context.Context, ref string, providerId string, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + V1UpdateASsoProvider(ctx context.Context, ref string, providerId openapi_types.UUID, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListTPAForProject request ListTPAForProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -217,21 +268,21 @@ type ClientInterface interface { CreateTPAForProject(ctx context.Context, ref string, body CreateTPAForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteTPAForProject request - DeleteTPAForProject(ctx context.Context, ref string, tpaId string, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteTPAForProject(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // GetTPAForProject request - GetTPAForProject(ctx context.Context, ref string, tpaId string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetTPAForProject(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // V1GetProjectPgbouncerConfig request V1GetProjectPgbouncerConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1GetSupavisorConfig request - V1GetSupavisorConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetPoolerConfig request + V1GetPoolerConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1UpdateSupavisorConfigWithBody request with any body - V1UpdateSupavisorConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1UpdatePoolerConfigWithBody request with any body + V1UpdatePoolerConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - V1UpdateSupavisorConfig(ctx context.Context, ref string, body V1UpdateSupavisorConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + V1UpdatePoolerConfig(ctx context.Context, ref string, body V1UpdatePoolerConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // V1GetPostgresConfig request V1GetPostgresConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -277,6 +328,14 @@ type ClientInterface interface { // GetDatabaseMetadata request GetDatabaseMetadata(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1ListMigrationHistory request + V1ListMigrationHistory(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1ApplyAMigrationWithBody request with any body + V1ApplyAMigrationWithBody(ctx context.Context, ref string, params *V1ApplyAMigrationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1ApplyAMigration(ctx context.Context, ref string, params *V1ApplyAMigrationParams, body V1ApplyAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1RunAQueryWithBody request with any body V1RunAQueryWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -291,8 +350,6 @@ type ClientInterface interface { // V1CreateAFunctionWithBody request with any body V1CreateAFunctionWithBody(ctx context.Context, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - V1CreateAFunction(ctx context.Context, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1BulkUpdateFunctionsWithBody request with any body V1BulkUpdateFunctionsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -326,6 +383,9 @@ type ClientInterface interface { // V1ListAllNetworkBans request V1ListAllNetworkBans(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1ListAllNetworkBansEnriched request + V1ListAllNetworkBansEnriched(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetNetworkRestrictions request V1GetNetworkRestrictions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -372,10 +432,8 @@ type ClientInterface interface { // V1ListAvailableRestoreVersions request V1ListAvailableRestoreVersions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1RestoreAProjectWithBody request with any body - V1RestoreAProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - V1RestoreAProject(ctx context.Context, ref string, body V1RestoreAProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1RestoreAProject request + V1RestoreAProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) // V1CancelAProjectRestoration request V1CancelAProjectRestoration(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -441,7 +499,7 @@ type ClientInterface interface { V1GetASnippet(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) } -func (c *Client) V1DeleteABranch(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1DeleteABranch(ctx context.Context, branchId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1DeleteABranchRequest(c.Server, branchId) if err != nil { return nil, err @@ -453,7 +511,7 @@ func (c *Client) V1DeleteABranch(ctx context.Context, branchId string, reqEditor return c.Client.Do(req) } -func (c *Client) V1GetABranchConfig(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1GetABranchConfig(ctx context.Context, branchId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1GetABranchConfigRequest(c.Server, branchId) if err != nil { return nil, err @@ -465,7 +523,7 @@ func (c *Client) V1GetABranchConfig(ctx context.Context, branchId string, reqEdi return c.Client.Do(req) } -func (c *Client) V1UpdateABranchConfigWithBody(ctx context.Context, branchId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1UpdateABranchConfigWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1UpdateABranchConfigRequestWithBody(c.Server, branchId, contentType, body) if err != nil { return nil, err @@ -477,7 +535,7 @@ func (c *Client) V1UpdateABranchConfigWithBody(ctx context.Context, branchId str return c.Client.Do(req) } -func (c *Client) V1UpdateABranchConfig(ctx context.Context, branchId string, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1UpdateABranchConfig(ctx context.Context, branchId openapi_types.UUID, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1UpdateABranchConfigRequest(c.Server, branchId, body) if err != nil { return nil, err @@ -489,8 +547,56 @@ func (c *Client) V1UpdateABranchConfig(ctx context.Context, branchId string, bod return c.Client.Do(req) } -func (c *Client) V1PushABranch(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1PushABranchRequest(c.Server, branchId) +func (c *Client) V1MergeABranchWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1MergeABranchRequestWithBody(c.Server, branchId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1MergeABranch(ctx context.Context, branchId openapi_types.UUID, body V1MergeABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1MergeABranchRequest(c.Server, branchId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1PushABranchWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1PushABranchRequestWithBody(c.Server, branchId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1PushABranch(ctx context.Context, branchId openapi_types.UUID, body V1PushABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1PushABranchRequest(c.Server, branchId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1ResetABranchWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ResetABranchRequestWithBody(c.Server, branchId, contentType, body) if err != nil { return nil, err } @@ -501,8 +607,8 @@ func (c *Client) V1PushABranch(ctx context.Context, branchId string, reqEditors return c.Client.Do(req) } -func (c *Client) V1ResetABranch(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1ResetABranchRequest(c.Server, branchId) +func (c *Client) V1ResetABranch(ctx context.Context, branchId openapi_types.UUID, body V1ResetABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ResetABranchRequest(c.Server, branchId, body) if err != nil { return nil, err } @@ -693,6 +799,30 @@ func (c *Client) V1GetProject(ctx context.Context, ref string, reqEditors ...Req return c.Client.Do(req) } +func (c *Client) GetPerformanceAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPerformanceAdvisorsRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetSecurityAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSecurityAdvisorsRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetLogs(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLogsRequest(c.Server, ref, params) if err != nil { @@ -705,6 +835,30 @@ func (c *Client) GetLogs(ctx context.Context, ref string, params *GetLogsParams, return c.Client.Do(req) } +func (c *Client) GetApiCounts(ctx context.Context, ref string, params *GetApiCountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiCountsRequest(c.Server, ref, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetApiRequestsCount(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetApiRequestsCountRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1GetProjectApiKeys(ctx context.Context, ref string, params *V1GetProjectApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1GetProjectApiKeysRequest(c.Server, ref, params) if err != nil { @@ -741,7 +895,7 @@ func (c *Client) CreateApiKey(ctx context.Context, ref string, params *CreateApi return c.Client.Do(req) } -func (c *Client) DeleteApiKey(ctx context.Context, ref string, id string, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) DeleteApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteApiKeyRequest(c.Server, ref, id, params) if err != nil { return nil, err @@ -753,7 +907,7 @@ func (c *Client) DeleteApiKey(ctx context.Context, ref string, id string, params return c.Client.Do(req) } -func (c *Client) GetApiKey(ctx context.Context, ref string, id string, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) GetApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetApiKeyRequest(c.Server, ref, id, params) if err != nil { return nil, err @@ -765,7 +919,7 @@ func (c *Client) GetApiKey(ctx context.Context, ref string, id string, params *G return c.Client.Do(req) } -func (c *Client) UpdateApiKeyWithBody(ctx context.Context, ref string, id string, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) UpdateApiKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateApiKeyRequestWithBody(c.Server, ref, id, params, contentType, body) if err != nil { return nil, err @@ -777,7 +931,7 @@ func (c *Client) UpdateApiKeyWithBody(ctx context.Context, ref string, id string return c.Client.Do(req) } -func (c *Client) UpdateApiKey(ctx context.Context, ref string, id string, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) UpdateApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateApiKeyRequest(c.Server, ref, id, params, body) if err != nil { return nil, err @@ -789,6 +943,54 @@ func (c *Client) UpdateApiKey(ctx context.Context, ref string, id string, params return c.Client.Do(req) } +func (c *Client) V1ListProjectAddons(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ListProjectAddonsRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1ApplyProjectAddonWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ApplyProjectAddonRequestWithBody(c.Server, ref, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1ApplyProjectAddon(ctx context.Context, ref string, body V1ApplyProjectAddonJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ApplyProjectAddonRequest(c.Server, ref, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1RemoveProjectAddon(ctx context.Context, ref string, addonVariant interface{}, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1RemoveProjectAddonRequest(c.Server, ref, addonVariant) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1DisablePreviewBranching(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1DisablePreviewBranchingRequest(c.Server, ref) if err != nil { @@ -873,6 +1075,90 @@ func (c *Client) V1UpdateAuthServiceConfig(ctx context.Context, ref string, body return c.Client.Do(req) } +func (c *Client) ListSigningKeysForProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListSigningKeysForProjectRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateSigningKeyForProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSigningKeyForProjectRequestWithBody(c.Server, ref, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateSigningKeyForProject(ctx context.Context, ref string, body CreateSigningKeyForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateSigningKeyForProjectRequest(c.Server, ref, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteSigningKeyRequest(c.Server, ref, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetSigningKeyForProject(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSigningKeyForProjectRequest(c.Server, ref, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PatchSigningKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchSigningKeyRequestWithBody(c.Server, ref, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PatchSigningKey(ctx context.Context, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPatchSigningKeyRequest(c.Server, ref, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1ListAllSsoProvider(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1ListAllSsoProviderRequest(c.Server, ref) if err != nil { @@ -909,7 +1195,7 @@ func (c *Client) V1CreateASsoProvider(ctx context.Context, ref string, body V1Cr return c.Client.Do(req) } -func (c *Client) V1DeleteASsoProvider(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1DeleteASsoProvider(ctx context.Context, ref string, providerId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1DeleteASsoProviderRequest(c.Server, ref, providerId) if err != nil { return nil, err @@ -921,7 +1207,7 @@ func (c *Client) V1DeleteASsoProvider(ctx context.Context, ref string, providerI return c.Client.Do(req) } -func (c *Client) V1GetASsoProvider(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1GetASsoProvider(ctx context.Context, ref string, providerId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1GetASsoProviderRequest(c.Server, ref, providerId) if err != nil { return nil, err @@ -933,7 +1219,7 @@ func (c *Client) V1GetASsoProvider(ctx context.Context, ref string, providerId s return c.Client.Do(req) } -func (c *Client) V1UpdateASsoProviderWithBody(ctx context.Context, ref string, providerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1UpdateASsoProviderWithBody(ctx context.Context, ref string, providerId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1UpdateASsoProviderRequestWithBody(c.Server, ref, providerId, contentType, body) if err != nil { return nil, err @@ -945,7 +1231,7 @@ func (c *Client) V1UpdateASsoProviderWithBody(ctx context.Context, ref string, p return c.Client.Do(req) } -func (c *Client) V1UpdateASsoProvider(ctx context.Context, ref string, providerId string, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1UpdateASsoProvider(ctx context.Context, ref string, providerId openapi_types.UUID, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1UpdateASsoProviderRequest(c.Server, ref, providerId, body) if err != nil { return nil, err @@ -993,7 +1279,7 @@ func (c *Client) CreateTPAForProject(ctx context.Context, ref string, body Creat return c.Client.Do(req) } -func (c *Client) DeleteTPAForProject(ctx context.Context, ref string, tpaId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) DeleteTPAForProject(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteTPAForProjectRequest(c.Server, ref, tpaId) if err != nil { return nil, err @@ -1005,7 +1291,7 @@ func (c *Client) DeleteTPAForProject(ctx context.Context, ref string, tpaId stri return c.Client.Do(req) } -func (c *Client) GetTPAForProject(ctx context.Context, ref string, tpaId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) GetTPAForProject(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTPAForProjectRequest(c.Server, ref, tpaId) if err != nil { return nil, err @@ -1029,8 +1315,8 @@ func (c *Client) V1GetProjectPgbouncerConfig(ctx context.Context, ref string, re return c.Client.Do(req) } -func (c *Client) V1GetSupavisorConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1GetSupavisorConfigRequest(c.Server, ref) +func (c *Client) V1GetPoolerConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetPoolerConfigRequest(c.Server, ref) if err != nil { return nil, err } @@ -1041,8 +1327,8 @@ func (c *Client) V1GetSupavisorConfig(ctx context.Context, ref string, reqEditor return c.Client.Do(req) } -func (c *Client) V1UpdateSupavisorConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1UpdateSupavisorConfigRequestWithBody(c.Server, ref, contentType, body) +func (c *Client) V1UpdatePoolerConfigWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdatePoolerConfigRequestWithBody(c.Server, ref, contentType, body) if err != nil { return nil, err } @@ -1053,8 +1339,8 @@ func (c *Client) V1UpdateSupavisorConfigWithBody(ctx context.Context, ref string return c.Client.Do(req) } -func (c *Client) V1UpdateSupavisorConfig(ctx context.Context, ref string, body V1UpdateSupavisorConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1UpdateSupavisorConfigRequest(c.Server, ref, body) +func (c *Client) V1UpdatePoolerConfig(ctx context.Context, ref string, body V1UpdatePoolerConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdatePoolerConfigRequest(c.Server, ref, body) if err != nil { return nil, err } @@ -1257,8 +1543,8 @@ func (c *Client) GetDatabaseMetadata(ctx context.Context, ref string, reqEditors return c.Client.Do(req) } -func (c *Client) V1RunAQueryWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1RunAQueryRequestWithBody(c.Server, ref, contentType, body) +func (c *Client) V1ListMigrationHistory(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ListMigrationHistoryRequest(c.Server, ref) if err != nil { return nil, err } @@ -1269,8 +1555,8 @@ func (c *Client) V1RunAQueryWithBody(ctx context.Context, ref string, contentTyp return c.Client.Do(req) } -func (c *Client) V1RunAQuery(ctx context.Context, ref string, body V1RunAQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1RunAQueryRequest(c.Server, ref, body) +func (c *Client) V1ApplyAMigrationWithBody(ctx context.Context, ref string, params *V1ApplyAMigrationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ApplyAMigrationRequestWithBody(c.Server, ref, params, contentType, body) if err != nil { return nil, err } @@ -1281,8 +1567,8 @@ func (c *Client) V1RunAQuery(ctx context.Context, ref string, body V1RunAQueryJS return c.Client.Do(req) } -func (c *Client) V1EnableDatabaseWebhook(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1EnableDatabaseWebhookRequest(c.Server, ref) +func (c *Client) V1ApplyAMigration(ctx context.Context, ref string, params *V1ApplyAMigrationParams, body V1ApplyAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ApplyAMigrationRequest(c.Server, ref, params, body) if err != nil { return nil, err } @@ -1293,8 +1579,8 @@ func (c *Client) V1EnableDatabaseWebhook(ctx context.Context, ref string, reqEdi return c.Client.Do(req) } -func (c *Client) V1ListAllFunctions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1ListAllFunctionsRequest(c.Server, ref) +func (c *Client) V1RunAQueryWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1RunAQueryRequestWithBody(c.Server, ref, contentType, body) if err != nil { return nil, err } @@ -1305,8 +1591,32 @@ func (c *Client) V1ListAllFunctions(ctx context.Context, ref string, reqEditors return c.Client.Do(req) } -func (c *Client) V1CreateAFunctionWithBody(ctx context.Context, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1CreateAFunctionRequestWithBody(c.Server, ref, params, contentType, body) +func (c *Client) V1RunAQuery(ctx context.Context, ref string, body V1RunAQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1RunAQueryRequest(c.Server, ref, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1EnableDatabaseWebhook(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1EnableDatabaseWebhookRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1ListAllFunctions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ListAllFunctionsRequest(c.Server, ref) if err != nil { return nil, err } @@ -1317,8 +1627,8 @@ func (c *Client) V1CreateAFunctionWithBody(ctx context.Context, ref string, para return c.Client.Do(req) } -func (c *Client) V1CreateAFunction(ctx context.Context, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1CreateAFunctionRequest(c.Server, ref, params, body) +func (c *Client) V1CreateAFunctionWithBody(ctx context.Context, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateAFunctionRequestWithBody(c.Server, ref, params, contentType, body) if err != nil { return nil, err } @@ -1473,7 +1783,19 @@ func (c *Client) V1ListAllNetworkBans(ctx context.Context, ref string, reqEditor return c.Client.Do(req) } -func (c *Client) V1GetNetworkRestrictions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { +func (c *Client) V1ListAllNetworkBansEnriched(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ListAllNetworkBansEnrichedRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1GetNetworkRestrictions(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1GetNetworkRestrictionsRequest(c.Server, ref) if err != nil { return nil, err @@ -1677,20 +1999,8 @@ func (c *Client) V1ListAvailableRestoreVersions(ctx context.Context, ref string, return c.Client.Do(req) } -func (c *Client) V1RestoreAProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1RestoreAProjectRequestWithBody(c.Server, ref, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) V1RestoreAProject(ctx context.Context, ref string, body V1RestoreAProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1RestoreAProjectRequest(c.Server, ref, body) +func (c *Client) V1RestoreAProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1RestoreAProjectRequest(c.Server, ref) if err != nil { return nil, err } @@ -1978,7 +2288,7 @@ func (c *Client) V1GetASnippet(ctx context.Context, id openapi_types.UUID, reqEd } // NewV1DeleteABranchRequest generates requests for V1DeleteABranch -func NewV1DeleteABranchRequest(server string, branchId string) (*http.Request, error) { +func NewV1DeleteABranchRequest(server string, branchId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -2012,7 +2322,7 @@ func NewV1DeleteABranchRequest(server string, branchId string) (*http.Request, e } // NewV1GetABranchConfigRequest generates requests for V1GetABranchConfig -func NewV1GetABranchConfigRequest(server string, branchId string) (*http.Request, error) { +func NewV1GetABranchConfigRequest(server string, branchId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -2046,7 +2356,7 @@ func NewV1GetABranchConfigRequest(server string, branchId string) (*http.Request } // NewV1UpdateABranchConfigRequest calls the generic V1UpdateABranchConfig builder with application/json body -func NewV1UpdateABranchConfigRequest(server string, branchId string, body V1UpdateABranchConfigJSONRequestBody) (*http.Request, error) { +func NewV1UpdateABranchConfigRequest(server string, branchId openapi_types.UUID, body V1UpdateABranchConfigJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { @@ -2057,7 +2367,7 @@ func NewV1UpdateABranchConfigRequest(server string, branchId string, body V1Upda } // NewV1UpdateABranchConfigRequestWithBody generates requests for V1UpdateABranchConfig with any type of body -func NewV1UpdateABranchConfigRequestWithBody(server string, branchId string, contentType string, body io.Reader) (*http.Request, error) { +func NewV1UpdateABranchConfigRequestWithBody(server string, branchId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -2092,8 +2402,66 @@ func NewV1UpdateABranchConfigRequestWithBody(server string, branchId string, con return req, nil } -// NewV1PushABranchRequest generates requests for V1PushABranch -func NewV1PushABranchRequest(server string, branchId string) (*http.Request, error) { +// NewV1MergeABranchRequest calls the generic V1MergeABranch builder with application/json body +func NewV1MergeABranchRequest(server string, branchId openapi_types.UUID, body V1MergeABranchJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1MergeABranchRequestWithBody(server, branchId, "application/json", bodyReader) +} + +// NewV1MergeABranchRequestWithBody generates requests for V1MergeABranch with any type of body +func NewV1MergeABranchRequestWithBody(server string, branchId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "branch_id", runtime.ParamLocationPath, branchId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/branches/%s/merge", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1PushABranchRequest calls the generic V1PushABranch builder with application/json body +func NewV1PushABranchRequest(server string, branchId openapi_types.UUID, body V1PushABranchJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1PushABranchRequestWithBody(server, branchId, "application/json", bodyReader) +} + +// NewV1PushABranchRequestWithBody generates requests for V1PushABranch with any type of body +func NewV1PushABranchRequestWithBody(server string, branchId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -2118,16 +2486,29 @@ func NewV1PushABranchRequest(server string, branchId string) (*http.Request, err return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1ResetABranchRequest generates requests for V1ResetABranch -func NewV1ResetABranchRequest(server string, branchId string) (*http.Request, error) { +// NewV1ResetABranchRequest calls the generic V1ResetABranch builder with application/json body +func NewV1ResetABranchRequest(server string, branchId openapi_types.UUID, body V1ResetABranchJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1ResetABranchRequestWithBody(server, branchId, "application/json", bodyReader) +} + +// NewV1ResetABranchRequestWithBody generates requests for V1ResetABranch with any type of body +func NewV1ResetABranchRequestWithBody(server string, branchId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -2152,11 +2533,13 @@ func NewV1ResetABranchRequest(server string, branchId string) (*http.Request, er return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } @@ -2659,6 +3042,74 @@ func NewV1GetProjectRequest(server string, ref string) (*http.Request, error) { return req, nil } +// NewGetPerformanceAdvisorsRequest generates requests for GetPerformanceAdvisors +func NewGetPerformanceAdvisorsRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/advisors/performance", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetSecurityAdvisorsRequest generates requests for GetSecurityAdvisors +func NewGetSecurityAdvisorsRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/advisors/security", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewGetLogsRequest generates requests for GetLogs func NewGetLogsRequest(server string, ref string, params *GetLogsParams) (*http.Request, error) { var err error @@ -2688,9 +3139,9 @@ func NewGetLogsRequest(server string, ref string, params *GetLogsParams) (*http. if params != nil { queryValues := queryURL.Query() - if params.IsoTimestampEnd != nil { + if params.Sql != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "iso_timestamp_end", runtime.ParamLocationQuery, *params.IsoTimestampEnd); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sql", runtime.ParamLocationQuery, *params.Sql); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -2720,9 +3171,9 @@ func NewGetLogsRequest(server string, ref string, params *GetLogsParams) (*http. } - if params.Sql != nil { + if params.IsoTimestampEnd != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sql", runtime.ParamLocationQuery, *params.Sql); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "iso_timestamp_end", runtime.ParamLocationQuery, *params.IsoTimestampEnd); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -2747,8 +3198,8 @@ func NewGetLogsRequest(server string, ref string, params *GetLogsParams) (*http. return req, nil } -// NewV1GetProjectApiKeysRequest generates requests for V1GetProjectApiKeys -func NewV1GetProjectApiKeysRequest(server string, ref string, params *V1GetProjectApiKeysParams) (*http.Request, error) { +// NewGetApiCountsRequest generates requests for GetApiCounts +func NewGetApiCountsRequest(server string, ref string, params *GetApiCountsParams) (*http.Request, error) { var err error var pathParam0 string @@ -2763,7 +3214,7 @@ func NewV1GetProjectApiKeysRequest(server string, ref string, params *V1GetProje return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/api-keys", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/analytics/endpoints/usage.api-counts", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2776,16 +3227,20 @@ func NewV1GetProjectApiKeysRequest(server string, ref string, params *V1GetProje if params != nil { queryValues := queryURL.Query() - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, params.Reveal); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.Interval != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "interval", runtime.ParamLocationQuery, *params.Interval); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } queryURL.RawQuery = queryValues.Encode() @@ -2799,19 +3254,8 @@ func NewV1GetProjectApiKeysRequest(server string, ref string, params *V1GetProje return req, nil } -// NewCreateApiKeyRequest calls the generic CreateApiKey builder with application/json body -func NewCreateApiKeyRequest(server string, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateApiKeyRequestWithBody(server, ref, params, "application/json", bodyReader) -} - -// NewCreateApiKeyRequestWithBody generates requests for CreateApiKey with any type of body -func NewCreateApiKeyRequestWithBody(server string, ref string, params *CreateApiKeyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewGetApiRequestsCountRequest generates requests for GetApiRequestsCount +func NewGetApiRequestsCountRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -2826,7 +3270,7 @@ func NewCreateApiKeyRequestWithBody(server string, ref string, params *CreateApi return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/api-keys", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/analytics/endpoints/usage.api-requests-count", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2836,36 +3280,16 @@ func NewCreateApiKeyRequestWithBody(server string, ref string, params *CreateApi return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, params.Reveal); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteApiKeyRequest generates requests for DeleteApiKey -func NewDeleteApiKeyRequest(server string, ref string, id string, params *DeleteApiKeyParams) (*http.Request, error) { +// NewV1GetProjectApiKeysRequest generates requests for V1GetProjectApiKeys +func NewV1GetProjectApiKeysRequest(server string, ref string, params *V1GetProjectApiKeysParams) (*http.Request, error) { var err error var pathParam0 string @@ -2875,19 +3299,12 @@ func NewDeleteApiKeyRequest(server string, ref string, id string, params *Delete return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/api-keys/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/api-keys", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2900,22 +3317,26 @@ func NewDeleteApiKeyRequest(server string, ref string, id string, params *Delete if params != nil { queryValues := queryURL.Query() - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, params.Reveal); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.Reveal != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, *params.Reveal); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } queryURL.RawQuery = queryValues.Encode() } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -2923,8 +3344,77 @@ func NewDeleteApiKeyRequest(server string, ref string, id string, params *Delete return req, nil } -// NewGetApiKeyRequest generates requests for GetApiKey -func NewGetApiKeyRequest(server string, ref string, id string, params *GetApiKeyParams) (*http.Request, error) { +// NewCreateApiKeyRequest calls the generic CreateApiKey builder with application/json body +func NewCreateApiKeyRequest(server string, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateApiKeyRequestWithBody(server, ref, params, "application/json", bodyReader) +} + +// NewCreateApiKeyRequestWithBody generates requests for CreateApiKey with any type of body +func NewCreateApiKeyRequestWithBody(server string, ref string, params *CreateApiKeyParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/api-keys", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Reveal != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, *params.Reveal); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteApiKeyRequest generates requests for DeleteApiKey +func NewDeleteApiKeyRequest(server string, ref string, id openapi_types.UUID, params *DeleteApiKeyParams) (*http.Request, error) { var err error var pathParam0 string @@ -2959,22 +3449,26 @@ func NewGetApiKeyRequest(server string, ref string, id string, params *GetApiKey if params != nil { queryValues := queryURL.Query() - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, params.Reveal); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.Reveal != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, *params.Reveal); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } queryURL.RawQuery = queryValues.Encode() } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -2982,19 +3476,8 @@ func NewGetApiKeyRequest(server string, ref string, id string, params *GetApiKey return req, nil } -// NewUpdateApiKeyRequest calls the generic UpdateApiKey builder with application/json body -func NewUpdateApiKeyRequest(server string, ref string, id string, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateApiKeyRequestWithBody(server, ref, id, params, "application/json", bodyReader) -} - -// NewUpdateApiKeyRequestWithBody generates requests for UpdateApiKey with any type of body -func NewUpdateApiKeyRequestWithBody(server string, ref string, id string, params *UpdateApiKeyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewGetApiKeyRequest generates requests for GetApiKey +func NewGetApiKeyRequest(server string, ref string, id openapi_types.UUID, params *GetApiKeyParams) (*http.Request, error) { var err error var pathParam0 string @@ -3029,33 +3512,46 @@ func NewUpdateApiKeyRequestWithBody(server string, ref string, id string, params if params != nil { queryValues := queryURL.Query() - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, params.Reveal); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.Reveal != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, *params.Reveal); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } queryURL.RawQuery = queryValues.Encode() } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1DisablePreviewBranchingRequest generates requests for V1DisablePreviewBranching -func NewV1DisablePreviewBranchingRequest(server string, ref string) (*http.Request, error) { +// NewUpdateApiKeyRequest calls the generic UpdateApiKey builder with application/json body +func NewUpdateApiKeyRequest(server string, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateApiKeyRequestWithBody(server, ref, id, params, "application/json", bodyReader) +} + +// NewUpdateApiKeyRequestWithBody generates requests for UpdateApiKey with any type of body +func NewUpdateApiKeyRequestWithBody(server string, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3065,12 +3561,19 @@ func NewV1DisablePreviewBranchingRequest(server string, ref string) (*http.Reque return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/branches", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/api-keys/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3080,16 +3583,40 @@ func NewV1DisablePreviewBranchingRequest(server string, ref string) (*http.Reque return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if params != nil { + queryValues := queryURL.Query() + + if params.Reveal != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reveal", runtime.ParamLocationQuery, *params.Reveal); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1ListAllBranchesRequest generates requests for V1ListAllBranches -func NewV1ListAllBranchesRequest(server string, ref string) (*http.Request, error) { +// NewV1ListProjectAddonsRequest generates requests for V1ListProjectAddons +func NewV1ListProjectAddonsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3104,7 +3631,7 @@ func NewV1ListAllBranchesRequest(server string, ref string) (*http.Request, erro return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/branches", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/billing/addons", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3122,19 +3649,19 @@ func NewV1ListAllBranchesRequest(server string, ref string) (*http.Request, erro return req, nil } -// NewV1CreateABranchRequest calls the generic V1CreateABranch builder with application/json body -func NewV1CreateABranchRequest(server string, ref string, body V1CreateABranchJSONRequestBody) (*http.Request, error) { +// NewV1ApplyProjectAddonRequest calls the generic V1ApplyProjectAddon builder with application/json body +func NewV1ApplyProjectAddonRequest(server string, ref string, body V1ApplyProjectAddonJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1CreateABranchRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1ApplyProjectAddonRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1CreateABranchRequestWithBody generates requests for V1CreateABranch with any type of body -func NewV1CreateABranchRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1ApplyProjectAddonRequestWithBody generates requests for V1ApplyProjectAddon with any type of body +func NewV1ApplyProjectAddonRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3149,7 +3676,7 @@ func NewV1CreateABranchRequestWithBody(server string, ref string, contentType st return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/branches", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/billing/addons", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3159,7 +3686,7 @@ func NewV1CreateABranchRequestWithBody(server string, ref string, contentType st return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } @@ -3169,8 +3696,8 @@ func NewV1CreateABranchRequestWithBody(server string, ref string, contentType st return req, nil } -// NewV1GetAuthServiceConfigRequest generates requests for V1GetAuthServiceConfig -func NewV1GetAuthServiceConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1RemoveProjectAddonRequest generates requests for V1RemoveProjectAddon +func NewV1RemoveProjectAddonRequest(server string, ref string, addonVariant interface{}) (*http.Request, error) { var err error var pathParam0 string @@ -3180,12 +3707,19 @@ func NewV1GetAuthServiceConfigRequest(server string, ref string) (*http.Request, return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "addon_variant", runtime.ParamLocationPath, addonVariant) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/billing/addons/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3195,7 +3729,7 @@ func NewV1GetAuthServiceConfigRequest(server string, ref string) (*http.Request, return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -3203,19 +3737,8 @@ func NewV1GetAuthServiceConfigRequest(server string, ref string) (*http.Request, return req, nil } -// NewV1UpdateAuthServiceConfigRequest calls the generic V1UpdateAuthServiceConfig builder with application/json body -func NewV1UpdateAuthServiceConfigRequest(server string, ref string, body V1UpdateAuthServiceConfigJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1UpdateAuthServiceConfigRequestWithBody(server, ref, "application/json", bodyReader) -} - -// NewV1UpdateAuthServiceConfigRequestWithBody generates requests for V1UpdateAuthServiceConfig with any type of body -func NewV1UpdateAuthServiceConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1DisablePreviewBranchingRequest generates requests for V1DisablePreviewBranching +func NewV1DisablePreviewBranchingRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3230,7 +3753,7 @@ func NewV1UpdateAuthServiceConfigRequestWithBody(server string, ref string, cont return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/branches", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3240,18 +3763,16 @@ func NewV1UpdateAuthServiceConfigRequestWithBody(server string, ref string, cont return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1ListAllSsoProviderRequest generates requests for V1ListAllSsoProvider -func NewV1ListAllSsoProviderRequest(server string, ref string) (*http.Request, error) { +// NewV1ListAllBranchesRequest generates requests for V1ListAllBranches +func NewV1ListAllBranchesRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3266,7 +3787,7 @@ func NewV1ListAllSsoProviderRequest(server string, ref string) (*http.Request, e return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/branches", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3284,19 +3805,19 @@ func NewV1ListAllSsoProviderRequest(server string, ref string) (*http.Request, e return req, nil } -// NewV1CreateASsoProviderRequest calls the generic V1CreateASsoProvider builder with application/json body -func NewV1CreateASsoProviderRequest(server string, ref string, body V1CreateASsoProviderJSONRequestBody) (*http.Request, error) { +// NewV1CreateABranchRequest calls the generic V1CreateABranch builder with application/json body +func NewV1CreateABranchRequest(server string, ref string, body V1CreateABranchJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1CreateASsoProviderRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1CreateABranchRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1CreateASsoProviderRequestWithBody generates requests for V1CreateASsoProvider with any type of body -func NewV1CreateASsoProviderRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1CreateABranchRequestWithBody generates requests for V1CreateABranch with any type of body +func NewV1CreateABranchRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3311,7 +3832,7 @@ func NewV1CreateASsoProviderRequestWithBody(server string, ref string, contentTy return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/branches", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3331,8 +3852,8 @@ func NewV1CreateASsoProviderRequestWithBody(server string, ref string, contentTy return req, nil } -// NewV1DeleteASsoProviderRequest generates requests for V1DeleteASsoProvider -func NewV1DeleteASsoProviderRequest(server string, ref string, providerId string) (*http.Request, error) { +// NewV1GetAuthServiceConfigRequest generates requests for V1GetAuthServiceConfig +func NewV1GetAuthServiceConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3342,19 +3863,12 @@ func NewV1DeleteASsoProviderRequest(server string, ref string, providerId string return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3364,7 +3878,7 @@ func NewV1DeleteASsoProviderRequest(server string, ref string, providerId string return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -3372,20 +3886,24 @@ func NewV1DeleteASsoProviderRequest(server string, ref string, providerId string return req, nil } -// NewV1GetASsoProviderRequest generates requests for V1GetASsoProvider -func NewV1GetASsoProviderRequest(server string, ref string, providerId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) +// NewV1UpdateAuthServiceConfigRequest calls the generic V1UpdateAuthServiceConfig builder with application/json body +func NewV1UpdateAuthServiceConfigRequest(server string, ref string, body V1UpdateAuthServiceConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewV1UpdateAuthServiceConfigRequestWithBody(server, ref, "application/json", bodyReader) +} - var pathParam1 string +// NewV1UpdateAuthServiceConfigRequestWithBody generates requests for V1UpdateAuthServiceConfig with any type of body +func NewV1UpdateAuthServiceConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) if err != nil { return nil, err } @@ -3395,7 +3913,7 @@ func NewV1GetASsoProviderRequest(server string, ref string, providerId string) ( return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3405,27 +3923,18 @@ func NewV1GetASsoProviderRequest(server string, ref string, providerId string) ( return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1UpdateASsoProviderRequest calls the generic V1UpdateASsoProvider builder with application/json body -func NewV1UpdateASsoProviderRequest(server string, ref string, providerId string, body V1UpdateASsoProviderJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1UpdateASsoProviderRequestWithBody(server, ref, providerId, "application/json", bodyReader) -} - -// NewV1UpdateASsoProviderRequestWithBody generates requests for V1UpdateASsoProvider with any type of body -func NewV1UpdateASsoProviderRequestWithBody(server string, ref string, providerId string, contentType string, body io.Reader) (*http.Request, error) { +// NewListSigningKeysForProjectRequest generates requests for ListSigningKeysForProject +func NewListSigningKeysForProjectRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3435,19 +3944,12 @@ func NewV1UpdateASsoProviderRequestWithBody(server string, ref string, providerI return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/signing-keys", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3457,18 +3959,27 @@ func NewV1UpdateASsoProviderRequestWithBody(server string, ref string, providerI return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewListTPAForProjectRequest generates requests for ListTPAForProject -func NewListTPAForProjectRequest(server string, ref string) (*http.Request, error) { +// NewCreateSigningKeyForProjectRequest calls the generic CreateSigningKeyForProject builder with application/json body +func NewCreateSigningKeyForProjectRequest(server string, ref string, body CreateSigningKeyForProjectJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateSigningKeyForProjectRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewCreateSigningKeyForProjectRequestWithBody generates requests for CreateSigningKeyForProject with any type of body +func NewCreateSigningKeyForProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3483,7 +3994,7 @@ func NewListTPAForProjectRequest(server string, ref string) (*http.Request, erro return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/third-party-auth", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/signing-keys", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3493,27 +4004,18 @@ func NewListTPAForProjectRequest(server string, ref string) (*http.Request, erro return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewCreateTPAForProjectRequest calls the generic CreateTPAForProject builder with application/json body -func NewCreateTPAForProjectRequest(server string, ref string, body CreateTPAForProjectJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateTPAForProjectRequestWithBody(server, ref, "application/json", bodyReader) + return req, nil } -// NewCreateTPAForProjectRequestWithBody generates requests for CreateTPAForProject with any type of body -func NewCreateTPAForProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewDeleteSigningKeyRequest generates requests for DeleteSigningKey +func NewDeleteSigningKeyRequest(server string, ref string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -3523,12 +4025,19 @@ func NewCreateTPAForProjectRequestWithBody(server string, ref string, contentTyp return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/third-party-auth", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/signing-keys/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3538,18 +4047,16 @@ func NewCreateTPAForProjectRequestWithBody(server string, ref string, contentTyp return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteTPAForProjectRequest generates requests for DeleteTPAForProject -func NewDeleteTPAForProjectRequest(server string, ref string, tpaId string) (*http.Request, error) { +// NewGetSigningKeyForProjectRequest generates requests for GetSigningKeyForProject +func NewGetSigningKeyForProjectRequest(server string, ref string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -3561,7 +4068,7 @@ func NewDeleteTPAForProjectRequest(server string, ref string, tpaId string) (*ht var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tpa_id", runtime.ParamLocationPath, tpaId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) if err != nil { return nil, err } @@ -3571,7 +4078,7 @@ func NewDeleteTPAForProjectRequest(server string, ref string, tpaId string) (*ht return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/third-party-auth/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/signing-keys/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3581,7 +4088,7 @@ func NewDeleteTPAForProjectRequest(server string, ref string, tpaId string) (*ht return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -3589,8 +4096,19 @@ func NewDeleteTPAForProjectRequest(server string, ref string, tpaId string) (*ht return req, nil } -// NewGetTPAForProjectRequest generates requests for GetTPAForProject -func NewGetTPAForProjectRequest(server string, ref string, tpaId string) (*http.Request, error) { +// NewPatchSigningKeyRequest calls the generic PatchSigningKey builder with application/json body +func NewPatchSigningKeyRequest(server string, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchSigningKeyRequestWithBody(server, ref, id, "application/json", bodyReader) +} + +// NewPatchSigningKeyRequestWithBody generates requests for PatchSigningKey with any type of body +func NewPatchSigningKeyRequestWithBody(server string, ref string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3602,7 +4120,7 @@ func NewGetTPAForProjectRequest(server string, ref string, tpaId string) (*http. var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tpa_id", runtime.ParamLocationPath, tpaId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) if err != nil { return nil, err } @@ -3612,7 +4130,7 @@ func NewGetTPAForProjectRequest(server string, ref string, tpaId string) (*http. return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/third-party-auth/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/signing-keys/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3622,16 +4140,18 @@ func NewGetTPAForProjectRequest(server string, ref string, tpaId string) (*http. return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1GetProjectPgbouncerConfigRequest generates requests for V1GetProjectPgbouncerConfig -func NewV1GetProjectPgbouncerConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1ListAllSsoProviderRequest generates requests for V1ListAllSsoProvider +func NewV1ListAllSsoProviderRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3646,7 +4166,7 @@ func NewV1GetProjectPgbouncerConfigRequest(server string, ref string) (*http.Req return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/database/pgbouncer", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3664,8 +4184,19 @@ func NewV1GetProjectPgbouncerConfigRequest(server string, ref string) (*http.Req return req, nil } -// NewV1GetSupavisorConfigRequest generates requests for V1GetSupavisorConfig -func NewV1GetSupavisorConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1CreateASsoProviderRequest calls the generic V1CreateASsoProvider builder with application/json body +func NewV1CreateASsoProviderRequest(server string, ref string, body V1CreateASsoProviderJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1CreateASsoProviderRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1CreateASsoProviderRequestWithBody generates requests for V1CreateASsoProvider with any type of body +func NewV1CreateASsoProviderRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3680,7 +4211,7 @@ func NewV1GetSupavisorConfigRequest(server string, ref string) (*http.Request, e return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/database/pooler", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3690,27 +4221,18 @@ func NewV1GetSupavisorConfigRequest(server string, ref string) (*http.Request, e return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewV1UpdateSupavisorConfigRequest calls the generic V1UpdateSupavisorConfig builder with application/json body -func NewV1UpdateSupavisorConfigRequest(server string, ref string, body V1UpdateSupavisorConfigJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1UpdateSupavisorConfigRequestWithBody(server, ref, "application/json", bodyReader) + return req, nil } -// NewV1UpdateSupavisorConfigRequestWithBody generates requests for V1UpdateSupavisorConfig with any type of body -func NewV1UpdateSupavisorConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1DeleteASsoProviderRequest generates requests for V1DeleteASsoProvider +func NewV1DeleteASsoProviderRequest(server string, ref string, providerId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -3720,12 +4242,19 @@ func NewV1UpdateSupavisorConfigRequestWithBody(server string, ref string, conten return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/database/pooler", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3735,18 +4264,16 @@ func NewV1UpdateSupavisorConfigRequestWithBody(server string, ref string, conten return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1GetPostgresConfigRequest generates requests for V1GetPostgresConfig -func NewV1GetPostgresConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1GetASsoProviderRequest generates requests for V1GetASsoProvider +func NewV1GetASsoProviderRequest(server string, ref string, providerId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -3756,12 +4283,19 @@ func NewV1GetPostgresConfigRequest(server string, ref string) (*http.Request, er return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/database/postgres", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3779,19 +4313,19 @@ func NewV1GetPostgresConfigRequest(server string, ref string) (*http.Request, er return req, nil } -// NewV1UpdatePostgresConfigRequest calls the generic V1UpdatePostgresConfig builder with application/json body -func NewV1UpdatePostgresConfigRequest(server string, ref string, body V1UpdatePostgresConfigJSONRequestBody) (*http.Request, error) { +// NewV1UpdateASsoProviderRequest calls the generic V1UpdateASsoProvider builder with application/json body +func NewV1UpdateASsoProviderRequest(server string, ref string, providerId openapi_types.UUID, body V1UpdateASsoProviderJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1UpdatePostgresConfigRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1UpdateASsoProviderRequestWithBody(server, ref, providerId, "application/json", bodyReader) } -// NewV1UpdatePostgresConfigRequestWithBody generates requests for V1UpdatePostgresConfig with any type of body -func NewV1UpdatePostgresConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UpdateASsoProviderRequestWithBody generates requests for V1UpdateASsoProvider with any type of body +func NewV1UpdateASsoProviderRequestWithBody(server string, ref string, providerId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3801,12 +4335,19 @@ func NewV1UpdatePostgresConfigRequestWithBody(server string, ref string, content return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/database/postgres", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3826,8 +4367,8 @@ func NewV1UpdatePostgresConfigRequestWithBody(server string, ref string, content return req, nil } -// NewV1GetStorageConfigRequest generates requests for V1GetStorageConfig -func NewV1GetStorageConfigRequest(server string, ref string) (*http.Request, error) { +// NewListTPAForProjectRequest generates requests for ListTPAForProject +func NewListTPAForProjectRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3842,7 +4383,7 @@ func NewV1GetStorageConfigRequest(server string, ref string) (*http.Request, err return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/storage", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/third-party-auth", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3860,19 +4401,19 @@ func NewV1GetStorageConfigRequest(server string, ref string) (*http.Request, err return req, nil } -// NewV1UpdateStorageConfigRequest calls the generic V1UpdateStorageConfig builder with application/json body -func NewV1UpdateStorageConfigRequest(server string, ref string, body V1UpdateStorageConfigJSONRequestBody) (*http.Request, error) { +// NewCreateTPAForProjectRequest calls the generic CreateTPAForProject builder with application/json body +func NewCreateTPAForProjectRequest(server string, ref string, body CreateTPAForProjectJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1UpdateStorageConfigRequestWithBody(server, ref, "application/json", bodyReader) + return NewCreateTPAForProjectRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1UpdateStorageConfigRequestWithBody generates requests for V1UpdateStorageConfig with any type of body -func NewV1UpdateStorageConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateTPAForProjectRequestWithBody generates requests for CreateTPAForProject with any type of body +func NewCreateTPAForProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3887,7 +4428,7 @@ func NewV1UpdateStorageConfigRequestWithBody(server string, ref string, contentT return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/config/storage", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/third-party-auth", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3897,7 +4438,7 @@ func NewV1UpdateStorageConfigRequestWithBody(server string, ref string, contentT return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } @@ -3907,8 +4448,8 @@ func NewV1UpdateStorageConfigRequestWithBody(server string, ref string, contentT return req, nil } -// NewV1DeleteHostnameConfigRequest generates requests for V1DeleteHostnameConfig -func NewV1DeleteHostnameConfigRequest(server string, ref string) (*http.Request, error) { +// NewDeleteTPAForProjectRequest generates requests for DeleteTPAForProject +func NewDeleteTPAForProjectRequest(server string, ref string, tpaId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -3918,12 +4459,19 @@ func NewV1DeleteHostnameConfigRequest(server string, ref string) (*http.Request, return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tpa_id", runtime.ParamLocationPath, tpaId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/third-party-auth/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3941,8 +4489,8 @@ func NewV1DeleteHostnameConfigRequest(server string, ref string) (*http.Request, return req, nil } -// NewV1GetHostnameConfigRequest generates requests for V1GetHostnameConfig -func NewV1GetHostnameConfigRequest(server string, ref string) (*http.Request, error) { +// NewGetTPAForProjectRequest generates requests for GetTPAForProject +func NewGetTPAForProjectRequest(server string, ref string, tpaId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -3952,12 +4500,19 @@ func NewV1GetHostnameConfigRequest(server string, ref string) (*http.Request, er return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tpa_id", runtime.ParamLocationPath, tpaId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/third-party-auth/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3975,8 +4530,8 @@ func NewV1GetHostnameConfigRequest(server string, ref string) (*http.Request, er return req, nil } -// NewV1ActivateCustomHostnameRequest generates requests for V1ActivateCustomHostname -func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Request, error) { +// NewV1GetProjectPgbouncerConfigRequest generates requests for V1GetProjectPgbouncerConfig +func NewV1GetProjectPgbouncerConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3991,7 +4546,7 @@ func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Reques return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/activate", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/database/pgbouncer", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4001,7 +4556,7 @@ func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Reques return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -4009,19 +4564,8 @@ func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Reques return req, nil } -// NewV1UpdateHostnameConfigRequest calls the generic V1UpdateHostnameConfig builder with application/json body -func NewV1UpdateHostnameConfigRequest(server string, ref string, body V1UpdateHostnameConfigJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1UpdateHostnameConfigRequestWithBody(server, ref, "application/json", bodyReader) -} - -// NewV1UpdateHostnameConfigRequestWithBody generates requests for V1UpdateHostnameConfig with any type of body -func NewV1UpdateHostnameConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1GetPoolerConfigRequest generates requests for V1GetPoolerConfig +func NewV1GetPoolerConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4036,7 +4580,7 @@ func NewV1UpdateHostnameConfigRequestWithBody(server string, ref string, content return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/initialize", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/database/pooler", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4046,18 +4590,27 @@ func NewV1UpdateHostnameConfigRequestWithBody(server string, ref string, content return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1VerifyDnsConfigRequest generates requests for V1VerifyDnsConfig -func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1UpdatePoolerConfigRequest calls the generic V1UpdatePoolerConfig builder with application/json body +func NewV1UpdatePoolerConfigRequest(server string, ref string, body V1UpdatePoolerConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpdatePoolerConfigRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpdatePoolerConfigRequestWithBody generates requests for V1UpdatePoolerConfig with any type of body +func NewV1UpdatePoolerConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4072,7 +4625,7 @@ func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, erro return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/reverify", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/database/pooler", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4082,16 +4635,18 @@ func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, erro return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1ListAllBackupsRequest generates requests for V1ListAllBackups -func NewV1ListAllBackupsRequest(server string, ref string) (*http.Request, error) { +// NewV1GetPostgresConfigRequest generates requests for V1GetPostgresConfig +func NewV1GetPostgresConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4106,7 +4661,7 @@ func NewV1ListAllBackupsRequest(server string, ref string) (*http.Request, error return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/database/backups", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/database/postgres", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4124,19 +4679,19 @@ func NewV1ListAllBackupsRequest(server string, ref string) (*http.Request, error return req, nil } -// NewV1RestorePitrBackupRequest calls the generic V1RestorePitrBackup builder with application/json body -func NewV1RestorePitrBackupRequest(server string, ref string, body V1RestorePitrBackupJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader +// NewV1UpdatePostgresConfigRequest calls the generic V1UpdatePostgresConfig builder with application/json body +func NewV1UpdatePostgresConfigRequest(server string, ref string, body V1UpdatePostgresConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1RestorePitrBackupRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1UpdatePostgresConfigRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1RestorePitrBackupRequestWithBody generates requests for V1RestorePitrBackup with any type of body -func NewV1RestorePitrBackupRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UpdatePostgresConfigRequestWithBody generates requests for V1UpdatePostgresConfig with any type of body +func NewV1UpdatePostgresConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4151,7 +4706,7 @@ func NewV1RestorePitrBackupRequestWithBody(server string, ref string, contentTyp return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/database/backups/restore-pitr", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/database/postgres", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4161,7 +4716,7 @@ func NewV1RestorePitrBackupRequestWithBody(server string, ref string, contentTyp return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } @@ -4171,8 +4726,8 @@ func NewV1RestorePitrBackupRequestWithBody(server string, ref string, contentTyp return req, nil } -// NewGetDatabaseMetadataRequest generates requests for GetDatabaseMetadata -func NewGetDatabaseMetadataRequest(server string, ref string) (*http.Request, error) { +// NewV1GetStorageConfigRequest generates requests for V1GetStorageConfig +func NewV1GetStorageConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4187,7 +4742,7 @@ func NewGetDatabaseMetadataRequest(server string, ref string) (*http.Request, er return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/database/context", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/storage", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4205,19 +4760,19 @@ func NewGetDatabaseMetadataRequest(server string, ref string) (*http.Request, er return req, nil } -// NewV1RunAQueryRequest calls the generic V1RunAQuery builder with application/json body -func NewV1RunAQueryRequest(server string, ref string, body V1RunAQueryJSONRequestBody) (*http.Request, error) { +// NewV1UpdateStorageConfigRequest calls the generic V1UpdateStorageConfig builder with application/json body +func NewV1UpdateStorageConfigRequest(server string, ref string, body V1UpdateStorageConfigJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1RunAQueryRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1UpdateStorageConfigRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1RunAQueryRequestWithBody generates requests for V1RunAQuery with any type of body -func NewV1RunAQueryRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UpdateStorageConfigRequestWithBody generates requests for V1UpdateStorageConfig with any type of body +func NewV1UpdateStorageConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4232,7 +4787,7 @@ func NewV1RunAQueryRequestWithBody(server string, ref string, contentType string return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/database/query", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/config/storage", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4242,7 +4797,7 @@ func NewV1RunAQueryRequestWithBody(server string, ref string, contentType string return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } @@ -4252,8 +4807,8 @@ func NewV1RunAQueryRequestWithBody(server string, ref string, contentType string return req, nil } -// NewV1EnableDatabaseWebhookRequest generates requests for V1EnableDatabaseWebhook -func NewV1EnableDatabaseWebhookRequest(server string, ref string) (*http.Request, error) { +// NewV1DeleteHostnameConfigRequest generates requests for V1DeleteHostnameConfig +func NewV1DeleteHostnameConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4268,7 +4823,7 @@ func NewV1EnableDatabaseWebhookRequest(server string, ref string) (*http.Request return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/database/webhooks/enable", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4278,7 +4833,7 @@ func NewV1EnableDatabaseWebhookRequest(server string, ref string) (*http.Request return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -4286,8 +4841,8 @@ func NewV1EnableDatabaseWebhookRequest(server string, ref string) (*http.Request return req, nil } -// NewV1ListAllFunctionsRequest generates requests for V1ListAllFunctions -func NewV1ListAllFunctionsRequest(server string, ref string) (*http.Request, error) { +// NewV1GetHostnameConfigRequest generates requests for V1GetHostnameConfig +func NewV1GetHostnameConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4302,7 +4857,7 @@ func NewV1ListAllFunctionsRequest(server string, ref string) (*http.Request, err return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/functions", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4320,19 +4875,8 @@ func NewV1ListAllFunctionsRequest(server string, ref string) (*http.Request, err return req, nil } -// NewV1CreateAFunctionRequest calls the generic V1CreateAFunction builder with application/json body -func NewV1CreateAFunctionRequest(server string, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1CreateAFunctionRequestWithBody(server, ref, params, "application/json", bodyReader) -} - -// NewV1CreateAFunctionRequestWithBody generates requests for V1CreateAFunction with any type of body -func NewV1CreateAFunctionRequestWithBody(server string, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader) (*http.Request, error) { +// NewV1ActivateCustomHostnameRequest generates requests for V1ActivateCustomHostname +func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4347,7 +4891,7 @@ func NewV1CreateAFunctionRequestWithBody(server string, ref string, params *V1Cr return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/functions", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/activate", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4357,147 +4901,27 @@ func NewV1CreateAFunctionRequestWithBody(server string, ref string, params *V1Cr return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.Slug != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slug", runtime.ParamLocationQuery, *params.Slug); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Name != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.VerifyJwt != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "verify_jwt", runtime.ParamLocationQuery, *params.VerifyJwt); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ImportMap != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map", runtime.ParamLocationQuery, *params.ImportMap); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.EntrypointPath != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "entrypoint_path", runtime.ParamLocationQuery, *params.EntrypointPath); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ImportMapPath != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map_path", runtime.ParamLocationQuery, *params.ImportMapPath); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ComputeMultiplier != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "compute_multiplier", runtime.ParamLocationQuery, *params.ComputeMultiplier); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1BulkUpdateFunctionsRequest calls the generic V1BulkUpdateFunctions builder with application/json body -func NewV1BulkUpdateFunctionsRequest(server string, ref string, body V1BulkUpdateFunctionsJSONRequestBody) (*http.Request, error) { +// NewV1UpdateHostnameConfigRequest calls the generic V1UpdateHostnameConfig builder with application/json body +func NewV1UpdateHostnameConfigRequest(server string, ref string, body V1UpdateHostnameConfigJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1BulkUpdateFunctionsRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1UpdateHostnameConfigRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1BulkUpdateFunctionsRequestWithBody generates requests for V1BulkUpdateFunctions with any type of body -func NewV1BulkUpdateFunctionsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UpdateHostnameConfigRequestWithBody generates requests for V1UpdateHostnameConfig with any type of body +func NewV1UpdateHostnameConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4512,7 +4936,7 @@ func NewV1BulkUpdateFunctionsRequestWithBody(server string, ref string, contentT return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/functions", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/initialize", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4522,7 +4946,7 @@ func NewV1BulkUpdateFunctionsRequestWithBody(server string, ref string, contentT return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } @@ -4532,8 +4956,8 @@ func NewV1BulkUpdateFunctionsRequestWithBody(server string, ref string, contentT return req, nil } -// NewV1DeployAFunctionRequestWithBody generates requests for V1DeployAFunction with any type of body -func NewV1DeployAFunctionRequestWithBody(server string, ref string, params *V1DeployAFunctionParams, contentType string, body io.Reader) (*http.Request, error) { +// NewV1VerifyDnsConfigRequest generates requests for V1VerifyDnsConfig +func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4548,7 +4972,7 @@ func NewV1DeployAFunctionRequestWithBody(server string, ref string, params *V1De return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/functions/deploy", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/reverify", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4558,56 +4982,16 @@ func NewV1DeployAFunctionRequestWithBody(server string, ref string, params *V1De return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.Slug != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slug", runtime.ParamLocationQuery, *params.Slug); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.BundleOnly != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bundleOnly", runtime.ParamLocationQuery, *params.BundleOnly); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1DeleteAFunctionRequest generates requests for V1DeleteAFunction -func NewV1DeleteAFunctionRequest(server string, ref string, functionSlug string) (*http.Request, error) { +// NewV1ListAllBackupsRequest generates requests for V1ListAllBackups +func NewV1ListAllBackupsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4617,19 +5001,12 @@ func NewV1DeleteAFunctionRequest(server string, ref string, functionSlug string) return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/database/backups", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4639,7 +5016,7 @@ func NewV1DeleteAFunctionRequest(server string, ref string, functionSlug string) return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -4647,20 +5024,24 @@ func NewV1DeleteAFunctionRequest(server string, ref string, functionSlug string) return req, nil } -// NewV1GetAFunctionRequest generates requests for V1GetAFunction -func NewV1GetAFunctionRequest(server string, ref string, functionSlug string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) +// NewV1RestorePitrBackupRequest calls the generic V1RestorePitrBackup builder with application/json body +func NewV1RestorePitrBackupRequest(server string, ref string, body V1RestorePitrBackupJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewV1RestorePitrBackupRequestWithBody(server, ref, "application/json", bodyReader) +} - var pathParam1 string +// NewV1RestorePitrBackupRequestWithBody generates requests for V1RestorePitrBackup with any type of body +func NewV1RestorePitrBackupRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) if err != nil { return nil, err } @@ -4670,7 +5051,7 @@ func NewV1GetAFunctionRequest(server string, ref string, functionSlug string) (* return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/database/backups/restore-pitr", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4680,27 +5061,18 @@ func NewV1GetAFunctionRequest(server string, ref string, functionSlug string) (* return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewV1UpdateAFunctionRequest calls the generic V1UpdateAFunction builder with application/json body -func NewV1UpdateAFunctionRequest(server string, ref string, functionSlug string, params *V1UpdateAFunctionParams, body V1UpdateAFunctionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1UpdateAFunctionRequestWithBody(server, ref, functionSlug, params, "application/json", bodyReader) + return req, nil } -// NewV1UpdateAFunctionRequestWithBody generates requests for V1UpdateAFunction with any type of body -func NewV1UpdateAFunctionRequestWithBody(server string, ref string, functionSlug string, params *V1UpdateAFunctionParams, contentType string, body io.Reader) (*http.Request, error) { +// NewGetDatabaseMetadataRequest generates requests for GetDatabaseMetadata +func NewGetDatabaseMetadataRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4710,19 +5082,12 @@ func NewV1UpdateAFunctionRequestWithBody(server string, ref string, functionSlug return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/database/context", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4732,136 +5097,16 @@ func NewV1UpdateAFunctionRequestWithBody(server string, ref string, functionSlug return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.Slug != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slug", runtime.ParamLocationQuery, *params.Slug); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Name != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.VerifyJwt != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "verify_jwt", runtime.ParamLocationQuery, *params.VerifyJwt); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ImportMap != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map", runtime.ParamLocationQuery, *params.ImportMap); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.EntrypointPath != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "entrypoint_path", runtime.ParamLocationQuery, *params.EntrypointPath); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ImportMapPath != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map_path", runtime.ParamLocationQuery, *params.ImportMapPath); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ComputeMultiplier != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "compute_multiplier", runtime.ParamLocationQuery, *params.ComputeMultiplier); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1GetAFunctionBodyRequest generates requests for V1GetAFunctionBody -func NewV1GetAFunctionBodyRequest(server string, ref string, functionSlug string) (*http.Request, error) { +// NewV1ListMigrationHistoryRequest generates requests for V1ListMigrationHistory +func NewV1ListMigrationHistoryRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4871,19 +5116,12 @@ func NewV1GetAFunctionBodyRequest(server string, ref string, functionSlug string return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s/body", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/projects/%s/database/migrations", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4901,8 +5139,19 @@ func NewV1GetAFunctionBodyRequest(server string, ref string, functionSlug string return req, nil } -// NewV1GetServicesHealthRequest generates requests for V1GetServicesHealth -func NewV1GetServicesHealthRequest(server string, ref string, params *V1GetServicesHealthParams) (*http.Request, error) { +// NewV1ApplyAMigrationRequest calls the generic V1ApplyAMigration builder with application/json body +func NewV1ApplyAMigrationRequest(server string, ref string, params *V1ApplyAMigrationParams, body V1ApplyAMigrationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1ApplyAMigrationRequestWithBody(server, ref, params, "application/json", bodyReader) +} + +// NewV1ApplyAMigrationRequestWithBody generates requests for V1ApplyAMigration with any type of body +func NewV1ApplyAMigrationRequestWithBody(server string, ref string, params *V1ApplyAMigrationParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4917,7 +5166,7 @@ func NewV1GetServicesHealthRequest(server string, ref string, params *V1GetServi return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/health", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/database/migrations", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4927,61 +5176,44 @@ func NewV1GetServicesHealthRequest(server string, ref string, params *V1GetServi return nil, err } + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + if params != nil { - queryValues := queryURL.Query() - if params.TimeoutMs != nil { + if params.IdempotencyKey != nil { + var headerParam0 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "timeout_ms", runtime.ParamLocationQuery, *params.TimeoutMs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Idempotency-Key", runtime.ParamLocationHeader, *params.IdempotencyKey) + if err != nil { return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } + req.Header.Set("Idempotency-Key", headerParam0) } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "services", runtime.ParamLocationQuery, params.Services); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } return req, nil } -// NewV1DeleteNetworkBansRequest calls the generic V1DeleteNetworkBans builder with application/json body -func NewV1DeleteNetworkBansRequest(server string, ref string, body V1DeleteNetworkBansJSONRequestBody) (*http.Request, error) { +// NewV1RunAQueryRequest calls the generic V1RunAQuery builder with application/json body +func NewV1RunAQueryRequest(server string, ref string, body V1RunAQueryJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1DeleteNetworkBansRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1RunAQueryRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1DeleteNetworkBansRequestWithBody generates requests for V1DeleteNetworkBans with any type of body -func NewV1DeleteNetworkBansRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1RunAQueryRequestWithBody generates requests for V1RunAQuery with any type of body +func NewV1RunAQueryRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4996,7 +5228,7 @@ func NewV1DeleteNetworkBansRequestWithBody(server string, ref string, contentTyp return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/network-bans", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/database/query", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5006,7 +5238,7 @@ func NewV1DeleteNetworkBansRequestWithBody(server string, ref string, contentTyp return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } @@ -5016,8 +5248,8 @@ func NewV1DeleteNetworkBansRequestWithBody(server string, ref string, contentTyp return req, nil } -// NewV1ListAllNetworkBansRequest generates requests for V1ListAllNetworkBans -func NewV1ListAllNetworkBansRequest(server string, ref string) (*http.Request, error) { +// NewV1EnableDatabaseWebhookRequest generates requests for V1EnableDatabaseWebhook +func NewV1EnableDatabaseWebhookRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5032,7 +5264,7 @@ func NewV1ListAllNetworkBansRequest(server string, ref string) (*http.Request, e return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/network-bans/retrieve", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/database/webhooks/enable", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5050,8 +5282,8 @@ func NewV1ListAllNetworkBansRequest(server string, ref string) (*http.Request, e return req, nil } -// NewV1GetNetworkRestrictionsRequest generates requests for V1GetNetworkRestrictions -func NewV1GetNetworkRestrictionsRequest(server string, ref string) (*http.Request, error) { +// NewV1ListAllFunctionsRequest generates requests for V1ListAllFunctions +func NewV1ListAllFunctionsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5066,7 +5298,7 @@ func NewV1GetNetworkRestrictionsRequest(server string, ref string) (*http.Reques return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/network-restrictions", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/functions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5084,19 +5316,8 @@ func NewV1GetNetworkRestrictionsRequest(server string, ref string) (*http.Reques return req, nil } -// NewV1UpdateNetworkRestrictionsRequest calls the generic V1UpdateNetworkRestrictions builder with application/json body -func NewV1UpdateNetworkRestrictionsRequest(server string, ref string, body V1UpdateNetworkRestrictionsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1UpdateNetworkRestrictionsRequestWithBody(server, ref, "application/json", bodyReader) -} - -// NewV1UpdateNetworkRestrictionsRequestWithBody generates requests for V1UpdateNetworkRestrictions with any type of body -func NewV1UpdateNetworkRestrictionsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1CreateAFunctionRequestWithBody generates requests for V1CreateAFunction with any type of body +func NewV1CreateAFunctionRequestWithBody(server string, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5111,7 +5332,7 @@ func NewV1UpdateNetworkRestrictionsRequestWithBody(server string, ref string, co return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/network-restrictions/apply", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/functions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5121,6 +5342,108 @@ func NewV1UpdateNetworkRestrictionsRequestWithBody(server string, ref string, co return nil, err } + if params != nil { + queryValues := queryURL.Query() + + if params.Slug != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slug", runtime.ParamLocationQuery, *params.Slug); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Name != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.VerifyJwt != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "verify_jwt", runtime.ParamLocationQuery, *params.VerifyJwt); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ImportMap != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map", runtime.ParamLocationQuery, *params.ImportMap); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.EntrypointPath != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "entrypoint_path", runtime.ParamLocationQuery, *params.EntrypointPath); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ImportMapPath != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map_path", runtime.ParamLocationQuery, *params.ImportMapPath); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err @@ -5131,8 +5454,19 @@ func NewV1UpdateNetworkRestrictionsRequestWithBody(server string, ref string, co return req, nil } -// NewV1PauseAProjectRequest generates requests for V1PauseAProject -func NewV1PauseAProjectRequest(server string, ref string) (*http.Request, error) { +// NewV1BulkUpdateFunctionsRequest calls the generic V1BulkUpdateFunctions builder with application/json body +func NewV1BulkUpdateFunctionsRequest(server string, ref string, body V1BulkUpdateFunctionsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1BulkUpdateFunctionsRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1BulkUpdateFunctionsRequestWithBody generates requests for V1BulkUpdateFunctions with any type of body +func NewV1BulkUpdateFunctionsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5147,7 +5481,7 @@ func NewV1PauseAProjectRequest(server string, ref string) (*http.Request, error) return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/pause", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/functions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5157,16 +5491,18 @@ func NewV1PauseAProjectRequest(server string, ref string) (*http.Request, error) return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1GetPgsodiumConfigRequest generates requests for V1GetPgsodiumConfig -func NewV1GetPgsodiumConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1DeployAFunctionRequestWithBody generates requests for V1DeployAFunction with any type of body +func NewV1DeployAFunctionRequestWithBody(server string, ref string, params *V1DeployAFunctionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5181,7 +5517,7 @@ func NewV1GetPgsodiumConfigRequest(server string, ref string) (*http.Request, er return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/pgsodium", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/functions/deploy", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5191,27 +5527,56 @@ func NewV1GetPgsodiumConfigRequest(server string, ref string) (*http.Request, er return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } + if params != nil { + queryValues := queryURL.Query() - return req, nil -} + if params.Slug != nil { -// NewV1UpdatePgsodiumConfigRequest calls the generic V1UpdatePgsodiumConfig builder with application/json body -func NewV1UpdatePgsodiumConfigRequest(server string, ref string, body V1UpdatePgsodiumConfigJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slug", runtime.ParamLocationQuery, *params.Slug); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BundleOnly != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bundleOnly", runtime.ParamLocationQuery, *params.BundleOnly); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewV1UpdatePgsodiumConfigRequestWithBody(server, ref, "application/json", bodyReader) + + req.Header.Add("Content-Type", contentType) + + return req, nil } -// NewV1UpdatePgsodiumConfigRequestWithBody generates requests for V1UpdatePgsodiumConfig with any type of body -func NewV1UpdatePgsodiumConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1DeleteAFunctionRequest generates requests for V1DeleteAFunction +func NewV1DeleteAFunctionRequest(server string, ref string, functionSlug string) (*http.Request, error) { var err error var pathParam0 string @@ -5221,12 +5586,19 @@ func NewV1UpdatePgsodiumConfigRequestWithBody(server string, ref string, content return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/pgsodium", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5236,18 +5608,16 @@ func NewV1UpdatePgsodiumConfigRequestWithBody(server string, ref string, content return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1GetPostgrestServiceConfigRequest generates requests for V1GetPostgrestServiceConfig -func NewV1GetPostgrestServiceConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1GetAFunctionRequest generates requests for V1GetAFunction +func NewV1GetAFunctionRequest(server string, ref string, functionSlug string) (*http.Request, error) { var err error var pathParam0 string @@ -5257,12 +5627,19 @@ func NewV1GetPostgrestServiceConfigRequest(server string, ref string) (*http.Req return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/postgrest", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5280,19 +5657,19 @@ func NewV1GetPostgrestServiceConfigRequest(server string, ref string) (*http.Req return req, nil } -// NewV1UpdatePostgrestServiceConfigRequest calls the generic V1UpdatePostgrestServiceConfig builder with application/json body -func NewV1UpdatePostgrestServiceConfigRequest(server string, ref string, body V1UpdatePostgrestServiceConfigJSONRequestBody) (*http.Request, error) { +// NewV1UpdateAFunctionRequest calls the generic V1UpdateAFunction builder with application/json body +func NewV1UpdateAFunctionRequest(server string, ref string, functionSlug string, params *V1UpdateAFunctionParams, body V1UpdateAFunctionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1UpdatePostgrestServiceConfigRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1UpdateAFunctionRequestWithBody(server, ref, functionSlug, params, "application/json", bodyReader) } -// NewV1UpdatePostgrestServiceConfigRequestWithBody generates requests for V1UpdatePostgrestServiceConfig with any type of body -func NewV1UpdatePostgrestServiceConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UpdateAFunctionRequestWithBody generates requests for V1UpdateAFunction with any type of body +func NewV1UpdateAFunctionRequestWithBody(server string, ref string, functionSlug string, params *V1UpdateAFunctionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5302,12 +5679,19 @@ func NewV1UpdatePostgrestServiceConfigRequestWithBody(server string, ref string, return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/postgrest", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5317,29 +5701,161 @@ func NewV1UpdatePostgrestServiceConfigRequestWithBody(server string, ref string, return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) - if err != nil { - return nil, err - } + if params != nil { + queryValues := queryURL.Query() - req.Header.Add("Content-Type", contentType) + if params.Slug != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "slug", runtime.ParamLocationQuery, *params.Slug); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Name != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.VerifyJwt != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "verify_jwt", runtime.ParamLocationQuery, *params.VerifyJwt); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ImportMap != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map", runtime.ParamLocationQuery, *params.ImportMap); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.EntrypointPath != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "entrypoint_path", runtime.ParamLocationQuery, *params.EntrypointPath); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ImportMapPath != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "import_map_path", runtime.ParamLocationQuery, *params.ImportMapPath); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) return req, nil } -// NewV1RemoveAReadReplicaRequest calls the generic V1RemoveAReadReplica builder with application/json body -func NewV1RemoveAReadReplicaRequest(server string, ref string, body V1RemoveAReadReplicaJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewV1GetAFunctionBodyRequest generates requests for V1GetAFunctionBody +func NewV1GetAFunctionBodyRequest(server string, ref string, functionSlug string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewV1RemoveAReadReplicaRequestWithBody(server, ref, "application/json", bodyReader) + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "function_slug", runtime.ParamLocationPath, functionSlug) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/functions/%s/body", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil } -// NewV1RemoveAReadReplicaRequestWithBody generates requests for V1RemoveAReadReplica with any type of body -func NewV1RemoveAReadReplicaRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1GetServicesHealthRequest generates requests for V1GetServicesHealth +func NewV1GetServicesHealthRequest(server string, ref string, params *V1GetServicesHealthParams) (*http.Request, error) { var err error var pathParam0 string @@ -5354,7 +5870,7 @@ func NewV1RemoveAReadReplicaRequestWithBody(server string, ref string, contentTy return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/read-replicas/remove", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/health", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5364,29 +5880,61 @@ func NewV1RemoveAReadReplicaRequestWithBody(server string, ref string, contentTy return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "services", runtime.ParamLocationQuery, params.Services); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.TimeoutMs != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "timeout_ms", runtime.ParamLocationQuery, *params.TimeoutMs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1SetupAReadReplicaRequest calls the generic V1SetupAReadReplica builder with application/json body -func NewV1SetupAReadReplicaRequest(server string, ref string, body V1SetupAReadReplicaJSONRequestBody) (*http.Request, error) { +// NewV1DeleteNetworkBansRequest calls the generic V1DeleteNetworkBans builder with application/json body +func NewV1DeleteNetworkBansRequest(server string, ref string, body V1DeleteNetworkBansJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1SetupAReadReplicaRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1DeleteNetworkBansRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1SetupAReadReplicaRequestWithBody generates requests for V1SetupAReadReplica with any type of body -func NewV1SetupAReadReplicaRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1DeleteNetworkBansRequestWithBody generates requests for V1DeleteNetworkBans with any type of body +func NewV1DeleteNetworkBansRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5401,7 +5949,7 @@ func NewV1SetupAReadReplicaRequestWithBody(server string, ref string, contentTyp return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/read-replicas/setup", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/network-bans", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5411,7 +5959,7 @@ func NewV1SetupAReadReplicaRequestWithBody(server string, ref string, contentTyp return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), body) if err != nil { return nil, err } @@ -5421,8 +5969,8 @@ func NewV1SetupAReadReplicaRequestWithBody(server string, ref string, contentTyp return req, nil } -// NewV1GetReadonlyModeStatusRequest generates requests for V1GetReadonlyModeStatus -func NewV1GetReadonlyModeStatusRequest(server string, ref string) (*http.Request, error) { +// NewV1ListAllNetworkBansRequest generates requests for V1ListAllNetworkBans +func NewV1ListAllNetworkBansRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5437,7 +5985,7 @@ func NewV1GetReadonlyModeStatusRequest(server string, ref string) (*http.Request return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/readonly", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/network-bans/retrieve", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5447,7 +5995,7 @@ func NewV1GetReadonlyModeStatusRequest(server string, ref string) (*http.Request return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } @@ -5455,8 +6003,8 @@ func NewV1GetReadonlyModeStatusRequest(server string, ref string) (*http.Request return req, nil } -// NewV1DisableReadonlyModeTemporarilyRequest generates requests for V1DisableReadonlyModeTemporarily -func NewV1DisableReadonlyModeTemporarilyRequest(server string, ref string) (*http.Request, error) { +// NewV1ListAllNetworkBansEnrichedRequest generates requests for V1ListAllNetworkBansEnriched +func NewV1ListAllNetworkBansEnrichedRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5471,7 +6019,7 @@ func NewV1DisableReadonlyModeTemporarilyRequest(server string, ref string) (*htt return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/readonly/temporary-disable", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/network-bans/retrieve/enriched", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5489,8 +6037,8 @@ func NewV1DisableReadonlyModeTemporarilyRequest(server string, ref string) (*htt return req, nil } -// NewV1ListAvailableRestoreVersionsRequest generates requests for V1ListAvailableRestoreVersions -func NewV1ListAvailableRestoreVersionsRequest(server string, ref string) (*http.Request, error) { +// NewV1GetNetworkRestrictionsRequest generates requests for V1GetNetworkRestrictions +func NewV1GetNetworkRestrictionsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5505,7 +6053,7 @@ func NewV1ListAvailableRestoreVersionsRequest(server string, ref string) (*http. return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/restore", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/network-restrictions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5523,19 +6071,19 @@ func NewV1ListAvailableRestoreVersionsRequest(server string, ref string) (*http. return req, nil } -// NewV1RestoreAProjectRequest calls the generic V1RestoreAProject builder with application/json body -func NewV1RestoreAProjectRequest(server string, ref string, body V1RestoreAProjectJSONRequestBody) (*http.Request, error) { +// NewV1UpdateNetworkRestrictionsRequest calls the generic V1UpdateNetworkRestrictions builder with application/json body +func NewV1UpdateNetworkRestrictionsRequest(server string, ref string, body V1UpdateNetworkRestrictionsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1RestoreAProjectRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1UpdateNetworkRestrictionsRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1RestoreAProjectRequestWithBody generates requests for V1RestoreAProject with any type of body -func NewV1RestoreAProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UpdateNetworkRestrictionsRequestWithBody generates requests for V1UpdateNetworkRestrictions with any type of body +func NewV1UpdateNetworkRestrictionsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5550,7 +6098,7 @@ func NewV1RestoreAProjectRequestWithBody(server string, ref string, contentType return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/restore", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/network-restrictions/apply", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5570,8 +6118,8 @@ func NewV1RestoreAProjectRequestWithBody(server string, ref string, contentType return req, nil } -// NewV1CancelAProjectRestorationRequest generates requests for V1CancelAProjectRestoration -func NewV1CancelAProjectRestorationRequest(server string, ref string) (*http.Request, error) { +// NewV1PauseAProjectRequest generates requests for V1PauseAProject +func NewV1PauseAProjectRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5586,7 +6134,7 @@ func NewV1CancelAProjectRestorationRequest(server string, ref string) (*http.Req return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/restore/cancel", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/pause", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5604,19 +6152,8 @@ func NewV1CancelAProjectRestorationRequest(server string, ref string) (*http.Req return req, nil } -// NewV1BulkDeleteSecretsRequest calls the generic V1BulkDeleteSecrets builder with application/json body -func NewV1BulkDeleteSecretsRequest(server string, ref string, body V1BulkDeleteSecretsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1BulkDeleteSecretsRequestWithBody(server, ref, "application/json", bodyReader) -} - -// NewV1BulkDeleteSecretsRequestWithBody generates requests for V1BulkDeleteSecrets with any type of body -func NewV1BulkDeleteSecretsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1GetPgsodiumConfigRequest generates requests for V1GetPgsodiumConfig +func NewV1GetPgsodiumConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5631,7 +6168,7 @@ func NewV1BulkDeleteSecretsRequestWithBody(server string, ref string, contentTyp return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/pgsodium", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5641,18 +6178,27 @@ func NewV1BulkDeleteSecretsRequestWithBody(server string, ref string, contentTyp return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1ListAllSecretsRequest generates requests for V1ListAllSecrets -func NewV1ListAllSecretsRequest(server string, ref string) (*http.Request, error) { +// NewV1UpdatePgsodiumConfigRequest calls the generic V1UpdatePgsodiumConfig builder with application/json body +func NewV1UpdatePgsodiumConfigRequest(server string, ref string, body V1UpdatePgsodiumConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpdatePgsodiumConfigRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpdatePgsodiumConfigRequestWithBody generates requests for V1UpdatePgsodiumConfig with any type of body +func NewV1UpdatePgsodiumConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5667,7 +6213,7 @@ func NewV1ListAllSecretsRequest(server string, ref string) (*http.Request, error return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/pgsodium", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5677,27 +6223,18 @@ func NewV1ListAllSecretsRequest(server string, ref string) (*http.Request, error return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewV1BulkCreateSecretsRequest calls the generic V1BulkCreateSecrets builder with application/json body -func NewV1BulkCreateSecretsRequest(server string, ref string, body V1BulkCreateSecretsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1BulkCreateSecretsRequestWithBody(server, ref, "application/json", bodyReader) + return req, nil } -// NewV1BulkCreateSecretsRequestWithBody generates requests for V1BulkCreateSecrets with any type of body -func NewV1BulkCreateSecretsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1GetPostgrestServiceConfigRequest generates requests for V1GetPostgrestServiceConfig +func NewV1GetPostgrestServiceConfigRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5712,7 +6249,7 @@ func NewV1BulkCreateSecretsRequestWithBody(server string, ref string, contentTyp return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/postgrest", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5722,18 +6259,27 @@ func NewV1BulkCreateSecretsRequestWithBody(server string, ref string, contentTyp return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1GetSslEnforcementConfigRequest generates requests for V1GetSslEnforcementConfig -func NewV1GetSslEnforcementConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1UpdatePostgrestServiceConfigRequest calls the generic V1UpdatePostgrestServiceConfig builder with application/json body +func NewV1UpdatePostgrestServiceConfigRequest(server string, ref string, body V1UpdatePostgrestServiceConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpdatePostgrestServiceConfigRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpdatePostgrestServiceConfigRequestWithBody generates requests for V1UpdatePostgrestServiceConfig with any type of body +func NewV1UpdatePostgrestServiceConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5748,7 +6294,7 @@ func NewV1GetSslEnforcementConfigRequest(server string, ref string) (*http.Reque return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/ssl-enforcement", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/postgrest", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5758,27 +6304,29 @@ func NewV1GetSslEnforcementConfigRequest(server string, ref string) (*http.Reque return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1UpdateSslEnforcementConfigRequest calls the generic V1UpdateSslEnforcementConfig builder with application/json body -func NewV1UpdateSslEnforcementConfigRequest(server string, ref string, body V1UpdateSslEnforcementConfigJSONRequestBody) (*http.Request, error) { +// NewV1RemoveAReadReplicaRequest calls the generic V1RemoveAReadReplica builder with application/json body +func NewV1RemoveAReadReplicaRequest(server string, ref string, body V1RemoveAReadReplicaJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1UpdateSslEnforcementConfigRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1RemoveAReadReplicaRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1UpdateSslEnforcementConfigRequestWithBody generates requests for V1UpdateSslEnforcementConfig with any type of body -func NewV1UpdateSslEnforcementConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1RemoveAReadReplicaRequestWithBody generates requests for V1RemoveAReadReplica with any type of body +func NewV1RemoveAReadReplicaRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5793,7 +6341,7 @@ func NewV1UpdateSslEnforcementConfigRequestWithBody(server string, ref string, c return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/ssl-enforcement", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/read-replicas/remove", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5803,7 +6351,7 @@ func NewV1UpdateSslEnforcementConfigRequestWithBody(server string, ref string, c return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } @@ -5813,8 +6361,19 @@ func NewV1UpdateSslEnforcementConfigRequestWithBody(server string, ref string, c return req, nil } -// NewV1ListAllBucketsRequest generates requests for V1ListAllBuckets -func NewV1ListAllBucketsRequest(server string, ref string) (*http.Request, error) { +// NewV1SetupAReadReplicaRequest calls the generic V1SetupAReadReplica builder with application/json body +func NewV1SetupAReadReplicaRequest(server string, ref string, body V1SetupAReadReplicaJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1SetupAReadReplicaRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1SetupAReadReplicaRequestWithBody generates requests for V1SetupAReadReplica with any type of body +func NewV1SetupAReadReplicaRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5829,7 +6388,7 @@ func NewV1ListAllBucketsRequest(server string, ref string) (*http.Request, error return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/storage/buckets", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/read-replicas/setup", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5839,16 +6398,18 @@ func NewV1ListAllBucketsRequest(server string, ref string) (*http.Request, error return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1GenerateTypescriptTypesRequest generates requests for V1GenerateTypescriptTypes -func NewV1GenerateTypescriptTypesRequest(server string, ref string, params *V1GenerateTypescriptTypesParams) (*http.Request, error) { +// NewV1GetReadonlyModeStatusRequest generates requests for V1GetReadonlyModeStatus +func NewV1GetReadonlyModeStatusRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5863,7 +6424,7 @@ func NewV1GenerateTypescriptTypesRequest(server string, ref string, params *V1Ge return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/types/typescript", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/readonly", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5873,28 +6434,6 @@ func NewV1GenerateTypescriptTypesRequest(server string, ref string, params *V1Ge return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.IncludedSchemas != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "included_schemas", runtime.ParamLocationQuery, *params.IncludedSchemas); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -5903,19 +6442,8 @@ func NewV1GenerateTypescriptTypesRequest(server string, ref string, params *V1Ge return req, nil } -// NewV1UpgradePostgresVersionRequest calls the generic V1UpgradePostgresVersion builder with application/json body -func NewV1UpgradePostgresVersionRequest(server string, ref string, body V1UpgradePostgresVersionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1UpgradePostgresVersionRequestWithBody(server, ref, "application/json", bodyReader) -} - -// NewV1UpgradePostgresVersionRequestWithBody generates requests for V1UpgradePostgresVersion with any type of body -func NewV1UpgradePostgresVersionRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1DisableReadonlyModeTemporarilyRequest generates requests for V1DisableReadonlyModeTemporarily +func NewV1DisableReadonlyModeTemporarilyRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5930,7 +6458,7 @@ func NewV1UpgradePostgresVersionRequestWithBody(server string, ref string, conte return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/upgrade", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/readonly/temporary-disable", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5940,18 +6468,16 @@ func NewV1UpgradePostgresVersionRequestWithBody(server string, ref string, conte return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1GetPostgresUpgradeEligibilityRequest generates requests for V1GetPostgresUpgradeEligibility -func NewV1GetPostgresUpgradeEligibilityRequest(server string, ref string) (*http.Request, error) { +// NewV1ListAvailableRestoreVersionsRequest generates requests for V1ListAvailableRestoreVersions +func NewV1ListAvailableRestoreVersionsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5966,7 +6492,7 @@ func NewV1GetPostgresUpgradeEligibilityRequest(server string, ref string) (*http return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/upgrade/eligibility", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/restore", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5984,8 +6510,8 @@ func NewV1GetPostgresUpgradeEligibilityRequest(server string, ref string) (*http return req, nil } -// NewV1GetPostgresUpgradeStatusRequest generates requests for V1GetPostgresUpgradeStatus -func NewV1GetPostgresUpgradeStatusRequest(server string, ref string, params *V1GetPostgresUpgradeStatusParams) (*http.Request, error) { +// NewV1RestoreAProjectRequest generates requests for V1RestoreAProject +func NewV1RestoreAProjectRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -6000,7 +6526,7 @@ func NewV1GetPostgresUpgradeStatusRequest(server string, ref string, params *V1G return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/upgrade/status", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/restore", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6010,29 +6536,7 @@ func NewV1GetPostgresUpgradeStatusRequest(server string, ref string, params *V1G return nil, err } - if params != nil { - queryValues := queryURL.Query() - - if params.TrackingId != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tracking_id", runtime.ParamLocationQuery, *params.TrackingId); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } @@ -6040,8 +6544,8 @@ func NewV1GetPostgresUpgradeStatusRequest(server string, ref string, params *V1G return req, nil } -// NewV1DeactivateVanitySubdomainConfigRequest generates requests for V1DeactivateVanitySubdomainConfig -func NewV1DeactivateVanitySubdomainConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1CancelAProjectRestorationRequest generates requests for V1CancelAProjectRestoration +func NewV1CancelAProjectRestorationRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -6056,7 +6560,7 @@ func NewV1DeactivateVanitySubdomainConfigRequest(server string, ref string) (*ht return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/restore/cancel", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6066,7 +6570,7 @@ func NewV1DeactivateVanitySubdomainConfigRequest(server string, ref string) (*ht return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } @@ -6074,8 +6578,19 @@ func NewV1DeactivateVanitySubdomainConfigRequest(server string, ref string) (*ht return req, nil } -// NewV1GetVanitySubdomainConfigRequest generates requests for V1GetVanitySubdomainConfig -func NewV1GetVanitySubdomainConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1BulkDeleteSecretsRequest calls the generic V1BulkDeleteSecrets builder with application/json body +func NewV1BulkDeleteSecretsRequest(server string, ref string, body V1BulkDeleteSecretsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1BulkDeleteSecretsRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1BulkDeleteSecretsRequestWithBody generates requests for V1BulkDeleteSecrets with any type of body +func NewV1BulkDeleteSecretsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -6090,7 +6605,7 @@ func NewV1GetVanitySubdomainConfigRequest(server string, ref string) (*http.Requ return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6100,27 +6615,18 @@ func NewV1GetVanitySubdomainConfigRequest(server string, ref string) (*http.Requ return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewV1ActivateVanitySubdomainConfigRequest calls the generic V1ActivateVanitySubdomainConfig builder with application/json body -func NewV1ActivateVanitySubdomainConfigRequest(server string, ref string, body V1ActivateVanitySubdomainConfigJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1ActivateVanitySubdomainConfigRequestWithBody(server, ref, "application/json", bodyReader) + return req, nil } -// NewV1ActivateVanitySubdomainConfigRequestWithBody generates requests for V1ActivateVanitySubdomainConfig with any type of body -func NewV1ActivateVanitySubdomainConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1ListAllSecretsRequest generates requests for V1ListAllSecrets +func NewV1ListAllSecretsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -6135,7 +6641,7 @@ func NewV1ActivateVanitySubdomainConfigRequestWithBody(server string, ref string return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain/activate", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6145,29 +6651,27 @@ func NewV1ActivateVanitySubdomainConfigRequestWithBody(server string, ref string return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewV1CheckVanitySubdomainAvailabilityRequest calls the generic V1CheckVanitySubdomainAvailability builder with application/json body -func NewV1CheckVanitySubdomainAvailabilityRequest(server string, ref string, body V1CheckVanitySubdomainAvailabilityJSONRequestBody) (*http.Request, error) { +// NewV1BulkCreateSecretsRequest calls the generic V1BulkCreateSecrets builder with application/json body +func NewV1BulkCreateSecretsRequest(server string, ref string, body V1BulkCreateSecretsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1CheckVanitySubdomainAvailabilityRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1BulkCreateSecretsRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1CheckVanitySubdomainAvailabilityRequestWithBody generates requests for V1CheckVanitySubdomainAvailability with any type of body -func NewV1CheckVanitySubdomainAvailabilityRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1BulkCreateSecretsRequestWithBody generates requests for V1BulkCreateSecrets with any type of body +func NewV1BulkCreateSecretsRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -6182,7 +6686,7 @@ func NewV1CheckVanitySubdomainAvailabilityRequestWithBody(server string, ref str return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain/check-availability", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/secrets", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6202,16 +6706,486 @@ func NewV1CheckVanitySubdomainAvailabilityRequestWithBody(server string, ref str return req, nil } -// NewV1ListAllSnippetsRequest generates requests for V1ListAllSnippets -func NewV1ListAllSnippetsRequest(server string, params *V1ListAllSnippetsParams) (*http.Request, error) { +// NewV1GetSslEnforcementConfigRequest generates requests for V1GetSslEnforcementConfig +func NewV1GetSslEnforcementConfigRequest(server string, ref string) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/snippets") + operationPath := fmt.Sprintf("/v1/projects/%s/ssl-enforcement", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1UpdateSslEnforcementConfigRequest calls the generic V1UpdateSslEnforcementConfig builder with application/json body +func NewV1UpdateSslEnforcementConfigRequest(server string, ref string, body V1UpdateSslEnforcementConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpdateSslEnforcementConfigRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpdateSslEnforcementConfigRequestWithBody generates requests for V1UpdateSslEnforcementConfig with any type of body +func NewV1UpdateSslEnforcementConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/ssl-enforcement", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1ListAllBucketsRequest generates requests for V1ListAllBuckets +func NewV1ListAllBucketsRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/storage/buckets", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1GenerateTypescriptTypesRequest generates requests for V1GenerateTypescriptTypes +func NewV1GenerateTypescriptTypesRequest(server string, ref string, params *V1GenerateTypescriptTypesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/types/typescript", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.IncludedSchemas != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "included_schemas", runtime.ParamLocationQuery, *params.IncludedSchemas); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1UpgradePostgresVersionRequest calls the generic V1UpgradePostgresVersion builder with application/json body +func NewV1UpgradePostgresVersionRequest(server string, ref string, body V1UpgradePostgresVersionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpgradePostgresVersionRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpgradePostgresVersionRequestWithBody generates requests for V1UpgradePostgresVersion with any type of body +func NewV1UpgradePostgresVersionRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/upgrade", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1GetPostgresUpgradeEligibilityRequest generates requests for V1GetPostgresUpgradeEligibility +func NewV1GetPostgresUpgradeEligibilityRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/upgrade/eligibility", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1GetPostgresUpgradeStatusRequest generates requests for V1GetPostgresUpgradeStatus +func NewV1GetPostgresUpgradeStatusRequest(server string, ref string, params *V1GetPostgresUpgradeStatusParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/upgrade/status", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.TrackingId != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tracking_id", runtime.ParamLocationQuery, *params.TrackingId); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1DeactivateVanitySubdomainConfigRequest generates requests for V1DeactivateVanitySubdomainConfig +func NewV1DeactivateVanitySubdomainConfigRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1GetVanitySubdomainConfigRequest generates requests for V1GetVanitySubdomainConfig +func NewV1GetVanitySubdomainConfigRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1ActivateVanitySubdomainConfigRequest calls the generic V1ActivateVanitySubdomainConfig builder with application/json body +func NewV1ActivateVanitySubdomainConfigRequest(server string, ref string, body V1ActivateVanitySubdomainConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1ActivateVanitySubdomainConfigRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1ActivateVanitySubdomainConfigRequestWithBody generates requests for V1ActivateVanitySubdomainConfig with any type of body +func NewV1ActivateVanitySubdomainConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain/activate", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1CheckVanitySubdomainAvailabilityRequest calls the generic V1CheckVanitySubdomainAvailability builder with application/json body +func NewV1CheckVanitySubdomainAvailabilityRequest(server string, ref string, body V1CheckVanitySubdomainAvailabilityJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1CheckVanitySubdomainAvailabilityRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1CheckVanitySubdomainAvailabilityRequestWithBody generates requests for V1CheckVanitySubdomainAvailability with any type of body +func NewV1CheckVanitySubdomainAvailabilityRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/vanity-subdomain/check-availability", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1ListAllSnippetsRequest generates requests for V1ListAllSnippets +func NewV1ListAllSnippetsRequest(server string, params *V1ListAllSnippetsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/snippets") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6224,9 +7198,9 @@ func NewV1ListAllSnippetsRequest(server string, params *V1ListAllSnippetsParams) if params != nil { queryValues := queryURL.Query() - if params.Cursor != nil { + if params.ProjectRef != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cursor", runtime.ParamLocationQuery, *params.Cursor); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "project_ref", runtime.ParamLocationQuery, *params.ProjectRef); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6240,9 +7214,9 @@ func NewV1ListAllSnippetsRequest(server string, params *V1ListAllSnippetsParams) } - if params.Limit != nil { + if params.Cursor != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cursor", runtime.ParamLocationQuery, *params.Cursor); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6256,9 +7230,9 @@ func NewV1ListAllSnippetsRequest(server string, params *V1ListAllSnippetsParams) } - if params.SortBy != nil { + if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort_by", runtime.ParamLocationQuery, *params.SortBy); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6272,9 +7246,9 @@ func NewV1ListAllSnippetsRequest(server string, params *V1ListAllSnippetsParams) } - if params.SortOrder != nil { + if params.SortBy != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort_order", runtime.ParamLocationQuery, *params.SortOrder); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort_by", runtime.ParamLocationQuery, *params.SortBy); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6288,9 +7262,9 @@ func NewV1ListAllSnippetsRequest(server string, params *V1ListAllSnippetsParams) } - if params.ProjectRef != nil { + if params.SortOrder != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "project_ref", runtime.ParamLocationQuery, *params.ProjectRef); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort_order", runtime.ParamLocationQuery, *params.SortOrder); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6393,21 +7367,30 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { // V1DeleteABranchWithResponse request - V1DeleteABranchWithResponse(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*V1DeleteABranchResponse, error) + V1DeleteABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1DeleteABranchResponse, error) // V1GetABranchConfigWithResponse request - V1GetABranchConfigWithResponse(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*V1GetABranchConfigResponse, error) + V1GetABranchConfigWithResponse(ctx context.Context, branchId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetABranchConfigResponse, error) // V1UpdateABranchConfigWithBodyWithResponse request with any body - V1UpdateABranchConfigWithBodyWithResponse(ctx context.Context, branchId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) + V1UpdateABranchConfigWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) + + V1UpdateABranchConfigWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) + + // V1MergeABranchWithBodyWithResponse request with any body + V1MergeABranchWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1MergeABranchResponse, error) - V1UpdateABranchConfigWithResponse(ctx context.Context, branchId string, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) + V1MergeABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1MergeABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1MergeABranchResponse, error) - // V1PushABranchWithResponse request - V1PushABranchWithResponse(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*V1PushABranchResponse, error) + // V1PushABranchWithBodyWithResponse request with any body + V1PushABranchWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1PushABranchResponse, error) - // V1ResetABranchWithResponse request - V1ResetABranchWithResponse(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*V1ResetABranchResponse, error) + V1PushABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1PushABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1PushABranchResponse, error) + + // V1ResetABranchWithBodyWithResponse request with any body + V1ResetABranchWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ResetABranchResponse, error) + + V1ResetABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1ResetABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ResetABranchResponse, error) // V1AuthorizeUserWithResponse request V1AuthorizeUserWithResponse(ctx context.Context, params *V1AuthorizeUserParams, reqEditors ...RequestEditorFn) (*V1AuthorizeUserResponse, error) @@ -6450,9 +7433,21 @@ type ClientWithResponsesInterface interface { // V1GetProjectWithResponse request V1GetProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectResponse, error) + // GetPerformanceAdvisorsWithResponse request + GetPerformanceAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetPerformanceAdvisorsResponse, error) + + // GetSecurityAdvisorsWithResponse request + GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetSecurityAdvisorsResponse, error) + // GetLogsWithResponse request GetLogsWithResponse(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*GetLogsResponse, error) + // GetApiCountsWithResponse request + GetApiCountsWithResponse(ctx context.Context, ref string, params *GetApiCountsParams, reqEditors ...RequestEditorFn) (*GetApiCountsResponse, error) + + // GetApiRequestsCountWithResponse request + GetApiRequestsCountWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetApiRequestsCountResponse, error) + // V1GetProjectApiKeysWithResponse request V1GetProjectApiKeysWithResponse(ctx context.Context, ref string, params *V1GetProjectApiKeysParams, reqEditors ...RequestEditorFn) (*V1GetProjectApiKeysResponse, error) @@ -6462,15 +7457,26 @@ type ClientWithResponsesInterface interface { CreateApiKeyWithResponse(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) // DeleteApiKeyWithResponse request - DeleteApiKeyWithResponse(ctx context.Context, ref string, id string, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) + DeleteApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) // GetApiKeyWithResponse request - GetApiKeyWithResponse(ctx context.Context, ref string, id string, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*GetApiKeyResponse, error) + GetApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*GetApiKeyResponse, error) // UpdateApiKeyWithBodyWithResponse request with any body - UpdateApiKeyWithBodyWithResponse(ctx context.Context, ref string, id string, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) + UpdateApiKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) + + UpdateApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) + + // V1ListProjectAddonsWithResponse request + V1ListProjectAddonsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListProjectAddonsResponse, error) - UpdateApiKeyWithResponse(ctx context.Context, ref string, id string, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) + // V1ApplyProjectAddonWithBodyWithResponse request with any body + V1ApplyProjectAddonWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ApplyProjectAddonResponse, error) + + V1ApplyProjectAddonWithResponse(ctx context.Context, ref string, body V1ApplyProjectAddonJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ApplyProjectAddonResponse, error) + + // V1RemoveProjectAddonWithResponse request + V1RemoveProjectAddonWithResponse(ctx context.Context, ref string, addonVariant interface{}, reqEditors ...RequestEditorFn) (*V1RemoveProjectAddonResponse, error) // V1DisablePreviewBranchingWithResponse request V1DisablePreviewBranchingWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DisablePreviewBranchingResponse, error) @@ -6491,6 +7497,25 @@ type ClientWithResponsesInterface interface { V1UpdateAuthServiceConfigWithResponse(ctx context.Context, ref string, body V1UpdateAuthServiceConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateAuthServiceConfigResponse, error) + // ListSigningKeysForProjectWithResponse request + ListSigningKeysForProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListSigningKeysForProjectResponse, error) + + // CreateSigningKeyForProjectWithBodyWithResponse request with any body + CreateSigningKeyForProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSigningKeyForProjectResponse, error) + + CreateSigningKeyForProjectWithResponse(ctx context.Context, ref string, body CreateSigningKeyForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSigningKeyForProjectResponse, error) + + // DeleteSigningKeyWithResponse request + DeleteSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteSigningKeyResponse, error) + + // GetSigningKeyForProjectWithResponse request + GetSigningKeyForProjectWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetSigningKeyForProjectResponse, error) + + // PatchSigningKeyWithBodyWithResponse request with any body + PatchSigningKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchSigningKeyResponse, error) + + PatchSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchSigningKeyResponse, error) + // V1ListAllSsoProviderWithResponse request V1ListAllSsoProviderWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllSsoProviderResponse, error) @@ -6500,15 +7525,15 @@ type ClientWithResponsesInterface interface { V1CreateASsoProviderWithResponse(ctx context.Context, ref string, body V1CreateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateASsoProviderResponse, error) // V1DeleteASsoProviderWithResponse request - V1DeleteASsoProviderWithResponse(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*V1DeleteASsoProviderResponse, error) + V1DeleteASsoProviderWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1DeleteASsoProviderResponse, error) // V1GetASsoProviderWithResponse request - V1GetASsoProviderWithResponse(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*V1GetASsoProviderResponse, error) + V1GetASsoProviderWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetASsoProviderResponse, error) // V1UpdateASsoProviderWithBodyWithResponse request with any body - V1UpdateASsoProviderWithBodyWithResponse(ctx context.Context, ref string, providerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) + V1UpdateASsoProviderWithBodyWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) - V1UpdateASsoProviderWithResponse(ctx context.Context, ref string, providerId string, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) + V1UpdateASsoProviderWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) // ListTPAForProjectWithResponse request ListTPAForProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListTPAForProjectResponse, error) @@ -6519,21 +7544,21 @@ type ClientWithResponsesInterface interface { CreateTPAForProjectWithResponse(ctx context.Context, ref string, body CreateTPAForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTPAForProjectResponse, error) // DeleteTPAForProjectWithResponse request - DeleteTPAForProjectWithResponse(ctx context.Context, ref string, tpaId string, reqEditors ...RequestEditorFn) (*DeleteTPAForProjectResponse, error) + DeleteTPAForProjectWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteTPAForProjectResponse, error) // GetTPAForProjectWithResponse request - GetTPAForProjectWithResponse(ctx context.Context, ref string, tpaId string, reqEditors ...RequestEditorFn) (*GetTPAForProjectResponse, error) + GetTPAForProjectWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTPAForProjectResponse, error) // V1GetProjectPgbouncerConfigWithResponse request V1GetProjectPgbouncerConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectPgbouncerConfigResponse, error) - // V1GetSupavisorConfigWithResponse request - V1GetSupavisorConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetSupavisorConfigResponse, error) + // V1GetPoolerConfigWithResponse request + V1GetPoolerConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPoolerConfigResponse, error) - // V1UpdateSupavisorConfigWithBodyWithResponse request with any body - V1UpdateSupavisorConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateSupavisorConfigResponse, error) + // V1UpdatePoolerConfigWithBodyWithResponse request with any body + V1UpdatePoolerConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdatePoolerConfigResponse, error) - V1UpdateSupavisorConfigWithResponse(ctx context.Context, ref string, body V1UpdateSupavisorConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateSupavisorConfigResponse, error) + V1UpdatePoolerConfigWithResponse(ctx context.Context, ref string, body V1UpdatePoolerConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdatePoolerConfigResponse, error) // V1GetPostgresConfigWithResponse request V1GetPostgresConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPostgresConfigResponse, error) @@ -6579,6 +7604,14 @@ type ClientWithResponsesInterface interface { // GetDatabaseMetadataWithResponse request GetDatabaseMetadataWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetDatabaseMetadataResponse, error) + // V1ListMigrationHistoryWithResponse request + V1ListMigrationHistoryWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListMigrationHistoryResponse, error) + + // V1ApplyAMigrationWithBodyWithResponse request with any body + V1ApplyAMigrationWithBodyWithResponse(ctx context.Context, ref string, params *V1ApplyAMigrationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ApplyAMigrationResponse, error) + + V1ApplyAMigrationWithResponse(ctx context.Context, ref string, params *V1ApplyAMigrationParams, body V1ApplyAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ApplyAMigrationResponse, error) + // V1RunAQueryWithBodyWithResponse request with any body V1RunAQueryWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RunAQueryResponse, error) @@ -6593,8 +7626,6 @@ type ClientWithResponsesInterface interface { // V1CreateAFunctionWithBodyWithResponse request with any body V1CreateAFunctionWithBodyWithResponse(ctx context.Context, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateAFunctionResponse, error) - V1CreateAFunctionWithResponse(ctx context.Context, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateAFunctionResponse, error) - // V1BulkUpdateFunctionsWithBodyWithResponse request with any body V1BulkUpdateFunctionsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkUpdateFunctionsResponse, error) @@ -6628,6 +7659,9 @@ type ClientWithResponsesInterface interface { // V1ListAllNetworkBansWithResponse request V1ListAllNetworkBansWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllNetworkBansResponse, error) + // V1ListAllNetworkBansEnrichedWithResponse request + V1ListAllNetworkBansEnrichedWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllNetworkBansEnrichedResponse, error) + // V1GetNetworkRestrictionsWithResponse request V1GetNetworkRestrictionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetNetworkRestrictionsResponse, error) @@ -6665,92 +7699,374 @@ type ClientWithResponsesInterface interface { V1SetupAReadReplicaWithResponse(ctx context.Context, ref string, body V1SetupAReadReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*V1SetupAReadReplicaResponse, error) - // V1GetReadonlyModeStatusWithResponse request - V1GetReadonlyModeStatusWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetReadonlyModeStatusResponse, error) + // V1GetReadonlyModeStatusWithResponse request + V1GetReadonlyModeStatusWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetReadonlyModeStatusResponse, error) + + // V1DisableReadonlyModeTemporarilyWithResponse request + V1DisableReadonlyModeTemporarilyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DisableReadonlyModeTemporarilyResponse, error) + + // V1ListAvailableRestoreVersionsWithResponse request + V1ListAvailableRestoreVersionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAvailableRestoreVersionsResponse, error) + + // V1RestoreAProjectWithResponse request + V1RestoreAProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1RestoreAProjectResponse, error) + + // V1CancelAProjectRestorationWithResponse request + V1CancelAProjectRestorationWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CancelAProjectRestorationResponse, error) + + // V1BulkDeleteSecretsWithBodyWithResponse request with any body + V1BulkDeleteSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkDeleteSecretsResponse, error) + + V1BulkDeleteSecretsWithResponse(ctx context.Context, ref string, body V1BulkDeleteSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*V1BulkDeleteSecretsResponse, error) + + // V1ListAllSecretsWithResponse request + V1ListAllSecretsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllSecretsResponse, error) + + // V1BulkCreateSecretsWithBodyWithResponse request with any body + V1BulkCreateSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkCreateSecretsResponse, error) + + V1BulkCreateSecretsWithResponse(ctx context.Context, ref string, body V1BulkCreateSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*V1BulkCreateSecretsResponse, error) + + // V1GetSslEnforcementConfigWithResponse request + V1GetSslEnforcementConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetSslEnforcementConfigResponse, error) + + // V1UpdateSslEnforcementConfigWithBodyWithResponse request with any body + V1UpdateSslEnforcementConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateSslEnforcementConfigResponse, error) + + V1UpdateSslEnforcementConfigWithResponse(ctx context.Context, ref string, body V1UpdateSslEnforcementConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateSslEnforcementConfigResponse, error) + + // V1ListAllBucketsWithResponse request + V1ListAllBucketsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllBucketsResponse, error) + + // V1GenerateTypescriptTypesWithResponse request + V1GenerateTypescriptTypesWithResponse(ctx context.Context, ref string, params *V1GenerateTypescriptTypesParams, reqEditors ...RequestEditorFn) (*V1GenerateTypescriptTypesResponse, error) + + // V1UpgradePostgresVersionWithBodyWithResponse request with any body + V1UpgradePostgresVersionWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpgradePostgresVersionResponse, error) + + V1UpgradePostgresVersionWithResponse(ctx context.Context, ref string, body V1UpgradePostgresVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpgradePostgresVersionResponse, error) + + // V1GetPostgresUpgradeEligibilityWithResponse request + V1GetPostgresUpgradeEligibilityWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPostgresUpgradeEligibilityResponse, error) + + // V1GetPostgresUpgradeStatusWithResponse request + V1GetPostgresUpgradeStatusWithResponse(ctx context.Context, ref string, params *V1GetPostgresUpgradeStatusParams, reqEditors ...RequestEditorFn) (*V1GetPostgresUpgradeStatusResponse, error) + + // V1DeactivateVanitySubdomainConfigWithResponse request + V1DeactivateVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeactivateVanitySubdomainConfigResponse, error) + + // V1GetVanitySubdomainConfigWithResponse request + V1GetVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetVanitySubdomainConfigResponse, error) + + // V1ActivateVanitySubdomainConfigWithBodyWithResponse request with any body + V1ActivateVanitySubdomainConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ActivateVanitySubdomainConfigResponse, error) + + V1ActivateVanitySubdomainConfigWithResponse(ctx context.Context, ref string, body V1ActivateVanitySubdomainConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ActivateVanitySubdomainConfigResponse, error) + + // V1CheckVanitySubdomainAvailabilityWithBodyWithResponse request with any body + V1CheckVanitySubdomainAvailabilityWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CheckVanitySubdomainAvailabilityResponse, error) + + V1CheckVanitySubdomainAvailabilityWithResponse(ctx context.Context, ref string, body V1CheckVanitySubdomainAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CheckVanitySubdomainAvailabilityResponse, error) + + // V1ListAllSnippetsWithResponse request + V1ListAllSnippetsWithResponse(ctx context.Context, params *V1ListAllSnippetsParams, reqEditors ...RequestEditorFn) (*V1ListAllSnippetsResponse, error) + + // V1GetASnippetWithResponse request + V1GetASnippetWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetASnippetResponse, error) +} + +type V1DeleteABranchResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *BranchDeleteResponse +} + +// Status returns HTTPResponse.Status +func (r V1DeleteABranchResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1DeleteABranchResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1GetABranchConfigResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *BranchDetailResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetABranchConfigResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetABranchConfigResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1UpdateABranchConfigResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *BranchResponse +} + +// Status returns HTTPResponse.Status +func (r V1UpdateABranchConfigResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1UpdateABranchConfigResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1MergeABranchResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *BranchUpdateResponse +} + +// Status returns HTTPResponse.Status +func (r V1MergeABranchResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1MergeABranchResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // V1DisableReadonlyModeTemporarilyWithResponse request - V1DisableReadonlyModeTemporarilyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DisableReadonlyModeTemporarilyResponse, error) +type V1PushABranchResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *BranchUpdateResponse +} - // V1ListAvailableRestoreVersionsWithResponse request - V1ListAvailableRestoreVersionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAvailableRestoreVersionsResponse, error) +// Status returns HTTPResponse.Status +func (r V1PushABranchResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1RestoreAProjectWithBodyWithResponse request with any body - V1RestoreAProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RestoreAProjectResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1PushABranchResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - V1RestoreAProjectWithResponse(ctx context.Context, ref string, body V1RestoreAProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*V1RestoreAProjectResponse, error) +type V1ResetABranchResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *BranchUpdateResponse +} - // V1CancelAProjectRestorationWithResponse request - V1CancelAProjectRestorationWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CancelAProjectRestorationResponse, error) +// Status returns HTTPResponse.Status +func (r V1ResetABranchResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1BulkDeleteSecretsWithBodyWithResponse request with any body - V1BulkDeleteSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkDeleteSecretsResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1ResetABranchResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - V1BulkDeleteSecretsWithResponse(ctx context.Context, ref string, body V1BulkDeleteSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*V1BulkDeleteSecretsResponse, error) +type V1AuthorizeUserResponse struct { + Body []byte + HTTPResponse *http.Response +} - // V1ListAllSecretsWithResponse request - V1ListAllSecretsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllSecretsResponse, error) +// Status returns HTTPResponse.Status +func (r V1AuthorizeUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1BulkCreateSecretsWithBodyWithResponse request with any body - V1BulkCreateSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkCreateSecretsResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1AuthorizeUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - V1BulkCreateSecretsWithResponse(ctx context.Context, ref string, body V1BulkCreateSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*V1BulkCreateSecretsResponse, error) +type V1RevokeTokenResponse struct { + Body []byte + HTTPResponse *http.Response +} - // V1GetSslEnforcementConfigWithResponse request - V1GetSslEnforcementConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetSslEnforcementConfigResponse, error) +// Status returns HTTPResponse.Status +func (r V1RevokeTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1UpdateSslEnforcementConfigWithBodyWithResponse request with any body - V1UpdateSslEnforcementConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateSslEnforcementConfigResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1RevokeTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - V1UpdateSslEnforcementConfigWithResponse(ctx context.Context, ref string, body V1UpdateSslEnforcementConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateSslEnforcementConfigResponse, error) +type V1ExchangeOauthTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *OAuthTokenResponse +} - // V1ListAllBucketsWithResponse request - V1ListAllBucketsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllBucketsResponse, error) +// Status returns HTTPResponse.Status +func (r V1ExchangeOauthTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1GenerateTypescriptTypesWithResponse request - V1GenerateTypescriptTypesWithResponse(ctx context.Context, ref string, params *V1GenerateTypescriptTypesParams, reqEditors ...RequestEditorFn) (*V1GenerateTypescriptTypesResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1ExchangeOauthTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // V1UpgradePostgresVersionWithBodyWithResponse request with any body - V1UpgradePostgresVersionWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpgradePostgresVersionResponse, error) +type V1ListAllOrganizationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]OrganizationResponseV1 +} - V1UpgradePostgresVersionWithResponse(ctx context.Context, ref string, body V1UpgradePostgresVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpgradePostgresVersionResponse, error) +// Status returns HTTPResponse.Status +func (r V1ListAllOrganizationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1GetPostgresUpgradeEligibilityWithResponse request - V1GetPostgresUpgradeEligibilityWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPostgresUpgradeEligibilityResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1ListAllOrganizationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // V1GetPostgresUpgradeStatusWithResponse request - V1GetPostgresUpgradeStatusWithResponse(ctx context.Context, ref string, params *V1GetPostgresUpgradeStatusParams, reqEditors ...RequestEditorFn) (*V1GetPostgresUpgradeStatusResponse, error) +type V1CreateAnOrganizationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *OrganizationResponseV1 +} - // V1DeactivateVanitySubdomainConfigWithResponse request - V1DeactivateVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeactivateVanitySubdomainConfigResponse, error) +// Status returns HTTPResponse.Status +func (r V1CreateAnOrganizationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1GetVanitySubdomainConfigWithResponse request - V1GetVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetVanitySubdomainConfigResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1CreateAnOrganizationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // V1ActivateVanitySubdomainConfigWithBodyWithResponse request with any body - V1ActivateVanitySubdomainConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ActivateVanitySubdomainConfigResponse, error) +type V1GetAnOrganizationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *V1OrganizationSlugResponse +} - V1ActivateVanitySubdomainConfigWithResponse(ctx context.Context, ref string, body V1ActivateVanitySubdomainConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ActivateVanitySubdomainConfigResponse, error) +// Status returns HTTPResponse.Status +func (r V1GetAnOrganizationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1CheckVanitySubdomainAvailabilityWithBodyWithResponse request with any body - V1CheckVanitySubdomainAvailabilityWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CheckVanitySubdomainAvailabilityResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetAnOrganizationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - V1CheckVanitySubdomainAvailabilityWithResponse(ctx context.Context, ref string, body V1CheckVanitySubdomainAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CheckVanitySubdomainAvailabilityResponse, error) +type V1ListOrganizationMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]V1OrganizationMemberResponse +} - // V1ListAllSnippetsWithResponse request - V1ListAllSnippetsWithResponse(ctx context.Context, params *V1ListAllSnippetsParams, reqEditors ...RequestEditorFn) (*V1ListAllSnippetsResponse, error) +// Status returns HTTPResponse.Status +func (r V1ListOrganizationMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // V1GetASnippetWithResponse request - V1GetASnippetWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetASnippetResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r V1ListOrganizationMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 } -type V1DeleteABranchResponse struct { +type V1ListAllProjectsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *BranchDeleteResponse + JSON200 *[]V1ProjectWithDatabaseResponse } // Status returns HTTPResponse.Status -func (r V1DeleteABranchResponse) Status() string { +func (r V1ListAllProjectsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6758,21 +8074,21 @@ func (r V1DeleteABranchResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1DeleteABranchResponse) StatusCode() int { +func (r V1ListAllProjectsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1GetABranchConfigResponse struct { +type V1CreateAProjectResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *BranchDetailResponse + JSON201 *V1ProjectResponse } // Status returns HTTPResponse.Status -func (r V1GetABranchConfigResponse) Status() string { +func (r V1CreateAProjectResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6780,21 +8096,21 @@ func (r V1GetABranchConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1GetABranchConfigResponse) StatusCode() int { +func (r V1CreateAProjectResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1UpdateABranchConfigResponse struct { +type V1DeleteAProjectResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *BranchResponse + JSON200 *V1ProjectRefResponse } // Status returns HTTPResponse.Status -func (r V1UpdateABranchConfigResponse) Status() string { +func (r V1DeleteAProjectResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6802,21 +8118,21 @@ func (r V1UpdateABranchConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1UpdateABranchConfigResponse) StatusCode() int { +func (r V1DeleteAProjectResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1PushABranchResponse struct { +type V1GetProjectResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *BranchUpdateResponse + JSON200 *V1ProjectWithDatabaseResponse } // Status returns HTTPResponse.Status -func (r V1PushABranchResponse) Status() string { +func (r V1GetProjectResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6824,21 +8140,21 @@ func (r V1PushABranchResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1PushABranchResponse) StatusCode() int { +func (r V1GetProjectResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1ResetABranchResponse struct { +type GetPerformanceAdvisorsResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *BranchUpdateResponse + JSON200 *V1ProjectAdvisorsResponse } // Status returns HTTPResponse.Status -func (r V1ResetABranchResponse) Status() string { +func (r GetPerformanceAdvisorsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6846,20 +8162,21 @@ func (r V1ResetABranchResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1ResetABranchResponse) StatusCode() int { +func (r GetPerformanceAdvisorsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1AuthorizeUserResponse struct { +type GetSecurityAdvisorsResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *V1ProjectAdvisorsResponse } // Status returns HTTPResponse.Status -func (r V1AuthorizeUserResponse) Status() string { +func (r GetSecurityAdvisorsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6867,20 +8184,21 @@ func (r V1AuthorizeUserResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1AuthorizeUserResponse) StatusCode() int { +func (r GetSecurityAdvisorsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1RevokeTokenResponse struct { +type GetLogsResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *AnalyticsResponse } // Status returns HTTPResponse.Status -func (r V1RevokeTokenResponse) Status() string { +func (r GetLogsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6888,21 +8206,21 @@ func (r V1RevokeTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1RevokeTokenResponse) StatusCode() int { +func (r GetLogsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1ExchangeOauthTokenResponse struct { +type GetApiCountsResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *OAuthTokenResponse + JSON200 *AnalyticsResponse } // Status returns HTTPResponse.Status -func (r V1ExchangeOauthTokenResponse) Status() string { +func (r GetApiCountsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6910,21 +8228,21 @@ func (r V1ExchangeOauthTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1ExchangeOauthTokenResponse) StatusCode() int { +func (r GetApiCountsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1ListAllOrganizationsResponse struct { +type GetApiRequestsCountResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]OrganizationResponseV1 + JSON200 *AnalyticsResponse } // Status returns HTTPResponse.Status -func (r V1ListAllOrganizationsResponse) Status() string { +func (r GetApiRequestsCountResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6932,21 +8250,21 @@ func (r V1ListAllOrganizationsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1ListAllOrganizationsResponse) StatusCode() int { +func (r GetApiRequestsCountResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1CreateAnOrganizationResponse struct { +type V1GetProjectApiKeysResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *OrganizationResponseV1 + JSON200 *[]ApiKeyResponse } // Status returns HTTPResponse.Status -func (r V1CreateAnOrganizationResponse) Status() string { +func (r V1GetProjectApiKeysResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6954,21 +8272,21 @@ func (r V1CreateAnOrganizationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1CreateAnOrganizationResponse) StatusCode() int { +func (r V1GetProjectApiKeysResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1GetAnOrganizationResponse struct { +type CreateApiKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *V1OrganizationSlugResponse + JSON201 *ApiKeyResponse } // Status returns HTTPResponse.Status -func (r V1GetAnOrganizationResponse) Status() string { +func (r CreateApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6976,21 +8294,21 @@ func (r V1GetAnOrganizationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1GetAnOrganizationResponse) StatusCode() int { +func (r CreateApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1ListOrganizationMembersResponse struct { +type DeleteApiKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]V1OrganizationMemberResponse + JSON200 *ApiKeyResponse } // Status returns HTTPResponse.Status -func (r V1ListOrganizationMembersResponse) Status() string { +func (r DeleteApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6998,21 +8316,21 @@ func (r V1ListOrganizationMembersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1ListOrganizationMembersResponse) StatusCode() int { +func (r DeleteApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1ListAllProjectsResponse struct { +type GetApiKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]V1ProjectWithDatabaseResponse + JSON200 *ApiKeyResponse } // Status returns HTTPResponse.Status -func (r V1ListAllProjectsResponse) Status() string { +func (r GetApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7020,21 +8338,21 @@ func (r V1ListAllProjectsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1ListAllProjectsResponse) StatusCode() int { +func (r GetApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1CreateAProjectResponse struct { +type UpdateApiKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *V1ProjectResponse + JSON200 *ApiKeyResponse } // Status returns HTTPResponse.Status -func (r V1CreateAProjectResponse) Status() string { +func (r UpdateApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7042,21 +8360,21 @@ func (r V1CreateAProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1CreateAProjectResponse) StatusCode() int { +func (r UpdateApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1DeleteAProjectResponse struct { +type V1ListProjectAddonsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *V1ProjectRefResponse + JSON200 *ListProjectAddonsResponse } // Status returns HTTPResponse.Status -func (r V1DeleteAProjectResponse) Status() string { +func (r V1ListProjectAddonsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7064,21 +8382,20 @@ func (r V1DeleteAProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1DeleteAProjectResponse) StatusCode() int { +func (r V1ListProjectAddonsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1GetProjectResponse struct { +type V1ApplyProjectAddonResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *V1ProjectWithDatabaseResponse } // Status returns HTTPResponse.Status -func (r V1GetProjectResponse) Status() string { +func (r V1ApplyProjectAddonResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7086,21 +8403,20 @@ func (r V1GetProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1GetProjectResponse) StatusCode() int { +func (r V1ApplyProjectAddonResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetLogsResponse struct { +type V1RemoveProjectAddonResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *V1AnalyticsResponse } // Status returns HTTPResponse.Status -func (r GetLogsResponse) Status() string { +func (r V1RemoveProjectAddonResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7108,21 +8424,20 @@ func (r GetLogsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetLogsResponse) StatusCode() int { +func (r V1RemoveProjectAddonResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1GetProjectApiKeysResponse struct { +type V1DisablePreviewBranchingResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]ApiKeyResponse } // Status returns HTTPResponse.Status -func (r V1GetProjectApiKeysResponse) Status() string { +func (r V1DisablePreviewBranchingResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7130,21 +8445,21 @@ func (r V1GetProjectApiKeysResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1GetProjectApiKeysResponse) StatusCode() int { +func (r V1DisablePreviewBranchingResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateApiKeyResponse struct { +type V1ListAllBranchesResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *ApiKeyResponse + JSON200 *[]BranchResponse } // Status returns HTTPResponse.Status -func (r CreateApiKeyResponse) Status() string { +func (r V1ListAllBranchesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7152,21 +8467,21 @@ func (r CreateApiKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateApiKeyResponse) StatusCode() int { +func (r V1ListAllBranchesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteApiKeyResponse struct { +type V1CreateABranchResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ApiKeyResponse + JSON201 *BranchResponse } // Status returns HTTPResponse.Status -func (r DeleteApiKeyResponse) Status() string { +func (r V1CreateABranchResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7174,21 +8489,21 @@ func (r DeleteApiKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteApiKeyResponse) StatusCode() int { +func (r V1CreateABranchResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetApiKeyResponse struct { +type V1GetAuthServiceConfigResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ApiKeyResponse + JSON200 *AuthConfigResponse } // Status returns HTTPResponse.Status -func (r GetApiKeyResponse) Status() string { +func (r V1GetAuthServiceConfigResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7196,21 +8511,21 @@ func (r GetApiKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetApiKeyResponse) StatusCode() int { +func (r V1GetAuthServiceConfigResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateApiKeyResponse struct { +type V1UpdateAuthServiceConfigResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ApiKeyResponse + JSON200 *AuthConfigResponse } // Status returns HTTPResponse.Status -func (r UpdateApiKeyResponse) Status() string { +func (r V1UpdateAuthServiceConfigResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7218,20 +8533,21 @@ func (r UpdateApiKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateApiKeyResponse) StatusCode() int { +func (r V1UpdateAuthServiceConfigResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1DisablePreviewBranchingResponse struct { +type ListSigningKeysForProjectResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *SigningKeysResponse } // Status returns HTTPResponse.Status -func (r V1DisablePreviewBranchingResponse) Status() string { +func (r ListSigningKeysForProjectResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7239,21 +8555,21 @@ func (r V1DisablePreviewBranchingResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1DisablePreviewBranchingResponse) StatusCode() int { +func (r ListSigningKeysForProjectResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1ListAllBranchesResponse struct { +type CreateSigningKeyForProjectResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]BranchResponse + JSON201 *SigningKeyResponse } // Status returns HTTPResponse.Status -func (r V1ListAllBranchesResponse) Status() string { +func (r CreateSigningKeyForProjectResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7261,21 +8577,21 @@ func (r V1ListAllBranchesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1ListAllBranchesResponse) StatusCode() int { +func (r CreateSigningKeyForProjectResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1CreateABranchResponse struct { +type DeleteSigningKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *BranchResponse + JSON200 *SigningKeyResponse } // Status returns HTTPResponse.Status -func (r V1CreateABranchResponse) Status() string { +func (r DeleteSigningKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7283,21 +8599,21 @@ func (r V1CreateABranchResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1CreateABranchResponse) StatusCode() int { +func (r DeleteSigningKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1GetAuthServiceConfigResponse struct { +type GetSigningKeyForProjectResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *AuthConfigResponse + JSON200 *SigningKeyResponse } // Status returns HTTPResponse.Status -func (r V1GetAuthServiceConfigResponse) Status() string { +func (r GetSigningKeyForProjectResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7305,21 +8621,21 @@ func (r V1GetAuthServiceConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1GetAuthServiceConfigResponse) StatusCode() int { +func (r GetSigningKeyForProjectResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1UpdateAuthServiceConfigResponse struct { +type PatchSigningKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *AuthConfigResponse + JSON200 *SigningKeyResponse } // Status returns HTTPResponse.Status -func (r V1UpdateAuthServiceConfigResponse) Status() string { +func (r PatchSigningKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7327,7 +8643,7 @@ func (r V1UpdateAuthServiceConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1UpdateAuthServiceConfigResponse) StatusCode() int { +func (r PatchSigningKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7554,14 +8870,14 @@ func (r V1GetProjectPgbouncerConfigResponse) StatusCode() int { return 0 } -type V1GetSupavisorConfigResponse struct { +type V1GetPoolerConfigResponse struct { Body []byte HTTPResponse *http.Response JSON200 *[]SupavisorConfigResponse } // Status returns HTTPResponse.Status -func (r V1GetSupavisorConfigResponse) Status() string { +func (r V1GetPoolerConfigResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7569,21 +8885,21 @@ func (r V1GetSupavisorConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1GetSupavisorConfigResponse) StatusCode() int { +func (r V1GetPoolerConfigResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1UpdateSupavisorConfigResponse struct { +type V1UpdatePoolerConfigResponse struct { Body []byte HTTPResponse *http.Response JSON200 *UpdateSupavisorConfigResponse } // Status returns HTTPResponse.Status -func (r V1UpdateSupavisorConfigResponse) Status() string { +func (r V1UpdatePoolerConfigResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7591,7 +8907,7 @@ func (r V1UpdateSupavisorConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1UpdateSupavisorConfigResponse) StatusCode() int { +func (r V1UpdatePoolerConfigResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -7840,7 +9156,7 @@ func (r V1RestorePitrBackupResponse) StatusCode() int { type GetDatabaseMetadataResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *GetProjectDbMetadataResponseDto + JSON200 *GetProjectDbMetadataResponse } // Status returns HTTPResponse.Status @@ -7859,10 +9175,52 @@ func (r GetDatabaseMetadataResponse) StatusCode() int { return 0 } +type V1ListMigrationHistoryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *V1ListMigrationsResponse +} + +// Status returns HTTPResponse.Status +func (r V1ListMigrationHistoryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1ListMigrationHistoryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1ApplyAMigrationResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1ApplyAMigrationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1ApplyAMigrationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1RunAQueryResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *map[string]interface{} } // Status returns HTTPResponse.Status @@ -8058,6 +9416,7 @@ func (r V1UpdateAFunctionResponse) StatusCode() int { type V1GetAFunctionBodyResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *StreamableFile } // Status returns HTTPResponse.Status @@ -8141,6 +9500,28 @@ func (r V1ListAllNetworkBansResponse) StatusCode() int { return 0 } +type V1ListAllNetworkBansEnrichedResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *NetworkBanResponseEnriched +} + +// Status returns HTTPResponse.Status +func (r V1ListAllNetworkBansEnrichedResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1ListAllNetworkBansEnrichedResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1GetNetworkRestrictionsResponse struct { Body []byte HTTPResponse *http.Response @@ -8446,7 +9827,6 @@ func (r V1CancelAProjectRestorationResponse) StatusCode() int { type V1BulkDeleteSecretsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *map[string]interface{} } // Status returns HTTPResponse.Status @@ -8794,7 +10174,7 @@ func (r V1GetASnippetResponse) StatusCode() int { } // V1DeleteABranchWithResponse request returning *V1DeleteABranchResponse -func (c *ClientWithResponses) V1DeleteABranchWithResponse(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*V1DeleteABranchResponse, error) { +func (c *ClientWithResponses) V1DeleteABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1DeleteABranchResponse, error) { rsp, err := c.V1DeleteABranch(ctx, branchId, reqEditors...) if err != nil { return nil, err @@ -8803,7 +10183,7 @@ func (c *ClientWithResponses) V1DeleteABranchWithResponse(ctx context.Context, b } // V1GetABranchConfigWithResponse request returning *V1GetABranchConfigResponse -func (c *ClientWithResponses) V1GetABranchConfigWithResponse(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*V1GetABranchConfigResponse, error) { +func (c *ClientWithResponses) V1GetABranchConfigWithResponse(ctx context.Context, branchId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetABranchConfigResponse, error) { rsp, err := c.V1GetABranchConfig(ctx, branchId, reqEditors...) if err != nil { return nil, err @@ -8812,7 +10192,7 @@ func (c *ClientWithResponses) V1GetABranchConfigWithResponse(ctx context.Context } // V1UpdateABranchConfigWithBodyWithResponse request with arbitrary body returning *V1UpdateABranchConfigResponse -func (c *ClientWithResponses) V1UpdateABranchConfigWithBodyWithResponse(ctx context.Context, branchId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) { +func (c *ClientWithResponses) V1UpdateABranchConfigWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) { rsp, err := c.V1UpdateABranchConfigWithBody(ctx, branchId, contentType, body, reqEditors...) if err != nil { return nil, err @@ -8820,7 +10200,7 @@ func (c *ClientWithResponses) V1UpdateABranchConfigWithBodyWithResponse(ctx cont return ParseV1UpdateABranchConfigResponse(rsp) } -func (c *ClientWithResponses) V1UpdateABranchConfigWithResponse(ctx context.Context, branchId string, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) { +func (c *ClientWithResponses) V1UpdateABranchConfigWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) { rsp, err := c.V1UpdateABranchConfig(ctx, branchId, body, reqEditors...) if err != nil { return nil, err @@ -8828,18 +10208,51 @@ func (c *ClientWithResponses) V1UpdateABranchConfigWithResponse(ctx context.Cont return ParseV1UpdateABranchConfigResponse(rsp) } -// V1PushABranchWithResponse request returning *V1PushABranchResponse -func (c *ClientWithResponses) V1PushABranchWithResponse(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*V1PushABranchResponse, error) { - rsp, err := c.V1PushABranch(ctx, branchId, reqEditors...) +// V1MergeABranchWithBodyWithResponse request with arbitrary body returning *V1MergeABranchResponse +func (c *ClientWithResponses) V1MergeABranchWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1MergeABranchResponse, error) { + rsp, err := c.V1MergeABranchWithBody(ctx, branchId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1MergeABranchResponse(rsp) +} + +func (c *ClientWithResponses) V1MergeABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1MergeABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1MergeABranchResponse, error) { + rsp, err := c.V1MergeABranch(ctx, branchId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1MergeABranchResponse(rsp) +} + +// V1PushABranchWithBodyWithResponse request with arbitrary body returning *V1PushABranchResponse +func (c *ClientWithResponses) V1PushABranchWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1PushABranchResponse, error) { + rsp, err := c.V1PushABranchWithBody(ctx, branchId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseV1PushABranchResponse(rsp) } -// V1ResetABranchWithResponse request returning *V1ResetABranchResponse -func (c *ClientWithResponses) V1ResetABranchWithResponse(ctx context.Context, branchId string, reqEditors ...RequestEditorFn) (*V1ResetABranchResponse, error) { - rsp, err := c.V1ResetABranch(ctx, branchId, reqEditors...) +func (c *ClientWithResponses) V1PushABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1PushABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1PushABranchResponse, error) { + rsp, err := c.V1PushABranch(ctx, branchId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1PushABranchResponse(rsp) +} + +// V1ResetABranchWithBodyWithResponse request with arbitrary body returning *V1ResetABranchResponse +func (c *ClientWithResponses) V1ResetABranchWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ResetABranchResponse, error) { + rsp, err := c.V1ResetABranchWithBody(ctx, branchId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ResetABranchResponse(rsp) +} + +func (c *ClientWithResponses) V1ResetABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1ResetABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ResetABranchResponse, error) { + rsp, err := c.V1ResetABranch(ctx, branchId, body, reqEditors...) if err != nil { return nil, err } @@ -8977,6 +10390,24 @@ func (c *ClientWithResponses) V1GetProjectWithResponse(ctx context.Context, ref return ParseV1GetProjectResponse(rsp) } +// GetPerformanceAdvisorsWithResponse request returning *GetPerformanceAdvisorsResponse +func (c *ClientWithResponses) GetPerformanceAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetPerformanceAdvisorsResponse, error) { + rsp, err := c.GetPerformanceAdvisors(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetPerformanceAdvisorsResponse(rsp) +} + +// GetSecurityAdvisorsWithResponse request returning *GetSecurityAdvisorsResponse +func (c *ClientWithResponses) GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetSecurityAdvisorsResponse, error) { + rsp, err := c.GetSecurityAdvisors(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSecurityAdvisorsResponse(rsp) +} + // GetLogsWithResponse request returning *GetLogsResponse func (c *ClientWithResponses) GetLogsWithResponse(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*GetLogsResponse, error) { rsp, err := c.GetLogs(ctx, ref, params, reqEditors...) @@ -8986,6 +10417,24 @@ func (c *ClientWithResponses) GetLogsWithResponse(ctx context.Context, ref strin return ParseGetLogsResponse(rsp) } +// GetApiCountsWithResponse request returning *GetApiCountsResponse +func (c *ClientWithResponses) GetApiCountsWithResponse(ctx context.Context, ref string, params *GetApiCountsParams, reqEditors ...RequestEditorFn) (*GetApiCountsResponse, error) { + rsp, err := c.GetApiCounts(ctx, ref, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiCountsResponse(rsp) +} + +// GetApiRequestsCountWithResponse request returning *GetApiRequestsCountResponse +func (c *ClientWithResponses) GetApiRequestsCountWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetApiRequestsCountResponse, error) { + rsp, err := c.GetApiRequestsCount(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiRequestsCountResponse(rsp) +} + // V1GetProjectApiKeysWithResponse request returning *V1GetProjectApiKeysResponse func (c *ClientWithResponses) V1GetProjectApiKeysWithResponse(ctx context.Context, ref string, params *V1GetProjectApiKeysParams, reqEditors ...RequestEditorFn) (*V1GetProjectApiKeysResponse, error) { rsp, err := c.V1GetProjectApiKeys(ctx, ref, params, reqEditors...) @@ -9001,50 +10450,85 @@ func (c *ClientWithResponses) CreateApiKeyWithBodyWithResponse(ctx context.Conte if err != nil { return nil, err } - return ParseCreateApiKeyResponse(rsp) + return ParseCreateApiKeyResponse(rsp) +} + +func (c *ClientWithResponses) CreateApiKeyWithResponse(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) { + rsp, err := c.CreateApiKey(ctx, ref, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateApiKeyResponse(rsp) +} + +// DeleteApiKeyWithResponse request returning *DeleteApiKeyResponse +func (c *ClientWithResponses) DeleteApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) { + rsp, err := c.DeleteApiKey(ctx, ref, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteApiKeyResponse(rsp) +} + +// GetApiKeyWithResponse request returning *GetApiKeyResponse +func (c *ClientWithResponses) GetApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*GetApiKeyResponse, error) { + rsp, err := c.GetApiKey(ctx, ref, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetApiKeyResponse(rsp) +} + +// UpdateApiKeyWithBodyWithResponse request with arbitrary body returning *UpdateApiKeyResponse +func (c *ClientWithResponses) UpdateApiKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) { + rsp, err := c.UpdateApiKeyWithBody(ctx, ref, id, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateApiKeyResponse(rsp) } -func (c *ClientWithResponses) CreateApiKeyWithResponse(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) { - rsp, err := c.CreateApiKey(ctx, ref, params, body, reqEditors...) +func (c *ClientWithResponses) UpdateApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) { + rsp, err := c.UpdateApiKey(ctx, ref, id, params, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateApiKeyResponse(rsp) + return ParseUpdateApiKeyResponse(rsp) } -// DeleteApiKeyWithResponse request returning *DeleteApiKeyResponse -func (c *ClientWithResponses) DeleteApiKeyWithResponse(ctx context.Context, ref string, id string, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) { - rsp, err := c.DeleteApiKey(ctx, ref, id, params, reqEditors...) +// V1ListProjectAddonsWithResponse request returning *V1ListProjectAddonsResponse +func (c *ClientWithResponses) V1ListProjectAddonsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListProjectAddonsResponse, error) { + rsp, err := c.V1ListProjectAddons(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseDeleteApiKeyResponse(rsp) + return ParseV1ListProjectAddonsResponse(rsp) } -// GetApiKeyWithResponse request returning *GetApiKeyResponse -func (c *ClientWithResponses) GetApiKeyWithResponse(ctx context.Context, ref string, id string, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*GetApiKeyResponse, error) { - rsp, err := c.GetApiKey(ctx, ref, id, params, reqEditors...) +// V1ApplyProjectAddonWithBodyWithResponse request with arbitrary body returning *V1ApplyProjectAddonResponse +func (c *ClientWithResponses) V1ApplyProjectAddonWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ApplyProjectAddonResponse, error) { + rsp, err := c.V1ApplyProjectAddonWithBody(ctx, ref, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetApiKeyResponse(rsp) + return ParseV1ApplyProjectAddonResponse(rsp) } -// UpdateApiKeyWithBodyWithResponse request with arbitrary body returning *UpdateApiKeyResponse -func (c *ClientWithResponses) UpdateApiKeyWithBodyWithResponse(ctx context.Context, ref string, id string, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) { - rsp, err := c.UpdateApiKeyWithBody(ctx, ref, id, params, contentType, body, reqEditors...) +func (c *ClientWithResponses) V1ApplyProjectAddonWithResponse(ctx context.Context, ref string, body V1ApplyProjectAddonJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ApplyProjectAddonResponse, error) { + rsp, err := c.V1ApplyProjectAddon(ctx, ref, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateApiKeyResponse(rsp) + return ParseV1ApplyProjectAddonResponse(rsp) } -func (c *ClientWithResponses) UpdateApiKeyWithResponse(ctx context.Context, ref string, id string, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) { - rsp, err := c.UpdateApiKey(ctx, ref, id, params, body, reqEditors...) +// V1RemoveProjectAddonWithResponse request returning *V1RemoveProjectAddonResponse +func (c *ClientWithResponses) V1RemoveProjectAddonWithResponse(ctx context.Context, ref string, addonVariant interface{}, reqEditors ...RequestEditorFn) (*V1RemoveProjectAddonResponse, error) { + rsp, err := c.V1RemoveProjectAddon(ctx, ref, addonVariant, reqEditors...) if err != nil { return nil, err } - return ParseUpdateApiKeyResponse(rsp) + return ParseV1RemoveProjectAddonResponse(rsp) } // V1DisablePreviewBranchingWithResponse request returning *V1DisablePreviewBranchingResponse @@ -9108,6 +10592,67 @@ func (c *ClientWithResponses) V1UpdateAuthServiceConfigWithResponse(ctx context. return ParseV1UpdateAuthServiceConfigResponse(rsp) } +// ListSigningKeysForProjectWithResponse request returning *ListSigningKeysForProjectResponse +func (c *ClientWithResponses) ListSigningKeysForProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListSigningKeysForProjectResponse, error) { + rsp, err := c.ListSigningKeysForProject(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseListSigningKeysForProjectResponse(rsp) +} + +// CreateSigningKeyForProjectWithBodyWithResponse request with arbitrary body returning *CreateSigningKeyForProjectResponse +func (c *ClientWithResponses) CreateSigningKeyForProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSigningKeyForProjectResponse, error) { + rsp, err := c.CreateSigningKeyForProjectWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSigningKeyForProjectResponse(rsp) +} + +func (c *ClientWithResponses) CreateSigningKeyForProjectWithResponse(ctx context.Context, ref string, body CreateSigningKeyForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSigningKeyForProjectResponse, error) { + rsp, err := c.CreateSigningKeyForProject(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateSigningKeyForProjectResponse(rsp) +} + +// DeleteSigningKeyWithResponse request returning *DeleteSigningKeyResponse +func (c *ClientWithResponses) DeleteSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteSigningKeyResponse, error) { + rsp, err := c.DeleteSigningKey(ctx, ref, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSigningKeyResponse(rsp) +} + +// GetSigningKeyForProjectWithResponse request returning *GetSigningKeyForProjectResponse +func (c *ClientWithResponses) GetSigningKeyForProjectWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetSigningKeyForProjectResponse, error) { + rsp, err := c.GetSigningKeyForProject(ctx, ref, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSigningKeyForProjectResponse(rsp) +} + +// PatchSigningKeyWithBodyWithResponse request with arbitrary body returning *PatchSigningKeyResponse +func (c *ClientWithResponses) PatchSigningKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchSigningKeyResponse, error) { + rsp, err := c.PatchSigningKeyWithBody(ctx, ref, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchSigningKeyResponse(rsp) +} + +func (c *ClientWithResponses) PatchSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchSigningKeyResponse, error) { + rsp, err := c.PatchSigningKey(ctx, ref, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePatchSigningKeyResponse(rsp) +} + // V1ListAllSsoProviderWithResponse request returning *V1ListAllSsoProviderResponse func (c *ClientWithResponses) V1ListAllSsoProviderWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllSsoProviderResponse, error) { rsp, err := c.V1ListAllSsoProvider(ctx, ref, reqEditors...) @@ -9135,7 +10680,7 @@ func (c *ClientWithResponses) V1CreateASsoProviderWithResponse(ctx context.Conte } // V1DeleteASsoProviderWithResponse request returning *V1DeleteASsoProviderResponse -func (c *ClientWithResponses) V1DeleteASsoProviderWithResponse(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*V1DeleteASsoProviderResponse, error) { +func (c *ClientWithResponses) V1DeleteASsoProviderWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1DeleteASsoProviderResponse, error) { rsp, err := c.V1DeleteASsoProvider(ctx, ref, providerId, reqEditors...) if err != nil { return nil, err @@ -9144,7 +10689,7 @@ func (c *ClientWithResponses) V1DeleteASsoProviderWithResponse(ctx context.Conte } // V1GetASsoProviderWithResponse request returning *V1GetASsoProviderResponse -func (c *ClientWithResponses) V1GetASsoProviderWithResponse(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*V1GetASsoProviderResponse, error) { +func (c *ClientWithResponses) V1GetASsoProviderWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetASsoProviderResponse, error) { rsp, err := c.V1GetASsoProvider(ctx, ref, providerId, reqEditors...) if err != nil { return nil, err @@ -9153,7 +10698,7 @@ func (c *ClientWithResponses) V1GetASsoProviderWithResponse(ctx context.Context, } // V1UpdateASsoProviderWithBodyWithResponse request with arbitrary body returning *V1UpdateASsoProviderResponse -func (c *ClientWithResponses) V1UpdateASsoProviderWithBodyWithResponse(ctx context.Context, ref string, providerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) { +func (c *ClientWithResponses) V1UpdateASsoProviderWithBodyWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) { rsp, err := c.V1UpdateASsoProviderWithBody(ctx, ref, providerId, contentType, body, reqEditors...) if err != nil { return nil, err @@ -9161,7 +10706,7 @@ func (c *ClientWithResponses) V1UpdateASsoProviderWithBodyWithResponse(ctx conte return ParseV1UpdateASsoProviderResponse(rsp) } -func (c *ClientWithResponses) V1UpdateASsoProviderWithResponse(ctx context.Context, ref string, providerId string, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) { +func (c *ClientWithResponses) V1UpdateASsoProviderWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) { rsp, err := c.V1UpdateASsoProvider(ctx, ref, providerId, body, reqEditors...) if err != nil { return nil, err @@ -9196,7 +10741,7 @@ func (c *ClientWithResponses) CreateTPAForProjectWithResponse(ctx context.Contex } // DeleteTPAForProjectWithResponse request returning *DeleteTPAForProjectResponse -func (c *ClientWithResponses) DeleteTPAForProjectWithResponse(ctx context.Context, ref string, tpaId string, reqEditors ...RequestEditorFn) (*DeleteTPAForProjectResponse, error) { +func (c *ClientWithResponses) DeleteTPAForProjectWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteTPAForProjectResponse, error) { rsp, err := c.DeleteTPAForProject(ctx, ref, tpaId, reqEditors...) if err != nil { return nil, err @@ -9205,7 +10750,7 @@ func (c *ClientWithResponses) DeleteTPAForProjectWithResponse(ctx context.Contex } // GetTPAForProjectWithResponse request returning *GetTPAForProjectResponse -func (c *ClientWithResponses) GetTPAForProjectWithResponse(ctx context.Context, ref string, tpaId string, reqEditors ...RequestEditorFn) (*GetTPAForProjectResponse, error) { +func (c *ClientWithResponses) GetTPAForProjectWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTPAForProjectResponse, error) { rsp, err := c.GetTPAForProject(ctx, ref, tpaId, reqEditors...) if err != nil { return nil, err @@ -9222,30 +10767,30 @@ func (c *ClientWithResponses) V1GetProjectPgbouncerConfigWithResponse(ctx contex return ParseV1GetProjectPgbouncerConfigResponse(rsp) } -// V1GetSupavisorConfigWithResponse request returning *V1GetSupavisorConfigResponse -func (c *ClientWithResponses) V1GetSupavisorConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetSupavisorConfigResponse, error) { - rsp, err := c.V1GetSupavisorConfig(ctx, ref, reqEditors...) +// V1GetPoolerConfigWithResponse request returning *V1GetPoolerConfigResponse +func (c *ClientWithResponses) V1GetPoolerConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPoolerConfigResponse, error) { + rsp, err := c.V1GetPoolerConfig(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseV1GetSupavisorConfigResponse(rsp) + return ParseV1GetPoolerConfigResponse(rsp) } -// V1UpdateSupavisorConfigWithBodyWithResponse request with arbitrary body returning *V1UpdateSupavisorConfigResponse -func (c *ClientWithResponses) V1UpdateSupavisorConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateSupavisorConfigResponse, error) { - rsp, err := c.V1UpdateSupavisorConfigWithBody(ctx, ref, contentType, body, reqEditors...) +// V1UpdatePoolerConfigWithBodyWithResponse request with arbitrary body returning *V1UpdatePoolerConfigResponse +func (c *ClientWithResponses) V1UpdatePoolerConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdatePoolerConfigResponse, error) { + rsp, err := c.V1UpdatePoolerConfigWithBody(ctx, ref, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseV1UpdateSupavisorConfigResponse(rsp) + return ParseV1UpdatePoolerConfigResponse(rsp) } -func (c *ClientWithResponses) V1UpdateSupavisorConfigWithResponse(ctx context.Context, ref string, body V1UpdateSupavisorConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateSupavisorConfigResponse, error) { - rsp, err := c.V1UpdateSupavisorConfig(ctx, ref, body, reqEditors...) +func (c *ClientWithResponses) V1UpdatePoolerConfigWithResponse(ctx context.Context, ref string, body V1UpdatePoolerConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdatePoolerConfigResponse, error) { + rsp, err := c.V1UpdatePoolerConfig(ctx, ref, body, reqEditors...) if err != nil { return nil, err } - return ParseV1UpdateSupavisorConfigResponse(rsp) + return ParseV1UpdatePoolerConfigResponse(rsp) } // V1GetPostgresConfigWithResponse request returning *V1GetPostgresConfigResponse @@ -9388,6 +10933,32 @@ func (c *ClientWithResponses) GetDatabaseMetadataWithResponse(ctx context.Contex return ParseGetDatabaseMetadataResponse(rsp) } +// V1ListMigrationHistoryWithResponse request returning *V1ListMigrationHistoryResponse +func (c *ClientWithResponses) V1ListMigrationHistoryWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListMigrationHistoryResponse, error) { + rsp, err := c.V1ListMigrationHistory(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ListMigrationHistoryResponse(rsp) +} + +// V1ApplyAMigrationWithBodyWithResponse request with arbitrary body returning *V1ApplyAMigrationResponse +func (c *ClientWithResponses) V1ApplyAMigrationWithBodyWithResponse(ctx context.Context, ref string, params *V1ApplyAMigrationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ApplyAMigrationResponse, error) { + rsp, err := c.V1ApplyAMigrationWithBody(ctx, ref, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ApplyAMigrationResponse(rsp) +} + +func (c *ClientWithResponses) V1ApplyAMigrationWithResponse(ctx context.Context, ref string, params *V1ApplyAMigrationParams, body V1ApplyAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ApplyAMigrationResponse, error) { + rsp, err := c.V1ApplyAMigration(ctx, ref, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ApplyAMigrationResponse(rsp) +} + // V1RunAQueryWithBodyWithResponse request with arbitrary body returning *V1RunAQueryResponse func (c *ClientWithResponses) V1RunAQueryWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RunAQueryResponse, error) { rsp, err := c.V1RunAQueryWithBody(ctx, ref, contentType, body, reqEditors...) @@ -9432,14 +11003,6 @@ func (c *ClientWithResponses) V1CreateAFunctionWithBodyWithResponse(ctx context. return ParseV1CreateAFunctionResponse(rsp) } -func (c *ClientWithResponses) V1CreateAFunctionWithResponse(ctx context.Context, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateAFunctionResponse, error) { - rsp, err := c.V1CreateAFunction(ctx, ref, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseV1CreateAFunctionResponse(rsp) -} - // V1BulkUpdateFunctionsWithBodyWithResponse request with arbitrary body returning *V1BulkUpdateFunctionsResponse func (c *ClientWithResponses) V1BulkUpdateFunctionsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkUpdateFunctionsResponse, error) { rsp, err := c.V1BulkUpdateFunctionsWithBody(ctx, ref, contentType, body, reqEditors...) @@ -9545,6 +11108,15 @@ func (c *ClientWithResponses) V1ListAllNetworkBansWithResponse(ctx context.Conte return ParseV1ListAllNetworkBansResponse(rsp) } +// V1ListAllNetworkBansEnrichedWithResponse request returning *V1ListAllNetworkBansEnrichedResponse +func (c *ClientWithResponses) V1ListAllNetworkBansEnrichedWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllNetworkBansEnrichedResponse, error) { + rsp, err := c.V1ListAllNetworkBansEnriched(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ListAllNetworkBansEnrichedResponse(rsp) +} + // V1GetNetworkRestrictionsWithResponse request returning *V1GetNetworkRestrictionsResponse func (c *ClientWithResponses) V1GetNetworkRestrictionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetNetworkRestrictionsResponse, error) { rsp, err := c.V1GetNetworkRestrictions(ctx, ref, reqEditors...) @@ -9603,330 +11175,640 @@ func (c *ClientWithResponses) V1UpdatePgsodiumConfigWithResponse(ctx context.Con if err != nil { return nil, err } - return ParseV1UpdatePgsodiumConfigResponse(rsp) + return ParseV1UpdatePgsodiumConfigResponse(rsp) +} + +// V1GetPostgrestServiceConfigWithResponse request returning *V1GetPostgrestServiceConfigResponse +func (c *ClientWithResponses) V1GetPostgrestServiceConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPostgrestServiceConfigResponse, error) { + rsp, err := c.V1GetPostgrestServiceConfig(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetPostgrestServiceConfigResponse(rsp) +} + +// V1UpdatePostgrestServiceConfigWithBodyWithResponse request with arbitrary body returning *V1UpdatePostgrestServiceConfigResponse +func (c *ClientWithResponses) V1UpdatePostgrestServiceConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdatePostgrestServiceConfigResponse, error) { + rsp, err := c.V1UpdatePostgrestServiceConfigWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdatePostgrestServiceConfigResponse(rsp) +} + +func (c *ClientWithResponses) V1UpdatePostgrestServiceConfigWithResponse(ctx context.Context, ref string, body V1UpdatePostgrestServiceConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdatePostgrestServiceConfigResponse, error) { + rsp, err := c.V1UpdatePostgrestServiceConfig(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdatePostgrestServiceConfigResponse(rsp) +} + +// V1RemoveAReadReplicaWithBodyWithResponse request with arbitrary body returning *V1RemoveAReadReplicaResponse +func (c *ClientWithResponses) V1RemoveAReadReplicaWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RemoveAReadReplicaResponse, error) { + rsp, err := c.V1RemoveAReadReplicaWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1RemoveAReadReplicaResponse(rsp) +} + +func (c *ClientWithResponses) V1RemoveAReadReplicaWithResponse(ctx context.Context, ref string, body V1RemoveAReadReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*V1RemoveAReadReplicaResponse, error) { + rsp, err := c.V1RemoveAReadReplica(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1RemoveAReadReplicaResponse(rsp) +} + +// V1SetupAReadReplicaWithBodyWithResponse request with arbitrary body returning *V1SetupAReadReplicaResponse +func (c *ClientWithResponses) V1SetupAReadReplicaWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1SetupAReadReplicaResponse, error) { + rsp, err := c.V1SetupAReadReplicaWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1SetupAReadReplicaResponse(rsp) +} + +func (c *ClientWithResponses) V1SetupAReadReplicaWithResponse(ctx context.Context, ref string, body V1SetupAReadReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*V1SetupAReadReplicaResponse, error) { + rsp, err := c.V1SetupAReadReplica(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1SetupAReadReplicaResponse(rsp) +} + +// V1GetReadonlyModeStatusWithResponse request returning *V1GetReadonlyModeStatusResponse +func (c *ClientWithResponses) V1GetReadonlyModeStatusWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetReadonlyModeStatusResponse, error) { + rsp, err := c.V1GetReadonlyModeStatus(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetReadonlyModeStatusResponse(rsp) +} + +// V1DisableReadonlyModeTemporarilyWithResponse request returning *V1DisableReadonlyModeTemporarilyResponse +func (c *ClientWithResponses) V1DisableReadonlyModeTemporarilyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DisableReadonlyModeTemporarilyResponse, error) { + rsp, err := c.V1DisableReadonlyModeTemporarily(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1DisableReadonlyModeTemporarilyResponse(rsp) +} + +// V1ListAvailableRestoreVersionsWithResponse request returning *V1ListAvailableRestoreVersionsResponse +func (c *ClientWithResponses) V1ListAvailableRestoreVersionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAvailableRestoreVersionsResponse, error) { + rsp, err := c.V1ListAvailableRestoreVersions(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ListAvailableRestoreVersionsResponse(rsp) +} + +// V1RestoreAProjectWithResponse request returning *V1RestoreAProjectResponse +func (c *ClientWithResponses) V1RestoreAProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1RestoreAProjectResponse, error) { + rsp, err := c.V1RestoreAProject(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1RestoreAProjectResponse(rsp) +} + +// V1CancelAProjectRestorationWithResponse request returning *V1CancelAProjectRestorationResponse +func (c *ClientWithResponses) V1CancelAProjectRestorationWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CancelAProjectRestorationResponse, error) { + rsp, err := c.V1CancelAProjectRestoration(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1CancelAProjectRestorationResponse(rsp) +} + +// V1BulkDeleteSecretsWithBodyWithResponse request with arbitrary body returning *V1BulkDeleteSecretsResponse +func (c *ClientWithResponses) V1BulkDeleteSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkDeleteSecretsResponse, error) { + rsp, err := c.V1BulkDeleteSecretsWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1BulkDeleteSecretsResponse(rsp) +} + +func (c *ClientWithResponses) V1BulkDeleteSecretsWithResponse(ctx context.Context, ref string, body V1BulkDeleteSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*V1BulkDeleteSecretsResponse, error) { + rsp, err := c.V1BulkDeleteSecrets(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1BulkDeleteSecretsResponse(rsp) +} + +// V1ListAllSecretsWithResponse request returning *V1ListAllSecretsResponse +func (c *ClientWithResponses) V1ListAllSecretsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllSecretsResponse, error) { + rsp, err := c.V1ListAllSecrets(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ListAllSecretsResponse(rsp) +} + +// V1BulkCreateSecretsWithBodyWithResponse request with arbitrary body returning *V1BulkCreateSecretsResponse +func (c *ClientWithResponses) V1BulkCreateSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkCreateSecretsResponse, error) { + rsp, err := c.V1BulkCreateSecretsWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1BulkCreateSecretsResponse(rsp) +} + +func (c *ClientWithResponses) V1BulkCreateSecretsWithResponse(ctx context.Context, ref string, body V1BulkCreateSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*V1BulkCreateSecretsResponse, error) { + rsp, err := c.V1BulkCreateSecrets(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1BulkCreateSecretsResponse(rsp) +} + +// V1GetSslEnforcementConfigWithResponse request returning *V1GetSslEnforcementConfigResponse +func (c *ClientWithResponses) V1GetSslEnforcementConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetSslEnforcementConfigResponse, error) { + rsp, err := c.V1GetSslEnforcementConfig(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetSslEnforcementConfigResponse(rsp) +} + +// V1UpdateSslEnforcementConfigWithBodyWithResponse request with arbitrary body returning *V1UpdateSslEnforcementConfigResponse +func (c *ClientWithResponses) V1UpdateSslEnforcementConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateSslEnforcementConfigResponse, error) { + rsp, err := c.V1UpdateSslEnforcementConfigWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdateSslEnforcementConfigResponse(rsp) +} + +func (c *ClientWithResponses) V1UpdateSslEnforcementConfigWithResponse(ctx context.Context, ref string, body V1UpdateSslEnforcementConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateSslEnforcementConfigResponse, error) { + rsp, err := c.V1UpdateSslEnforcementConfig(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdateSslEnforcementConfigResponse(rsp) +} + +// V1ListAllBucketsWithResponse request returning *V1ListAllBucketsResponse +func (c *ClientWithResponses) V1ListAllBucketsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllBucketsResponse, error) { + rsp, err := c.V1ListAllBuckets(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ListAllBucketsResponse(rsp) } -// V1GetPostgrestServiceConfigWithResponse request returning *V1GetPostgrestServiceConfigResponse -func (c *ClientWithResponses) V1GetPostgrestServiceConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPostgrestServiceConfigResponse, error) { - rsp, err := c.V1GetPostgrestServiceConfig(ctx, ref, reqEditors...) +// V1GenerateTypescriptTypesWithResponse request returning *V1GenerateTypescriptTypesResponse +func (c *ClientWithResponses) V1GenerateTypescriptTypesWithResponse(ctx context.Context, ref string, params *V1GenerateTypescriptTypesParams, reqEditors ...RequestEditorFn) (*V1GenerateTypescriptTypesResponse, error) { + rsp, err := c.V1GenerateTypescriptTypes(ctx, ref, params, reqEditors...) if err != nil { return nil, err } - return ParseV1GetPostgrestServiceConfigResponse(rsp) + return ParseV1GenerateTypescriptTypesResponse(rsp) } -// V1UpdatePostgrestServiceConfigWithBodyWithResponse request with arbitrary body returning *V1UpdatePostgrestServiceConfigResponse -func (c *ClientWithResponses) V1UpdatePostgrestServiceConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdatePostgrestServiceConfigResponse, error) { - rsp, err := c.V1UpdatePostgrestServiceConfigWithBody(ctx, ref, contentType, body, reqEditors...) +// V1UpgradePostgresVersionWithBodyWithResponse request with arbitrary body returning *V1UpgradePostgresVersionResponse +func (c *ClientWithResponses) V1UpgradePostgresVersionWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpgradePostgresVersionResponse, error) { + rsp, err := c.V1UpgradePostgresVersionWithBody(ctx, ref, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseV1UpdatePostgrestServiceConfigResponse(rsp) + return ParseV1UpgradePostgresVersionResponse(rsp) } -func (c *ClientWithResponses) V1UpdatePostgrestServiceConfigWithResponse(ctx context.Context, ref string, body V1UpdatePostgrestServiceConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdatePostgrestServiceConfigResponse, error) { - rsp, err := c.V1UpdatePostgrestServiceConfig(ctx, ref, body, reqEditors...) +func (c *ClientWithResponses) V1UpgradePostgresVersionWithResponse(ctx context.Context, ref string, body V1UpgradePostgresVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpgradePostgresVersionResponse, error) { + rsp, err := c.V1UpgradePostgresVersion(ctx, ref, body, reqEditors...) if err != nil { return nil, err } - return ParseV1UpdatePostgrestServiceConfigResponse(rsp) + return ParseV1UpgradePostgresVersionResponse(rsp) } -// V1RemoveAReadReplicaWithBodyWithResponse request with arbitrary body returning *V1RemoveAReadReplicaResponse -func (c *ClientWithResponses) V1RemoveAReadReplicaWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RemoveAReadReplicaResponse, error) { - rsp, err := c.V1RemoveAReadReplicaWithBody(ctx, ref, contentType, body, reqEditors...) +// V1GetPostgresUpgradeEligibilityWithResponse request returning *V1GetPostgresUpgradeEligibilityResponse +func (c *ClientWithResponses) V1GetPostgresUpgradeEligibilityWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPostgresUpgradeEligibilityResponse, error) { + rsp, err := c.V1GetPostgresUpgradeEligibility(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseV1RemoveAReadReplicaResponse(rsp) + return ParseV1GetPostgresUpgradeEligibilityResponse(rsp) } -func (c *ClientWithResponses) V1RemoveAReadReplicaWithResponse(ctx context.Context, ref string, body V1RemoveAReadReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*V1RemoveAReadReplicaResponse, error) { - rsp, err := c.V1RemoveAReadReplica(ctx, ref, body, reqEditors...) +// V1GetPostgresUpgradeStatusWithResponse request returning *V1GetPostgresUpgradeStatusResponse +func (c *ClientWithResponses) V1GetPostgresUpgradeStatusWithResponse(ctx context.Context, ref string, params *V1GetPostgresUpgradeStatusParams, reqEditors ...RequestEditorFn) (*V1GetPostgresUpgradeStatusResponse, error) { + rsp, err := c.V1GetPostgresUpgradeStatus(ctx, ref, params, reqEditors...) if err != nil { return nil, err } - return ParseV1RemoveAReadReplicaResponse(rsp) + return ParseV1GetPostgresUpgradeStatusResponse(rsp) } -// V1SetupAReadReplicaWithBodyWithResponse request with arbitrary body returning *V1SetupAReadReplicaResponse -func (c *ClientWithResponses) V1SetupAReadReplicaWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1SetupAReadReplicaResponse, error) { - rsp, err := c.V1SetupAReadReplicaWithBody(ctx, ref, contentType, body, reqEditors...) +// V1DeactivateVanitySubdomainConfigWithResponse request returning *V1DeactivateVanitySubdomainConfigResponse +func (c *ClientWithResponses) V1DeactivateVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeactivateVanitySubdomainConfigResponse, error) { + rsp, err := c.V1DeactivateVanitySubdomainConfig(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseV1SetupAReadReplicaResponse(rsp) + return ParseV1DeactivateVanitySubdomainConfigResponse(rsp) } -func (c *ClientWithResponses) V1SetupAReadReplicaWithResponse(ctx context.Context, ref string, body V1SetupAReadReplicaJSONRequestBody, reqEditors ...RequestEditorFn) (*V1SetupAReadReplicaResponse, error) { - rsp, err := c.V1SetupAReadReplica(ctx, ref, body, reqEditors...) +// V1GetVanitySubdomainConfigWithResponse request returning *V1GetVanitySubdomainConfigResponse +func (c *ClientWithResponses) V1GetVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetVanitySubdomainConfigResponse, error) { + rsp, err := c.V1GetVanitySubdomainConfig(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseV1SetupAReadReplicaResponse(rsp) + return ParseV1GetVanitySubdomainConfigResponse(rsp) } -// V1GetReadonlyModeStatusWithResponse request returning *V1GetReadonlyModeStatusResponse -func (c *ClientWithResponses) V1GetReadonlyModeStatusWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetReadonlyModeStatusResponse, error) { - rsp, err := c.V1GetReadonlyModeStatus(ctx, ref, reqEditors...) +// V1ActivateVanitySubdomainConfigWithBodyWithResponse request with arbitrary body returning *V1ActivateVanitySubdomainConfigResponse +func (c *ClientWithResponses) V1ActivateVanitySubdomainConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ActivateVanitySubdomainConfigResponse, error) { + rsp, err := c.V1ActivateVanitySubdomainConfigWithBody(ctx, ref, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseV1GetReadonlyModeStatusResponse(rsp) + return ParseV1ActivateVanitySubdomainConfigResponse(rsp) } -// V1DisableReadonlyModeTemporarilyWithResponse request returning *V1DisableReadonlyModeTemporarilyResponse -func (c *ClientWithResponses) V1DisableReadonlyModeTemporarilyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DisableReadonlyModeTemporarilyResponse, error) { - rsp, err := c.V1DisableReadonlyModeTemporarily(ctx, ref, reqEditors...) +func (c *ClientWithResponses) V1ActivateVanitySubdomainConfigWithResponse(ctx context.Context, ref string, body V1ActivateVanitySubdomainConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ActivateVanitySubdomainConfigResponse, error) { + rsp, err := c.V1ActivateVanitySubdomainConfig(ctx, ref, body, reqEditors...) if err != nil { return nil, err } - return ParseV1DisableReadonlyModeTemporarilyResponse(rsp) + return ParseV1ActivateVanitySubdomainConfigResponse(rsp) } -// V1ListAvailableRestoreVersionsWithResponse request returning *V1ListAvailableRestoreVersionsResponse -func (c *ClientWithResponses) V1ListAvailableRestoreVersionsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAvailableRestoreVersionsResponse, error) { - rsp, err := c.V1ListAvailableRestoreVersions(ctx, ref, reqEditors...) +// V1CheckVanitySubdomainAvailabilityWithBodyWithResponse request with arbitrary body returning *V1CheckVanitySubdomainAvailabilityResponse +func (c *ClientWithResponses) V1CheckVanitySubdomainAvailabilityWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CheckVanitySubdomainAvailabilityResponse, error) { + rsp, err := c.V1CheckVanitySubdomainAvailabilityWithBody(ctx, ref, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseV1ListAvailableRestoreVersionsResponse(rsp) + return ParseV1CheckVanitySubdomainAvailabilityResponse(rsp) } -// V1RestoreAProjectWithBodyWithResponse request with arbitrary body returning *V1RestoreAProjectResponse -func (c *ClientWithResponses) V1RestoreAProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RestoreAProjectResponse, error) { - rsp, err := c.V1RestoreAProjectWithBody(ctx, ref, contentType, body, reqEditors...) +func (c *ClientWithResponses) V1CheckVanitySubdomainAvailabilityWithResponse(ctx context.Context, ref string, body V1CheckVanitySubdomainAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CheckVanitySubdomainAvailabilityResponse, error) { + rsp, err := c.V1CheckVanitySubdomainAvailability(ctx, ref, body, reqEditors...) if err != nil { return nil, err } - return ParseV1RestoreAProjectResponse(rsp) + return ParseV1CheckVanitySubdomainAvailabilityResponse(rsp) } -func (c *ClientWithResponses) V1RestoreAProjectWithResponse(ctx context.Context, ref string, body V1RestoreAProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*V1RestoreAProjectResponse, error) { - rsp, err := c.V1RestoreAProject(ctx, ref, body, reqEditors...) +// V1ListAllSnippetsWithResponse request returning *V1ListAllSnippetsResponse +func (c *ClientWithResponses) V1ListAllSnippetsWithResponse(ctx context.Context, params *V1ListAllSnippetsParams, reqEditors ...RequestEditorFn) (*V1ListAllSnippetsResponse, error) { + rsp, err := c.V1ListAllSnippets(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseV1RestoreAProjectResponse(rsp) + return ParseV1ListAllSnippetsResponse(rsp) } -// V1CancelAProjectRestorationWithResponse request returning *V1CancelAProjectRestorationResponse -func (c *ClientWithResponses) V1CancelAProjectRestorationWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CancelAProjectRestorationResponse, error) { - rsp, err := c.V1CancelAProjectRestoration(ctx, ref, reqEditors...) +// V1GetASnippetWithResponse request returning *V1GetASnippetResponse +func (c *ClientWithResponses) V1GetASnippetWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetASnippetResponse, error) { + rsp, err := c.V1GetASnippet(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseV1CancelAProjectRestorationResponse(rsp) + return ParseV1GetASnippetResponse(rsp) } -// V1BulkDeleteSecretsWithBodyWithResponse request with arbitrary body returning *V1BulkDeleteSecretsResponse -func (c *ClientWithResponses) V1BulkDeleteSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkDeleteSecretsResponse, error) { - rsp, err := c.V1BulkDeleteSecretsWithBody(ctx, ref, contentType, body, reqEditors...) +// ParseV1DeleteABranchResponse parses an HTTP response from a V1DeleteABranchWithResponse call +func ParseV1DeleteABranchResponse(rsp *http.Response) (*V1DeleteABranchResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1BulkDeleteSecretsResponse(rsp) + + response := &V1DeleteABranchResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BranchDeleteResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) V1BulkDeleteSecretsWithResponse(ctx context.Context, ref string, body V1BulkDeleteSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*V1BulkDeleteSecretsResponse, error) { - rsp, err := c.V1BulkDeleteSecrets(ctx, ref, body, reqEditors...) +// ParseV1GetABranchConfigResponse parses an HTTP response from a V1GetABranchConfigWithResponse call +func ParseV1GetABranchConfigResponse(rsp *http.Response) (*V1GetABranchConfigResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1BulkDeleteSecretsResponse(rsp) + + response := &V1GetABranchConfigResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BranchDetailResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// V1ListAllSecretsWithResponse request returning *V1ListAllSecretsResponse -func (c *ClientWithResponses) V1ListAllSecretsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllSecretsResponse, error) { - rsp, err := c.V1ListAllSecrets(ctx, ref, reqEditors...) +// ParseV1UpdateABranchConfigResponse parses an HTTP response from a V1UpdateABranchConfigWithResponse call +func ParseV1UpdateABranchConfigResponse(rsp *http.Response) (*V1UpdateABranchConfigResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1ListAllSecretsResponse(rsp) + + response := &V1UpdateABranchConfigResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BranchResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// V1BulkCreateSecretsWithBodyWithResponse request with arbitrary body returning *V1BulkCreateSecretsResponse -func (c *ClientWithResponses) V1BulkCreateSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkCreateSecretsResponse, error) { - rsp, err := c.V1BulkCreateSecretsWithBody(ctx, ref, contentType, body, reqEditors...) +// ParseV1MergeABranchResponse parses an HTTP response from a V1MergeABranchWithResponse call +func ParseV1MergeABranchResponse(rsp *http.Response) (*V1MergeABranchResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1BulkCreateSecretsResponse(rsp) + + response := &V1MergeABranchResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest BranchUpdateResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) V1BulkCreateSecretsWithResponse(ctx context.Context, ref string, body V1BulkCreateSecretsJSONRequestBody, reqEditors ...RequestEditorFn) (*V1BulkCreateSecretsResponse, error) { - rsp, err := c.V1BulkCreateSecrets(ctx, ref, body, reqEditors...) +// ParseV1PushABranchResponse parses an HTTP response from a V1PushABranchWithResponse call +func ParseV1PushABranchResponse(rsp *http.Response) (*V1PushABranchResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1BulkCreateSecretsResponse(rsp) + + response := &V1PushABranchResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest BranchUpdateResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil } -// V1GetSslEnforcementConfigWithResponse request returning *V1GetSslEnforcementConfigResponse -func (c *ClientWithResponses) V1GetSslEnforcementConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetSslEnforcementConfigResponse, error) { - rsp, err := c.V1GetSslEnforcementConfig(ctx, ref, reqEditors...) +// ParseV1ResetABranchResponse parses an HTTP response from a V1ResetABranchWithResponse call +func ParseV1ResetABranchResponse(rsp *http.Response) (*V1ResetABranchResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1GetSslEnforcementConfigResponse(rsp) + + response := &V1ResetABranchResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest BranchUpdateResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil } -// V1UpdateSslEnforcementConfigWithBodyWithResponse request with arbitrary body returning *V1UpdateSslEnforcementConfigResponse -func (c *ClientWithResponses) V1UpdateSslEnforcementConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateSslEnforcementConfigResponse, error) { - rsp, err := c.V1UpdateSslEnforcementConfigWithBody(ctx, ref, contentType, body, reqEditors...) +// ParseV1AuthorizeUserResponse parses an HTTP response from a V1AuthorizeUserWithResponse call +func ParseV1AuthorizeUserResponse(rsp *http.Response) (*V1AuthorizeUserResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1UpdateSslEnforcementConfigResponse(rsp) + + response := &V1AuthorizeUserResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil } -func (c *ClientWithResponses) V1UpdateSslEnforcementConfigWithResponse(ctx context.Context, ref string, body V1UpdateSslEnforcementConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateSslEnforcementConfigResponse, error) { - rsp, err := c.V1UpdateSslEnforcementConfig(ctx, ref, body, reqEditors...) +// ParseV1RevokeTokenResponse parses an HTTP response from a V1RevokeTokenWithResponse call +func ParseV1RevokeTokenResponse(rsp *http.Response) (*V1RevokeTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1UpdateSslEnforcementConfigResponse(rsp) -} -// V1ListAllBucketsWithResponse request returning *V1ListAllBucketsResponse -func (c *ClientWithResponses) V1ListAllBucketsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllBucketsResponse, error) { - rsp, err := c.V1ListAllBuckets(ctx, ref, reqEditors...) - if err != nil { - return nil, err + response := &V1RevokeTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseV1ListAllBucketsResponse(rsp) + + return response, nil } -// V1GenerateTypescriptTypesWithResponse request returning *V1GenerateTypescriptTypesResponse -func (c *ClientWithResponses) V1GenerateTypescriptTypesWithResponse(ctx context.Context, ref string, params *V1GenerateTypescriptTypesParams, reqEditors ...RequestEditorFn) (*V1GenerateTypescriptTypesResponse, error) { - rsp, err := c.V1GenerateTypescriptTypes(ctx, ref, params, reqEditors...) +// ParseV1ExchangeOauthTokenResponse parses an HTTP response from a V1ExchangeOauthTokenWithResponse call +func ParseV1ExchangeOauthTokenResponse(rsp *http.Response) (*V1ExchangeOauthTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1GenerateTypescriptTypesResponse(rsp) -} -// V1UpgradePostgresVersionWithBodyWithResponse request with arbitrary body returning *V1UpgradePostgresVersionResponse -func (c *ClientWithResponses) V1UpgradePostgresVersionWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpgradePostgresVersionResponse, error) { - rsp, err := c.V1UpgradePostgresVersionWithBody(ctx, ref, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &V1ExchangeOauthTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseV1UpgradePostgresVersionResponse(rsp) -} -func (c *ClientWithResponses) V1UpgradePostgresVersionWithResponse(ctx context.Context, ref string, body V1UpgradePostgresVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpgradePostgresVersionResponse, error) { - rsp, err := c.V1UpgradePostgresVersion(ctx, ref, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest OAuthTokenResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + } - return ParseV1UpgradePostgresVersionResponse(rsp) + + return response, nil } -// V1GetPostgresUpgradeEligibilityWithResponse request returning *V1GetPostgresUpgradeEligibilityResponse -func (c *ClientWithResponses) V1GetPostgresUpgradeEligibilityWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPostgresUpgradeEligibilityResponse, error) { - rsp, err := c.V1GetPostgresUpgradeEligibility(ctx, ref, reqEditors...) +// ParseV1ListAllOrganizationsResponse parses an HTTP response from a V1ListAllOrganizationsWithResponse call +func ParseV1ListAllOrganizationsResponse(rsp *http.Response) (*V1ListAllOrganizationsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1GetPostgresUpgradeEligibilityResponse(rsp) -} -// V1GetPostgresUpgradeStatusWithResponse request returning *V1GetPostgresUpgradeStatusResponse -func (c *ClientWithResponses) V1GetPostgresUpgradeStatusWithResponse(ctx context.Context, ref string, params *V1GetPostgresUpgradeStatusParams, reqEditors ...RequestEditorFn) (*V1GetPostgresUpgradeStatusResponse, error) { - rsp, err := c.V1GetPostgresUpgradeStatus(ctx, ref, params, reqEditors...) - if err != nil { - return nil, err + response := &V1ListAllOrganizationsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseV1GetPostgresUpgradeStatusResponse(rsp) -} -// V1DeactivateVanitySubdomainConfigWithResponse request returning *V1DeactivateVanitySubdomainConfigResponse -func (c *ClientWithResponses) V1DeactivateVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeactivateVanitySubdomainConfigResponse, error) { - rsp, err := c.V1DeactivateVanitySubdomainConfig(ctx, ref, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []OrganizationResponseV1 + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseV1DeactivateVanitySubdomainConfigResponse(rsp) + + return response, nil } -// V1GetVanitySubdomainConfigWithResponse request returning *V1GetVanitySubdomainConfigResponse -func (c *ClientWithResponses) V1GetVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetVanitySubdomainConfigResponse, error) { - rsp, err := c.V1GetVanitySubdomainConfig(ctx, ref, reqEditors...) +// ParseV1CreateAnOrganizationResponse parses an HTTP response from a V1CreateAnOrganizationWithResponse call +func ParseV1CreateAnOrganizationResponse(rsp *http.Response) (*V1CreateAnOrganizationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1GetVanitySubdomainConfigResponse(rsp) -} -// V1ActivateVanitySubdomainConfigWithBodyWithResponse request with arbitrary body returning *V1ActivateVanitySubdomainConfigResponse -func (c *ClientWithResponses) V1ActivateVanitySubdomainConfigWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1ActivateVanitySubdomainConfigResponse, error) { - rsp, err := c.V1ActivateVanitySubdomainConfigWithBody(ctx, ref, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &V1CreateAnOrganizationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseV1ActivateVanitySubdomainConfigResponse(rsp) -} -func (c *ClientWithResponses) V1ActivateVanitySubdomainConfigWithResponse(ctx context.Context, ref string, body V1ActivateVanitySubdomainConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ActivateVanitySubdomainConfigResponse, error) { - rsp, err := c.V1ActivateVanitySubdomainConfig(ctx, ref, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest OrganizationResponseV1 + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + } - return ParseV1ActivateVanitySubdomainConfigResponse(rsp) + + return response, nil } -// V1CheckVanitySubdomainAvailabilityWithBodyWithResponse request with arbitrary body returning *V1CheckVanitySubdomainAvailabilityResponse -func (c *ClientWithResponses) V1CheckVanitySubdomainAvailabilityWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CheckVanitySubdomainAvailabilityResponse, error) { - rsp, err := c.V1CheckVanitySubdomainAvailabilityWithBody(ctx, ref, contentType, body, reqEditors...) +// ParseV1GetAnOrganizationResponse parses an HTTP response from a V1GetAnOrganizationWithResponse call +func ParseV1GetAnOrganizationResponse(rsp *http.Response) (*V1GetAnOrganizationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1CheckVanitySubdomainAvailabilityResponse(rsp) -} -func (c *ClientWithResponses) V1CheckVanitySubdomainAvailabilityWithResponse(ctx context.Context, ref string, body V1CheckVanitySubdomainAvailabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CheckVanitySubdomainAvailabilityResponse, error) { - rsp, err := c.V1CheckVanitySubdomainAvailability(ctx, ref, body, reqEditors...) - if err != nil { - return nil, err + response := &V1GetAnOrganizationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseV1CheckVanitySubdomainAvailabilityResponse(rsp) -} -// V1ListAllSnippetsWithResponse request returning *V1ListAllSnippetsResponse -func (c *ClientWithResponses) V1ListAllSnippetsWithResponse(ctx context.Context, params *V1ListAllSnippetsParams, reqEditors ...RequestEditorFn) (*V1ListAllSnippetsResponse, error) { - rsp, err := c.V1ListAllSnippets(ctx, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1OrganizationSlugResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseV1ListAllSnippetsResponse(rsp) + + return response, nil } -// V1GetASnippetWithResponse request returning *V1GetASnippetResponse -func (c *ClientWithResponses) V1GetASnippetWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetASnippetResponse, error) { - rsp, err := c.V1GetASnippet(ctx, id, reqEditors...) +// ParseV1ListOrganizationMembersResponse parses an HTTP response from a V1ListOrganizationMembersWithResponse call +func ParseV1ListOrganizationMembersResponse(rsp *http.Response) (*V1ListOrganizationMembersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseV1GetASnippetResponse(rsp) + + response := &V1ListOrganizationMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []V1OrganizationMemberResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ParseV1DeleteABranchResponse parses an HTTP response from a V1DeleteABranchWithResponse call -func ParseV1DeleteABranchResponse(rsp *http.Response) (*V1DeleteABranchResponse, error) { +// ParseV1ListAllProjectsResponse parses an HTTP response from a V1ListAllProjectsWithResponse call +func ParseV1ListAllProjectsResponse(rsp *http.Response) (*V1ListAllProjectsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1DeleteABranchResponse{ + response := &V1ListAllProjectsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BranchDeleteResponse + var dest []V1ProjectWithDatabaseResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -9937,48 +11819,48 @@ func ParseV1DeleteABranchResponse(rsp *http.Response) (*V1DeleteABranchResponse, return response, nil } -// ParseV1GetABranchConfigResponse parses an HTTP response from a V1GetABranchConfigWithResponse call -func ParseV1GetABranchConfigResponse(rsp *http.Response) (*V1GetABranchConfigResponse, error) { +// ParseV1CreateAProjectResponse parses an HTTP response from a V1CreateAProjectWithResponse call +func ParseV1CreateAProjectResponse(rsp *http.Response) (*V1CreateAProjectResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1GetABranchConfigResponse{ + response := &V1CreateAProjectResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BranchDetailResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest V1ProjectResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest } return response, nil } -// ParseV1UpdateABranchConfigResponse parses an HTTP response from a V1UpdateABranchConfigWithResponse call -func ParseV1UpdateABranchConfigResponse(rsp *http.Response) (*V1UpdateABranchConfigResponse, error) { +// ParseV1DeleteAProjectResponse parses an HTTP response from a V1DeleteAProjectWithResponse call +func ParseV1DeleteAProjectResponse(rsp *http.Response) (*V1DeleteAProjectResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1UpdateABranchConfigResponse{ + response := &V1DeleteAProjectResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BranchResponse + var dest V1ProjectRefResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -9989,132 +11871,152 @@ func ParseV1UpdateABranchConfigResponse(rsp *http.Response) (*V1UpdateABranchCon return response, nil } -// ParseV1PushABranchResponse parses an HTTP response from a V1PushABranchWithResponse call -func ParseV1PushABranchResponse(rsp *http.Response) (*V1PushABranchResponse, error) { +// ParseV1GetProjectResponse parses an HTTP response from a V1GetProjectWithResponse call +func ParseV1GetProjectResponse(rsp *http.Response) (*V1GetProjectResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1PushABranchResponse{ + response := &V1GetProjectResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest BranchUpdateResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1ProjectWithDatabaseResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest } return response, nil } -// ParseV1ResetABranchResponse parses an HTTP response from a V1ResetABranchWithResponse call -func ParseV1ResetABranchResponse(rsp *http.Response) (*V1ResetABranchResponse, error) { +// ParseGetPerformanceAdvisorsResponse parses an HTTP response from a GetPerformanceAdvisorsWithResponse call +func ParseGetPerformanceAdvisorsResponse(rsp *http.Response) (*GetPerformanceAdvisorsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1ResetABranchResponse{ + response := &GetPerformanceAdvisorsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest BranchUpdateResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1ProjectAdvisorsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest } return response, nil } -// ParseV1AuthorizeUserResponse parses an HTTP response from a V1AuthorizeUserWithResponse call -func ParseV1AuthorizeUserResponse(rsp *http.Response) (*V1AuthorizeUserResponse, error) { +// ParseGetSecurityAdvisorsResponse parses an HTTP response from a GetSecurityAdvisorsWithResponse call +func ParseGetSecurityAdvisorsResponse(rsp *http.Response) (*GetSecurityAdvisorsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1AuthorizeUserResponse{ + response := &GetSecurityAdvisorsResponse{ Body: bodyBytes, HTTPResponse: rsp, } + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1ProjectAdvisorsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + return response, nil } -// ParseV1RevokeTokenResponse parses an HTTP response from a V1RevokeTokenWithResponse call -func ParseV1RevokeTokenResponse(rsp *http.Response) (*V1RevokeTokenResponse, error) { +// ParseGetLogsResponse parses an HTTP response from a GetLogsWithResponse call +func ParseGetLogsResponse(rsp *http.Response) (*GetLogsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1RevokeTokenResponse{ + response := &GetLogsResponse{ Body: bodyBytes, HTTPResponse: rsp, } + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AnalyticsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + return response, nil } -// ParseV1ExchangeOauthTokenResponse parses an HTTP response from a V1ExchangeOauthTokenWithResponse call -func ParseV1ExchangeOauthTokenResponse(rsp *http.Response) (*V1ExchangeOauthTokenResponse, error) { +// ParseGetApiCountsResponse parses an HTTP response from a GetApiCountsWithResponse call +func ParseGetApiCountsResponse(rsp *http.Response) (*GetApiCountsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1ExchangeOauthTokenResponse{ + response := &GetApiCountsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest OAuthTokenResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AnalyticsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest } return response, nil } -// ParseV1ListAllOrganizationsResponse parses an HTTP response from a V1ListAllOrganizationsWithResponse call -func ParseV1ListAllOrganizationsResponse(rsp *http.Response) (*V1ListAllOrganizationsResponse, error) { +// ParseGetApiRequestsCountResponse parses an HTTP response from a GetApiRequestsCountWithResponse call +func ParseGetApiRequestsCountResponse(rsp *http.Response) (*GetApiRequestsCountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1ListAllOrganizationsResponse{ + response := &GetApiRequestsCountResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []OrganizationResponseV1 + var dest AnalyticsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10125,74 +12027,74 @@ func ParseV1ListAllOrganizationsResponse(rsp *http.Response) (*V1ListAllOrganiza return response, nil } -// ParseV1CreateAnOrganizationResponse parses an HTTP response from a V1CreateAnOrganizationWithResponse call -func ParseV1CreateAnOrganizationResponse(rsp *http.Response) (*V1CreateAnOrganizationResponse, error) { +// ParseV1GetProjectApiKeysResponse parses an HTTP response from a V1GetProjectApiKeysWithResponse call +func ParseV1GetProjectApiKeysResponse(rsp *http.Response) (*V1GetProjectApiKeysResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1CreateAnOrganizationResponse{ + response := &V1GetProjectApiKeysResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest OrganizationResponseV1 + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []ApiKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest } return response, nil } -// ParseV1GetAnOrganizationResponse parses an HTTP response from a V1GetAnOrganizationWithResponse call -func ParseV1GetAnOrganizationResponse(rsp *http.Response) (*V1GetAnOrganizationResponse, error) { +// ParseCreateApiKeyResponse parses an HTTP response from a CreateApiKeyWithResponse call +func ParseCreateApiKeyResponse(rsp *http.Response) (*CreateApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1GetAnOrganizationResponse{ + response := &CreateApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1OrganizationSlugResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ApiKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest } return response, nil } -// ParseV1ListOrganizationMembersResponse parses an HTTP response from a V1ListOrganizationMembersWithResponse call -func ParseV1ListOrganizationMembersResponse(rsp *http.Response) (*V1ListOrganizationMembersResponse, error) { +// ParseDeleteApiKeyResponse parses an HTTP response from a DeleteApiKeyWithResponse call +func ParseDeleteApiKeyResponse(rsp *http.Response) (*DeleteApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1ListOrganizationMembersResponse{ + response := &DeleteApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []V1OrganizationMemberResponse + var dest ApiKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10203,22 +12105,22 @@ func ParseV1ListOrganizationMembersResponse(rsp *http.Response) (*V1ListOrganiza return response, nil } -// ParseV1ListAllProjectsResponse parses an HTTP response from a V1ListAllProjectsWithResponse call -func ParseV1ListAllProjectsResponse(rsp *http.Response) (*V1ListAllProjectsResponse, error) { +// ParseGetApiKeyResponse parses an HTTP response from a GetApiKeyWithResponse call +func ParseGetApiKeyResponse(rsp *http.Response) (*GetApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1ListAllProjectsResponse{ + response := &GetApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []V1ProjectWithDatabaseResponse + var dest ApiKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10229,48 +12131,48 @@ func ParseV1ListAllProjectsResponse(rsp *http.Response) (*V1ListAllProjectsRespo return response, nil } -// ParseV1CreateAProjectResponse parses an HTTP response from a V1CreateAProjectWithResponse call -func ParseV1CreateAProjectResponse(rsp *http.Response) (*V1CreateAProjectResponse, error) { +// ParseUpdateApiKeyResponse parses an HTTP response from a UpdateApiKeyWithResponse call +func ParseUpdateApiKeyResponse(rsp *http.Response) (*UpdateApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1CreateAProjectResponse{ + response := &UpdateApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest V1ProjectResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ApiKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest } return response, nil } -// ParseV1DeleteAProjectResponse parses an HTTP response from a V1DeleteAProjectWithResponse call -func ParseV1DeleteAProjectResponse(rsp *http.Response) (*V1DeleteAProjectResponse, error) { +// ParseV1ListProjectAddonsResponse parses an HTTP response from a V1ListProjectAddonsWithResponse call +func ParseV1ListProjectAddonsResponse(rsp *http.Response) (*V1ListProjectAddonsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1DeleteAProjectResponse{ + response := &V1ListProjectAddonsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1ProjectRefResponse + var dest ListProjectAddonsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10281,74 +12183,70 @@ func ParseV1DeleteAProjectResponse(rsp *http.Response) (*V1DeleteAProjectRespons return response, nil } -// ParseV1GetProjectResponse parses an HTTP response from a V1GetProjectWithResponse call -func ParseV1GetProjectResponse(rsp *http.Response) (*V1GetProjectResponse, error) { +// ParseV1ApplyProjectAddonResponse parses an HTTP response from a V1ApplyProjectAddonWithResponse call +func ParseV1ApplyProjectAddonResponse(rsp *http.Response) (*V1ApplyProjectAddonResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1GetProjectResponse{ + response := &V1ApplyProjectAddonResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1ProjectWithDatabaseResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - return response, nil } -// ParseGetLogsResponse parses an HTTP response from a GetLogsWithResponse call -func ParseGetLogsResponse(rsp *http.Response) (*GetLogsResponse, error) { +// ParseV1RemoveProjectAddonResponse parses an HTTP response from a V1RemoveProjectAddonWithResponse call +func ParseV1RemoveProjectAddonResponse(rsp *http.Response) (*V1RemoveProjectAddonResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetLogsResponse{ + response := &V1RemoveProjectAddonResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest V1AnalyticsResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + return response, nil +} + +// ParseV1DisablePreviewBranchingResponse parses an HTTP response from a V1DisablePreviewBranchingWithResponse call +func ParseV1DisablePreviewBranchingResponse(rsp *http.Response) (*V1DisablePreviewBranchingResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + response := &V1DisablePreviewBranchingResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } return response, nil } -// ParseV1GetProjectApiKeysResponse parses an HTTP response from a V1GetProjectApiKeysWithResponse call -func ParseV1GetProjectApiKeysResponse(rsp *http.Response) (*V1GetProjectApiKeysResponse, error) { +// ParseV1ListAllBranchesResponse parses an HTTP response from a V1ListAllBranchesWithResponse call +func ParseV1ListAllBranchesResponse(rsp *http.Response) (*V1ListAllBranchesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1GetProjectApiKeysResponse{ + response := &V1ListAllBranchesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []ApiKeyResponse + var dest []BranchResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10359,22 +12257,22 @@ func ParseV1GetProjectApiKeysResponse(rsp *http.Response) (*V1GetProjectApiKeysR return response, nil } -// ParseCreateApiKeyResponse parses an HTTP response from a CreateApiKeyWithResponse call -func ParseCreateApiKeyResponse(rsp *http.Response) (*CreateApiKeyResponse, error) { +// ParseV1CreateABranchResponse parses an HTTP response from a V1CreateABranchWithResponse call +func ParseV1CreateABranchResponse(rsp *http.Response) (*V1CreateABranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateApiKeyResponse{ + response := &V1CreateABranchResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest ApiKeyResponse + var dest BranchResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10385,22 +12283,22 @@ func ParseCreateApiKeyResponse(rsp *http.Response) (*CreateApiKeyResponse, error return response, nil } -// ParseDeleteApiKeyResponse parses an HTTP response from a DeleteApiKeyWithResponse call -func ParseDeleteApiKeyResponse(rsp *http.Response) (*DeleteApiKeyResponse, error) { +// ParseV1GetAuthServiceConfigResponse parses an HTTP response from a V1GetAuthServiceConfigWithResponse call +func ParseV1GetAuthServiceConfigResponse(rsp *http.Response) (*V1GetAuthServiceConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteApiKeyResponse{ + response := &V1GetAuthServiceConfigResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ApiKeyResponse + var dest AuthConfigResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10411,22 +12309,22 @@ func ParseDeleteApiKeyResponse(rsp *http.Response) (*DeleteApiKeyResponse, error return response, nil } -// ParseGetApiKeyResponse parses an HTTP response from a GetApiKeyWithResponse call -func ParseGetApiKeyResponse(rsp *http.Response) (*GetApiKeyResponse, error) { +// ParseV1UpdateAuthServiceConfigResponse parses an HTTP response from a V1UpdateAuthServiceConfigWithResponse call +func ParseV1UpdateAuthServiceConfigResponse(rsp *http.Response) (*V1UpdateAuthServiceConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiKeyResponse{ + response := &V1UpdateAuthServiceConfigResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ApiKeyResponse + var dest AuthConfigResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10437,22 +12335,22 @@ func ParseGetApiKeyResponse(rsp *http.Response) (*GetApiKeyResponse, error) { return response, nil } -// ParseUpdateApiKeyResponse parses an HTTP response from a UpdateApiKeyWithResponse call -func ParseUpdateApiKeyResponse(rsp *http.Response) (*UpdateApiKeyResponse, error) { +// ParseListSigningKeysForProjectResponse parses an HTTP response from a ListSigningKeysForProjectWithResponse call +func ParseListSigningKeysForProjectResponse(rsp *http.Response) (*ListSigningKeysForProjectResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateApiKeyResponse{ + response := &ListSigningKeysForProjectResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ApiKeyResponse + var dest SigningKeysResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10463,90 +12361,74 @@ func ParseUpdateApiKeyResponse(rsp *http.Response) (*UpdateApiKeyResponse, error return response, nil } -// ParseV1DisablePreviewBranchingResponse parses an HTTP response from a V1DisablePreviewBranchingWithResponse call -func ParseV1DisablePreviewBranchingResponse(rsp *http.Response) (*V1DisablePreviewBranchingResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &V1DisablePreviewBranchingResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseV1ListAllBranchesResponse parses an HTTP response from a V1ListAllBranchesWithResponse call -func ParseV1ListAllBranchesResponse(rsp *http.Response) (*V1ListAllBranchesResponse, error) { +// ParseCreateSigningKeyForProjectResponse parses an HTTP response from a CreateSigningKeyForProjectWithResponse call +func ParseCreateSigningKeyForProjectResponse(rsp *http.Response) (*CreateSigningKeyForProjectResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1ListAllBranchesResponse{ + response := &CreateSigningKeyForProjectResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []BranchResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest SigningKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest } return response, nil } -// ParseV1CreateABranchResponse parses an HTTP response from a V1CreateABranchWithResponse call -func ParseV1CreateABranchResponse(rsp *http.Response) (*V1CreateABranchResponse, error) { +// ParseDeleteSigningKeyResponse parses an HTTP response from a DeleteSigningKeyWithResponse call +func ParseDeleteSigningKeyResponse(rsp *http.Response) (*DeleteSigningKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1CreateABranchResponse{ + response := &DeleteSigningKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest BranchResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SigningKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest } return response, nil } -// ParseV1GetAuthServiceConfigResponse parses an HTTP response from a V1GetAuthServiceConfigWithResponse call -func ParseV1GetAuthServiceConfigResponse(rsp *http.Response) (*V1GetAuthServiceConfigResponse, error) { +// ParseGetSigningKeyForProjectResponse parses an HTTP response from a GetSigningKeyForProjectWithResponse call +func ParseGetSigningKeyForProjectResponse(rsp *http.Response) (*GetSigningKeyForProjectResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1GetAuthServiceConfigResponse{ + response := &GetSigningKeyForProjectResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AuthConfigResponse + var dest SigningKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10557,22 +12439,22 @@ func ParseV1GetAuthServiceConfigResponse(rsp *http.Response) (*V1GetAuthServiceC return response, nil } -// ParseV1UpdateAuthServiceConfigResponse parses an HTTP response from a V1UpdateAuthServiceConfigWithResponse call -func ParseV1UpdateAuthServiceConfigResponse(rsp *http.Response) (*V1UpdateAuthServiceConfigResponse, error) { +// ParsePatchSigningKeyResponse parses an HTTP response from a PatchSigningKeyWithResponse call +func ParsePatchSigningKeyResponse(rsp *http.Response) (*PatchSigningKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1UpdateAuthServiceConfigResponse{ + response := &PatchSigningKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AuthConfigResponse + var dest SigningKeyResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10843,15 +12725,15 @@ func ParseV1GetProjectPgbouncerConfigResponse(rsp *http.Response) (*V1GetProject return response, nil } -// ParseV1GetSupavisorConfigResponse parses an HTTP response from a V1GetSupavisorConfigWithResponse call -func ParseV1GetSupavisorConfigResponse(rsp *http.Response) (*V1GetSupavisorConfigResponse, error) { +// ParseV1GetPoolerConfigResponse parses an HTTP response from a V1GetPoolerConfigWithResponse call +func ParseV1GetPoolerConfigResponse(rsp *http.Response) (*V1GetPoolerConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1GetSupavisorConfigResponse{ + response := &V1GetPoolerConfigResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -10869,15 +12751,15 @@ func ParseV1GetSupavisorConfigResponse(rsp *http.Response) (*V1GetSupavisorConfi return response, nil } -// ParseV1UpdateSupavisorConfigResponse parses an HTTP response from a V1UpdateSupavisorConfigWithResponse call -func ParseV1UpdateSupavisorConfigResponse(rsp *http.Response) (*V1UpdateSupavisorConfigResponse, error) { +// ParseV1UpdatePoolerConfigResponse parses an HTTP response from a V1UpdatePoolerConfigWithResponse call +func ParseV1UpdatePoolerConfigResponse(rsp *http.Response) (*V1UpdatePoolerConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1UpdateSupavisorConfigResponse{ + response := &V1UpdatePoolerConfigResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -11166,7 +13048,7 @@ func ParseGetDatabaseMetadataResponse(rsp *http.Response) (*GetDatabaseMetadataR switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest GetProjectDbMetadataResponseDto + var dest GetProjectDbMetadataResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11177,27 +13059,59 @@ func ParseGetDatabaseMetadataResponse(rsp *http.Response) (*GetDatabaseMetadataR return response, nil } -// ParseV1RunAQueryResponse parses an HTTP response from a V1RunAQueryWithResponse call -func ParseV1RunAQueryResponse(rsp *http.Response) (*V1RunAQueryResponse, error) { +// ParseV1ListMigrationHistoryResponse parses an HTTP response from a V1ListMigrationHistoryWithResponse call +func ParseV1ListMigrationHistoryResponse(rsp *http.Response) (*V1ListMigrationHistoryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &V1RunAQueryResponse{ + response := &V1ListMigrationHistoryResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest map[string]interface{} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1ListMigrationsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest + + } + + return response, nil +} +// ParseV1ApplyAMigrationResponse parses an HTTP response from a V1ApplyAMigrationWithResponse call +func ParseV1ApplyAMigrationResponse(rsp *http.Response) (*V1ApplyAMigrationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1ApplyAMigrationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseV1RunAQueryResponse parses an HTTP response from a V1RunAQueryWithResponse call +func ParseV1RunAQueryResponse(rsp *http.Response) (*V1RunAQueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1RunAQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } return response, nil @@ -11404,6 +13318,16 @@ func ParseV1GetAFunctionBodyResponse(rsp *http.Response) (*V1GetAFunctionBodyRes HTTPResponse: rsp, } + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest StreamableFile + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + return response, nil } @@ -11475,6 +13399,32 @@ func ParseV1ListAllNetworkBansResponse(rsp *http.Response) (*V1ListAllNetworkBan return response, nil } +// ParseV1ListAllNetworkBansEnrichedResponse parses an HTTP response from a V1ListAllNetworkBansEnrichedWithResponse call +func ParseV1ListAllNetworkBansEnrichedResponse(rsp *http.Response) (*V1ListAllNetworkBansEnrichedResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1ListAllNetworkBansEnrichedResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest NetworkBanResponseEnriched + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil +} + // ParseV1GetNetworkRestrictionsResponse parses an HTTP response from a V1GetNetworkRestrictionsWithResponse call func ParseV1GetNetworkRestrictionsResponse(rsp *http.Response) (*V1GetNetworkRestrictionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -11792,16 +13742,6 @@ func ParseV1BulkDeleteSecretsResponse(rsp *http.Response) (*V1BulkDeleteSecretsR HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest map[string]interface{} - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - return response, nil } diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 9c289d3fe..4ef41ea87 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -6,6 +6,7 @@ package api import ( "encoding/json" "fmt" + "time" "github.com/oapi-codegen/runtime" openapi_types "github.com/oapi-codegen/runtime/types" @@ -23,17 +24,59 @@ const ( ApiKeyResponseTypeSecret ApiKeyResponseType = "secret" ) -// Defines values for AuthHealthResponseName. +// Defines values for ApplyProjectAddonBodyAddonType. const ( - GoTrue AuthHealthResponseName = "GoTrue" + ApplyProjectAddonBodyAddonTypeAuthMfaPhone ApplyProjectAddonBodyAddonType = "auth_mfa_phone" + ApplyProjectAddonBodyAddonTypeAuthMfaWebAuthn ApplyProjectAddonBodyAddonType = "auth_mfa_web_authn" + ApplyProjectAddonBodyAddonTypeComputeInstance ApplyProjectAddonBodyAddonType = "compute_instance" + ApplyProjectAddonBodyAddonTypeCustomDomain ApplyProjectAddonBodyAddonType = "custom_domain" + ApplyProjectAddonBodyAddonTypeIpv4 ApplyProjectAddonBodyAddonType = "ipv4" + ApplyProjectAddonBodyAddonTypeLogDrain ApplyProjectAddonBodyAddonType = "log_drain" + ApplyProjectAddonBodyAddonTypePitr ApplyProjectAddonBodyAddonType = "pitr" ) -// Defines values for BillingPlanId. +// Defines values for ApplyProjectAddonBodyAddonVariant0. const ( - BillingPlanIdEnterprise BillingPlanId = "enterprise" - BillingPlanIdFree BillingPlanId = "free" - BillingPlanIdPro BillingPlanId = "pro" - BillingPlanIdTeam BillingPlanId = "team" + ApplyProjectAddonBodyAddonVariant0Ci12xlarge ApplyProjectAddonBodyAddonVariant0 = "ci_12xlarge" + ApplyProjectAddonBodyAddonVariant0Ci16xlarge ApplyProjectAddonBodyAddonVariant0 = "ci_16xlarge" + ApplyProjectAddonBodyAddonVariant0Ci24xlarge ApplyProjectAddonBodyAddonVariant0 = "ci_24xlarge" + ApplyProjectAddonBodyAddonVariant0Ci24xlargeHighMemory ApplyProjectAddonBodyAddonVariant0 = "ci_24xlarge_high_memory" + ApplyProjectAddonBodyAddonVariant0Ci24xlargeOptimizedCpu ApplyProjectAddonBodyAddonVariant0 = "ci_24xlarge_optimized_cpu" + ApplyProjectAddonBodyAddonVariant0Ci24xlargeOptimizedMemory ApplyProjectAddonBodyAddonVariant0 = "ci_24xlarge_optimized_memory" + ApplyProjectAddonBodyAddonVariant0Ci2xlarge ApplyProjectAddonBodyAddonVariant0 = "ci_2xlarge" + ApplyProjectAddonBodyAddonVariant0Ci48xlarge ApplyProjectAddonBodyAddonVariant0 = "ci_48xlarge" + ApplyProjectAddonBodyAddonVariant0Ci48xlargeHighMemory ApplyProjectAddonBodyAddonVariant0 = "ci_48xlarge_high_memory" + ApplyProjectAddonBodyAddonVariant0Ci48xlargeOptimizedCpu ApplyProjectAddonBodyAddonVariant0 = "ci_48xlarge_optimized_cpu" + ApplyProjectAddonBodyAddonVariant0Ci48xlargeOptimizedMemory ApplyProjectAddonBodyAddonVariant0 = "ci_48xlarge_optimized_memory" + ApplyProjectAddonBodyAddonVariant0Ci4xlarge ApplyProjectAddonBodyAddonVariant0 = "ci_4xlarge" + ApplyProjectAddonBodyAddonVariant0Ci8xlarge ApplyProjectAddonBodyAddonVariant0 = "ci_8xlarge" + ApplyProjectAddonBodyAddonVariant0CiLarge ApplyProjectAddonBodyAddonVariant0 = "ci_large" + ApplyProjectAddonBodyAddonVariant0CiMedium ApplyProjectAddonBodyAddonVariant0 = "ci_medium" + ApplyProjectAddonBodyAddonVariant0CiMicro ApplyProjectAddonBodyAddonVariant0 = "ci_micro" + ApplyProjectAddonBodyAddonVariant0CiSmall ApplyProjectAddonBodyAddonVariant0 = "ci_small" + ApplyProjectAddonBodyAddonVariant0CiXlarge ApplyProjectAddonBodyAddonVariant0 = "ci_xlarge" +) + +// Defines values for ApplyProjectAddonBodyAddonVariant1. +const ( + ApplyProjectAddonBodyAddonVariant1CdDefault ApplyProjectAddonBodyAddonVariant1 = "cd_default" +) + +// Defines values for ApplyProjectAddonBodyAddonVariant2. +const ( + ApplyProjectAddonBodyAddonVariant2Pitr14 ApplyProjectAddonBodyAddonVariant2 = "pitr_14" + ApplyProjectAddonBodyAddonVariant2Pitr28 ApplyProjectAddonBodyAddonVariant2 = "pitr_28" + ApplyProjectAddonBodyAddonVariant2Pitr7 ApplyProjectAddonBodyAddonVariant2 = "pitr_7" +) + +// Defines values for ApplyProjectAddonBodyAddonVariant3. +const ( + ApplyProjectAddonBodyAddonVariant3Ipv4Default ApplyProjectAddonBodyAddonVariant3 = "ipv4_default" +) + +// Defines values for BranchDeleteResponseMessage. +const ( + BranchDeleteResponseMessageOk BranchDeleteResponseMessage = "ok" ) // Defines values for BranchDetailResponseStatus. @@ -65,6 +108,11 @@ const ( BranchResponseStatusRUNNINGMIGRATIONS BranchResponseStatus = "RUNNING_MIGRATIONS" ) +// Defines values for BranchUpdateResponseMessage. +const ( + BranchUpdateResponseMessageOk BranchUpdateResponseMessage = "ok" +) + // Defines values for BulkUpdateFunctionBodyStatus. const ( BulkUpdateFunctionBodyStatusACTIVE BulkUpdateFunctionBodyStatus = "ACTIVE" @@ -72,50 +120,105 @@ const ( BulkUpdateFunctionBodyStatusTHROTTLED BulkUpdateFunctionBodyStatus = "THROTTLED" ) +// Defines values for BulkUpdateFunctionResponseFunctionsStatus. +const ( + BulkUpdateFunctionResponseFunctionsStatusACTIVE BulkUpdateFunctionResponseFunctionsStatus = "ACTIVE" + BulkUpdateFunctionResponseFunctionsStatusREMOVED BulkUpdateFunctionResponseFunctionsStatus = "REMOVED" + BulkUpdateFunctionResponseFunctionsStatusTHROTTLED BulkUpdateFunctionResponseFunctionsStatus = "THROTTLED" +) + // Defines values for CreateApiKeyBodyType. const ( CreateApiKeyBodyTypePublishable CreateApiKeyBodyType = "publishable" CreateApiKeyBodyTypeSecret CreateApiKeyBodyType = "secret" ) +// Defines values for CreateBranchBodyDesiredInstanceSize. +const ( + CreateBranchBodyDesiredInstanceSizeLarge CreateBranchBodyDesiredInstanceSize = "large" + CreateBranchBodyDesiredInstanceSizeMedium CreateBranchBodyDesiredInstanceSize = "medium" + CreateBranchBodyDesiredInstanceSizeMicro CreateBranchBodyDesiredInstanceSize = "micro" + CreateBranchBodyDesiredInstanceSizeN12xlarge CreateBranchBodyDesiredInstanceSize = "12xlarge" + CreateBranchBodyDesiredInstanceSizeN16xlarge CreateBranchBodyDesiredInstanceSize = "16xlarge" + CreateBranchBodyDesiredInstanceSizeN24xlarge CreateBranchBodyDesiredInstanceSize = "24xlarge" + CreateBranchBodyDesiredInstanceSizeN24xlargeHighMemory CreateBranchBodyDesiredInstanceSize = "24xlarge_high_memory" + CreateBranchBodyDesiredInstanceSizeN24xlargeOptimizedCpu CreateBranchBodyDesiredInstanceSize = "24xlarge_optimized_cpu" + CreateBranchBodyDesiredInstanceSizeN24xlargeOptimizedMemory CreateBranchBodyDesiredInstanceSize = "24xlarge_optimized_memory" + CreateBranchBodyDesiredInstanceSizeN2xlarge CreateBranchBodyDesiredInstanceSize = "2xlarge" + CreateBranchBodyDesiredInstanceSizeN48xlarge CreateBranchBodyDesiredInstanceSize = "48xlarge" + CreateBranchBodyDesiredInstanceSizeN48xlargeHighMemory CreateBranchBodyDesiredInstanceSize = "48xlarge_high_memory" + CreateBranchBodyDesiredInstanceSizeN48xlargeOptimizedCpu CreateBranchBodyDesiredInstanceSize = "48xlarge_optimized_cpu" + CreateBranchBodyDesiredInstanceSizeN48xlargeOptimizedMemory CreateBranchBodyDesiredInstanceSize = "48xlarge_optimized_memory" + CreateBranchBodyDesiredInstanceSizeN4xlarge CreateBranchBodyDesiredInstanceSize = "4xlarge" + CreateBranchBodyDesiredInstanceSizeN8xlarge CreateBranchBodyDesiredInstanceSize = "8xlarge" + CreateBranchBodyDesiredInstanceSizeNano CreateBranchBodyDesiredInstanceSize = "nano" + CreateBranchBodyDesiredInstanceSizePico CreateBranchBodyDesiredInstanceSize = "pico" + CreateBranchBodyDesiredInstanceSizeSmall CreateBranchBodyDesiredInstanceSize = "small" + CreateBranchBodyDesiredInstanceSizeXlarge CreateBranchBodyDesiredInstanceSize = "xlarge" +) + +// Defines values for CreateBranchBodyPostgresEngine. +const ( + CreateBranchBodyPostgresEngineN15 CreateBranchBodyPostgresEngine = "15" + CreateBranchBodyPostgresEngineN17 CreateBranchBodyPostgresEngine = "17" + CreateBranchBodyPostgresEngineN17Oriole CreateBranchBodyPostgresEngine = "17-oriole" +) + +// Defines values for CreateBranchBodyReleaseChannel. +const ( + CreateBranchBodyReleaseChannelAlpha CreateBranchBodyReleaseChannel = "alpha" + CreateBranchBodyReleaseChannelBeta CreateBranchBodyReleaseChannel = "beta" + CreateBranchBodyReleaseChannelGa CreateBranchBodyReleaseChannel = "ga" + CreateBranchBodyReleaseChannelInternal CreateBranchBodyReleaseChannel = "internal" + CreateBranchBodyReleaseChannelPreview CreateBranchBodyReleaseChannel = "preview" + CreateBranchBodyReleaseChannelWithdrawn CreateBranchBodyReleaseChannel = "withdrawn" +) + // Defines values for CreateProviderBodyType. const ( Saml CreateProviderBodyType = "saml" ) -// Defines values for DatabaseUpgradeStatusError. +// Defines values for CreateSigningKeyBodyAlgorithm. +const ( + CreateSigningKeyBodyAlgorithmES256 CreateSigningKeyBodyAlgorithm = "ES256" + CreateSigningKeyBodyAlgorithmEdDSA CreateSigningKeyBodyAlgorithm = "EdDSA" + CreateSigningKeyBodyAlgorithmHS256 CreateSigningKeyBodyAlgorithm = "HS256" + CreateSigningKeyBodyAlgorithmRS256 CreateSigningKeyBodyAlgorithm = "RS256" +) + +// Defines values for CreateSigningKeyBodyStatus. const ( - N1UpgradedInstanceLaunchFailed DatabaseUpgradeStatusError = "1_upgraded_instance_launch_failed" - N2VolumeDetachchmentFromUpgradedInstanceFailed DatabaseUpgradeStatusError = "2_volume_detachchment_from_upgraded_instance_failed" - N3VolumeAttachmentToOriginalInstanceFailed DatabaseUpgradeStatusError = "3_volume_attachment_to_original_instance_failed" - N4DataUpgradeInitiationFailed DatabaseUpgradeStatusError = "4_data_upgrade_initiation_failed" - N5DataUpgradeCompletionFailed DatabaseUpgradeStatusError = "5_data_upgrade_completion_failed" - N6VolumeDetachchmentFromOriginalInstanceFailed DatabaseUpgradeStatusError = "6_volume_detachchment_from_original_instance_failed" - N7VolumeAttachmentToUpgradedInstanceFailed DatabaseUpgradeStatusError = "7_volume_attachment_to_upgraded_instance_failed" - N8UpgradeCompletionFailed DatabaseUpgradeStatusError = "8_upgrade_completion_failed" - N9PostPhysicalBackupFailed DatabaseUpgradeStatusError = "9_post_physical_backup_failed" + CreateSigningKeyBodyStatusInUse CreateSigningKeyBodyStatus = "in_use" + CreateSigningKeyBodyStatusStandby CreateSigningKeyBodyStatus = "standby" ) -// Defines values for DatabaseUpgradeStatusProgress. +// Defines values for DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError. const ( - N0Requested DatabaseUpgradeStatusProgress = "0_requested" - N10CompletedPostPhysicalBackup DatabaseUpgradeStatusProgress = "10_completed_post_physical_backup" - N1Started DatabaseUpgradeStatusProgress = "1_started" - N2LaunchedUpgradedInstance DatabaseUpgradeStatusProgress = "2_launched_upgraded_instance" - N3DetachedVolumeFromUpgradedInstance DatabaseUpgradeStatusProgress = "3_detached_volume_from_upgraded_instance" - N4AttachedVolumeToOriginalInstance DatabaseUpgradeStatusProgress = "4_attached_volume_to_original_instance" - N5InitiatedDataUpgrade DatabaseUpgradeStatusProgress = "5_initiated_data_upgrade" - N6CompletedDataUpgrade DatabaseUpgradeStatusProgress = "6_completed_data_upgrade" - N7DetachedVolumeFromOriginalInstance DatabaseUpgradeStatusProgress = "7_detached_volume_from_original_instance" - N8AttachedVolumeToUpgradedInstance DatabaseUpgradeStatusProgress = "8_attached_volume_to_upgraded_instance" - N9CompletedUpgrade DatabaseUpgradeStatusProgress = "9_completed_upgrade" + N1UpgradedInstanceLaunchFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "1_upgraded_instance_launch_failed" + N2VolumeDetachchmentFromUpgradedInstanceFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "2_volume_detachchment_from_upgraded_instance_failed" + N3VolumeAttachmentToOriginalInstanceFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "3_volume_attachment_to_original_instance_failed" + N4DataUpgradeInitiationFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "4_data_upgrade_initiation_failed" + N5DataUpgradeCompletionFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "5_data_upgrade_completion_failed" + N6VolumeDetachchmentFromOriginalInstanceFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "6_volume_detachchment_from_original_instance_failed" + N7VolumeAttachmentToUpgradedInstanceFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "7_volume_attachment_to_upgraded_instance_failed" + N8UpgradeCompletionFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "8_upgrade_completion_failed" + N9PostPhysicalBackupFailed DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError = "9_post_physical_backup_failed" ) -// Defines values for DatabaseUpgradeStatusStatus. +// Defines values for DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress. const ( - N0 DatabaseUpgradeStatusStatus = 0 - N1 DatabaseUpgradeStatusStatus = 1 - N2 DatabaseUpgradeStatusStatus = 2 + N0Requested DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "0_requested" + N10CompletedPostPhysicalBackup DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "10_completed_post_physical_backup" + N1Started DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "1_started" + N2LaunchedUpgradedInstance DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "2_launched_upgraded_instance" + N3DetachedVolumeFromUpgradedInstance DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "3_detached_volume_from_upgraded_instance" + N4AttachedVolumeToOriginalInstance DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "4_attached_volume_to_original_instance" + N5InitiatedDataUpgrade DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "5_initiated_data_upgrade" + N6CompletedDataUpgrade DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "6_completed_data_upgrade" + N7DetachedVolumeFromOriginalInstance DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "7_detached_volume_from_original_instance" + N8AttachedVolumeToUpgradedInstance DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "8_attached_volume_to_upgraded_instance" + N9CompletedUpgrade DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress = "9_completed_upgrade" ) // Defines values for DeployFunctionResponseStatus. @@ -125,20 +228,6 @@ const ( DeployFunctionResponseStatusTHROTTLED DeployFunctionResponseStatus = "THROTTLED" ) -// Defines values for DesiredInstanceSize. -const ( - DesiredInstanceSizeLarge DesiredInstanceSize = "large" - DesiredInstanceSizeMedium DesiredInstanceSize = "medium" - DesiredInstanceSizeMicro DesiredInstanceSize = "micro" - DesiredInstanceSizeN12xlarge DesiredInstanceSize = "12xlarge" - DesiredInstanceSizeN16xlarge DesiredInstanceSize = "16xlarge" - DesiredInstanceSizeN2xlarge DesiredInstanceSize = "2xlarge" - DesiredInstanceSizeN4xlarge DesiredInstanceSize = "4xlarge" - DesiredInstanceSizeN8xlarge DesiredInstanceSize = "8xlarge" - DesiredInstanceSizeSmall DesiredInstanceSize = "small" - DesiredInstanceSizeXlarge DesiredInstanceSize = "xlarge" -) - // Defines values for FunctionResponseStatus. const ( FunctionResponseStatusACTIVE FunctionResponseStatus = "ACTIVE" @@ -153,6 +242,179 @@ const ( FunctionSlugResponseStatusTHROTTLED FunctionSlugResponseStatus = "THROTTLED" ) +// Defines values for GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine. +const ( + GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngineN13 GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine = "13" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngineN14 GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine = "14" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngineN15 GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine = "15" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngineN17 GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine = "17" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngineN17Oriole GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine = "17-oriole" +) + +// Defines values for GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel. +const ( + GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannelAlpha GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel = "alpha" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannelBeta GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel = "beta" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannelGa GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel = "ga" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannelInternal GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel = "internal" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannelPreview GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel = "preview" + GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannelWithdrawn GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel = "withdrawn" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsType. +const ( + ListProjectAddonsResponseAvailableAddonsTypeAuthMfaPhone ListProjectAddonsResponseAvailableAddonsType = "auth_mfa_phone" + ListProjectAddonsResponseAvailableAddonsTypeAuthMfaWebAuthn ListProjectAddonsResponseAvailableAddonsType = "auth_mfa_web_authn" + ListProjectAddonsResponseAvailableAddonsTypeComputeInstance ListProjectAddonsResponseAvailableAddonsType = "compute_instance" + ListProjectAddonsResponseAvailableAddonsTypeCustomDomain ListProjectAddonsResponseAvailableAddonsType = "custom_domain" + ListProjectAddonsResponseAvailableAddonsTypeIpv4 ListProjectAddonsResponseAvailableAddonsType = "ipv4" + ListProjectAddonsResponseAvailableAddonsTypeLogDrain ListProjectAddonsResponseAvailableAddonsType = "log_drain" + ListProjectAddonsResponseAvailableAddonsTypePitr ListProjectAddonsResponseAvailableAddonsType = "pitr" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsId0. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci12xlarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_12xlarge" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci16xlarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_16xlarge" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci24xlarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_24xlarge" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci24xlargeHighMemory ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_24xlarge_high_memory" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci24xlargeOptimizedCpu ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_24xlarge_optimized_cpu" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci24xlargeOptimizedMemory ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_24xlarge_optimized_memory" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci2xlarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_2xlarge" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci48xlarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_48xlarge" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci48xlargeHighMemory ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_48xlarge_high_memory" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci48xlargeOptimizedCpu ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_48xlarge_optimized_cpu" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci48xlargeOptimizedMemory ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_48xlarge_optimized_memory" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci4xlarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_4xlarge" + ListProjectAddonsResponseAvailableAddonsVariantsId0Ci8xlarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_8xlarge" + ListProjectAddonsResponseAvailableAddonsVariantsId0CiLarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_large" + ListProjectAddonsResponseAvailableAddonsVariantsId0CiMedium ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_medium" + ListProjectAddonsResponseAvailableAddonsVariantsId0CiMicro ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_micro" + ListProjectAddonsResponseAvailableAddonsVariantsId0CiSmall ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_small" + ListProjectAddonsResponseAvailableAddonsVariantsId0CiXlarge ListProjectAddonsResponseAvailableAddonsVariantsId0 = "ci_xlarge" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsId1. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsId1CdDefault ListProjectAddonsResponseAvailableAddonsVariantsId1 = "cd_default" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsId2. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsId2Pitr14 ListProjectAddonsResponseAvailableAddonsVariantsId2 = "pitr_14" + ListProjectAddonsResponseAvailableAddonsVariantsId2Pitr28 ListProjectAddonsResponseAvailableAddonsVariantsId2 = "pitr_28" + ListProjectAddonsResponseAvailableAddonsVariantsId2Pitr7 ListProjectAddonsResponseAvailableAddonsVariantsId2 = "pitr_7" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsId3. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsId3Ipv4Default ListProjectAddonsResponseAvailableAddonsVariantsId3 = "ipv4_default" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsId4. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsId4AuthMfaPhoneDefault ListProjectAddonsResponseAvailableAddonsVariantsId4 = "auth_mfa_phone_default" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsId5. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsId5AuthMfaWebAuthnDefault ListProjectAddonsResponseAvailableAddonsVariantsId5 = "auth_mfa_web_authn_default" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsId6. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsId6LogDrainDefault ListProjectAddonsResponseAvailableAddonsVariantsId6 = "log_drain_default" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsPriceInterval. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsPriceIntervalHourly ListProjectAddonsResponseAvailableAddonsVariantsPriceInterval = "hourly" + ListProjectAddonsResponseAvailableAddonsVariantsPriceIntervalMonthly ListProjectAddonsResponseAvailableAddonsVariantsPriceInterval = "monthly" +) + +// Defines values for ListProjectAddonsResponseAvailableAddonsVariantsPriceType. +const ( + ListProjectAddonsResponseAvailableAddonsVariantsPriceTypeFixed ListProjectAddonsResponseAvailableAddonsVariantsPriceType = "fixed" + ListProjectAddonsResponseAvailableAddonsVariantsPriceTypeUsage ListProjectAddonsResponseAvailableAddonsVariantsPriceType = "usage" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsType. +const ( + AuthMfaPhone ListProjectAddonsResponseSelectedAddonsType = "auth_mfa_phone" + AuthMfaWebAuthn ListProjectAddonsResponseSelectedAddonsType = "auth_mfa_web_authn" + ComputeInstance ListProjectAddonsResponseSelectedAddonsType = "compute_instance" + CustomDomain ListProjectAddonsResponseSelectedAddonsType = "custom_domain" + Ipv4 ListProjectAddonsResponseSelectedAddonsType = "ipv4" + LogDrain ListProjectAddonsResponseSelectedAddonsType = "log_drain" + Pitr ListProjectAddonsResponseSelectedAddonsType = "pitr" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantId0. +const ( + Ci12xlarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_12xlarge" + Ci16xlarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_16xlarge" + Ci24xlarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_24xlarge" + Ci24xlargeHighMemory ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_24xlarge_high_memory" + Ci24xlargeOptimizedCpu ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_24xlarge_optimized_cpu" + Ci24xlargeOptimizedMemory ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_24xlarge_optimized_memory" + Ci2xlarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_2xlarge" + Ci48xlarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_48xlarge" + Ci48xlargeHighMemory ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_48xlarge_high_memory" + Ci48xlargeOptimizedCpu ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_48xlarge_optimized_cpu" + Ci48xlargeOptimizedMemory ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_48xlarge_optimized_memory" + Ci4xlarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_4xlarge" + Ci8xlarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_8xlarge" + CiLarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_large" + CiMedium ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_medium" + CiMicro ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_micro" + CiSmall ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_small" + CiXlarge ListProjectAddonsResponseSelectedAddonsVariantId0 = "ci_xlarge" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantId1. +const ( + CdDefault ListProjectAddonsResponseSelectedAddonsVariantId1 = "cd_default" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantId2. +const ( + Pitr14 ListProjectAddonsResponseSelectedAddonsVariantId2 = "pitr_14" + Pitr28 ListProjectAddonsResponseSelectedAddonsVariantId2 = "pitr_28" + Pitr7 ListProjectAddonsResponseSelectedAddonsVariantId2 = "pitr_7" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantId3. +const ( + Ipv4Default ListProjectAddonsResponseSelectedAddonsVariantId3 = "ipv4_default" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantId4. +const ( + ListProjectAddonsResponseSelectedAddonsVariantId4AuthMfaPhoneDefault ListProjectAddonsResponseSelectedAddonsVariantId4 = "auth_mfa_phone_default" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantId5. +const ( + ListProjectAddonsResponseSelectedAddonsVariantId5AuthMfaWebAuthnDefault ListProjectAddonsResponseSelectedAddonsVariantId5 = "auth_mfa_web_authn_default" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantId6. +const ( + ListProjectAddonsResponseSelectedAddonsVariantId6LogDrainDefault ListProjectAddonsResponseSelectedAddonsVariantId6 = "log_drain_default" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantPriceInterval. +const ( + ListProjectAddonsResponseSelectedAddonsVariantPriceIntervalHourly ListProjectAddonsResponseSelectedAddonsVariantPriceInterval = "hourly" + ListProjectAddonsResponseSelectedAddonsVariantPriceIntervalMonthly ListProjectAddonsResponseSelectedAddonsVariantPriceInterval = "monthly" +) + +// Defines values for ListProjectAddonsResponseSelectedAddonsVariantPriceType. +const ( + ListProjectAddonsResponseSelectedAddonsVariantPriceTypeFixed ListProjectAddonsResponseSelectedAddonsVariantPriceType = "fixed" + ListProjectAddonsResponseSelectedAddonsVariantPriceTypeUsage ListProjectAddonsResponseSelectedAddonsVariantPriceType = "usage" +) + // Defines values for NetworkRestrictionsResponseEntitlement. const ( Allowed NetworkRestrictionsResponseEntitlement = "allowed" @@ -183,39 +445,31 @@ const ( PostgresConfigResponseSessionReplicationRoleReplica PostgresConfigResponseSessionReplicationRole = "replica" ) -// Defines values for PostgresEngine. -const ( - PostgresEngineN15 PostgresEngine = "15" - PostgresEngineN17Oriole PostgresEngine = "17-oriole" -) - -// Defines values for ProjectAvailableRestoreVersionPostgresEngine. +// Defines values for ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel. const ( - ProjectAvailableRestoreVersionPostgresEngineN13 ProjectAvailableRestoreVersionPostgresEngine = "13" - ProjectAvailableRestoreVersionPostgresEngineN14 ProjectAvailableRestoreVersionPostgresEngine = "14" - ProjectAvailableRestoreVersionPostgresEngineN15 ProjectAvailableRestoreVersionPostgresEngine = "15" - ProjectAvailableRestoreVersionPostgresEngineN17 ProjectAvailableRestoreVersionPostgresEngine = "17" - ProjectAvailableRestoreVersionPostgresEngineN17Oriole ProjectAvailableRestoreVersionPostgresEngine = "17-oriole" + ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannelAlpha ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel = "alpha" + ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannelBeta ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel = "beta" + ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannelGa ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel = "ga" + ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannelInternal ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel = "internal" + ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannelPreview ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel = "preview" + ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannelWithdrawn ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel = "withdrawn" ) -// Defines values for ProjectAvailableRestoreVersionReleaseChannel. +// Defines values for ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion. const ( - ProjectAvailableRestoreVersionReleaseChannelAlpha ProjectAvailableRestoreVersionReleaseChannel = "alpha" - ProjectAvailableRestoreVersionReleaseChannelBeta ProjectAvailableRestoreVersionReleaseChannel = "beta" - ProjectAvailableRestoreVersionReleaseChannelGa ProjectAvailableRestoreVersionReleaseChannel = "ga" - ProjectAvailableRestoreVersionReleaseChannelInternal ProjectAvailableRestoreVersionReleaseChannel = "internal" - ProjectAvailableRestoreVersionReleaseChannelPreview ProjectAvailableRestoreVersionReleaseChannel = "preview" - ProjectAvailableRestoreVersionReleaseChannelWithdrawn ProjectAvailableRestoreVersionReleaseChannel = "withdrawn" + N15 ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion = "15" + N17 ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion = "17" + N17Oriole ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion = "17-oriole" ) -// Defines values for ReleaseChannel. +// Defines values for ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel. const ( - ReleaseChannelAlpha ReleaseChannel = "alpha" - ReleaseChannelBeta ReleaseChannel = "beta" - ReleaseChannelGa ReleaseChannel = "ga" - ReleaseChannelInternal ReleaseChannel = "internal" - ReleaseChannelPreview ReleaseChannel = "preview" - ReleaseChannelWithdrawn ReleaseChannel = "withdrawn" + ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannelAlpha ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel = "alpha" + ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannelBeta ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel = "beta" + ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannelGa ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel = "ga" + ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannelInternal ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel = "internal" + ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannelPreview ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel = "preview" + ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannelWithdrawn ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel = "withdrawn" ) // Defines values for SetUpReadReplicaBodyReadReplicaRegion. @@ -240,17 +494,49 @@ const ( SetUpReadReplicaBodyReadReplicaRegionUsWest2 SetUpReadReplicaBodyReadReplicaRegion = "us-west-2" ) -// Defines values for SnippetMetaType. +// Defines values for SigningKeyResponseAlgorithm. +const ( + SigningKeyResponseAlgorithmES256 SigningKeyResponseAlgorithm = "ES256" + SigningKeyResponseAlgorithmEdDSA SigningKeyResponseAlgorithm = "EdDSA" + SigningKeyResponseAlgorithmHS256 SigningKeyResponseAlgorithm = "HS256" + SigningKeyResponseAlgorithmRS256 SigningKeyResponseAlgorithm = "RS256" +) + +// Defines values for SigningKeyResponseStatus. +const ( + SigningKeyResponseStatusInUse SigningKeyResponseStatus = "in_use" + SigningKeyResponseStatusPreviouslyUsed SigningKeyResponseStatus = "previously_used" + SigningKeyResponseStatusRevoked SigningKeyResponseStatus = "revoked" + SigningKeyResponseStatusStandby SigningKeyResponseStatus = "standby" +) + +// Defines values for SigningKeysResponseKeysAlgorithm. +const ( + ES256 SigningKeysResponseKeysAlgorithm = "ES256" + EdDSA SigningKeysResponseKeysAlgorithm = "EdDSA" + HS256 SigningKeysResponseKeysAlgorithm = "HS256" + RS256 SigningKeysResponseKeysAlgorithm = "RS256" +) + +// Defines values for SigningKeysResponseKeysStatus. +const ( + SigningKeysResponseKeysStatusInUse SigningKeysResponseKeysStatus = "in_use" + SigningKeysResponseKeysStatusPreviouslyUsed SigningKeysResponseKeysStatus = "previously_used" + SigningKeysResponseKeysStatusRevoked SigningKeysResponseKeysStatus = "revoked" + SigningKeysResponseKeysStatusStandby SigningKeysResponseKeysStatus = "standby" +) + +// Defines values for SnippetListDataType. const ( - SnippetMetaTypeSql SnippetMetaType = "sql" + SnippetListDataTypeSql SnippetListDataType = "sql" ) -// Defines values for SnippetMetaVisibility. +// Defines values for SnippetListDataVisibility. const ( - SnippetMetaVisibilityOrg SnippetMetaVisibility = "org" - SnippetMetaVisibilityProject SnippetMetaVisibility = "project" - SnippetMetaVisibilityPublic SnippetMetaVisibility = "public" - SnippetMetaVisibilityUser SnippetMetaVisibility = "user" + SnippetListDataVisibilityOrg SnippetListDataVisibility = "org" + SnippetListDataVisibilityProject SnippetListDataVisibility = "project" + SnippetListDataVisibilityPublic SnippetListDataVisibility = "public" + SnippetListDataVisibilityUser SnippetListDataVisibility = "user" ) // Defines values for SnippetResponseType. @@ -286,6 +572,21 @@ const ( Empty UpdateAuthConfigBodyPasswordRequiredCharacters = "" ) +// Defines values for UpdateAuthConfigBodySecurityCaptchaProvider. +const ( + Hcaptcha UpdateAuthConfigBodySecurityCaptchaProvider = "hcaptcha" + Turnstile UpdateAuthConfigBodySecurityCaptchaProvider = "turnstile" +) + +// Defines values for UpdateAuthConfigBodySmsProvider. +const ( + Messagebird UpdateAuthConfigBodySmsProvider = "messagebird" + Textlocal UpdateAuthConfigBodySmsProvider = "textlocal" + Twilio UpdateAuthConfigBodySmsProvider = "twilio" + TwilioVerify UpdateAuthConfigBodySmsProvider = "twilio_verify" + Vonage UpdateAuthConfigBodySmsProvider = "vonage" +) + // Defines values for UpdateBranchBodyStatus. const ( UpdateBranchBodyStatusCREATINGPROJECT UpdateBranchBodyStatus = "CREATING_PROJECT" @@ -312,68 +613,99 @@ const ( UpdatePostgresConfigBodySessionReplicationRoleReplica UpdatePostgresConfigBodySessionReplicationRole = "replica" ) +// Defines values for UpdateSigningKeyBodyStatus. +const ( + UpdateSigningKeyBodyStatusInUse UpdateSigningKeyBodyStatus = "in_use" + UpdateSigningKeyBodyStatusPreviouslyUsed UpdateSigningKeyBodyStatus = "previously_used" + UpdateSigningKeyBodyStatusRevoked UpdateSigningKeyBodyStatus = "revoked" + UpdateSigningKeyBodyStatusStandby UpdateSigningKeyBodyStatus = "standby" +) + // Defines values for UpdateSupavisorConfigBodyPoolMode. const ( UpdateSupavisorConfigBodyPoolModeSession UpdateSupavisorConfigBodyPoolMode = "session" UpdateSupavisorConfigBodyPoolModeTransaction UpdateSupavisorConfigBodyPoolMode = "transaction" ) -// Defines values for UpdateSupavisorConfigResponsePoolMode. +// Defines values for UpgradeDatabaseBodyReleaseChannel. +const ( + UpgradeDatabaseBodyReleaseChannelAlpha UpgradeDatabaseBodyReleaseChannel = "alpha" + UpgradeDatabaseBodyReleaseChannelBeta UpgradeDatabaseBodyReleaseChannel = "beta" + UpgradeDatabaseBodyReleaseChannelGa UpgradeDatabaseBodyReleaseChannel = "ga" + UpgradeDatabaseBodyReleaseChannelInternal UpgradeDatabaseBodyReleaseChannel = "internal" + UpgradeDatabaseBodyReleaseChannelPreview UpgradeDatabaseBodyReleaseChannel = "preview" + UpgradeDatabaseBodyReleaseChannelWithdrawn UpgradeDatabaseBodyReleaseChannel = "withdrawn" +) + +// Defines values for V1BackupsResponseBackupsStatus. const ( - UpdateSupavisorConfigResponsePoolModeSession UpdateSupavisorConfigResponsePoolMode = "session" - UpdateSupavisorConfigResponsePoolModeTransaction UpdateSupavisorConfigResponsePoolMode = "transaction" + V1BackupsResponseBackupsStatusARCHIVED V1BackupsResponseBackupsStatus = "ARCHIVED" + V1BackupsResponseBackupsStatusCANCELLED V1BackupsResponseBackupsStatus = "CANCELLED" + V1BackupsResponseBackupsStatusCOMPLETED V1BackupsResponseBackupsStatus = "COMPLETED" + V1BackupsResponseBackupsStatusFAILED V1BackupsResponseBackupsStatus = "FAILED" + V1BackupsResponseBackupsStatusPENDING V1BackupsResponseBackupsStatus = "PENDING" + V1BackupsResponseBackupsStatusREMOVED V1BackupsResponseBackupsStatus = "REMOVED" ) -// Defines values for V1BackupStatus. +// Defines values for V1CreateProjectBodyDesiredInstanceSize. const ( - V1BackupStatusARCHIVED V1BackupStatus = "ARCHIVED" - V1BackupStatusCANCELLED V1BackupStatus = "CANCELLED" - V1BackupStatusCOMPLETED V1BackupStatus = "COMPLETED" - V1BackupStatusFAILED V1BackupStatus = "FAILED" - V1BackupStatusPENDING V1BackupStatus = "PENDING" - V1BackupStatusREMOVED V1BackupStatus = "REMOVED" + V1CreateProjectBodyDesiredInstanceSizeLarge V1CreateProjectBodyDesiredInstanceSize = "large" + V1CreateProjectBodyDesiredInstanceSizeMedium V1CreateProjectBodyDesiredInstanceSize = "medium" + V1CreateProjectBodyDesiredInstanceSizeMicro V1CreateProjectBodyDesiredInstanceSize = "micro" + V1CreateProjectBodyDesiredInstanceSizeN12xlarge V1CreateProjectBodyDesiredInstanceSize = "12xlarge" + V1CreateProjectBodyDesiredInstanceSizeN16xlarge V1CreateProjectBodyDesiredInstanceSize = "16xlarge" + V1CreateProjectBodyDesiredInstanceSizeN24xlarge V1CreateProjectBodyDesiredInstanceSize = "24xlarge" + V1CreateProjectBodyDesiredInstanceSizeN24xlargeHighMemory V1CreateProjectBodyDesiredInstanceSize = "24xlarge_high_memory" + V1CreateProjectBodyDesiredInstanceSizeN24xlargeOptimizedCpu V1CreateProjectBodyDesiredInstanceSize = "24xlarge_optimized_cpu" + V1CreateProjectBodyDesiredInstanceSizeN24xlargeOptimizedMemory V1CreateProjectBodyDesiredInstanceSize = "24xlarge_optimized_memory" + V1CreateProjectBodyDesiredInstanceSizeN2xlarge V1CreateProjectBodyDesiredInstanceSize = "2xlarge" + V1CreateProjectBodyDesiredInstanceSizeN48xlarge V1CreateProjectBodyDesiredInstanceSize = "48xlarge" + V1CreateProjectBodyDesiredInstanceSizeN48xlargeHighMemory V1CreateProjectBodyDesiredInstanceSize = "48xlarge_high_memory" + V1CreateProjectBodyDesiredInstanceSizeN48xlargeOptimizedCpu V1CreateProjectBodyDesiredInstanceSize = "48xlarge_optimized_cpu" + V1CreateProjectBodyDesiredInstanceSizeN48xlargeOptimizedMemory V1CreateProjectBodyDesiredInstanceSize = "48xlarge_optimized_memory" + V1CreateProjectBodyDesiredInstanceSizeN4xlarge V1CreateProjectBodyDesiredInstanceSize = "4xlarge" + V1CreateProjectBodyDesiredInstanceSizeN8xlarge V1CreateProjectBodyDesiredInstanceSize = "8xlarge" + V1CreateProjectBodyDesiredInstanceSizePico V1CreateProjectBodyDesiredInstanceSize = "pico" + V1CreateProjectBodyDesiredInstanceSizeSmall V1CreateProjectBodyDesiredInstanceSize = "small" + V1CreateProjectBodyDesiredInstanceSizeXlarge V1CreateProjectBodyDesiredInstanceSize = "xlarge" ) -// Defines values for V1CreateProjectBodyDtoDesiredInstanceSize. +// Defines values for V1CreateProjectBodyPlan. const ( - V1CreateProjectBodyDtoDesiredInstanceSizeLarge V1CreateProjectBodyDtoDesiredInstanceSize = "large" - V1CreateProjectBodyDtoDesiredInstanceSizeMedium V1CreateProjectBodyDtoDesiredInstanceSize = "medium" - V1CreateProjectBodyDtoDesiredInstanceSizeMicro V1CreateProjectBodyDtoDesiredInstanceSize = "micro" - V1CreateProjectBodyDtoDesiredInstanceSizeN12xlarge V1CreateProjectBodyDtoDesiredInstanceSize = "12xlarge" - V1CreateProjectBodyDtoDesiredInstanceSizeN16xlarge V1CreateProjectBodyDtoDesiredInstanceSize = "16xlarge" - V1CreateProjectBodyDtoDesiredInstanceSizeN2xlarge V1CreateProjectBodyDtoDesiredInstanceSize = "2xlarge" - V1CreateProjectBodyDtoDesiredInstanceSizeN4xlarge V1CreateProjectBodyDtoDesiredInstanceSize = "4xlarge" - V1CreateProjectBodyDtoDesiredInstanceSizeN8xlarge V1CreateProjectBodyDtoDesiredInstanceSize = "8xlarge" - V1CreateProjectBodyDtoDesiredInstanceSizeSmall V1CreateProjectBodyDtoDesiredInstanceSize = "small" - V1CreateProjectBodyDtoDesiredInstanceSizeXlarge V1CreateProjectBodyDtoDesiredInstanceSize = "xlarge" + V1CreateProjectBodyPlanFree V1CreateProjectBodyPlan = "free" + V1CreateProjectBodyPlanPro V1CreateProjectBodyPlan = "pro" ) -// Defines values for V1CreateProjectBodyDtoPlan. +// Defines values for V1CreateProjectBodyRegion. const ( - V1CreateProjectBodyDtoPlanFree V1CreateProjectBodyDtoPlan = "free" - V1CreateProjectBodyDtoPlanPro V1CreateProjectBodyDtoPlan = "pro" + V1CreateProjectBodyRegionApEast1 V1CreateProjectBodyRegion = "ap-east-1" + V1CreateProjectBodyRegionApNortheast1 V1CreateProjectBodyRegion = "ap-northeast-1" + V1CreateProjectBodyRegionApNortheast2 V1CreateProjectBodyRegion = "ap-northeast-2" + V1CreateProjectBodyRegionApSouth1 V1CreateProjectBodyRegion = "ap-south-1" + V1CreateProjectBodyRegionApSoutheast1 V1CreateProjectBodyRegion = "ap-southeast-1" + V1CreateProjectBodyRegionApSoutheast2 V1CreateProjectBodyRegion = "ap-southeast-2" + V1CreateProjectBodyRegionCaCentral1 V1CreateProjectBodyRegion = "ca-central-1" + V1CreateProjectBodyRegionEuCentral1 V1CreateProjectBodyRegion = "eu-central-1" + V1CreateProjectBodyRegionEuCentral2 V1CreateProjectBodyRegion = "eu-central-2" + V1CreateProjectBodyRegionEuNorth1 V1CreateProjectBodyRegion = "eu-north-1" + V1CreateProjectBodyRegionEuWest1 V1CreateProjectBodyRegion = "eu-west-1" + V1CreateProjectBodyRegionEuWest2 V1CreateProjectBodyRegion = "eu-west-2" + V1CreateProjectBodyRegionEuWest3 V1CreateProjectBodyRegion = "eu-west-3" + V1CreateProjectBodyRegionSaEast1 V1CreateProjectBodyRegion = "sa-east-1" + V1CreateProjectBodyRegionUsEast1 V1CreateProjectBodyRegion = "us-east-1" + V1CreateProjectBodyRegionUsEast2 V1CreateProjectBodyRegion = "us-east-2" + V1CreateProjectBodyRegionUsWest1 V1CreateProjectBodyRegion = "us-west-1" + V1CreateProjectBodyRegionUsWest2 V1CreateProjectBodyRegion = "us-west-2" ) -// Defines values for V1CreateProjectBodyDtoRegion. +// Defines values for V1OrganizationSlugResponseAllowedReleaseChannels. const ( - V1CreateProjectBodyDtoRegionApEast1 V1CreateProjectBodyDtoRegion = "ap-east-1" - V1CreateProjectBodyDtoRegionApNortheast1 V1CreateProjectBodyDtoRegion = "ap-northeast-1" - V1CreateProjectBodyDtoRegionApNortheast2 V1CreateProjectBodyDtoRegion = "ap-northeast-2" - V1CreateProjectBodyDtoRegionApSouth1 V1CreateProjectBodyDtoRegion = "ap-south-1" - V1CreateProjectBodyDtoRegionApSoutheast1 V1CreateProjectBodyDtoRegion = "ap-southeast-1" - V1CreateProjectBodyDtoRegionApSoutheast2 V1CreateProjectBodyDtoRegion = "ap-southeast-2" - V1CreateProjectBodyDtoRegionCaCentral1 V1CreateProjectBodyDtoRegion = "ca-central-1" - V1CreateProjectBodyDtoRegionEuCentral1 V1CreateProjectBodyDtoRegion = "eu-central-1" - V1CreateProjectBodyDtoRegionEuCentral2 V1CreateProjectBodyDtoRegion = "eu-central-2" - V1CreateProjectBodyDtoRegionEuNorth1 V1CreateProjectBodyDtoRegion = "eu-north-1" - V1CreateProjectBodyDtoRegionEuWest1 V1CreateProjectBodyDtoRegion = "eu-west-1" - V1CreateProjectBodyDtoRegionEuWest2 V1CreateProjectBodyDtoRegion = "eu-west-2" - V1CreateProjectBodyDtoRegionEuWest3 V1CreateProjectBodyDtoRegion = "eu-west-3" - V1CreateProjectBodyDtoRegionSaEast1 V1CreateProjectBodyDtoRegion = "sa-east-1" - V1CreateProjectBodyDtoRegionUsEast1 V1CreateProjectBodyDtoRegion = "us-east-1" - V1CreateProjectBodyDtoRegionUsEast2 V1CreateProjectBodyDtoRegion = "us-east-2" - V1CreateProjectBodyDtoRegionUsWest1 V1CreateProjectBodyDtoRegion = "us-west-1" - V1CreateProjectBodyDtoRegionUsWest2 V1CreateProjectBodyDtoRegion = "us-west-2" + V1OrganizationSlugResponseAllowedReleaseChannelsAlpha V1OrganizationSlugResponseAllowedReleaseChannels = "alpha" + V1OrganizationSlugResponseAllowedReleaseChannelsBeta V1OrganizationSlugResponseAllowedReleaseChannels = "beta" + V1OrganizationSlugResponseAllowedReleaseChannelsGa V1OrganizationSlugResponseAllowedReleaseChannels = "ga" + V1OrganizationSlugResponseAllowedReleaseChannelsInternal V1OrganizationSlugResponseAllowedReleaseChannels = "internal" + V1OrganizationSlugResponseAllowedReleaseChannelsPreview V1OrganizationSlugResponseAllowedReleaseChannels = "preview" + V1OrganizationSlugResponseAllowedReleaseChannelsWithdrawn V1OrganizationSlugResponseAllowedReleaseChannels = "withdrawn" ) // Defines values for V1OrganizationSlugResponseOptInTags. @@ -381,11 +713,79 @@ const ( AISQLGENERATOROPTIN V1OrganizationSlugResponseOptInTags = "AI_SQL_GENERATOR_OPT_IN" ) +// Defines values for V1OrganizationSlugResponsePlan. +const ( + V1OrganizationSlugResponsePlanEnterprise V1OrganizationSlugResponsePlan = "enterprise" + V1OrganizationSlugResponsePlanFree V1OrganizationSlugResponsePlan = "free" + V1OrganizationSlugResponsePlanPro V1OrganizationSlugResponsePlan = "pro" + V1OrganizationSlugResponsePlanTeam V1OrganizationSlugResponsePlan = "team" +) + // Defines values for V1PgbouncerConfigResponsePoolMode. const ( - V1PgbouncerConfigResponsePoolModeSession V1PgbouncerConfigResponsePoolMode = "session" - V1PgbouncerConfigResponsePoolModeStatement V1PgbouncerConfigResponsePoolMode = "statement" - V1PgbouncerConfigResponsePoolModeTransaction V1PgbouncerConfigResponsePoolMode = "transaction" + Session V1PgbouncerConfigResponsePoolMode = "session" + Statement V1PgbouncerConfigResponsePoolMode = "statement" + Transaction V1PgbouncerConfigResponsePoolMode = "transaction" +) + +// Defines values for V1ProjectAdvisorsResponseLintsCategories. +const ( + PERFORMANCE V1ProjectAdvisorsResponseLintsCategories = "PERFORMANCE" + SECURITY V1ProjectAdvisorsResponseLintsCategories = "SECURITY" +) + +// Defines values for V1ProjectAdvisorsResponseLintsFacing. +const ( + EXTERNAL V1ProjectAdvisorsResponseLintsFacing = "EXTERNAL" +) + +// Defines values for V1ProjectAdvisorsResponseLintsLevel. +const ( + ERROR V1ProjectAdvisorsResponseLintsLevel = "ERROR" + INFO V1ProjectAdvisorsResponseLintsLevel = "INFO" + WARN V1ProjectAdvisorsResponseLintsLevel = "WARN" +) + +// Defines values for V1ProjectAdvisorsResponseLintsMetadataType. +const ( + V1ProjectAdvisorsResponseLintsMetadataTypeAuth V1ProjectAdvisorsResponseLintsMetadataType = "auth" + V1ProjectAdvisorsResponseLintsMetadataTypeCompliance V1ProjectAdvisorsResponseLintsMetadataType = "compliance" + V1ProjectAdvisorsResponseLintsMetadataTypeExtension V1ProjectAdvisorsResponseLintsMetadataType = "extension" + V1ProjectAdvisorsResponseLintsMetadataTypeFunction V1ProjectAdvisorsResponseLintsMetadataType = "function" + V1ProjectAdvisorsResponseLintsMetadataTypeTable V1ProjectAdvisorsResponseLintsMetadataType = "table" + V1ProjectAdvisorsResponseLintsMetadataTypeView V1ProjectAdvisorsResponseLintsMetadataType = "view" +) + +// Defines values for V1ProjectAdvisorsResponseLintsName. +const ( + AuthInsufficientMfaOptions V1ProjectAdvisorsResponseLintsName = "auth_insufficient_mfa_options" + AuthLeakedPasswordProtection V1ProjectAdvisorsResponseLintsName = "auth_leaked_password_protection" + AuthOtpLongExpiry V1ProjectAdvisorsResponseLintsName = "auth_otp_long_expiry" + AuthOtpShortLength V1ProjectAdvisorsResponseLintsName = "auth_otp_short_length" + AuthPasswordPolicyMissing V1ProjectAdvisorsResponseLintsName = "auth_password_policy_missing" + AuthRlsInitplan V1ProjectAdvisorsResponseLintsName = "auth_rls_initplan" + AuthUsersExposed V1ProjectAdvisorsResponseLintsName = "auth_users_exposed" + DuplicateIndex V1ProjectAdvisorsResponseLintsName = "duplicate_index" + ExtensionInPublic V1ProjectAdvisorsResponseLintsName = "extension_in_public" + ForeignTableInApi V1ProjectAdvisorsResponseLintsName = "foreign_table_in_api" + FunctionSearchPathMutable V1ProjectAdvisorsResponseLintsName = "function_search_path_mutable" + LeakedServiceKey V1ProjectAdvisorsResponseLintsName = "leaked_service_key" + MaterializedViewInApi V1ProjectAdvisorsResponseLintsName = "materialized_view_in_api" + MultiplePermissivePolicies V1ProjectAdvisorsResponseLintsName = "multiple_permissive_policies" + NetworkRestrictionsNotSet V1ProjectAdvisorsResponseLintsName = "network_restrictions_not_set" + NoBackupAdmin V1ProjectAdvisorsResponseLintsName = "no_backup_admin" + NoPrimaryKey V1ProjectAdvisorsResponseLintsName = "no_primary_key" + PasswordRequirementsMinLength V1ProjectAdvisorsResponseLintsName = "password_requirements_min_length" + PitrNotEnabled V1ProjectAdvisorsResponseLintsName = "pitr_not_enabled" + PolicyExistsRlsDisabled V1ProjectAdvisorsResponseLintsName = "policy_exists_rls_disabled" + RlsDisabledInPublic V1ProjectAdvisorsResponseLintsName = "rls_disabled_in_public" + RlsEnabledNoPolicy V1ProjectAdvisorsResponseLintsName = "rls_enabled_no_policy" + RlsReferencesUserMetadata V1ProjectAdvisorsResponseLintsName = "rls_references_user_metadata" + SecurityDefinerView V1ProjectAdvisorsResponseLintsName = "security_definer_view" + SslNotEnforced V1ProjectAdvisorsResponseLintsName = "ssl_not_enforced" + UnindexedForeignKeys V1ProjectAdvisorsResponseLintsName = "unindexed_foreign_keys" + UnsupportedRegTypes V1ProjectAdvisorsResponseLintsName = "unsupported_reg_types" + UnusedIndex V1ProjectAdvisorsResponseLintsName = "unused_index" ) // Defines values for V1ProjectResponseStatus. @@ -426,6 +826,11 @@ const ( V1ProjectWithDatabaseResponseStatusUPGRADING V1ProjectWithDatabaseResponseStatus = "UPGRADING" ) +// Defines values for V1ServiceHealthResponseInfo0Name. +const ( + GoTrue V1ServiceHealthResponseInfo0Name = "GoTrue" +) + // Defines values for V1ServiceHealthResponseName. const ( V1ServiceHealthResponseNameAuth V1ServiceHealthResponseName = "auth" @@ -438,9 +843,9 @@ const ( // Defines values for V1ServiceHealthResponseStatus. const ( - ACTIVEHEALTHY V1ServiceHealthResponseStatus = "ACTIVE_HEALTHY" - COMINGUP V1ServiceHealthResponseStatus = "COMING_UP" - UNHEALTHY V1ServiceHealthResponseStatus = "UNHEALTHY" + V1ServiceHealthResponseStatusACTIVEHEALTHY V1ServiceHealthResponseStatus = "ACTIVE_HEALTHY" + V1ServiceHealthResponseStatusCOMINGUP V1ServiceHealthResponseStatus = "COMING_UP" + V1ServiceHealthResponseStatusUNHEALTHY V1ServiceHealthResponseStatus = "UNHEALTHY" ) // Defines values for VanitySubdomainConfigResponseStatus. @@ -464,14 +869,15 @@ const ( Sha256 V1AuthorizeUserParamsCodeChallengeMethod = "sha256" ) -// Defines values for V1GetServicesHealthParamsServices. +// Defines values for GetApiCountsParamsInterval. const ( - V1GetServicesHealthParamsServicesAuth V1GetServicesHealthParamsServices = "auth" - V1GetServicesHealthParamsServicesDb V1GetServicesHealthParamsServices = "db" - V1GetServicesHealthParamsServicesPooler V1GetServicesHealthParamsServices = "pooler" - V1GetServicesHealthParamsServicesRealtime V1GetServicesHealthParamsServices = "realtime" - V1GetServicesHealthParamsServicesRest V1GetServicesHealthParamsServices = "rest" - V1GetServicesHealthParamsServicesStorage V1GetServicesHealthParamsServices = "storage" + N15min GetApiCountsParamsInterval = "15min" + N1day GetApiCountsParamsInterval = "1day" + N1hr GetApiCountsParamsInterval = "1hr" + N30min GetApiCountsParamsInterval = "30min" + N3day GetApiCountsParamsInterval = "3day" + N3hr GetApiCountsParamsInterval = "3hr" + N7day GetApiCountsParamsInterval = "7day" ) // Defines values for V1ListAllSnippetsParamsSortBy. @@ -491,55 +897,76 @@ type ActivateVanitySubdomainResponse struct { CustomDomain string `json:"custom_domain"` } +// AnalyticsResponse defines model for AnalyticsResponse. +type AnalyticsResponse struct { + Error *AnalyticsResponse_Error `json:"error,omitempty"` + Result *[]interface{} `json:"result,omitempty"` +} + +// AnalyticsResponseError0 defines model for . +type AnalyticsResponseError0 = string + +// AnalyticsResponseError1 defines model for . +type AnalyticsResponseError1 struct { + Code float32 `json:"code"` + Errors []struct { + Domain string `json:"domain"` + Location string `json:"location"` + LocationType string `json:"locationType"` + Message string `json:"message"` + Reason string `json:"reason"` + } `json:"errors"` + Message string `json:"message"` + Status string `json:"status"` +} + +// AnalyticsResponse_Error defines model for AnalyticsResponse.Error. +type AnalyticsResponse_Error struct { + union json.RawMessage +} + // ApiKeyResponse defines model for ApiKeyResponse. type ApiKeyResponse struct { - ApiKey string `json:"api_key"` - Description *string `json:"description"` - Hash *string `json:"hash"` - Id *string `json:"id"` - InsertedAt *string `json:"inserted_at"` - Name string `json:"name"` - Prefix *string `json:"prefix"` - SecretJwtTemplate *ApiKeySecretJWTTemplate `json:"secret_jwt_template"` - Type *ApiKeyResponseType `json:"type"` - UpdatedAt *string `json:"updated_at"` + ApiKey string `json:"api_key"` + Description *string `json:"description"` + Hash *string `json:"hash"` + Id *string `json:"id"` + InsertedAt *time.Time `json:"inserted_at"` + Name string `json:"name"` + Prefix *string `json:"prefix"` + SecretJwtTemplate *struct { + Role string `json:"role"` + } `json:"secret_jwt_template"` + Type *ApiKeyResponseType `json:"type"` + UpdatedAt *time.Time `json:"updated_at"` } // ApiKeyResponseType defines model for ApiKeyResponse.Type. type ApiKeyResponseType string -// ApiKeySecretJWTTemplate defines model for ApiKeySecretJWTTemplate. -type ApiKeySecretJWTTemplate struct { - Role string `json:"role"` +// ApplyProjectAddonBody defines model for ApplyProjectAddonBody. +type ApplyProjectAddonBody struct { + AddonType ApplyProjectAddonBodyAddonType `json:"addon_type"` + AddonVariant ApplyProjectAddonBody_AddonVariant `json:"addon_variant"` } -// AttributeMapping defines model for AttributeMapping. -type AttributeMapping struct { - Keys map[string]AttributeValue `json:"keys"` -} - -// AttributeValue defines model for AttributeValue. -type AttributeValue struct { - Array *bool `json:"array,omitempty"` - Default *AttributeValue_Default `json:"default,omitempty"` - Name *string `json:"name,omitempty"` - Names *[]string `json:"names,omitempty"` -} +// ApplyProjectAddonBodyAddonType defines model for ApplyProjectAddonBody.AddonType. +type ApplyProjectAddonBodyAddonType string -// AttributeValueDefault0 defines model for . -type AttributeValueDefault0 = map[string]interface{} +// ApplyProjectAddonBodyAddonVariant0 defines model for ApplyProjectAddonBody.AddonVariant.0. +type ApplyProjectAddonBodyAddonVariant0 string -// AttributeValueDefault1 defines model for . -type AttributeValueDefault1 = float32 +// ApplyProjectAddonBodyAddonVariant1 defines model for ApplyProjectAddonBody.AddonVariant.1. +type ApplyProjectAddonBodyAddonVariant1 string -// AttributeValueDefault2 defines model for . -type AttributeValueDefault2 = string +// ApplyProjectAddonBodyAddonVariant2 defines model for ApplyProjectAddonBody.AddonVariant.2. +type ApplyProjectAddonBodyAddonVariant2 string -// AttributeValueDefault3 defines model for . -type AttributeValueDefault3 = bool +// ApplyProjectAddonBodyAddonVariant3 defines model for ApplyProjectAddonBody.AddonVariant.3. +type ApplyProjectAddonBodyAddonVariant3 string -// AttributeValue_Default defines model for AttributeValue.Default. -type AttributeValue_Default struct { +// ApplyProjectAddonBody_AddonVariant defines model for ApplyProjectAddonBody.AddonVariant. +type ApplyProjectAddonBody_AddonVariant struct { union json.RawMessage } @@ -611,6 +1038,7 @@ type AuthConfigResponse struct { ExternalTwitterClientId *string `json:"external_twitter_client_id"` ExternalTwitterEnabled *bool `json:"external_twitter_enabled"` ExternalTwitterSecret *string `json:"external_twitter_secret"` + ExternalWeb3SolanaEnabled *bool `json:"external_web3_solana_enabled"` ExternalWorkosClientId *string `json:"external_workos_client_id"` ExternalWorkosEnabled *bool `json:"external_workos_enabled"` ExternalWorkosSecret *string `json:"external_workos_secret"` @@ -670,6 +1098,7 @@ type AuthConfigResponse struct { RateLimitSmsSent *int `json:"rate_limit_sms_sent"` RateLimitTokenRefresh *int `json:"rate_limit_token_refresh"` RateLimitVerify *int `json:"rate_limit_verify"` + RateLimitWeb3 *int `json:"rate_limit_web3"` RefreshTokenRotationEnabled *bool `json:"refresh_token_rotation_enabled"` SamlAllowEncryptedAssertions *bool `json:"saml_allow_encrypted_assertions"` SamlEnabled *bool `json:"saml_enabled"` @@ -717,22 +1146,19 @@ type AuthConfigResponse struct { UriAllowList *string `json:"uri_allow_list"` } -// AuthHealthResponse defines model for AuthHealthResponse. -type AuthHealthResponse struct { - Name AuthHealthResponseName `json:"name"` +// BranchActionBody defines model for BranchActionBody. +type BranchActionBody struct { + MigrationVersion *string `json:"migration_version,omitempty"` } -// AuthHealthResponseName defines model for AuthHealthResponse.Name. -type AuthHealthResponseName string - -// BillingPlanId defines model for BillingPlanId. -type BillingPlanId string - // BranchDeleteResponse defines model for BranchDeleteResponse. type BranchDeleteResponse struct { - Message string `json:"message"` + Message BranchDeleteResponseMessage `json:"message"` } +// BranchDeleteResponseMessage defines model for BranchDeleteResponse.Message. +type BranchDeleteResponseMessage string + // BranchDetailResponse defines model for BranchDetailResponse. type BranchDetailResponse struct { DbHost string `json:"db_host"` @@ -774,12 +1200,15 @@ type BranchResponseStatus string // BranchUpdateResponse defines model for BranchUpdateResponse. type BranchUpdateResponse struct { - Message string `json:"message"` - WorkflowRunId string `json:"workflow_run_id"` + Message BranchUpdateResponseMessage `json:"message"` + WorkflowRunId string `json:"workflow_run_id"` } +// BranchUpdateResponseMessage defines model for BranchUpdateResponse.Message. +type BranchUpdateResponseMessage string + // BulkUpdateFunctionBody defines model for BulkUpdateFunctionBody. -type BulkUpdateFunctionBody struct { +type BulkUpdateFunctionBody = []struct { CreatedAt *int64 `json:"created_at,omitempty"` EntrypointPath *string `json:"entrypoint_path,omitempty"` Id string `json:"id"` @@ -797,22 +1226,32 @@ type BulkUpdateFunctionBodyStatus string // BulkUpdateFunctionResponse defines model for BulkUpdateFunctionResponse. type BulkUpdateFunctionResponse struct { - Functions []FunctionResponse `json:"functions"` -} - -// CfResponse defines model for CfResponse. -type CfResponse struct { - Errors []map[string]interface{} `json:"errors"` - Messages []map[string]interface{} `json:"messages"` - Result CustomHostnameDetails `json:"result"` - Success bool `json:"success"` -} + Functions []struct { + CreatedAt int `json:"created_at"` + EntrypointPath *string `json:"entrypoint_path,omitempty"` + Id string `json:"id"` + ImportMap *bool `json:"import_map,omitempty"` + ImportMapPath *string `json:"import_map_path,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Status BulkUpdateFunctionResponseFunctionsStatus `json:"status"` + UpdatedAt int `json:"updated_at"` + VerifyJwt *bool `json:"verify_jwt,omitempty"` + Version int `json:"version"` + } `json:"functions"` +} + +// BulkUpdateFunctionResponseFunctionsStatus defines model for BulkUpdateFunctionResponse.Functions.Status. +type BulkUpdateFunctionResponseFunctionsStatus string // CreateApiKeyBody defines model for CreateApiKeyBody. type CreateApiKeyBody struct { - Description *string `json:"description"` - SecretJwtTemplate *ApiKeySecretJWTTemplate `json:"secret_jwt_template"` - Type CreateApiKeyBodyType `json:"type"` + Description *string `json:"description"` + Name string `json:"name"` + SecretJwtTemplate *struct { + Role string `json:"role"` + } `json:"secret_jwt_template"` + Type CreateApiKeyBodyType `json:"type"` } // CreateApiKeyBodyType defines model for CreateApiKeyBody.Type. @@ -820,28 +1259,47 @@ type CreateApiKeyBodyType string // CreateBranchBody defines model for CreateBranchBody. type CreateBranchBody struct { - BranchName string `json:"branch_name"` - DesiredInstanceSize *DesiredInstanceSize `json:"desired_instance_size,omitempty"` - GitBranch *string `json:"git_branch,omitempty"` - Persistent *bool `json:"persistent,omitempty"` + BranchName string `json:"branch_name"` + DesiredInstanceSize *CreateBranchBodyDesiredInstanceSize `json:"desired_instance_size,omitempty"` + GitBranch *string `json:"git_branch,omitempty"` + Persistent *bool `json:"persistent,omitempty"` // PostgresEngine Postgres engine version. If not provided, the latest version will be used. - PostgresEngine *PostgresEngine `json:"postgres_engine,omitempty"` - Region *string `json:"region,omitempty"` - ReleaseChannel *ReleaseChannel `json:"release_channel,omitempty"` + PostgresEngine *CreateBranchBodyPostgresEngine `json:"postgres_engine,omitempty"` + Region *string `json:"region,omitempty"` + + // ReleaseChannel Release channel. If not provided, GA will be used. + ReleaseChannel *CreateBranchBodyReleaseChannel `json:"release_channel,omitempty"` + Secrets *map[string]string `json:"secrets,omitempty"` } -// CreateOrganizationV1Dto defines model for CreateOrganizationV1Dto. -type CreateOrganizationV1Dto struct { +// CreateBranchBodyDesiredInstanceSize defines model for CreateBranchBody.DesiredInstanceSize. +type CreateBranchBodyDesiredInstanceSize string + +// CreateBranchBodyPostgresEngine Postgres engine version. If not provided, the latest version will be used. +type CreateBranchBodyPostgresEngine string + +// CreateBranchBodyReleaseChannel Release channel. If not provided, GA will be used. +type CreateBranchBodyReleaseChannel string + +// CreateOrganizationV1 defines model for CreateOrganizationV1. +type CreateOrganizationV1 struct { Name string `json:"name"` } // CreateProviderBody defines model for CreateProviderBody. type CreateProviderBody struct { - AttributeMapping *AttributeMapping `json:"attribute_mapping,omitempty"` - Domains *[]string `json:"domains,omitempty"` - MetadataUrl *string `json:"metadata_url,omitempty"` - MetadataXml *string `json:"metadata_xml,omitempty"` + AttributeMapping *struct { + Keys map[string]struct { + Array *bool `json:"array,omitempty"` + Default *interface{} `json:"default,omitempty"` + Name *string `json:"name,omitempty"` + Names *[]string `json:"names,omitempty"` + } `json:"keys"` + } `json:"attribute_mapping,omitempty"` + Domains *[]string `json:"domains,omitempty"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` // Type What type of provider will be created Type CreateProviderBodyType `json:"type"` @@ -852,130 +1310,145 @@ type CreateProviderBodyType string // CreateProviderResponse defines model for CreateProviderResponse. type CreateProviderResponse struct { - CreatedAt *string `json:"created_at,omitempty"` - Domains *[]Domain `json:"domains,omitempty"` - Id string `json:"id"` - Saml *SamlDescriptor `json:"saml,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]struct { + CreatedAt *string `json:"created_at,omitempty"` + Domain *string `json:"domain,omitempty"` + Id string `json:"id"` + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"domains,omitempty"` + Id string `json:"id"` + Saml *struct { + AttributeMapping *struct { + Keys map[string]struct { + Array *bool `json:"array,omitempty"` + Default *interface{} `json:"default,omitempty"` + Name *string `json:"name,omitempty"` + Names *[]string `json:"names,omitempty"` + } `json:"keys"` + } `json:"attribute_mapping,omitempty"` + EntityId string `json:"entity_id"` + Id string `json:"id"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` + } `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` } // CreateSecretBody defines model for CreateSecretBody. -type CreateSecretBody struct { +type CreateSecretBody = []struct { // Name Secret name must not start with the SUPABASE_ prefix. Name string `json:"name"` Value string `json:"value"` } -// CreateThirdPartyAuthBody defines model for CreateThirdPartyAuthBody. -type CreateThirdPartyAuthBody struct { - CustomJwks *map[string]interface{} `json:"custom_jwks,omitempty"` - JwksUrl *string `json:"jwks_url,omitempty"` - OidcIssuerUrl *string `json:"oidc_issuer_url,omitempty"` -} - -// CustomHostnameDetails defines model for CustomHostnameDetails. -type CustomHostnameDetails struct { - CustomOriginServer string `json:"custom_origin_server"` - Hostname string `json:"hostname"` - Id string `json:"id"` - OwnershipVerification OwnershipVerification `json:"ownership_verification"` - Ssl SslValidation `json:"ssl"` - Status string `json:"status"` - VerificationErrors *[]string `json:"verification_errors,omitempty"` -} - -// DatabaseUpgradeStatus defines model for DatabaseUpgradeStatus. -type DatabaseUpgradeStatus struct { - Error *DatabaseUpgradeStatusError `json:"error,omitempty"` - InitiatedAt string `json:"initiated_at"` - LatestStatusAt string `json:"latest_status_at"` - Progress *DatabaseUpgradeStatusProgress `json:"progress,omitempty"` - Status DatabaseUpgradeStatusStatus `json:"status"` - TargetVersion int `json:"target_version"` +// CreateSigningKeyBody defines model for CreateSigningKeyBody. +type CreateSigningKeyBody struct { + Algorithm CreateSigningKeyBodyAlgorithm `json:"algorithm"` + Status *CreateSigningKeyBodyStatus `json:"status,omitempty"` } -// DatabaseUpgradeStatusError defines model for DatabaseUpgradeStatus.Error. -type DatabaseUpgradeStatusError string +// CreateSigningKeyBodyAlgorithm defines model for CreateSigningKeyBody.Algorithm. +type CreateSigningKeyBodyAlgorithm string -// DatabaseUpgradeStatusProgress defines model for DatabaseUpgradeStatus.Progress. -type DatabaseUpgradeStatusProgress string +// CreateSigningKeyBodyStatus defines model for CreateSigningKeyBody.Status. +type CreateSigningKeyBodyStatus string -// DatabaseUpgradeStatusStatus defines model for DatabaseUpgradeStatus.Status. -type DatabaseUpgradeStatusStatus int +// CreateThirdPartyAuthBody defines model for CreateThirdPartyAuthBody. +type CreateThirdPartyAuthBody struct { + CustomJwks *interface{} `json:"custom_jwks,omitempty"` + JwksUrl *string `json:"jwks_url,omitempty"` + OidcIssuerUrl *string `json:"oidc_issuer_url,omitempty"` +} // DatabaseUpgradeStatusResponse defines model for DatabaseUpgradeStatusResponse. type DatabaseUpgradeStatusResponse struct { - DatabaseUpgradeStatus *DatabaseUpgradeStatus `json:"databaseUpgradeStatus"` + DatabaseUpgradeStatus *struct { + Error *DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError `json:"error,omitempty"` + InitiatedAt string `json:"initiated_at"` + LatestStatusAt string `json:"latest_status_at"` + Progress *DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress `json:"progress,omitempty"` + Status float32 `json:"status"` + TargetVersion float32 `json:"target_version"` + } `json:"databaseUpgradeStatus"` } +// DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError defines model for DatabaseUpgradeStatusResponse.DatabaseUpgradeStatus.Error. +type DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError string + +// DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress defines model for DatabaseUpgradeStatusResponse.DatabaseUpgradeStatus.Progress. +type DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress string + // DeleteProviderResponse defines model for DeleteProviderResponse. type DeleteProviderResponse struct { - CreatedAt *string `json:"created_at,omitempty"` - Domains *[]Domain `json:"domains,omitempty"` - Id string `json:"id"` - Saml *SamlDescriptor `json:"saml,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]struct { + CreatedAt *string `json:"created_at,omitempty"` + Domain *string `json:"domain,omitempty"` + Id string `json:"id"` + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"domains,omitempty"` + Id string `json:"id"` + Saml *struct { + AttributeMapping *struct { + Keys map[string]struct { + Array *bool `json:"array,omitempty"` + Default *interface{} `json:"default,omitempty"` + Name *string `json:"name,omitempty"` + Names *[]string `json:"names,omitempty"` + } `json:"keys"` + } `json:"attribute_mapping,omitempty"` + EntityId string `json:"entity_id"` + Id string `json:"id"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` + } `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` } // DeployFunctionResponse defines model for DeployFunctionResponse. type DeployFunctionResponse struct { - ComputeMultiplier *float32 `json:"compute_multiplier,omitempty"` - CreatedAt *int64 `json:"created_at,omitempty"` - EntrypointPath *string `json:"entrypoint_path,omitempty"` - Id string `json:"id"` - ImportMap *bool `json:"import_map,omitempty"` - ImportMapPath *string `json:"import_map_path,omitempty"` - Name string `json:"name"` - Slug string `json:"slug"` - Status DeployFunctionResponseStatus `json:"status"` - UpdatedAt *int64 `json:"updated_at,omitempty"` - VerifyJwt *bool `json:"verify_jwt,omitempty"` - Version int `json:"version"` + CreatedAt *int64 `json:"created_at,omitempty"` + EntrypointPath *string `json:"entrypoint_path,omitempty"` + Id string `json:"id"` + ImportMap *bool `json:"import_map,omitempty"` + ImportMapPath *string `json:"import_map_path,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Status DeployFunctionResponseStatus `json:"status"` + UpdatedAt *int64 `json:"updated_at,omitempty"` + VerifyJwt *bool `json:"verify_jwt,omitempty"` + Version int `json:"version"` } // DeployFunctionResponseStatus defines model for DeployFunctionResponse.Status. type DeployFunctionResponseStatus string -// DesiredInstanceSize defines model for DesiredInstanceSize. -type DesiredInstanceSize string - -// Domain defines model for Domain. -type Domain struct { - CreatedAt *string `json:"created_at,omitempty"` - Domain *string `json:"domain,omitempty"` - Id string `json:"id"` - UpdatedAt *string `json:"updated_at,omitempty"` -} - // FunctionDeployBody defines model for FunctionDeployBody. type FunctionDeployBody struct { - File []openapi_types.File `json:"file"` - Metadata FunctionDeployMetadata `json:"metadata"` -} - -// FunctionDeployMetadata defines model for FunctionDeployMetadata. -type FunctionDeployMetadata struct { - EntrypointPath string `json:"entrypoint_path"` - ImportMapPath *string `json:"import_map_path,omitempty"` - Name *string `json:"name,omitempty"` - StaticPatterns *[]string `json:"static_patterns,omitempty"` - VerifyJwt *bool `json:"verify_jwt,omitempty"` + File *[]openapi_types.File `json:"file,omitempty"` + Metadata struct { + EntrypointPath string `json:"entrypoint_path"` + ImportMapPath *string `json:"import_map_path,omitempty"` + Name *string `json:"name,omitempty"` + StaticPatterns *[]string `json:"static_patterns,omitempty"` + VerifyJwt *bool `json:"verify_jwt,omitempty"` + } `json:"metadata"` } // FunctionResponse defines model for FunctionResponse. type FunctionResponse struct { - ComputeMultiplier *float32 `json:"compute_multiplier,omitempty"` - CreatedAt int64 `json:"created_at"` - EntrypointPath *string `json:"entrypoint_path,omitempty"` - Id string `json:"id"` - ImportMap *bool `json:"import_map,omitempty"` - ImportMapPath *string `json:"import_map_path,omitempty"` - Name string `json:"name"` - Slug string `json:"slug"` - Status FunctionResponseStatus `json:"status"` - UpdatedAt int64 `json:"updated_at"` - VerifyJwt *bool `json:"verify_jwt,omitempty"` - Version int `json:"version"` + CreatedAt int64 `json:"created_at"` + EntrypointPath *string `json:"entrypoint_path,omitempty"` + Id string `json:"id"` + ImportMap *bool `json:"import_map,omitempty"` + ImportMapPath *string `json:"import_map_path,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Status FunctionResponseStatus `json:"status"` + UpdatedAt int64 `json:"updated_at"` + VerifyJwt *bool `json:"verify_jwt,omitempty"` + Version int `json:"version"` } // FunctionResponseStatus defines model for FunctionResponse.Status. @@ -983,18 +1456,17 @@ type FunctionResponseStatus string // FunctionSlugResponse defines model for FunctionSlugResponse. type FunctionSlugResponse struct { - ComputeMultiplier *float32 `json:"compute_multiplier,omitempty"` - CreatedAt int64 `json:"created_at"` - EntrypointPath *string `json:"entrypoint_path,omitempty"` - Id string `json:"id"` - ImportMap *bool `json:"import_map,omitempty"` - ImportMapPath *string `json:"import_map_path,omitempty"` - Name string `json:"name"` - Slug string `json:"slug"` - Status FunctionSlugResponseStatus `json:"status"` - UpdatedAt int64 `json:"updated_at"` - VerifyJwt *bool `json:"verify_jwt,omitempty"` - Version int `json:"version"` + CreatedAt int `json:"created_at"` + EntrypointPath *string `json:"entrypoint_path,omitempty"` + Id string `json:"id"` + ImportMap *bool `json:"import_map,omitempty"` + ImportMapPath *string `json:"import_map_path,omitempty"` + Name string `json:"name"` + Slug string `json:"slug"` + Status FunctionSlugResponseStatus `json:"status"` + UpdatedAt int `json:"updated_at"` + VerifyJwt *bool `json:"verify_jwt,omitempty"` + Version int `json:"version"` } // FunctionSlugResponseStatus defines model for FunctionSlugResponse.Status. @@ -1002,39 +1474,198 @@ type FunctionSlugResponseStatus string // GetProjectAvailableRestoreVersionsResponse defines model for GetProjectAvailableRestoreVersionsResponse. type GetProjectAvailableRestoreVersionsResponse struct { - AvailableVersions []ProjectAvailableRestoreVersion `json:"available_versions"` + AvailableVersions []struct { + PostgresEngine GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine `json:"postgres_engine"` + ReleaseChannel GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel `json:"release_channel"` + Version string `json:"version"` + } `json:"available_versions"` } -// GetProjectDbMetadataResponseDto defines model for GetProjectDbMetadataResponseDto. -type GetProjectDbMetadataResponseDto struct { - Databases []GetProjectDbMetadataResponseDto_Databases_Item `json:"databases"` +// GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine defines model for GetProjectAvailableRestoreVersionsResponse.AvailableVersions.PostgresEngine. +type GetProjectAvailableRestoreVersionsResponseAvailableVersionsPostgresEngine string + +// GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel defines model for GetProjectAvailableRestoreVersionsResponse.AvailableVersions.ReleaseChannel. +type GetProjectAvailableRestoreVersionsResponseAvailableVersionsReleaseChannel string + +// GetProjectDbMetadataResponse defines model for GetProjectDbMetadataResponse. +type GetProjectDbMetadataResponse struct { + Databases []GetProjectDbMetadataResponse_Databases_Item `json:"databases"` } -// GetProjectDbMetadataResponseDto_Databases_Schemas_Item defines model for GetProjectDbMetadataResponseDto.Databases.Schemas.Item. -type GetProjectDbMetadataResponseDto_Databases_Schemas_Item struct { +// GetProjectDbMetadataResponse_Databases_Schemas_Item defines model for GetProjectDbMetadataResponse.Databases.Schemas.Item. +type GetProjectDbMetadataResponse_Databases_Schemas_Item struct { Name string `json:"name"` AdditionalProperties map[string]interface{} `json:"-"` } -// GetProjectDbMetadataResponseDto_Databases_Item defines model for GetProjectDbMetadataResponseDto.databases.Item. -type GetProjectDbMetadataResponseDto_Databases_Item struct { - Name string `json:"name"` - Schemas []GetProjectDbMetadataResponseDto_Databases_Schemas_Item `json:"schemas"` - AdditionalProperties map[string]interface{} `json:"-"` +// GetProjectDbMetadataResponse_Databases_Item defines model for GetProjectDbMetadataResponse.databases.Item. +type GetProjectDbMetadataResponse_Databases_Item struct { + Name string `json:"name"` + Schemas []GetProjectDbMetadataResponse_Databases_Schemas_Item `json:"schemas"` + AdditionalProperties map[string]interface{} `json:"-"` } // GetProviderResponse defines model for GetProviderResponse. type GetProviderResponse struct { - CreatedAt *string `json:"created_at,omitempty"` - Domains *[]Domain `json:"domains,omitempty"` - Id string `json:"id"` - Saml *SamlDescriptor `json:"saml,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]struct { + CreatedAt *string `json:"created_at,omitempty"` + Domain *string `json:"domain,omitempty"` + Id string `json:"id"` + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"domains,omitempty"` + Id string `json:"id"` + Saml *struct { + AttributeMapping *struct { + Keys map[string]struct { + Array *bool `json:"array,omitempty"` + Default *interface{} `json:"default,omitempty"` + Name *string `json:"name,omitempty"` + Names *[]string `json:"names,omitempty"` + } `json:"keys"` + } `json:"attribute_mapping,omitempty"` + EntityId string `json:"entity_id"` + Id string `json:"id"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` + } `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// ListProjectAddonsResponse defines model for ListProjectAddonsResponse. +type ListProjectAddonsResponse struct { + AvailableAddons []struct { + Name string `json:"name"` + Type ListProjectAddonsResponseAvailableAddonsType `json:"type"` + Variants []struct { + Id ListProjectAddonsResponse_AvailableAddons_Variants_Id `json:"id"` + + // Meta Any JSON-serializable value + Meta *interface{} `json:"meta,omitempty"` + Name string `json:"name"` + Price struct { + Amount float32 `json:"amount"` + Description string `json:"description"` + Interval ListProjectAddonsResponseAvailableAddonsVariantsPriceInterval `json:"interval"` + Type ListProjectAddonsResponseAvailableAddonsVariantsPriceType `json:"type"` + } `json:"price"` + } `json:"variants"` + } `json:"available_addons"` + SelectedAddons []struct { + Type ListProjectAddonsResponseSelectedAddonsType `json:"type"` + Variant struct { + Id ListProjectAddonsResponse_SelectedAddons_Variant_Id `json:"id"` + + // Meta Any JSON-serializable value + Meta *interface{} `json:"meta,omitempty"` + Name string `json:"name"` + Price struct { + Amount float32 `json:"amount"` + Description string `json:"description"` + Interval ListProjectAddonsResponseSelectedAddonsVariantPriceInterval `json:"interval"` + Type ListProjectAddonsResponseSelectedAddonsVariantPriceType `json:"type"` + } `json:"price"` + } `json:"variant"` + } `json:"selected_addons"` +} + +// ListProjectAddonsResponseAvailableAddonsType defines model for ListProjectAddonsResponse.AvailableAddons.Type. +type ListProjectAddonsResponseAvailableAddonsType string + +// ListProjectAddonsResponseAvailableAddonsVariantsId0 defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Id.0. +type ListProjectAddonsResponseAvailableAddonsVariantsId0 string + +// ListProjectAddonsResponseAvailableAddonsVariantsId1 defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Id.1. +type ListProjectAddonsResponseAvailableAddonsVariantsId1 string + +// ListProjectAddonsResponseAvailableAddonsVariantsId2 defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Id.2. +type ListProjectAddonsResponseAvailableAddonsVariantsId2 string + +// ListProjectAddonsResponseAvailableAddonsVariantsId3 defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Id.3. +type ListProjectAddonsResponseAvailableAddonsVariantsId3 string + +// ListProjectAddonsResponseAvailableAddonsVariantsId4 defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Id.4. +type ListProjectAddonsResponseAvailableAddonsVariantsId4 string + +// ListProjectAddonsResponseAvailableAddonsVariantsId5 defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Id.5. +type ListProjectAddonsResponseAvailableAddonsVariantsId5 string + +// ListProjectAddonsResponseAvailableAddonsVariantsId6 defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Id.6. +type ListProjectAddonsResponseAvailableAddonsVariantsId6 string + +// ListProjectAddonsResponse_AvailableAddons_Variants_Id defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Id. +type ListProjectAddonsResponse_AvailableAddons_Variants_Id struct { + union json.RawMessage +} + +// ListProjectAddonsResponseAvailableAddonsVariantsPriceInterval defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Price.Interval. +type ListProjectAddonsResponseAvailableAddonsVariantsPriceInterval string + +// ListProjectAddonsResponseAvailableAddonsVariantsPriceType defines model for ListProjectAddonsResponse.AvailableAddons.Variants.Price.Type. +type ListProjectAddonsResponseAvailableAddonsVariantsPriceType string + +// ListProjectAddonsResponseSelectedAddonsType defines model for ListProjectAddonsResponse.SelectedAddons.Type. +type ListProjectAddonsResponseSelectedAddonsType string + +// ListProjectAddonsResponseSelectedAddonsVariantId0 defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Id.0. +type ListProjectAddonsResponseSelectedAddonsVariantId0 string + +// ListProjectAddonsResponseSelectedAddonsVariantId1 defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Id.1. +type ListProjectAddonsResponseSelectedAddonsVariantId1 string + +// ListProjectAddonsResponseSelectedAddonsVariantId2 defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Id.2. +type ListProjectAddonsResponseSelectedAddonsVariantId2 string + +// ListProjectAddonsResponseSelectedAddonsVariantId3 defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Id.3. +type ListProjectAddonsResponseSelectedAddonsVariantId3 string + +// ListProjectAddonsResponseSelectedAddonsVariantId4 defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Id.4. +type ListProjectAddonsResponseSelectedAddonsVariantId4 string + +// ListProjectAddonsResponseSelectedAddonsVariantId5 defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Id.5. +type ListProjectAddonsResponseSelectedAddonsVariantId5 string + +// ListProjectAddonsResponseSelectedAddonsVariantId6 defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Id.6. +type ListProjectAddonsResponseSelectedAddonsVariantId6 string + +// ListProjectAddonsResponse_SelectedAddons_Variant_Id defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Id. +type ListProjectAddonsResponse_SelectedAddons_Variant_Id struct { + union json.RawMessage } +// ListProjectAddonsResponseSelectedAddonsVariantPriceInterval defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Price.Interval. +type ListProjectAddonsResponseSelectedAddonsVariantPriceInterval string + +// ListProjectAddonsResponseSelectedAddonsVariantPriceType defines model for ListProjectAddonsResponse.SelectedAddons.Variant.Price.Type. +type ListProjectAddonsResponseSelectedAddonsVariantPriceType string + // ListProvidersResponse defines model for ListProvidersResponse. type ListProvidersResponse struct { - Items []Provider `json:"items"` + Items []struct { + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]struct { + CreatedAt *string `json:"created_at,omitempty"` + Domain *string `json:"domain,omitempty"` + Id string `json:"id"` + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"domains,omitempty"` + Id string `json:"id"` + Saml *struct { + AttributeMapping *struct { + Keys map[string]struct { + Array *bool `json:"array,omitempty"` + Default *interface{} `json:"default,omitempty"` + Name *string `json:"name,omitempty"` + Names *[]string `json:"names,omitempty"` + } `json:"keys"` + } `json:"attribute_mapping,omitempty"` + EntityId string `json:"entity_id"` + Id string `json:"id"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` + } `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"items"` } // NetworkBanResponse defines model for NetworkBanResponse. @@ -1042,6 +1673,15 @@ type NetworkBanResponse struct { BannedIpv4Addresses []string `json:"banned_ipv4_addresses"` } +// NetworkBanResponseEnriched defines model for NetworkBanResponseEnriched. +type NetworkBanResponseEnriched struct { + BannedIpv4Addresses []struct { + BannedAddress string `json:"banned_address"` + Identifier string `json:"identifier"` + Type string `json:"type"` + } `json:"banned_ipv4_addresses"` +} + // NetworkRestrictionsRequest defines model for NetworkRestrictionsRequest. type NetworkRestrictionsRequest struct { DbAllowedCidrs *[]string `json:"dbAllowedCidrs,omitempty"` @@ -1050,10 +1690,19 @@ type NetworkRestrictionsRequest struct { // NetworkRestrictionsResponse defines model for NetworkRestrictionsResponse. type NetworkRestrictionsResponse struct { - Config NetworkRestrictionsRequest `json:"config"` + // Config At any given point in time, this is the config that the user has requested be applied to their project. The `status` field indicates if it has been applied to the project, or is pending. When an updated config is received, the applied config is moved to `old_config`. + Config struct { + DbAllowedCidrs *[]string `json:"dbAllowedCidrs,omitempty"` + DbAllowedCidrsV6 *[]string `json:"dbAllowedCidrsV6,omitempty"` + } `json:"config"` Entitlement NetworkRestrictionsResponseEntitlement `json:"entitlement"` - OldConfig *NetworkRestrictionsRequest `json:"old_config,omitempty"` - Status NetworkRestrictionsResponseStatus `json:"status"` + + // OldConfig Populated when a new config has been received, but not registered as successfully applied to a project. + OldConfig *struct { + DbAllowedCidrs *[]string `json:"dbAllowedCidrs,omitempty"` + DbAllowedCidrsV6 *[]string `json:"dbAllowedCidrsV6,omitempty"` + } `json:"old_config,omitempty"` + Status NetworkRestrictionsResponseStatus `json:"status"` } // NetworkRestrictionsResponseEntitlement defines model for NetworkRestrictionsResponse.Entitlement. @@ -1062,8 +1711,8 @@ type NetworkRestrictionsResponseEntitlement string // NetworkRestrictionsResponseStatus defines model for NetworkRestrictionsResponse.Status. type NetworkRestrictionsResponseStatus string -// OAuthRevokeTokenBodyDto defines model for OAuthRevokeTokenBodyDto. -type OAuthRevokeTokenBodyDto struct { +// OAuthRevokeTokenBody defines model for OAuthRevokeTokenBody. +type OAuthRevokeTokenBody struct { ClientId openapi_types.UUID `json:"client_id"` ClientSecret string `json:"client_secret"` RefreshToken string `json:"refresh_token"` @@ -1071,13 +1720,13 @@ type OAuthRevokeTokenBodyDto struct { // OAuthTokenBody defines model for OAuthTokenBody. type OAuthTokenBody struct { - ClientId string `json:"client_id"` - ClientSecret string `json:"client_secret"` - Code *string `json:"code,omitempty"` - CodeVerifier *string `json:"code_verifier,omitempty"` - GrantType OAuthTokenBodyGrantType `json:"grant_type"` - RedirectUri *string `json:"redirect_uri,omitempty"` - RefreshToken *string `json:"refresh_token,omitempty"` + ClientId *openapi_types.UUID `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + Code *string `json:"code,omitempty"` + CodeVerifier *string `json:"code_verifier,omitempty"` + GrantType *OAuthTokenBodyGrantType `json:"grant_type,omitempty"` + RedirectUri *string `json:"redirect_uri,omitempty"` + RefreshToken *string `json:"refresh_token,omitempty"` } // OAuthTokenBodyGrantType defines model for OAuthTokenBody.GrantType. @@ -1086,7 +1735,7 @@ type OAuthTokenBodyGrantType string // OAuthTokenResponse defines model for OAuthTokenResponse. type OAuthTokenResponse struct { AccessToken string `json:"access_token"` - ExpiresIn int64 `json:"expires_in"` + ExpiresIn int `json:"expires_in"` RefreshToken string `json:"refresh_token"` TokenType OAuthTokenResponseTokenType `json:"token_type"` } @@ -1100,13 +1749,6 @@ type OrganizationResponseV1 struct { Name string `json:"name"` } -// OwnershipVerification defines model for OwnershipVerification. -type OwnershipVerification struct { - Name string `json:"name"` - Type string `json:"type"` - Value string `json:"value"` -} - // PgsodiumConfigResponse defines model for PgsodiumConfigResponse. type PgsodiumConfigResponse struct { RootKey string `json:"root_key"` @@ -1142,9 +1784,6 @@ type PostgresConfigResponse struct { // PostgresConfigResponseSessionReplicationRole defines model for PostgresConfigResponse.SessionReplicationRole. type PostgresConfigResponseSessionReplicationRole string -// PostgresEngine Postgres engine version. If not provided, the latest version will be used. -type PostgresEngine string - // PostgrestConfigWithJWTSecretResponse defines model for PostgrestConfigWithJWTSecretResponse. type PostgrestConfigWithJWTSecretResponse struct { DbExtraSearchPath string `json:"db_extra_search_path"` @@ -1156,55 +1795,37 @@ type PostgrestConfigWithJWTSecretResponse struct { MaxRows int `json:"max_rows"` } -// ProjectAvailableRestoreVersion defines model for ProjectAvailableRestoreVersion. -type ProjectAvailableRestoreVersion struct { - PostgresEngine ProjectAvailableRestoreVersionPostgresEngine `json:"postgres_engine"` - ReleaseChannel ProjectAvailableRestoreVersionReleaseChannel `json:"release_channel"` - Version string `json:"version"` -} - -// ProjectAvailableRestoreVersionPostgresEngine defines model for ProjectAvailableRestoreVersion.PostgresEngine. -type ProjectAvailableRestoreVersionPostgresEngine string - -// ProjectAvailableRestoreVersionReleaseChannel defines model for ProjectAvailableRestoreVersion.ReleaseChannel. -type ProjectAvailableRestoreVersionReleaseChannel string - // ProjectUpgradeEligibilityResponse defines model for ProjectUpgradeEligibilityResponse. type ProjectUpgradeEligibilityResponse struct { - CurrentAppVersion string `json:"current_app_version"` - CurrentAppVersionReleaseChannel ReleaseChannel `json:"current_app_version_release_channel"` - DurationEstimateHours int `json:"duration_estimate_hours"` - Eligible bool `json:"eligible"` - ExtensionDependentObjects []string `json:"extension_dependent_objects"` - LatestAppVersion string `json:"latest_app_version"` - LegacyAuthCustomRoles []string `json:"legacy_auth_custom_roles"` - PotentialBreakingChanges []string `json:"potential_breaking_changes"` - TargetUpgradeVersions []ProjectVersion `json:"target_upgrade_versions"` -} + CurrentAppVersion string `json:"current_app_version"` + CurrentAppVersionReleaseChannel ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel `json:"current_app_version_release_channel"` + DurationEstimateHours float32 `json:"duration_estimate_hours"` + Eligible bool `json:"eligible"` + ExtensionDependentObjects []string `json:"extension_dependent_objects"` + LatestAppVersion string `json:"latest_app_version"` + LegacyAuthCustomRoles []string `json:"legacy_auth_custom_roles"` + PotentialBreakingChanges []string `json:"potential_breaking_changes"` + TargetUpgradeVersions []struct { + AppVersion string `json:"app_version"` + PostgresVersion ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion `json:"postgres_version"` + ReleaseChannel ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel `json:"release_channel"` + } `json:"target_upgrade_versions"` +} + +// ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel defines model for ProjectUpgradeEligibilityResponse.CurrentAppVersionReleaseChannel. +type ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel string + +// ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion defines model for ProjectUpgradeEligibilityResponse.TargetUpgradeVersions.PostgresVersion. +type ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion string + +// ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel defines model for ProjectUpgradeEligibilityResponse.TargetUpgradeVersions.ReleaseChannel. +type ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel string // ProjectUpgradeInitiateResponse defines model for ProjectUpgradeInitiateResponse. type ProjectUpgradeInitiateResponse struct { TrackingId string `json:"tracking_id"` } -// ProjectVersion defines model for ProjectVersion. -type ProjectVersion struct { - AppVersion string `json:"app_version"` - - // PostgresVersion Postgres engine version. If not provided, the latest version will be used. - PostgresVersion PostgresEngine `json:"postgres_version"` - ReleaseChannel ReleaseChannel `json:"release_channel"` -} - -// Provider defines model for Provider. -type Provider struct { - CreatedAt *string `json:"created_at,omitempty"` - Domains *[]Domain `json:"domains,omitempty"` - Id string `json:"id"` - Saml *SamlDescriptor `json:"saml,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` -} - // ReadOnlyStatusResponse defines model for ReadOnlyStatusResponse. type ReadOnlyStatusResponse struct { Enabled bool `json:"enabled"` @@ -1212,16 +1833,9 @@ type ReadOnlyStatusResponse struct { OverrideEnabled bool `json:"override_enabled"` } -// RealtimeHealthResponse defines model for RealtimeHealthResponse. -type RealtimeHealthResponse struct { - ConnectedCluster int `json:"connected_cluster"` -} - -// ReleaseChannel defines model for ReleaseChannel. -type ReleaseChannel string - // RemoveNetworkBanRequest defines model for RemoveNetworkBanRequest. type RemoveNetworkBanRequest struct { + Identifier *string `json:"identifier,omitempty"` Ipv4Addresses []string `json:"ipv4_addresses"` } @@ -1230,22 +1844,11 @@ type RemoveReadReplicaBody struct { DatabaseIdentifier string `json:"database_identifier"` } -// RestoreProjectBodyDto defines model for RestoreProjectBodyDto. -type RestoreProjectBodyDto = map[string]interface{} - -// SamlDescriptor defines model for SamlDescriptor. -type SamlDescriptor struct { - AttributeMapping *AttributeMapping `json:"attribute_mapping,omitempty"` - EntityId string `json:"entity_id"` - Id string `json:"id"` - MetadataUrl *string `json:"metadata_url,omitempty"` - MetadataXml *string `json:"metadata_xml,omitempty"` -} - // SecretResponse defines model for SecretResponse. type SecretResponse struct { - Name string `json:"name"` - Value string `json:"value"` + Name string `json:"name"` + UpdatedAt *string `json:"updated_at,omitempty"` + Value string `json:"value"` } // SetUpReadReplicaBody defines model for SetUpReadReplicaBody. @@ -1257,58 +1860,98 @@ type SetUpReadReplicaBody struct { // SetUpReadReplicaBodyReadReplicaRegion Region you want your read replica to reside in type SetUpReadReplicaBodyReadReplicaRegion string -// SnippetContent defines model for SnippetContent. -type SnippetContent struct { - Favorite bool `json:"favorite"` - SchemaVersion string `json:"schema_version"` - Sql string `json:"sql"` +// SigningKeyResponse defines model for SigningKeyResponse. +type SigningKeyResponse struct { + Algorithm SigningKeyResponseAlgorithm `json:"algorithm"` + CreatedAt time.Time `json:"created_at"` + Id openapi_types.UUID `json:"id"` + PublicJwk *interface{} `json:"public_jwk"` + Status SigningKeyResponseStatus `json:"status"` + UpdatedAt time.Time `json:"updated_at"` } -// SnippetList defines model for SnippetList. -type SnippetList struct { - Cursor *string `json:"cursor,omitempty"` - Data []SnippetMeta `json:"data"` -} +// SigningKeyResponseAlgorithm defines model for SigningKeyResponse.Algorithm. +type SigningKeyResponseAlgorithm string + +// SigningKeyResponseStatus defines model for SigningKeyResponse.Status. +type SigningKeyResponseStatus string -// SnippetMeta defines model for SnippetMeta. -type SnippetMeta struct { - Description *string `json:"description"` - Id string `json:"id"` - InsertedAt string `json:"inserted_at"` - Name string `json:"name"` - Owner SnippetUser `json:"owner"` - Project SnippetProject `json:"project"` - Type SnippetMetaType `json:"type"` - UpdatedAt string `json:"updated_at"` - UpdatedBy SnippetUser `json:"updated_by"` - Visibility SnippetMetaVisibility `json:"visibility"` +// SigningKeysResponse defines model for SigningKeysResponse. +type SigningKeysResponse struct { + Keys []struct { + Algorithm SigningKeysResponseKeysAlgorithm `json:"algorithm"` + CreatedAt time.Time `json:"created_at"` + Id openapi_types.UUID `json:"id"` + PublicJwk *interface{} `json:"public_jwk"` + Status SigningKeysResponseKeysStatus `json:"status"` + UpdatedAt time.Time `json:"updated_at"` + } `json:"keys"` } -// SnippetMetaType defines model for SnippetMeta.Type. -type SnippetMetaType string +// SigningKeysResponseKeysAlgorithm defines model for SigningKeysResponse.Keys.Algorithm. +type SigningKeysResponseKeysAlgorithm string -// SnippetMetaVisibility defines model for SnippetMeta.Visibility. -type SnippetMetaVisibility string +// SigningKeysResponseKeysStatus defines model for SigningKeysResponse.Keys.Status. +type SigningKeysResponseKeysStatus string -// SnippetProject defines model for SnippetProject. -type SnippetProject struct { - Id int64 `json:"id"` - Name string `json:"name"` -} +// SnippetList defines model for SnippetList. +type SnippetList struct { + Cursor *string `json:"cursor,omitempty"` + Data []struct { + Description *string `json:"description"` + Id string `json:"id"` + InsertedAt string `json:"inserted_at"` + Name string `json:"name"` + Owner struct { + Id float32 `json:"id"` + Username string `json:"username"` + } `json:"owner"` + Project struct { + Id float32 `json:"id"` + Name string `json:"name"` + } `json:"project"` + Type SnippetListDataType `json:"type"` + UpdatedAt string `json:"updated_at"` + UpdatedBy struct { + Id float32 `json:"id"` + Username string `json:"username"` + } `json:"updated_by"` + Visibility SnippetListDataVisibility `json:"visibility"` + } `json:"data"` +} + +// SnippetListDataType defines model for SnippetList.Data.Type. +type SnippetListDataType string + +// SnippetListDataVisibility defines model for SnippetList.Data.Visibility. +type SnippetListDataVisibility string // SnippetResponse defines model for SnippetResponse. type SnippetResponse struct { - Content SnippetContent `json:"content"` - Description *string `json:"description"` - Id string `json:"id"` - InsertedAt string `json:"inserted_at"` - Name string `json:"name"` - Owner SnippetUser `json:"owner"` - Project SnippetProject `json:"project"` - Type SnippetResponseType `json:"type"` - UpdatedAt string `json:"updated_at"` - UpdatedBy SnippetUser `json:"updated_by"` - Visibility SnippetResponseVisibility `json:"visibility"` + Content struct { + Favorite bool `json:"favorite"` + SchemaVersion string `json:"schema_version"` + Sql string `json:"sql"` + } `json:"content"` + Description *string `json:"description"` + Id string `json:"id"` + InsertedAt string `json:"inserted_at"` + Name string `json:"name"` + Owner struct { + Id float32 `json:"id"` + Username string `json:"username"` + } `json:"owner"` + Project struct { + Id float32 `json:"id"` + Name string `json:"name"` + } `json:"project"` + Type SnippetResponseType `json:"type"` + UpdatedAt string `json:"updated_at"` + UpdatedBy struct { + Id float32 `json:"id"` + Username string `json:"username"` + } `json:"updated_by"` + Visibility SnippetResponseVisibility `json:"visibility"` } // SnippetResponseType defines model for SnippetResponse.Type. @@ -1317,56 +1960,36 @@ type SnippetResponseType string // SnippetResponseVisibility defines model for SnippetResponse.Visibility. type SnippetResponseVisibility string -// SnippetUser defines model for SnippetUser. -type SnippetUser struct { - Id int64 `json:"id"` - Username string `json:"username"` -} - // SslEnforcementRequest defines model for SslEnforcementRequest. type SslEnforcementRequest struct { - RequestedConfig SslEnforcements `json:"requestedConfig"` + RequestedConfig struct { + Database bool `json:"database"` + } `json:"requestedConfig"` } // SslEnforcementResponse defines model for SslEnforcementResponse. type SslEnforcementResponse struct { - AppliedSuccessfully bool `json:"appliedSuccessfully"` - CurrentConfig SslEnforcements `json:"currentConfig"` -} - -// SslEnforcements defines model for SslEnforcements. -type SslEnforcements struct { - Database bool `json:"database"` -} - -// SslValidation defines model for SslValidation. -type SslValidation struct { - Status string `json:"status"` - ValidationErrors *[]ValidationError `json:"validation_errors,omitempty"` - ValidationRecords []ValidationRecord `json:"validation_records"` + AppliedSuccessfully bool `json:"appliedSuccessfully"` + CurrentConfig struct { + Database bool `json:"database"` + } `json:"currentConfig"` } // StorageConfigResponse defines model for StorageConfigResponse. type StorageConfigResponse struct { - Features StorageFeatures `json:"features"` - FileSizeLimit int64 `json:"fileSizeLimit"` -} - -// StorageFeatureImageTransformation defines model for StorageFeatureImageTransformation. -type StorageFeatureImageTransformation struct { - Enabled bool `json:"enabled"` + Features struct { + ImageTransformation struct { + Enabled bool `json:"enabled"` + } `json:"imageTransformation"` + S3Protocol struct { + Enabled bool `json:"enabled"` + } `json:"s3Protocol"` + } `json:"features"` + FileSizeLimit int64 `json:"fileSizeLimit"` } -// StorageFeatureS3Protocol defines model for StorageFeatureS3Protocol. -type StorageFeatureS3Protocol struct { - Enabled bool `json:"enabled"` -} - -// StorageFeatures defines model for StorageFeatures. -type StorageFeatures struct { - ImageTransformation StorageFeatureImageTransformation `json:"imageTransformation"` - S3Protocol StorageFeatureS3Protocol `json:"s3Protocol"` -} +// StreamableFile defines model for StreamableFile. +type StreamableFile = map[string]interface{} // SubdomainAvailabilityResponse defines model for SubdomainAvailabilityResponse. type SubdomainAvailabilityResponse struct { @@ -1375,7 +1998,7 @@ type SubdomainAvailabilityResponse struct { // SupavisorConfigResponse defines model for SupavisorConfigResponse. type SupavisorConfigResponse struct { - ConnectionString string `json:"connectionString"` + ConnectionString string `json:"connection_string"` DatabaseType SupavisorConfigResponseDatabaseType `json:"database_type"` DbHost string `json:"db_host"` DbName string `json:"db_name"` @@ -1396,15 +2019,15 @@ type SupavisorConfigResponsePoolMode string // ThirdPartyAuth defines model for ThirdPartyAuth. type ThirdPartyAuth struct { - CustomJwks *map[string]interface{} `json:"custom_jwks"` - Id string `json:"id"` - InsertedAt string `json:"inserted_at"` - JwksUrl *string `json:"jwks_url"` - OidcIssuerUrl *string `json:"oidc_issuer_url"` - ResolvedAt *string `json:"resolved_at"` - ResolvedJwks *map[string]interface{} `json:"resolved_jwks"` - Type string `json:"type"` - UpdatedAt string `json:"updated_at"` + CustomJwks *interface{} `json:"custom_jwks"` + Id openapi_types.UUID `json:"id"` + InsertedAt string `json:"inserted_at"` + JwksUrl *string `json:"jwks_url"` + OidcIssuerUrl *string `json:"oidc_issuer_url"` + ResolvedAt *string `json:"resolved_at"` + ResolvedJwks *interface{} `json:"resolved_jwks"` + Type string `json:"type"` + UpdatedAt string `json:"updated_at"` } // TypescriptResponse defines model for TypescriptResponse. @@ -1414,186 +2037,197 @@ type TypescriptResponse struct { // UpdateApiKeyBody defines model for UpdateApiKeyBody. type UpdateApiKeyBody struct { - Description *string `json:"description"` - SecretJwtTemplate *ApiKeySecretJWTTemplate `json:"secret_jwt_template"` + Description *string `json:"description"` + Name *string `json:"name,omitempty"` + SecretJwtTemplate *struct { + Role string `json:"role"` + } `json:"secret_jwt_template"` } // UpdateAuthConfigBody defines model for UpdateAuthConfigBody. type UpdateAuthConfigBody struct { - ApiMaxRequestDuration *int `json:"api_max_request_duration,omitempty"` - DbMaxPoolSize *int `json:"db_max_pool_size,omitempty"` - DisableSignup *bool `json:"disable_signup,omitempty"` - ExternalAnonymousUsersEnabled *bool `json:"external_anonymous_users_enabled,omitempty"` - ExternalAppleAdditionalClientIds *string `json:"external_apple_additional_client_ids,omitempty"` - ExternalAppleClientId *string `json:"external_apple_client_id,omitempty"` - ExternalAppleEnabled *bool `json:"external_apple_enabled,omitempty"` - ExternalAppleSecret *string `json:"external_apple_secret,omitempty"` - ExternalAzureClientId *string `json:"external_azure_client_id,omitempty"` - ExternalAzureEnabled *bool `json:"external_azure_enabled,omitempty"` - ExternalAzureSecret *string `json:"external_azure_secret,omitempty"` - ExternalAzureUrl *string `json:"external_azure_url,omitempty"` - ExternalBitbucketClientId *string `json:"external_bitbucket_client_id,omitempty"` - ExternalBitbucketEnabled *bool `json:"external_bitbucket_enabled,omitempty"` - ExternalBitbucketSecret *string `json:"external_bitbucket_secret,omitempty"` - ExternalDiscordClientId *string `json:"external_discord_client_id,omitempty"` - ExternalDiscordEnabled *bool `json:"external_discord_enabled,omitempty"` - ExternalDiscordSecret *string `json:"external_discord_secret,omitempty"` - ExternalEmailEnabled *bool `json:"external_email_enabled,omitempty"` - ExternalFacebookClientId *string `json:"external_facebook_client_id,omitempty"` - ExternalFacebookEnabled *bool `json:"external_facebook_enabled,omitempty"` - ExternalFacebookSecret *string `json:"external_facebook_secret,omitempty"` - ExternalFigmaClientId *string `json:"external_figma_client_id,omitempty"` - ExternalFigmaEnabled *bool `json:"external_figma_enabled,omitempty"` - ExternalFigmaSecret *string `json:"external_figma_secret,omitempty"` - ExternalGithubClientId *string `json:"external_github_client_id,omitempty"` - ExternalGithubEnabled *bool `json:"external_github_enabled,omitempty"` - ExternalGithubSecret *string `json:"external_github_secret,omitempty"` - ExternalGitlabClientId *string `json:"external_gitlab_client_id,omitempty"` - ExternalGitlabEnabled *bool `json:"external_gitlab_enabled,omitempty"` - ExternalGitlabSecret *string `json:"external_gitlab_secret,omitempty"` - ExternalGitlabUrl *string `json:"external_gitlab_url,omitempty"` - ExternalGoogleAdditionalClientIds *string `json:"external_google_additional_client_ids,omitempty"` - ExternalGoogleClientId *string `json:"external_google_client_id,omitempty"` - ExternalGoogleEnabled *bool `json:"external_google_enabled,omitempty"` - ExternalGoogleSecret *string `json:"external_google_secret,omitempty"` - ExternalGoogleSkipNonceCheck *bool `json:"external_google_skip_nonce_check,omitempty"` - ExternalKakaoClientId *string `json:"external_kakao_client_id,omitempty"` - ExternalKakaoEnabled *bool `json:"external_kakao_enabled,omitempty"` - ExternalKakaoSecret *string `json:"external_kakao_secret,omitempty"` - ExternalKeycloakClientId *string `json:"external_keycloak_client_id,omitempty"` - ExternalKeycloakEnabled *bool `json:"external_keycloak_enabled,omitempty"` - ExternalKeycloakSecret *string `json:"external_keycloak_secret,omitempty"` - ExternalKeycloakUrl *string `json:"external_keycloak_url,omitempty"` - ExternalLinkedinOidcClientId *string `json:"external_linkedin_oidc_client_id,omitempty"` - ExternalLinkedinOidcEnabled *bool `json:"external_linkedin_oidc_enabled,omitempty"` - ExternalLinkedinOidcSecret *string `json:"external_linkedin_oidc_secret,omitempty"` - ExternalNotionClientId *string `json:"external_notion_client_id,omitempty"` - ExternalNotionEnabled *bool `json:"external_notion_enabled,omitempty"` - ExternalNotionSecret *string `json:"external_notion_secret,omitempty"` - ExternalPhoneEnabled *bool `json:"external_phone_enabled,omitempty"` - ExternalSlackClientId *string `json:"external_slack_client_id,omitempty"` - ExternalSlackEnabled *bool `json:"external_slack_enabled,omitempty"` - ExternalSlackOidcClientId *string `json:"external_slack_oidc_client_id,omitempty"` - ExternalSlackOidcEnabled *bool `json:"external_slack_oidc_enabled,omitempty"` - ExternalSlackOidcSecret *string `json:"external_slack_oidc_secret,omitempty"` - ExternalSlackSecret *string `json:"external_slack_secret,omitempty"` - ExternalSpotifyClientId *string `json:"external_spotify_client_id,omitempty"` - ExternalSpotifyEnabled *bool `json:"external_spotify_enabled,omitempty"` - ExternalSpotifySecret *string `json:"external_spotify_secret,omitempty"` - ExternalTwitchClientId *string `json:"external_twitch_client_id,omitempty"` - ExternalTwitchEnabled *bool `json:"external_twitch_enabled,omitempty"` - ExternalTwitchSecret *string `json:"external_twitch_secret,omitempty"` - ExternalTwitterClientId *string `json:"external_twitter_client_id,omitempty"` - ExternalTwitterEnabled *bool `json:"external_twitter_enabled,omitempty"` - ExternalTwitterSecret *string `json:"external_twitter_secret,omitempty"` - ExternalWorkosClientId *string `json:"external_workos_client_id,omitempty"` - ExternalWorkosEnabled *bool `json:"external_workos_enabled,omitempty"` - ExternalWorkosSecret *string `json:"external_workos_secret,omitempty"` - ExternalWorkosUrl *string `json:"external_workos_url,omitempty"` - ExternalZoomClientId *string `json:"external_zoom_client_id,omitempty"` - ExternalZoomEnabled *bool `json:"external_zoom_enabled,omitempty"` - ExternalZoomSecret *string `json:"external_zoom_secret,omitempty"` - HookCustomAccessTokenEnabled *bool `json:"hook_custom_access_token_enabled,omitempty"` - HookCustomAccessTokenSecrets *string `json:"hook_custom_access_token_secrets,omitempty"` - HookCustomAccessTokenUri *string `json:"hook_custom_access_token_uri,omitempty"` - HookMfaVerificationAttemptEnabled *bool `json:"hook_mfa_verification_attempt_enabled,omitempty"` - HookMfaVerificationAttemptSecrets *string `json:"hook_mfa_verification_attempt_secrets,omitempty"` - HookMfaVerificationAttemptUri *string `json:"hook_mfa_verification_attempt_uri,omitempty"` - HookPasswordVerificationAttemptEnabled *bool `json:"hook_password_verification_attempt_enabled,omitempty"` - HookPasswordVerificationAttemptSecrets *string `json:"hook_password_verification_attempt_secrets,omitempty"` - HookPasswordVerificationAttemptUri *string `json:"hook_password_verification_attempt_uri,omitempty"` - HookSendEmailEnabled *bool `json:"hook_send_email_enabled,omitempty"` - HookSendEmailSecrets *string `json:"hook_send_email_secrets,omitempty"` - HookSendEmailUri *string `json:"hook_send_email_uri,omitempty"` - HookSendSmsEnabled *bool `json:"hook_send_sms_enabled,omitempty"` - HookSendSmsSecrets *string `json:"hook_send_sms_secrets,omitempty"` - HookSendSmsUri *string `json:"hook_send_sms_uri,omitempty"` - JwtExp *int `json:"jwt_exp,omitempty"` - MailerAllowUnverifiedEmailSignIns *bool `json:"mailer_allow_unverified_email_sign_ins,omitempty"` - MailerAutoconfirm *bool `json:"mailer_autoconfirm,omitempty"` + ApiMaxRequestDuration *int `json:"api_max_request_duration"` + DbMaxPoolSize *int `json:"db_max_pool_size"` + DisableSignup *bool `json:"disable_signup"` + ExternalAnonymousUsersEnabled *bool `json:"external_anonymous_users_enabled"` + ExternalAppleAdditionalClientIds *string `json:"external_apple_additional_client_ids"` + ExternalAppleClientId *string `json:"external_apple_client_id"` + ExternalAppleEnabled *bool `json:"external_apple_enabled"` + ExternalAppleSecret *string `json:"external_apple_secret"` + ExternalAzureClientId *string `json:"external_azure_client_id"` + ExternalAzureEnabled *bool `json:"external_azure_enabled"` + ExternalAzureSecret *string `json:"external_azure_secret"` + ExternalAzureUrl *string `json:"external_azure_url"` + ExternalBitbucketClientId *string `json:"external_bitbucket_client_id"` + ExternalBitbucketEnabled *bool `json:"external_bitbucket_enabled"` + ExternalBitbucketSecret *string `json:"external_bitbucket_secret"` + ExternalDiscordClientId *string `json:"external_discord_client_id"` + ExternalDiscordEnabled *bool `json:"external_discord_enabled"` + ExternalDiscordSecret *string `json:"external_discord_secret"` + ExternalEmailEnabled *bool `json:"external_email_enabled"` + ExternalFacebookClientId *string `json:"external_facebook_client_id"` + ExternalFacebookEnabled *bool `json:"external_facebook_enabled"` + ExternalFacebookSecret *string `json:"external_facebook_secret"` + ExternalFigmaClientId *string `json:"external_figma_client_id"` + ExternalFigmaEnabled *bool `json:"external_figma_enabled"` + ExternalFigmaSecret *string `json:"external_figma_secret"` + ExternalGithubClientId *string `json:"external_github_client_id"` + ExternalGithubEnabled *bool `json:"external_github_enabled"` + ExternalGithubSecret *string `json:"external_github_secret"` + ExternalGitlabClientId *string `json:"external_gitlab_client_id"` + ExternalGitlabEnabled *bool `json:"external_gitlab_enabled"` + ExternalGitlabSecret *string `json:"external_gitlab_secret"` + ExternalGitlabUrl *string `json:"external_gitlab_url"` + ExternalGoogleAdditionalClientIds *string `json:"external_google_additional_client_ids"` + ExternalGoogleClientId *string `json:"external_google_client_id"` + ExternalGoogleEnabled *bool `json:"external_google_enabled"` + ExternalGoogleSecret *string `json:"external_google_secret"` + ExternalGoogleSkipNonceCheck *bool `json:"external_google_skip_nonce_check"` + ExternalKakaoClientId *string `json:"external_kakao_client_id"` + ExternalKakaoEnabled *bool `json:"external_kakao_enabled"` + ExternalKakaoSecret *string `json:"external_kakao_secret"` + ExternalKeycloakClientId *string `json:"external_keycloak_client_id"` + ExternalKeycloakEnabled *bool `json:"external_keycloak_enabled"` + ExternalKeycloakSecret *string `json:"external_keycloak_secret"` + ExternalKeycloakUrl *string `json:"external_keycloak_url"` + ExternalLinkedinOidcClientId *string `json:"external_linkedin_oidc_client_id"` + ExternalLinkedinOidcEnabled *bool `json:"external_linkedin_oidc_enabled"` + ExternalLinkedinOidcSecret *string `json:"external_linkedin_oidc_secret"` + ExternalNotionClientId *string `json:"external_notion_client_id"` + ExternalNotionEnabled *bool `json:"external_notion_enabled"` + ExternalNotionSecret *string `json:"external_notion_secret"` + ExternalPhoneEnabled *bool `json:"external_phone_enabled"` + ExternalSlackClientId *string `json:"external_slack_client_id"` + ExternalSlackEnabled *bool `json:"external_slack_enabled"` + ExternalSlackOidcClientId *string `json:"external_slack_oidc_client_id"` + ExternalSlackOidcEnabled *bool `json:"external_slack_oidc_enabled"` + ExternalSlackOidcSecret *string `json:"external_slack_oidc_secret"` + ExternalSlackSecret *string `json:"external_slack_secret"` + ExternalSpotifyClientId *string `json:"external_spotify_client_id"` + ExternalSpotifyEnabled *bool `json:"external_spotify_enabled"` + ExternalSpotifySecret *string `json:"external_spotify_secret"` + ExternalTwitchClientId *string `json:"external_twitch_client_id"` + ExternalTwitchEnabled *bool `json:"external_twitch_enabled"` + ExternalTwitchSecret *string `json:"external_twitch_secret"` + ExternalTwitterClientId *string `json:"external_twitter_client_id"` + ExternalTwitterEnabled *bool `json:"external_twitter_enabled"` + ExternalTwitterSecret *string `json:"external_twitter_secret"` + ExternalWeb3SolanaEnabled *bool `json:"external_web3_solana_enabled"` + ExternalWorkosClientId *string `json:"external_workos_client_id"` + ExternalWorkosEnabled *bool `json:"external_workos_enabled"` + ExternalWorkosSecret *string `json:"external_workos_secret"` + ExternalWorkosUrl *string `json:"external_workos_url"` + ExternalZoomClientId *string `json:"external_zoom_client_id"` + ExternalZoomEnabled *bool `json:"external_zoom_enabled"` + ExternalZoomSecret *string `json:"external_zoom_secret"` + HookCustomAccessTokenEnabled *bool `json:"hook_custom_access_token_enabled"` + HookCustomAccessTokenSecrets *string `json:"hook_custom_access_token_secrets"` + HookCustomAccessTokenUri *string `json:"hook_custom_access_token_uri"` + HookMfaVerificationAttemptEnabled *bool `json:"hook_mfa_verification_attempt_enabled"` + HookMfaVerificationAttemptSecrets *string `json:"hook_mfa_verification_attempt_secrets"` + HookMfaVerificationAttemptUri *string `json:"hook_mfa_verification_attempt_uri"` + HookPasswordVerificationAttemptEnabled *bool `json:"hook_password_verification_attempt_enabled"` + HookPasswordVerificationAttemptSecrets *string `json:"hook_password_verification_attempt_secrets"` + HookPasswordVerificationAttemptUri *string `json:"hook_password_verification_attempt_uri"` + HookSendEmailEnabled *bool `json:"hook_send_email_enabled"` + HookSendEmailSecrets *string `json:"hook_send_email_secrets"` + HookSendEmailUri *string `json:"hook_send_email_uri"` + HookSendSmsEnabled *bool `json:"hook_send_sms_enabled"` + HookSendSmsSecrets *string `json:"hook_send_sms_secrets"` + HookSendSmsUri *string `json:"hook_send_sms_uri"` + JwtExp *int `json:"jwt_exp"` + MailerAllowUnverifiedEmailSignIns *bool `json:"mailer_allow_unverified_email_sign_ins"` + MailerAutoconfirm *bool `json:"mailer_autoconfirm"` MailerOtpExp *int `json:"mailer_otp_exp,omitempty"` - MailerOtpLength *int `json:"mailer_otp_length,omitempty"` - MailerSecureEmailChangeEnabled *bool `json:"mailer_secure_email_change_enabled,omitempty"` - MailerSubjectsConfirmation *string `json:"mailer_subjects_confirmation,omitempty"` - MailerSubjectsEmailChange *string `json:"mailer_subjects_email_change,omitempty"` - MailerSubjectsInvite *string `json:"mailer_subjects_invite,omitempty"` - MailerSubjectsMagicLink *string `json:"mailer_subjects_magic_link,omitempty"` - MailerSubjectsReauthentication *string `json:"mailer_subjects_reauthentication,omitempty"` - MailerSubjectsRecovery *string `json:"mailer_subjects_recovery,omitempty"` - MailerTemplatesConfirmationContent *string `json:"mailer_templates_confirmation_content,omitempty"` - MailerTemplatesEmailChangeContent *string `json:"mailer_templates_email_change_content,omitempty"` - MailerTemplatesInviteContent *string `json:"mailer_templates_invite_content,omitempty"` - MailerTemplatesMagicLinkContent *string `json:"mailer_templates_magic_link_content,omitempty"` - MailerTemplatesReauthenticationContent *string `json:"mailer_templates_reauthentication_content,omitempty"` - MailerTemplatesRecoveryContent *string `json:"mailer_templates_recovery_content,omitempty"` - MfaMaxEnrolledFactors *int `json:"mfa_max_enrolled_factors,omitempty"` - MfaPhoneEnrollEnabled *bool `json:"mfa_phone_enroll_enabled,omitempty"` - MfaPhoneMaxFrequency *int `json:"mfa_phone_max_frequency,omitempty"` - MfaPhoneOtpLength *int `json:"mfa_phone_otp_length,omitempty"` - MfaPhoneTemplate *string `json:"mfa_phone_template,omitempty"` - MfaPhoneVerifyEnabled *bool `json:"mfa_phone_verify_enabled,omitempty"` - MfaTotpEnrollEnabled *bool `json:"mfa_totp_enroll_enabled,omitempty"` - MfaTotpVerifyEnabled *bool `json:"mfa_totp_verify_enabled,omitempty"` - MfaWebAuthnEnrollEnabled *bool `json:"mfa_web_authn_enroll_enabled,omitempty"` - MfaWebAuthnVerifyEnabled *bool `json:"mfa_web_authn_verify_enabled,omitempty"` - PasswordHibpEnabled *bool `json:"password_hibp_enabled,omitempty"` - PasswordMinLength *int `json:"password_min_length,omitempty"` - PasswordRequiredCharacters *UpdateAuthConfigBodyPasswordRequiredCharacters `json:"password_required_characters,omitempty"` - RateLimitAnonymousUsers *int `json:"rate_limit_anonymous_users,omitempty"` - RateLimitEmailSent *int `json:"rate_limit_email_sent,omitempty"` - RateLimitOtp *int `json:"rate_limit_otp,omitempty"` - RateLimitSmsSent *int `json:"rate_limit_sms_sent,omitempty"` - RateLimitTokenRefresh *int `json:"rate_limit_token_refresh,omitempty"` - RateLimitVerify *int `json:"rate_limit_verify,omitempty"` - RefreshTokenRotationEnabled *bool `json:"refresh_token_rotation_enabled,omitempty"` - SamlEnabled *bool `json:"saml_enabled,omitempty"` - SamlExternalUrl *string `json:"saml_external_url,omitempty"` - SecurityCaptchaEnabled *bool `json:"security_captcha_enabled,omitempty"` - SecurityCaptchaProvider *string `json:"security_captcha_provider,omitempty"` - SecurityCaptchaSecret *string `json:"security_captcha_secret,omitempty"` - SecurityManualLinkingEnabled *bool `json:"security_manual_linking_enabled,omitempty"` - SecurityRefreshTokenReuseInterval *int `json:"security_refresh_token_reuse_interval,omitempty"` - SecurityUpdatePasswordRequireReauthentication *bool `json:"security_update_password_require_reauthentication,omitempty"` - SessionsInactivityTimeout *int `json:"sessions_inactivity_timeout,omitempty"` - SessionsSinglePerUser *bool `json:"sessions_single_per_user,omitempty"` - SessionsTags *string `json:"sessions_tags,omitempty"` - SessionsTimebox *int `json:"sessions_timebox,omitempty"` - SiteUrl *string `json:"site_url,omitempty"` - SmsAutoconfirm *bool `json:"sms_autoconfirm,omitempty"` - SmsMaxFrequency *int `json:"sms_max_frequency,omitempty"` - SmsMessagebirdAccessKey *string `json:"sms_messagebird_access_key,omitempty"` - SmsMessagebirdOriginator *string `json:"sms_messagebird_originator,omitempty"` - SmsOtpExp *int `json:"sms_otp_exp,omitempty"` + MailerOtpLength *int `json:"mailer_otp_length"` + MailerSecureEmailChangeEnabled *bool `json:"mailer_secure_email_change_enabled"` + MailerSubjectsConfirmation *string `json:"mailer_subjects_confirmation"` + MailerSubjectsEmailChange *string `json:"mailer_subjects_email_change"` + MailerSubjectsInvite *string `json:"mailer_subjects_invite"` + MailerSubjectsMagicLink *string `json:"mailer_subjects_magic_link"` + MailerSubjectsReauthentication *string `json:"mailer_subjects_reauthentication"` + MailerSubjectsRecovery *string `json:"mailer_subjects_recovery"` + MailerTemplatesConfirmationContent *string `json:"mailer_templates_confirmation_content"` + MailerTemplatesEmailChangeContent *string `json:"mailer_templates_email_change_content"` + MailerTemplatesInviteContent *string `json:"mailer_templates_invite_content"` + MailerTemplatesMagicLinkContent *string `json:"mailer_templates_magic_link_content"` + MailerTemplatesReauthenticationContent *string `json:"mailer_templates_reauthentication_content"` + MailerTemplatesRecoveryContent *string `json:"mailer_templates_recovery_content"` + MfaMaxEnrolledFactors *int `json:"mfa_max_enrolled_factors"` + MfaPhoneEnrollEnabled *bool `json:"mfa_phone_enroll_enabled"` + MfaPhoneMaxFrequency *int `json:"mfa_phone_max_frequency"` + MfaPhoneOtpLength *int `json:"mfa_phone_otp_length"` + MfaPhoneTemplate *string `json:"mfa_phone_template"` + MfaPhoneVerifyEnabled *bool `json:"mfa_phone_verify_enabled"` + MfaTotpEnrollEnabled *bool `json:"mfa_totp_enroll_enabled"` + MfaTotpVerifyEnabled *bool `json:"mfa_totp_verify_enabled"` + MfaWebAuthnEnrollEnabled *bool `json:"mfa_web_authn_enroll_enabled"` + MfaWebAuthnVerifyEnabled *bool `json:"mfa_web_authn_verify_enabled"` + PasswordHibpEnabled *bool `json:"password_hibp_enabled"` + PasswordMinLength *int `json:"password_min_length"` + PasswordRequiredCharacters *UpdateAuthConfigBodyPasswordRequiredCharacters `json:"password_required_characters"` + RateLimitAnonymousUsers *int `json:"rate_limit_anonymous_users"` + RateLimitEmailSent *int `json:"rate_limit_email_sent"` + RateLimitOtp *int `json:"rate_limit_otp"` + RateLimitSmsSent *int `json:"rate_limit_sms_sent"` + RateLimitTokenRefresh *int `json:"rate_limit_token_refresh"` + RateLimitVerify *int `json:"rate_limit_verify"` + RateLimitWeb3 *int `json:"rate_limit_web3"` + RefreshTokenRotationEnabled *bool `json:"refresh_token_rotation_enabled"` + SamlEnabled *bool `json:"saml_enabled"` + SamlExternalUrl *string `json:"saml_external_url"` + SecurityCaptchaEnabled *bool `json:"security_captcha_enabled"` + SecurityCaptchaProvider *UpdateAuthConfigBodySecurityCaptchaProvider `json:"security_captcha_provider"` + SecurityCaptchaSecret *string `json:"security_captcha_secret"` + SecurityManualLinkingEnabled *bool `json:"security_manual_linking_enabled"` + SecurityRefreshTokenReuseInterval *int `json:"security_refresh_token_reuse_interval"` + SecurityUpdatePasswordRequireReauthentication *bool `json:"security_update_password_require_reauthentication"` + SessionsInactivityTimeout *int `json:"sessions_inactivity_timeout"` + SessionsSinglePerUser *bool `json:"sessions_single_per_user"` + SessionsTags *string `json:"sessions_tags"` + SessionsTimebox *int `json:"sessions_timebox"` + SiteUrl *string `json:"site_url"` + SmsAutoconfirm *bool `json:"sms_autoconfirm"` + SmsMaxFrequency *int `json:"sms_max_frequency"` + SmsMessagebirdAccessKey *string `json:"sms_messagebird_access_key"` + SmsMessagebirdOriginator *string `json:"sms_messagebird_originator"` + SmsOtpExp *int `json:"sms_otp_exp"` SmsOtpLength *int `json:"sms_otp_length,omitempty"` - SmsProvider *string `json:"sms_provider,omitempty"` - SmsTemplate *string `json:"sms_template,omitempty"` - SmsTestOtp *string `json:"sms_test_otp,omitempty"` - SmsTestOtpValidUntil *string `json:"sms_test_otp_valid_until,omitempty"` - SmsTextlocalApiKey *string `json:"sms_textlocal_api_key,omitempty"` - SmsTextlocalSender *string `json:"sms_textlocal_sender,omitempty"` - SmsTwilioAccountSid *string `json:"sms_twilio_account_sid,omitempty"` - SmsTwilioAuthToken *string `json:"sms_twilio_auth_token,omitempty"` - SmsTwilioContentSid *string `json:"sms_twilio_content_sid,omitempty"` - SmsTwilioMessageServiceSid *string `json:"sms_twilio_message_service_sid,omitempty"` - SmsTwilioVerifyAccountSid *string `json:"sms_twilio_verify_account_sid,omitempty"` - SmsTwilioVerifyAuthToken *string `json:"sms_twilio_verify_auth_token,omitempty"` - SmsTwilioVerifyMessageServiceSid *string `json:"sms_twilio_verify_message_service_sid,omitempty"` - SmsVonageApiKey *string `json:"sms_vonage_api_key,omitempty"` - SmsVonageApiSecret *string `json:"sms_vonage_api_secret,omitempty"` - SmsVonageFrom *string `json:"sms_vonage_from,omitempty"` - SmtpAdminEmail *string `json:"smtp_admin_email,omitempty"` - SmtpHost *string `json:"smtp_host,omitempty"` - SmtpMaxFrequency *int `json:"smtp_max_frequency,omitempty"` - SmtpPass *string `json:"smtp_pass,omitempty"` - SmtpPort *string `json:"smtp_port,omitempty"` - SmtpSenderName *string `json:"smtp_sender_name,omitempty"` - SmtpUser *string `json:"smtp_user,omitempty"` - UriAllowList *string `json:"uri_allow_list,omitempty"` + SmsProvider *UpdateAuthConfigBodySmsProvider `json:"sms_provider"` + SmsTemplate *string `json:"sms_template"` + SmsTestOtp *string `json:"sms_test_otp"` + SmsTestOtpValidUntil *time.Time `json:"sms_test_otp_valid_until"` + SmsTextlocalApiKey *string `json:"sms_textlocal_api_key"` + SmsTextlocalSender *string `json:"sms_textlocal_sender"` + SmsTwilioAccountSid *string `json:"sms_twilio_account_sid"` + SmsTwilioAuthToken *string `json:"sms_twilio_auth_token"` + SmsTwilioContentSid *string `json:"sms_twilio_content_sid"` + SmsTwilioMessageServiceSid *string `json:"sms_twilio_message_service_sid"` + SmsTwilioVerifyAccountSid *string `json:"sms_twilio_verify_account_sid"` + SmsTwilioVerifyAuthToken *string `json:"sms_twilio_verify_auth_token"` + SmsTwilioVerifyMessageServiceSid *string `json:"sms_twilio_verify_message_service_sid"` + SmsVonageApiKey *string `json:"sms_vonage_api_key"` + SmsVonageApiSecret *string `json:"sms_vonage_api_secret"` + SmsVonageFrom *string `json:"sms_vonage_from"` + SmtpAdminEmail *string `json:"smtp_admin_email"` + SmtpHost *string `json:"smtp_host"` + SmtpMaxFrequency *int `json:"smtp_max_frequency"` + SmtpPass *string `json:"smtp_pass"` + SmtpPort *string `json:"smtp_port"` + SmtpSenderName *string `json:"smtp_sender_name"` + SmtpUser *string `json:"smtp_user"` + UriAllowList *string `json:"uri_allow_list"` } // UpdateAuthConfigBodyPasswordRequiredCharacters defines model for UpdateAuthConfigBody.PasswordRequiredCharacters. type UpdateAuthConfigBodyPasswordRequiredCharacters string +// UpdateAuthConfigBodySecurityCaptchaProvider defines model for UpdateAuthConfigBody.SecurityCaptchaProvider. +type UpdateAuthConfigBodySecurityCaptchaProvider string + +// UpdateAuthConfigBodySmsProvider defines model for UpdateAuthConfigBody.SmsProvider. +type UpdateAuthConfigBodySmsProvider string + // UpdateBranchBody defines model for UpdateBranchBody. type UpdateBranchBody struct { BranchName *string `json:"branch_name,omitempty"` @@ -1616,9 +2250,35 @@ type UpdateCustomHostnameBody struct { // UpdateCustomHostnameResponse defines model for UpdateCustomHostnameResponse. type UpdateCustomHostnameResponse struct { - CustomHostname string `json:"custom_hostname"` - Data CfResponse `json:"data"` - Status UpdateCustomHostnameResponseStatus `json:"status"` + CustomHostname string `json:"custom_hostname"` + Data struct { + Errors []interface{} `json:"errors"` + Messages []interface{} `json:"messages"` + Result struct { + CustomOriginServer string `json:"custom_origin_server"` + Hostname string `json:"hostname"` + Id string `json:"id"` + OwnershipVerification struct { + Name string `json:"name"` + Type string `json:"type"` + Value string `json:"value"` + } `json:"ownership_verification"` + Ssl struct { + Status string `json:"status"` + ValidationErrors *[]struct { + Message string `json:"message"` + } `json:"validation_errors,omitempty"` + ValidationRecords []struct { + TxtName string `json:"txt_name"` + TxtValue string `json:"txt_value"` + } `json:"validation_records"` + } `json:"ssl"` + Status string `json:"status"` + VerificationErrors *[]string `json:"verification_errors,omitempty"` + } `json:"result"` + Success bool `json:"success"` + } `json:"data"` + Status UpdateCustomHostnameResponseStatus `json:"status"` } // UpdateCustomHostnameResponseStatus defines model for UpdateCustomHostnameResponse.Status. @@ -1660,125 +2320,125 @@ type UpdatePostgresConfigBody struct { // UpdatePostgresConfigBodySessionReplicationRole defines model for UpdatePostgresConfigBody.SessionReplicationRole. type UpdatePostgresConfigBodySessionReplicationRole string -// UpdatePostgrestConfigBody defines model for UpdatePostgrestConfigBody. -type UpdatePostgrestConfigBody struct { - DbExtraSearchPath *string `json:"db_extra_search_path,omitempty"` - DbPool *int `json:"db_pool,omitempty"` - DbSchema *string `json:"db_schema,omitempty"` - MaxRows *int `json:"max_rows,omitempty"` -} - // UpdateProviderBody defines model for UpdateProviderBody. type UpdateProviderBody struct { - AttributeMapping *AttributeMapping `json:"attribute_mapping,omitempty"` - Domains *[]string `json:"domains,omitempty"` - MetadataUrl *string `json:"metadata_url,omitempty"` - MetadataXml *string `json:"metadata_xml,omitempty"` + AttributeMapping *struct { + Keys map[string]struct { + Array *bool `json:"array,omitempty"` + Default *interface{} `json:"default,omitempty"` + Name *string `json:"name,omitempty"` + Names *[]string `json:"names,omitempty"` + } `json:"keys"` + } `json:"attribute_mapping,omitempty"` + Domains *[]string `json:"domains,omitempty"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` } // UpdateProviderResponse defines model for UpdateProviderResponse. type UpdateProviderResponse struct { - CreatedAt *string `json:"created_at,omitempty"` - Domains *[]Domain `json:"domains,omitempty"` - Id string `json:"id"` - Saml *SamlDescriptor `json:"saml,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]struct { + CreatedAt *string `json:"created_at,omitempty"` + Domain *string `json:"domain,omitempty"` + Id string `json:"id"` + UpdatedAt *string `json:"updated_at,omitempty"` + } `json:"domains,omitempty"` + Id string `json:"id"` + Saml *struct { + AttributeMapping *struct { + Keys map[string]struct { + Array *bool `json:"array,omitempty"` + Default *interface{} `json:"default,omitempty"` + Name *string `json:"name,omitempty"` + Names *[]string `json:"names,omitempty"` + } `json:"keys"` + } `json:"attribute_mapping,omitempty"` + EntityId string `json:"entity_id"` + Id string `json:"id"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` + } `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` } +// UpdateSigningKeyBody defines model for UpdateSigningKeyBody. +type UpdateSigningKeyBody struct { + Status UpdateSigningKeyBodyStatus `json:"status"` +} + +// UpdateSigningKeyBodyStatus defines model for UpdateSigningKeyBody.Status. +type UpdateSigningKeyBodyStatus string + // UpdateStorageConfigBody defines model for UpdateStorageConfigBody. type UpdateStorageConfigBody struct { - Features *StorageFeatures `json:"features,omitempty"` - FileSizeLimit *int64 `json:"fileSizeLimit,omitempty"` + Features *struct { + ImageTransformation struct { + Enabled bool `json:"enabled"` + } `json:"imageTransformation"` + S3Protocol struct { + Enabled bool `json:"enabled"` + } `json:"s3Protocol"` + } `json:"features,omitempty"` + FileSizeLimit *int64 `json:"fileSizeLimit,omitempty"` } // UpdateSupavisorConfigBody defines model for UpdateSupavisorConfigBody. type UpdateSupavisorConfigBody struct { DefaultPoolSize *int `json:"default_pool_size"` - // PoolMode This field is deprecated and is ignored in this request - // Deprecated: + // PoolMode Dedicated pooler mode for the project PoolMode *UpdateSupavisorConfigBodyPoolMode `json:"pool_mode,omitempty"` } -// UpdateSupavisorConfigBodyPoolMode This field is deprecated and is ignored in this request +// UpdateSupavisorConfigBodyPoolMode Dedicated pooler mode for the project type UpdateSupavisorConfigBodyPoolMode string // UpdateSupavisorConfigResponse defines model for UpdateSupavisorConfigResponse. type UpdateSupavisorConfigResponse struct { - DefaultPoolSize *int `json:"default_pool_size"` - PoolMode UpdateSupavisorConfigResponsePoolMode `json:"pool_mode"` + DefaultPoolSize *int `json:"default_pool_size"` + PoolMode string `json:"pool_mode"` } -// UpdateSupavisorConfigResponsePoolMode defines model for UpdateSupavisorConfigResponse.PoolMode. -type UpdateSupavisorConfigResponsePoolMode string - // UpgradeDatabaseBody defines model for UpgradeDatabaseBody. type UpgradeDatabaseBody struct { - ReleaseChannel ReleaseChannel `json:"release_channel"` - TargetVersion string `json:"target_version"` -} - -// V1AnalyticsResponse defines model for V1AnalyticsResponse. -type V1AnalyticsResponse struct { - Error *V1AnalyticsResponse_Error `json:"error,omitempty"` - Result *[]map[string]interface{} `json:"result,omitempty"` -} - -// V1AnalyticsResponseError0 defines model for . -type V1AnalyticsResponseError0 struct { - Code *float32 `json:"code,omitempty"` - Errors *[]struct { - Domain *string `json:"domain,omitempty"` - Location *string `json:"location,omitempty"` - LocationType *string `json:"locationType,omitempty"` - Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` - } `json:"errors,omitempty"` - Message *string `json:"message,omitempty"` - Status *string `json:"status,omitempty"` -} - -// V1AnalyticsResponseError1 defines model for . -type V1AnalyticsResponseError1 = string - -// V1AnalyticsResponse_Error defines model for V1AnalyticsResponse.Error. -type V1AnalyticsResponse_Error struct { - union json.RawMessage -} - -// V1Backup defines model for V1Backup. -type V1Backup struct { - InsertedAt string `json:"inserted_at"` - IsPhysicalBackup bool `json:"is_physical_backup"` - Status V1BackupStatus `json:"status"` + ReleaseChannel *UpgradeDatabaseBodyReleaseChannel `json:"release_channel,omitempty"` + TargetVersion string `json:"target_version"` } -// V1BackupStatus defines model for V1Backup.Status. -type V1BackupStatus string +// UpgradeDatabaseBodyReleaseChannel defines model for UpgradeDatabaseBody.ReleaseChannel. +type UpgradeDatabaseBodyReleaseChannel string // V1BackupsResponse defines model for V1BackupsResponse. type V1BackupsResponse struct { - Backups []V1Backup `json:"backups"` - PhysicalBackupData V1PhysicalBackup `json:"physical_backup_data"` - PitrEnabled bool `json:"pitr_enabled"` - Region string `json:"region"` - WalgEnabled bool `json:"walg_enabled"` -} - -// V1CreateFunctionBody defines model for V1CreateFunctionBody. -type V1CreateFunctionBody struct { - Body string `json:"body"` - ComputeMultiplier *float32 `json:"compute_multiplier,omitempty"` - Name string `json:"name"` - Slug string `json:"slug"` - VerifyJwt *bool `json:"verify_jwt,omitempty"` -} - -// V1CreateProjectBodyDto defines model for V1CreateProjectBodyDto. -type V1CreateProjectBodyDto struct { + Backups []struct { + InsertedAt string `json:"inserted_at"` + IsPhysicalBackup bool `json:"is_physical_backup"` + Status V1BackupsResponseBackupsStatus `json:"status"` + } `json:"backups"` + PhysicalBackupData struct { + EarliestPhysicalBackupDateUnix *int `json:"earliest_physical_backup_date_unix,omitempty"` + LatestPhysicalBackupDateUnix *int `json:"latest_physical_backup_date_unix,omitempty"` + } `json:"physical_backup_data"` + PitrEnabled bool `json:"pitr_enabled"` + Region string `json:"region"` + WalgEnabled bool `json:"walg_enabled"` +} + +// V1BackupsResponseBackupsStatus defines model for V1BackupsResponse.Backups.Status. +type V1BackupsResponseBackupsStatus string + +// V1CreateMigrationBody defines model for V1CreateMigrationBody. +type V1CreateMigrationBody struct { + Name *string `json:"name,omitempty"` + Query string `json:"query"` +} + +// V1CreateProjectBody defines model for V1CreateProjectBody. +type V1CreateProjectBody struct { // DbPass Database password - DbPass string `json:"db_pass"` - DesiredInstanceSize *V1CreateProjectBodyDtoDesiredInstanceSize `json:"desired_instance_size,omitempty"` + DbPass string `json:"db_pass"` + DesiredInstanceSize *V1CreateProjectBodyDesiredInstanceSize `json:"desired_instance_size,omitempty"` // KpsEnabled This field is deprecated and is ignored in this request // Deprecated: @@ -1792,37 +2452,28 @@ type V1CreateProjectBodyDto struct { // Plan Subscription Plan is now set on organization level and is ignored in this request // Deprecated: - Plan *V1CreateProjectBodyDtoPlan `json:"plan,omitempty"` + Plan *V1CreateProjectBodyPlan `json:"plan,omitempty"` // Region Region you want your server to reside in - Region V1CreateProjectBodyDtoRegion `json:"region"` + Region V1CreateProjectBodyRegion `json:"region"` // TemplateUrl Template URL used to create the project from the CLI. TemplateUrl *string `json:"template_url,omitempty"` } -// V1CreateProjectBodyDtoDesiredInstanceSize defines model for V1CreateProjectBodyDto.DesiredInstanceSize. -type V1CreateProjectBodyDtoDesiredInstanceSize string - -// V1CreateProjectBodyDtoPlan Subscription Plan is now set on organization level and is ignored in this request -type V1CreateProjectBodyDtoPlan string - -// V1CreateProjectBodyDtoRegion Region you want your server to reside in -type V1CreateProjectBodyDtoRegion string +// V1CreateProjectBodyDesiredInstanceSize defines model for V1CreateProjectBody.DesiredInstanceSize. +type V1CreateProjectBodyDesiredInstanceSize string -// V1DatabaseResponse defines model for V1DatabaseResponse. -type V1DatabaseResponse struct { - // Host Database host - Host string `json:"host"` +// V1CreateProjectBodyPlan Subscription Plan is now set on organization level and is ignored in this request +type V1CreateProjectBodyPlan string - // PostgresEngine Database engine - PostgresEngine string `json:"postgres_engine"` +// V1CreateProjectBodyRegion Region you want your server to reside in +type V1CreateProjectBodyRegion string - // ReleaseChannel Release channel - ReleaseChannel string `json:"release_channel"` - - // Version Database version - Version string `json:"version"` +// V1ListMigrationsResponse defines model for V1ListMigrationsResponse. +type V1ListMigrationsResponse = []struct { + Name *string `json:"name,omitempty"` + Version string `json:"version"` } // V1OrganizationMemberResponse defines model for V1OrganizationMemberResponse. @@ -1836,16 +2487,22 @@ type V1OrganizationMemberResponse struct { // V1OrganizationSlugResponse defines model for V1OrganizationSlugResponse. type V1OrganizationSlugResponse struct { - AllowedReleaseChannels []ReleaseChannel `json:"allowed_release_channels"` - Id string `json:"id"` - Name string `json:"name"` - OptInTags []V1OrganizationSlugResponseOptInTags `json:"opt_in_tags"` - Plan *BillingPlanId `json:"plan,omitempty"` + AllowedReleaseChannels []V1OrganizationSlugResponseAllowedReleaseChannels `json:"allowed_release_channels"` + Id string `json:"id"` + Name string `json:"name"` + OptInTags []V1OrganizationSlugResponseOptInTags `json:"opt_in_tags"` + Plan *V1OrganizationSlugResponsePlan `json:"plan,omitempty"` } +// V1OrganizationSlugResponseAllowedReleaseChannels defines model for V1OrganizationSlugResponse.AllowedReleaseChannels. +type V1OrganizationSlugResponseAllowedReleaseChannels string + // V1OrganizationSlugResponseOptInTags defines model for V1OrganizationSlugResponse.OptInTags. type V1OrganizationSlugResponseOptInTags string +// V1OrganizationSlugResponsePlan defines model for V1OrganizationSlugResponse.Plan. +type V1OrganizationSlugResponsePlan string + // V1PgbouncerConfigResponse defines model for V1PgbouncerConfigResponse. type V1PgbouncerConfigResponse struct { ConnectionString *string `json:"connection_string,omitempty"` @@ -1858,12 +2515,6 @@ type V1PgbouncerConfigResponse struct { // V1PgbouncerConfigResponsePoolMode defines model for V1PgbouncerConfigResponse.PoolMode. type V1PgbouncerConfigResponsePoolMode string -// V1PhysicalBackup defines model for V1PhysicalBackup. -type V1PhysicalBackup struct { - EarliestPhysicalBackupDateUnix *int64 `json:"earliest_physical_backup_date_unix,omitempty"` - LatestPhysicalBackupDateUnix *int64 `json:"latest_physical_backup_date_unix,omitempty"` -} - // V1PostgrestConfigResponse defines model for V1PostgrestConfigResponse. type V1PostgrestConfigResponse struct { DbExtraSearchPath string `json:"db_extra_search_path"` @@ -1874,9 +2525,47 @@ type V1PostgrestConfigResponse struct { MaxRows int `json:"max_rows"` } +// V1ProjectAdvisorsResponse defines model for V1ProjectAdvisorsResponse. +type V1ProjectAdvisorsResponse struct { + Lints []struct { + CacheKey string `json:"cache_key"` + Categories []V1ProjectAdvisorsResponseLintsCategories `json:"categories"` + Description string `json:"description"` + Detail string `json:"detail"` + Facing V1ProjectAdvisorsResponseLintsFacing `json:"facing"` + Level V1ProjectAdvisorsResponseLintsLevel `json:"level"` + Metadata *struct { + Entity *string `json:"entity,omitempty"` + FkeyColumns *[]float32 `json:"fkey_columns,omitempty"` + FkeyName *string `json:"fkey_name,omitempty"` + Name *string `json:"name,omitempty"` + Schema *string `json:"schema,omitempty"` + Type *V1ProjectAdvisorsResponseLintsMetadataType `json:"type,omitempty"` + } `json:"metadata,omitempty"` + Name V1ProjectAdvisorsResponseLintsName `json:"name"` + Remediation string `json:"remediation"` + Title string `json:"title"` + } `json:"lints"` +} + +// V1ProjectAdvisorsResponseLintsCategories defines model for V1ProjectAdvisorsResponse.Lints.Categories. +type V1ProjectAdvisorsResponseLintsCategories string + +// V1ProjectAdvisorsResponseLintsFacing defines model for V1ProjectAdvisorsResponse.Lints.Facing. +type V1ProjectAdvisorsResponseLintsFacing string + +// V1ProjectAdvisorsResponseLintsLevel defines model for V1ProjectAdvisorsResponse.Lints.Level. +type V1ProjectAdvisorsResponseLintsLevel string + +// V1ProjectAdvisorsResponseLintsMetadataType defines model for V1ProjectAdvisorsResponse.Lints.Metadata.Type. +type V1ProjectAdvisorsResponseLintsMetadataType string + +// V1ProjectAdvisorsResponseLintsName defines model for V1ProjectAdvisorsResponse.Lints.Name. +type V1ProjectAdvisorsResponseLintsName string + // V1ProjectRefResponse defines model for V1ProjectRefResponse. type V1ProjectRefResponse struct { - Id int64 `json:"id"` + Id int `json:"id"` Name string `json:"name"` Ref string `json:"ref"` } @@ -1906,8 +2595,20 @@ type V1ProjectResponseStatus string // V1ProjectWithDatabaseResponse defines model for V1ProjectWithDatabaseResponse. type V1ProjectWithDatabaseResponse struct { // CreatedAt Creation timestamp - CreatedAt string `json:"created_at"` - Database V1DatabaseResponse `json:"database"` + CreatedAt string `json:"created_at"` + Database struct { + // Host Database host + Host string `json:"host"` + + // PostgresEngine Database engine + PostgresEngine string `json:"postgres_engine"` + + // ReleaseChannel Release channel + ReleaseChannel string `json:"release_channel"` + + // Version Database version + Version string `json:"version"` + } `json:"database"` // Id Id of your project Id string `json:"id"` @@ -1933,7 +2634,8 @@ type V1RestorePitrBody struct { // V1RunQueryBody defines model for V1RunQueryBody. type V1RunQueryBody struct { - Query string `json:"query"` + Query string `json:"query"` + ReadOnly *bool `json:"read_only,omitempty"` } // V1ServiceHealthResponse defines model for V1ServiceHealthResponse. @@ -1945,6 +2647,23 @@ type V1ServiceHealthResponse struct { Status V1ServiceHealthResponseStatus `json:"status"` } +// V1ServiceHealthResponseInfo0 defines model for . +type V1ServiceHealthResponseInfo0 struct { + Description string `json:"description"` + Name V1ServiceHealthResponseInfo0Name `json:"name"` + Version string `json:"version"` +} + +// V1ServiceHealthResponseInfo0Name defines model for V1ServiceHealthResponse.Info.0.Name. +type V1ServiceHealthResponseInfo0Name string + +// V1ServiceHealthResponseInfo1 defines model for . +type V1ServiceHealthResponseInfo1 struct { + ConnectedCluster int `json:"connected_cluster"` + DbConnected bool `json:"db_connected"` + Healthy bool `json:"healthy"` +} + // V1ServiceHealthResponse_Info defines model for V1ServiceHealthResponse.Info. type V1ServiceHealthResponse_Info struct { union json.RawMessage @@ -1968,21 +2687,17 @@ type V1StorageBucketResponse struct { // V1UpdateFunctionBody defines model for V1UpdateFunctionBody. type V1UpdateFunctionBody struct { - Body *string `json:"body,omitempty"` - ComputeMultiplier *float32 `json:"compute_multiplier,omitempty"` - Name *string `json:"name,omitempty"` - VerifyJwt *bool `json:"verify_jwt,omitempty"` + Body *string `json:"body,omitempty"` + Name *string `json:"name,omitempty"` + VerifyJwt *bool `json:"verify_jwt,omitempty"` } -// ValidationError defines model for ValidationError. -type ValidationError struct { - Message string `json:"message"` -} - -// ValidationRecord defines model for ValidationRecord. -type ValidationRecord struct { - TxtName string `json:"txt_name"` - TxtValue string `json:"txt_value"` +// V1UpdatePostgrestConfigBody defines model for V1UpdatePostgrestConfigBody. +type V1UpdatePostgrestConfigBody struct { + DbExtraSearchPath *string `json:"db_extra_search_path,omitempty"` + DbPool *int `json:"db_pool,omitempty"` + DbSchema *string `json:"db_schema,omitempty"` + MaxRows *int `json:"max_rows,omitempty"` } // VanitySubdomainBody defines model for VanitySubdomainBody. @@ -2001,7 +2716,7 @@ type VanitySubdomainConfigResponseStatus string // V1AuthorizeUserParams defines parameters for V1AuthorizeUser. type V1AuthorizeUserParams struct { - ClientId string `form:"client_id" json:"client_id"` + ClientId openapi_types.UUID `form:"client_id" json:"client_id"` ResponseType V1AuthorizeUserParamsResponseType `form:"response_type" json:"response_type"` RedirectUri string `form:"redirect_uri" json:"redirect_uri"` Scope *string `form:"scope,omitempty" json:"scope,omitempty"` @@ -2019,82 +2734,100 @@ type V1AuthorizeUserParamsCodeChallengeMethod string // GetLogsParams defines parameters for GetLogs. type GetLogsParams struct { - IsoTimestampEnd *string `form:"iso_timestamp_end,omitempty" json:"iso_timestamp_end,omitempty"` - IsoTimestampStart *string `form:"iso_timestamp_start,omitempty" json:"iso_timestamp_start,omitempty"` - Sql *string `form:"sql,omitempty" json:"sql,omitempty"` + Sql *string `form:"sql,omitempty" json:"sql,omitempty"` + IsoTimestampStart *time.Time `form:"iso_timestamp_start,omitempty" json:"iso_timestamp_start,omitempty"` + IsoTimestampEnd *time.Time `form:"iso_timestamp_end,omitempty" json:"iso_timestamp_end,omitempty"` +} + +// GetApiCountsParams defines parameters for GetApiCounts. +type GetApiCountsParams struct { + Interval *GetApiCountsParamsInterval `form:"interval,omitempty" json:"interval,omitempty"` } +// GetApiCountsParamsInterval defines parameters for GetApiCounts. +type GetApiCountsParamsInterval string + // V1GetProjectApiKeysParams defines parameters for V1GetProjectApiKeys. type V1GetProjectApiKeysParams struct { - Reveal bool `form:"reveal" json:"reveal"` + // Reveal Boolean string, true or false + Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } // CreateApiKeyParams defines parameters for CreateApiKey. type CreateApiKeyParams struct { - Reveal bool `form:"reveal" json:"reveal"` + // Reveal Boolean string, true or false + Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } // DeleteApiKeyParams defines parameters for DeleteApiKey. type DeleteApiKeyParams struct { - Reveal bool `form:"reveal" json:"reveal"` + // Reveal Boolean string, true or false + Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } // GetApiKeyParams defines parameters for GetApiKey. type GetApiKeyParams struct { - Reveal bool `form:"reveal" json:"reveal"` + // Reveal Boolean string, true or false + Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } // UpdateApiKeyParams defines parameters for UpdateApiKey. type UpdateApiKeyParams struct { - Reveal bool `form:"reveal" json:"reveal"` + // Reveal Boolean string, true or false + Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` +} + +// V1ApplyAMigrationParams defines parameters for V1ApplyAMigration. +type V1ApplyAMigrationParams struct { + // IdempotencyKey A unique key to ensure the same migration is tracked only once. + IdempotencyKey *string `json:"Idempotency-Key,omitempty"` } // V1CreateAFunctionParams defines parameters for V1CreateAFunction. type V1CreateAFunctionParams struct { - Slug *string `form:"slug,omitempty" json:"slug,omitempty"` - Name *string `form:"name,omitempty" json:"name,omitempty"` - VerifyJwt *bool `form:"verify_jwt,omitempty" json:"verify_jwt,omitempty"` - ImportMap *bool `form:"import_map,omitempty" json:"import_map,omitempty"` - EntrypointPath *string `form:"entrypoint_path,omitempty" json:"entrypoint_path,omitempty"` - ImportMapPath *string `form:"import_map_path,omitempty" json:"import_map_path,omitempty"` - ComputeMultiplier *float32 `form:"compute_multiplier,omitempty" json:"compute_multiplier,omitempty"` -} + Slug *string `form:"slug,omitempty" json:"slug,omitempty"` + Name *string `form:"name,omitempty" json:"name,omitempty"` + + // VerifyJwt Boolean string, true or false + VerifyJwt *bool `form:"verify_jwt,omitempty" json:"verify_jwt,omitempty"` -// V1BulkUpdateFunctionsJSONBody defines parameters for V1BulkUpdateFunctions. -type V1BulkUpdateFunctionsJSONBody = []BulkUpdateFunctionBody + // ImportMap Boolean string, true or false + ImportMap *bool `form:"import_map,omitempty" json:"import_map,omitempty"` + EntrypointPath *string `form:"entrypoint_path,omitempty" json:"entrypoint_path,omitempty"` + ImportMapPath *string `form:"import_map_path,omitempty" json:"import_map_path,omitempty"` +} // V1DeployAFunctionParams defines parameters for V1DeployAFunction. type V1DeployAFunctionParams struct { - Slug *string `form:"slug,omitempty" json:"slug,omitempty"` - BundleOnly *bool `form:"bundleOnly,omitempty" json:"bundleOnly,omitempty"` + Slug *string `form:"slug,omitempty" json:"slug,omitempty"` + + // BundleOnly Boolean string, true or false + BundleOnly *bool `form:"bundleOnly,omitempty" json:"bundleOnly,omitempty"` } // V1UpdateAFunctionParams defines parameters for V1UpdateAFunction. type V1UpdateAFunctionParams struct { - Slug *string `form:"slug,omitempty" json:"slug,omitempty"` - Name *string `form:"name,omitempty" json:"name,omitempty"` - VerifyJwt *bool `form:"verify_jwt,omitempty" json:"verify_jwt,omitempty"` - ImportMap *bool `form:"import_map,omitempty" json:"import_map,omitempty"` - EntrypointPath *string `form:"entrypoint_path,omitempty" json:"entrypoint_path,omitempty"` - ImportMapPath *string `form:"import_map_path,omitempty" json:"import_map_path,omitempty"` - ComputeMultiplier *float32 `form:"compute_multiplier,omitempty" json:"compute_multiplier,omitempty"` + Slug *string `form:"slug,omitempty" json:"slug,omitempty"` + Name *string `form:"name,omitempty" json:"name,omitempty"` + + // VerifyJwt Boolean string, true or false + VerifyJwt *bool `form:"verify_jwt,omitempty" json:"verify_jwt,omitempty"` + + // ImportMap Boolean string, true or false + ImportMap *bool `form:"import_map,omitempty" json:"import_map,omitempty"` + EntrypointPath *string `form:"entrypoint_path,omitempty" json:"entrypoint_path,omitempty"` + ImportMapPath *string `form:"import_map_path,omitempty" json:"import_map_path,omitempty"` } // V1GetServicesHealthParams defines parameters for V1GetServicesHealth. type V1GetServicesHealthParams struct { - TimeoutMs *int `form:"timeout_ms,omitempty" json:"timeout_ms,omitempty"` - Services []V1GetServicesHealthParamsServices `form:"services" json:"services"` + Services []interface{} `form:"services" json:"services"` + TimeoutMs *int `form:"timeout_ms,omitempty" json:"timeout_ms,omitempty"` } -// V1GetServicesHealthParamsServices defines parameters for V1GetServicesHealth. -type V1GetServicesHealthParamsServices string - // V1BulkDeleteSecretsJSONBody defines parameters for V1BulkDeleteSecrets. type V1BulkDeleteSecretsJSONBody = []string -// V1BulkCreateSecretsJSONBody defines parameters for V1BulkCreateSecrets. -type V1BulkCreateSecretsJSONBody = []CreateSecretBody - // V1GenerateTypescriptTypesParams defines parameters for V1GenerateTypescriptTypes. type V1GenerateTypescriptTypesParams struct { IncludedSchemas *string `form:"included_schemas,omitempty" json:"included_schemas,omitempty"` @@ -2107,11 +2840,12 @@ type V1GetPostgresUpgradeStatusParams struct { // V1ListAllSnippetsParams defines parameters for V1ListAllSnippets. type V1ListAllSnippetsParams struct { + // ProjectRef Project ref + ProjectRef *string `form:"project_ref,omitempty" json:"project_ref,omitempty"` Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"` Limit *string `form:"limit,omitempty" json:"limit,omitempty"` SortBy *V1ListAllSnippetsParamsSortBy `form:"sort_by,omitempty" json:"sort_by,omitempty"` SortOrder *V1ListAllSnippetsParamsSortOrder `form:"sort_order,omitempty" json:"sort_order,omitempty"` - ProjectRef *string `form:"project_ref,omitempty" json:"project_ref,omitempty"` } // V1ListAllSnippetsParamsSortBy defines parameters for V1ListAllSnippets. @@ -2123,17 +2857,26 @@ type V1ListAllSnippetsParamsSortOrder string // V1UpdateABranchConfigJSONRequestBody defines body for V1UpdateABranchConfig for application/json ContentType. type V1UpdateABranchConfigJSONRequestBody = UpdateBranchBody +// V1MergeABranchJSONRequestBody defines body for V1MergeABranch for application/json ContentType. +type V1MergeABranchJSONRequestBody = BranchActionBody + +// V1PushABranchJSONRequestBody defines body for V1PushABranch for application/json ContentType. +type V1PushABranchJSONRequestBody = BranchActionBody + +// V1ResetABranchJSONRequestBody defines body for V1ResetABranch for application/json ContentType. +type V1ResetABranchJSONRequestBody = BranchActionBody + // V1RevokeTokenJSONRequestBody defines body for V1RevokeToken for application/json ContentType. -type V1RevokeTokenJSONRequestBody = OAuthRevokeTokenBodyDto +type V1RevokeTokenJSONRequestBody = OAuthRevokeTokenBody // V1ExchangeOauthTokenFormdataRequestBody defines body for V1ExchangeOauthToken for application/x-www-form-urlencoded ContentType. type V1ExchangeOauthTokenFormdataRequestBody = OAuthTokenBody // V1CreateAnOrganizationJSONRequestBody defines body for V1CreateAnOrganization for application/json ContentType. -type V1CreateAnOrganizationJSONRequestBody = CreateOrganizationV1Dto +type V1CreateAnOrganizationJSONRequestBody = CreateOrganizationV1 // V1CreateAProjectJSONRequestBody defines body for V1CreateAProject for application/json ContentType. -type V1CreateAProjectJSONRequestBody = V1CreateProjectBodyDto +type V1CreateAProjectJSONRequestBody = V1CreateProjectBody // CreateApiKeyJSONRequestBody defines body for CreateApiKey for application/json ContentType. type CreateApiKeyJSONRequestBody = CreateApiKeyBody @@ -2141,12 +2884,21 @@ type CreateApiKeyJSONRequestBody = CreateApiKeyBody // UpdateApiKeyJSONRequestBody defines body for UpdateApiKey for application/json ContentType. type UpdateApiKeyJSONRequestBody = UpdateApiKeyBody +// V1ApplyProjectAddonJSONRequestBody defines body for V1ApplyProjectAddon for application/json ContentType. +type V1ApplyProjectAddonJSONRequestBody = ApplyProjectAddonBody + // V1CreateABranchJSONRequestBody defines body for V1CreateABranch for application/json ContentType. type V1CreateABranchJSONRequestBody = CreateBranchBody // V1UpdateAuthServiceConfigJSONRequestBody defines body for V1UpdateAuthServiceConfig for application/json ContentType. type V1UpdateAuthServiceConfigJSONRequestBody = UpdateAuthConfigBody +// CreateSigningKeyForProjectJSONRequestBody defines body for CreateSigningKeyForProject for application/json ContentType. +type CreateSigningKeyForProjectJSONRequestBody = CreateSigningKeyBody + +// PatchSigningKeyJSONRequestBody defines body for PatchSigningKey for application/json ContentType. +type PatchSigningKeyJSONRequestBody = UpdateSigningKeyBody + // V1CreateASsoProviderJSONRequestBody defines body for V1CreateASsoProvider for application/json ContentType. type V1CreateASsoProviderJSONRequestBody = CreateProviderBody @@ -2156,8 +2908,8 @@ type V1UpdateASsoProviderJSONRequestBody = UpdateProviderBody // CreateTPAForProjectJSONRequestBody defines body for CreateTPAForProject for application/json ContentType. type CreateTPAForProjectJSONRequestBody = CreateThirdPartyAuthBody -// V1UpdateSupavisorConfigJSONRequestBody defines body for V1UpdateSupavisorConfig for application/json ContentType. -type V1UpdateSupavisorConfigJSONRequestBody = UpdateSupavisorConfigBody +// V1UpdatePoolerConfigJSONRequestBody defines body for V1UpdatePoolerConfig for application/json ContentType. +type V1UpdatePoolerConfigJSONRequestBody = UpdateSupavisorConfigBody // V1UpdatePostgresConfigJSONRequestBody defines body for V1UpdatePostgresConfig for application/json ContentType. type V1UpdatePostgresConfigJSONRequestBody = UpdatePostgresConfigBody @@ -2171,14 +2923,14 @@ type V1UpdateHostnameConfigJSONRequestBody = UpdateCustomHostnameBody // V1RestorePitrBackupJSONRequestBody defines body for V1RestorePitrBackup for application/json ContentType. type V1RestorePitrBackupJSONRequestBody = V1RestorePitrBody +// V1ApplyAMigrationJSONRequestBody defines body for V1ApplyAMigration for application/json ContentType. +type V1ApplyAMigrationJSONRequestBody = V1CreateMigrationBody + // V1RunAQueryJSONRequestBody defines body for V1RunAQuery for application/json ContentType. type V1RunAQueryJSONRequestBody = V1RunQueryBody -// V1CreateAFunctionJSONRequestBody defines body for V1CreateAFunction for application/json ContentType. -type V1CreateAFunctionJSONRequestBody = V1CreateFunctionBody - // V1BulkUpdateFunctionsJSONRequestBody defines body for V1BulkUpdateFunctions for application/json ContentType. -type V1BulkUpdateFunctionsJSONRequestBody = V1BulkUpdateFunctionsJSONBody +type V1BulkUpdateFunctionsJSONRequestBody = BulkUpdateFunctionBody // V1DeployAFunctionMultipartRequestBody defines body for V1DeployAFunction for multipart/form-data ContentType. type V1DeployAFunctionMultipartRequestBody = FunctionDeployBody @@ -2196,7 +2948,7 @@ type V1UpdateNetworkRestrictionsJSONRequestBody = NetworkRestrictionsRequest type V1UpdatePgsodiumConfigJSONRequestBody = UpdatePgsodiumConfigBody // V1UpdatePostgrestServiceConfigJSONRequestBody defines body for V1UpdatePostgrestServiceConfig for application/json ContentType. -type V1UpdatePostgrestServiceConfigJSONRequestBody = UpdatePostgrestConfigBody +type V1UpdatePostgrestServiceConfigJSONRequestBody = V1UpdatePostgrestConfigBody // V1RemoveAReadReplicaJSONRequestBody defines body for V1RemoveAReadReplica for application/json ContentType. type V1RemoveAReadReplicaJSONRequestBody = RemoveReadReplicaBody @@ -2204,14 +2956,11 @@ type V1RemoveAReadReplicaJSONRequestBody = RemoveReadReplicaBody // V1SetupAReadReplicaJSONRequestBody defines body for V1SetupAReadReplica for application/json ContentType. type V1SetupAReadReplicaJSONRequestBody = SetUpReadReplicaBody -// V1RestoreAProjectJSONRequestBody defines body for V1RestoreAProject for application/json ContentType. -type V1RestoreAProjectJSONRequestBody = RestoreProjectBodyDto - // V1BulkDeleteSecretsJSONRequestBody defines body for V1BulkDeleteSecrets for application/json ContentType. type V1BulkDeleteSecretsJSONRequestBody = V1BulkDeleteSecretsJSONBody // V1BulkCreateSecretsJSONRequestBody defines body for V1BulkCreateSecrets for application/json ContentType. -type V1BulkCreateSecretsJSONRequestBody = V1BulkCreateSecretsJSONBody +type V1BulkCreateSecretsJSONRequestBody = CreateSecretBody // V1UpdateSslEnforcementConfigJSONRequestBody defines body for V1UpdateSslEnforcementConfig for application/json ContentType. type V1UpdateSslEnforcementConfigJSONRequestBody = SslEnforcementRequest @@ -2225,25 +2974,25 @@ type V1ActivateVanitySubdomainConfigJSONRequestBody = VanitySubdomainBody // V1CheckVanitySubdomainAvailabilityJSONRequestBody defines body for V1CheckVanitySubdomainAvailability for application/json ContentType. type V1CheckVanitySubdomainAvailabilityJSONRequestBody = VanitySubdomainBody -// Getter for additional properties for GetProjectDbMetadataResponseDto_Databases_Schemas_Item. Returns the specified +// Getter for additional properties for GetProjectDbMetadataResponse_Databases_Schemas_Item. Returns the specified // element and whether it was found -func (a GetProjectDbMetadataResponseDto_Databases_Schemas_Item) Get(fieldName string) (value interface{}, found bool) { +func (a GetProjectDbMetadataResponse_Databases_Schemas_Item) Get(fieldName string) (value interface{}, found bool) { if a.AdditionalProperties != nil { value, found = a.AdditionalProperties[fieldName] } return } -// Setter for additional properties for GetProjectDbMetadataResponseDto_Databases_Schemas_Item -func (a *GetProjectDbMetadataResponseDto_Databases_Schemas_Item) Set(fieldName string, value interface{}) { +// Setter for additional properties for GetProjectDbMetadataResponse_Databases_Schemas_Item +func (a *GetProjectDbMetadataResponse_Databases_Schemas_Item) Set(fieldName string, value interface{}) { if a.AdditionalProperties == nil { a.AdditionalProperties = make(map[string]interface{}) } a.AdditionalProperties[fieldName] = value } -// Override default JSON handling for GetProjectDbMetadataResponseDto_Databases_Schemas_Item to handle AdditionalProperties -func (a *GetProjectDbMetadataResponseDto_Databases_Schemas_Item) UnmarshalJSON(b []byte) error { +// Override default JSON handling for GetProjectDbMetadataResponse_Databases_Schemas_Item to handle AdditionalProperties +func (a *GetProjectDbMetadataResponse_Databases_Schemas_Item) UnmarshalJSON(b []byte) error { object := make(map[string]json.RawMessage) err := json.Unmarshal(b, &object) if err != nil { @@ -2272,8 +3021,8 @@ func (a *GetProjectDbMetadataResponseDto_Databases_Schemas_Item) UnmarshalJSON(b return nil } -// Override default JSON handling for GetProjectDbMetadataResponseDto_Databases_Schemas_Item to handle AdditionalProperties -func (a GetProjectDbMetadataResponseDto_Databases_Schemas_Item) MarshalJSON() ([]byte, error) { +// Override default JSON handling for GetProjectDbMetadataResponse_Databases_Schemas_Item to handle AdditionalProperties +func (a GetProjectDbMetadataResponse_Databases_Schemas_Item) MarshalJSON() ([]byte, error) { var err error object := make(map[string]json.RawMessage) @@ -2291,25 +3040,25 @@ func (a GetProjectDbMetadataResponseDto_Databases_Schemas_Item) MarshalJSON() ([ return json.Marshal(object) } -// Getter for additional properties for GetProjectDbMetadataResponseDto_Databases_Item. Returns the specified +// Getter for additional properties for GetProjectDbMetadataResponse_Databases_Item. Returns the specified // element and whether it was found -func (a GetProjectDbMetadataResponseDto_Databases_Item) Get(fieldName string) (value interface{}, found bool) { +func (a GetProjectDbMetadataResponse_Databases_Item) Get(fieldName string) (value interface{}, found bool) { if a.AdditionalProperties != nil { value, found = a.AdditionalProperties[fieldName] } return } -// Setter for additional properties for GetProjectDbMetadataResponseDto_Databases_Item -func (a *GetProjectDbMetadataResponseDto_Databases_Item) Set(fieldName string, value interface{}) { +// Setter for additional properties for GetProjectDbMetadataResponse_Databases_Item +func (a *GetProjectDbMetadataResponse_Databases_Item) Set(fieldName string, value interface{}) { if a.AdditionalProperties == nil { a.AdditionalProperties = make(map[string]interface{}) } a.AdditionalProperties[fieldName] = value } -// Override default JSON handling for GetProjectDbMetadataResponseDto_Databases_Item to handle AdditionalProperties -func (a *GetProjectDbMetadataResponseDto_Databases_Item) UnmarshalJSON(b []byte) error { +// Override default JSON handling for GetProjectDbMetadataResponse_Databases_Item to handle AdditionalProperties +func (a *GetProjectDbMetadataResponse_Databases_Item) UnmarshalJSON(b []byte) error { object := make(map[string]json.RawMessage) err := json.Unmarshal(b, &object) if err != nil { @@ -2346,8 +3095,8 @@ func (a *GetProjectDbMetadataResponseDto_Databases_Item) UnmarshalJSON(b []byte) return nil } -// Override default JSON handling for GetProjectDbMetadataResponseDto_Databases_Item to handle AdditionalProperties -func (a GetProjectDbMetadataResponseDto_Databases_Item) MarshalJSON() ([]byte, error) { +// Override default JSON handling for GetProjectDbMetadataResponse_Databases_Item to handle AdditionalProperties +func (a GetProjectDbMetadataResponse_Databases_Item) MarshalJSON() ([]byte, error) { var err error object := make(map[string]json.RawMessage) @@ -2370,22 +3119,84 @@ func (a GetProjectDbMetadataResponseDto_Databases_Item) MarshalJSON() ([]byte, e return json.Marshal(object) } -// AsAttributeValueDefault0 returns the union data inside the AttributeValue_Default as a AttributeValueDefault0 -func (t AttributeValue_Default) AsAttributeValueDefault0() (AttributeValueDefault0, error) { - var body AttributeValueDefault0 +// AsAnalyticsResponseError0 returns the union data inside the AnalyticsResponse_Error as a AnalyticsResponseError0 +func (t AnalyticsResponse_Error) AsAnalyticsResponseError0() (AnalyticsResponseError0, error) { + var body AnalyticsResponseError0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAnalyticsResponseError0 overwrites any union data inside the AnalyticsResponse_Error as the provided AnalyticsResponseError0 +func (t *AnalyticsResponse_Error) FromAnalyticsResponseError0(v AnalyticsResponseError0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAnalyticsResponseError0 performs a merge with any union data inside the AnalyticsResponse_Error, using the provided AnalyticsResponseError0 +func (t *AnalyticsResponse_Error) MergeAnalyticsResponseError0(v AnalyticsResponseError0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAnalyticsResponseError1 returns the union data inside the AnalyticsResponse_Error as a AnalyticsResponseError1 +func (t AnalyticsResponse_Error) AsAnalyticsResponseError1() (AnalyticsResponseError1, error) { + var body AnalyticsResponseError1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAnalyticsResponseError1 overwrites any union data inside the AnalyticsResponse_Error as the provided AnalyticsResponseError1 +func (t *AnalyticsResponse_Error) FromAnalyticsResponseError1(v AnalyticsResponseError1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAnalyticsResponseError1 performs a merge with any union data inside the AnalyticsResponse_Error, using the provided AnalyticsResponseError1 +func (t *AnalyticsResponse_Error) MergeAnalyticsResponseError1(v AnalyticsResponseError1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t AnalyticsResponse_Error) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AnalyticsResponse_Error) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsApplyProjectAddonBodyAddonVariant0 returns the union data inside the ApplyProjectAddonBody_AddonVariant as a ApplyProjectAddonBodyAddonVariant0 +func (t ApplyProjectAddonBody_AddonVariant) AsApplyProjectAddonBodyAddonVariant0() (ApplyProjectAddonBodyAddonVariant0, error) { + var body ApplyProjectAddonBodyAddonVariant0 err := json.Unmarshal(t.union, &body) return body, err } -// FromAttributeValueDefault0 overwrites any union data inside the AttributeValue_Default as the provided AttributeValueDefault0 -func (t *AttributeValue_Default) FromAttributeValueDefault0(v AttributeValueDefault0) error { +// FromApplyProjectAddonBodyAddonVariant0 overwrites any union data inside the ApplyProjectAddonBody_AddonVariant as the provided ApplyProjectAddonBodyAddonVariant0 +func (t *ApplyProjectAddonBody_AddonVariant) FromApplyProjectAddonBodyAddonVariant0(v ApplyProjectAddonBodyAddonVariant0) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAttributeValueDefault0 performs a merge with any union data inside the AttributeValue_Default, using the provided AttributeValueDefault0 -func (t *AttributeValue_Default) MergeAttributeValueDefault0(v AttributeValueDefault0) error { +// MergeApplyProjectAddonBodyAddonVariant0 performs a merge with any union data inside the ApplyProjectAddonBody_AddonVariant, using the provided ApplyProjectAddonBodyAddonVariant0 +func (t *ApplyProjectAddonBody_AddonVariant) MergeApplyProjectAddonBodyAddonVariant0(v ApplyProjectAddonBodyAddonVariant0) error { b, err := json.Marshal(v) if err != nil { return err @@ -2396,22 +3207,22 @@ func (t *AttributeValue_Default) MergeAttributeValueDefault0(v AttributeValueDef return err } -// AsAttributeValueDefault1 returns the union data inside the AttributeValue_Default as a AttributeValueDefault1 -func (t AttributeValue_Default) AsAttributeValueDefault1() (AttributeValueDefault1, error) { - var body AttributeValueDefault1 +// AsApplyProjectAddonBodyAddonVariant1 returns the union data inside the ApplyProjectAddonBody_AddonVariant as a ApplyProjectAddonBodyAddonVariant1 +func (t ApplyProjectAddonBody_AddonVariant) AsApplyProjectAddonBodyAddonVariant1() (ApplyProjectAddonBodyAddonVariant1, error) { + var body ApplyProjectAddonBodyAddonVariant1 err := json.Unmarshal(t.union, &body) return body, err } -// FromAttributeValueDefault1 overwrites any union data inside the AttributeValue_Default as the provided AttributeValueDefault1 -func (t *AttributeValue_Default) FromAttributeValueDefault1(v AttributeValueDefault1) error { +// FromApplyProjectAddonBodyAddonVariant1 overwrites any union data inside the ApplyProjectAddonBody_AddonVariant as the provided ApplyProjectAddonBodyAddonVariant1 +func (t *ApplyProjectAddonBody_AddonVariant) FromApplyProjectAddonBodyAddonVariant1(v ApplyProjectAddonBodyAddonVariant1) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAttributeValueDefault1 performs a merge with any union data inside the AttributeValue_Default, using the provided AttributeValueDefault1 -func (t *AttributeValue_Default) MergeAttributeValueDefault1(v AttributeValueDefault1) error { +// MergeApplyProjectAddonBodyAddonVariant1 performs a merge with any union data inside the ApplyProjectAddonBody_AddonVariant, using the provided ApplyProjectAddonBodyAddonVariant1 +func (t *ApplyProjectAddonBody_AddonVariant) MergeApplyProjectAddonBodyAddonVariant1(v ApplyProjectAddonBodyAddonVariant1) error { b, err := json.Marshal(v) if err != nil { return err @@ -2422,22 +3233,22 @@ func (t *AttributeValue_Default) MergeAttributeValueDefault1(v AttributeValueDef return err } -// AsAttributeValueDefault2 returns the union data inside the AttributeValue_Default as a AttributeValueDefault2 -func (t AttributeValue_Default) AsAttributeValueDefault2() (AttributeValueDefault2, error) { - var body AttributeValueDefault2 +// AsApplyProjectAddonBodyAddonVariant2 returns the union data inside the ApplyProjectAddonBody_AddonVariant as a ApplyProjectAddonBodyAddonVariant2 +func (t ApplyProjectAddonBody_AddonVariant) AsApplyProjectAddonBodyAddonVariant2() (ApplyProjectAddonBodyAddonVariant2, error) { + var body ApplyProjectAddonBodyAddonVariant2 err := json.Unmarshal(t.union, &body) return body, err } -// FromAttributeValueDefault2 overwrites any union data inside the AttributeValue_Default as the provided AttributeValueDefault2 -func (t *AttributeValue_Default) FromAttributeValueDefault2(v AttributeValueDefault2) error { +// FromApplyProjectAddonBodyAddonVariant2 overwrites any union data inside the ApplyProjectAddonBody_AddonVariant as the provided ApplyProjectAddonBodyAddonVariant2 +func (t *ApplyProjectAddonBody_AddonVariant) FromApplyProjectAddonBodyAddonVariant2(v ApplyProjectAddonBodyAddonVariant2) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAttributeValueDefault2 performs a merge with any union data inside the AttributeValue_Default, using the provided AttributeValueDefault2 -func (t *AttributeValue_Default) MergeAttributeValueDefault2(v AttributeValueDefault2) error { +// MergeApplyProjectAddonBodyAddonVariant2 performs a merge with any union data inside the ApplyProjectAddonBody_AddonVariant, using the provided ApplyProjectAddonBodyAddonVariant2 +func (t *ApplyProjectAddonBody_AddonVariant) MergeApplyProjectAddonBodyAddonVariant2(v ApplyProjectAddonBodyAddonVariant2) error { b, err := json.Marshal(v) if err != nil { return err @@ -2448,22 +3259,22 @@ func (t *AttributeValue_Default) MergeAttributeValueDefault2(v AttributeValueDef return err } -// AsAttributeValueDefault3 returns the union data inside the AttributeValue_Default as a AttributeValueDefault3 -func (t AttributeValue_Default) AsAttributeValueDefault3() (AttributeValueDefault3, error) { - var body AttributeValueDefault3 +// AsApplyProjectAddonBodyAddonVariant3 returns the union data inside the ApplyProjectAddonBody_AddonVariant as a ApplyProjectAddonBodyAddonVariant3 +func (t ApplyProjectAddonBody_AddonVariant) AsApplyProjectAddonBodyAddonVariant3() (ApplyProjectAddonBodyAddonVariant3, error) { + var body ApplyProjectAddonBodyAddonVariant3 err := json.Unmarshal(t.union, &body) return body, err } -// FromAttributeValueDefault3 overwrites any union data inside the AttributeValue_Default as the provided AttributeValueDefault3 -func (t *AttributeValue_Default) FromAttributeValueDefault3(v AttributeValueDefault3) error { +// FromApplyProjectAddonBodyAddonVariant3 overwrites any union data inside the ApplyProjectAddonBody_AddonVariant as the provided ApplyProjectAddonBodyAddonVariant3 +func (t *ApplyProjectAddonBody_AddonVariant) FromApplyProjectAddonBodyAddonVariant3(v ApplyProjectAddonBodyAddonVariant3) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAttributeValueDefault3 performs a merge with any union data inside the AttributeValue_Default, using the provided AttributeValueDefault3 -func (t *AttributeValue_Default) MergeAttributeValueDefault3(v AttributeValueDefault3) error { +// MergeApplyProjectAddonBodyAddonVariant3 performs a merge with any union data inside the ApplyProjectAddonBody_AddonVariant, using the provided ApplyProjectAddonBodyAddonVariant3 +func (t *ApplyProjectAddonBody_AddonVariant) MergeApplyProjectAddonBodyAddonVariant3(v ApplyProjectAddonBodyAddonVariant3) error { b, err := json.Marshal(v) if err != nil { return err @@ -2474,32 +3285,354 @@ func (t *AttributeValue_Default) MergeAttributeValueDefault3(v AttributeValueDef return err } -func (t AttributeValue_Default) MarshalJSON() ([]byte, error) { +func (t ApplyProjectAddonBody_AddonVariant) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *AttributeValue_Default) UnmarshalJSON(b []byte) error { +func (t *ApplyProjectAddonBody_AddonVariant) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsV1AnalyticsResponseError0 returns the union data inside the V1AnalyticsResponse_Error as a V1AnalyticsResponseError0 -func (t V1AnalyticsResponse_Error) AsV1AnalyticsResponseError0() (V1AnalyticsResponseError0, error) { - var body V1AnalyticsResponseError0 +// AsListProjectAddonsResponseAvailableAddonsVariantsId0 returns the union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as a ListProjectAddonsResponseAvailableAddonsVariantsId0 +func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) AsListProjectAddonsResponseAvailableAddonsVariantsId0() (ListProjectAddonsResponseAvailableAddonsVariantsId0, error) { + var body ListProjectAddonsResponseAvailableAddonsVariantsId0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseAvailableAddonsVariantsId0 overwrites any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as the provided ListProjectAddonsResponseAvailableAddonsVariantsId0 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) FromListProjectAddonsResponseAvailableAddonsVariantsId0(v ListProjectAddonsResponseAvailableAddonsVariantsId0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseAvailableAddonsVariantsId0 performs a merge with any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id, using the provided ListProjectAddonsResponseAvailableAddonsVariantsId0 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) MergeListProjectAddonsResponseAvailableAddonsVariantsId0(v ListProjectAddonsResponseAvailableAddonsVariantsId0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseAvailableAddonsVariantsId1 returns the union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as a ListProjectAddonsResponseAvailableAddonsVariantsId1 +func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) AsListProjectAddonsResponseAvailableAddonsVariantsId1() (ListProjectAddonsResponseAvailableAddonsVariantsId1, error) { + var body ListProjectAddonsResponseAvailableAddonsVariantsId1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseAvailableAddonsVariantsId1 overwrites any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as the provided ListProjectAddonsResponseAvailableAddonsVariantsId1 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) FromListProjectAddonsResponseAvailableAddonsVariantsId1(v ListProjectAddonsResponseAvailableAddonsVariantsId1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseAvailableAddonsVariantsId1 performs a merge with any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id, using the provided ListProjectAddonsResponseAvailableAddonsVariantsId1 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) MergeListProjectAddonsResponseAvailableAddonsVariantsId1(v ListProjectAddonsResponseAvailableAddonsVariantsId1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseAvailableAddonsVariantsId2 returns the union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as a ListProjectAddonsResponseAvailableAddonsVariantsId2 +func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) AsListProjectAddonsResponseAvailableAddonsVariantsId2() (ListProjectAddonsResponseAvailableAddonsVariantsId2, error) { + var body ListProjectAddonsResponseAvailableAddonsVariantsId2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseAvailableAddonsVariantsId2 overwrites any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as the provided ListProjectAddonsResponseAvailableAddonsVariantsId2 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) FromListProjectAddonsResponseAvailableAddonsVariantsId2(v ListProjectAddonsResponseAvailableAddonsVariantsId2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseAvailableAddonsVariantsId2 performs a merge with any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id, using the provided ListProjectAddonsResponseAvailableAddonsVariantsId2 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) MergeListProjectAddonsResponseAvailableAddonsVariantsId2(v ListProjectAddonsResponseAvailableAddonsVariantsId2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseAvailableAddonsVariantsId3 returns the union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as a ListProjectAddonsResponseAvailableAddonsVariantsId3 +func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) AsListProjectAddonsResponseAvailableAddonsVariantsId3() (ListProjectAddonsResponseAvailableAddonsVariantsId3, error) { + var body ListProjectAddonsResponseAvailableAddonsVariantsId3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseAvailableAddonsVariantsId3 overwrites any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as the provided ListProjectAddonsResponseAvailableAddonsVariantsId3 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) FromListProjectAddonsResponseAvailableAddonsVariantsId3(v ListProjectAddonsResponseAvailableAddonsVariantsId3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseAvailableAddonsVariantsId3 performs a merge with any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id, using the provided ListProjectAddonsResponseAvailableAddonsVariantsId3 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) MergeListProjectAddonsResponseAvailableAddonsVariantsId3(v ListProjectAddonsResponseAvailableAddonsVariantsId3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseAvailableAddonsVariantsId4 returns the union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as a ListProjectAddonsResponseAvailableAddonsVariantsId4 +func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) AsListProjectAddonsResponseAvailableAddonsVariantsId4() (ListProjectAddonsResponseAvailableAddonsVariantsId4, error) { + var body ListProjectAddonsResponseAvailableAddonsVariantsId4 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseAvailableAddonsVariantsId4 overwrites any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as the provided ListProjectAddonsResponseAvailableAddonsVariantsId4 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) FromListProjectAddonsResponseAvailableAddonsVariantsId4(v ListProjectAddonsResponseAvailableAddonsVariantsId4) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseAvailableAddonsVariantsId4 performs a merge with any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id, using the provided ListProjectAddonsResponseAvailableAddonsVariantsId4 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) MergeListProjectAddonsResponseAvailableAddonsVariantsId4(v ListProjectAddonsResponseAvailableAddonsVariantsId4) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseAvailableAddonsVariantsId5 returns the union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as a ListProjectAddonsResponseAvailableAddonsVariantsId5 +func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) AsListProjectAddonsResponseAvailableAddonsVariantsId5() (ListProjectAddonsResponseAvailableAddonsVariantsId5, error) { + var body ListProjectAddonsResponseAvailableAddonsVariantsId5 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseAvailableAddonsVariantsId5 overwrites any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as the provided ListProjectAddonsResponseAvailableAddonsVariantsId5 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) FromListProjectAddonsResponseAvailableAddonsVariantsId5(v ListProjectAddonsResponseAvailableAddonsVariantsId5) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseAvailableAddonsVariantsId5 performs a merge with any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id, using the provided ListProjectAddonsResponseAvailableAddonsVariantsId5 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) MergeListProjectAddonsResponseAvailableAddonsVariantsId5(v ListProjectAddonsResponseAvailableAddonsVariantsId5) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseAvailableAddonsVariantsId6 returns the union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as a ListProjectAddonsResponseAvailableAddonsVariantsId6 +func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) AsListProjectAddonsResponseAvailableAddonsVariantsId6() (ListProjectAddonsResponseAvailableAddonsVariantsId6, error) { + var body ListProjectAddonsResponseAvailableAddonsVariantsId6 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseAvailableAddonsVariantsId6 overwrites any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as the provided ListProjectAddonsResponseAvailableAddonsVariantsId6 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) FromListProjectAddonsResponseAvailableAddonsVariantsId6(v ListProjectAddonsResponseAvailableAddonsVariantsId6) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseAvailableAddonsVariantsId6 performs a merge with any union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id, using the provided ListProjectAddonsResponseAvailableAddonsVariantsId6 +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) MergeListProjectAddonsResponseAvailableAddonsVariantsId6(v ListProjectAddonsResponseAvailableAddonsVariantsId6) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ListProjectAddonsResponse_AvailableAddons_Variants_Id) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsListProjectAddonsResponseSelectedAddonsVariantId0 returns the union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as a ListProjectAddonsResponseSelectedAddonsVariantId0 +func (t ListProjectAddonsResponse_SelectedAddons_Variant_Id) AsListProjectAddonsResponseSelectedAddonsVariantId0() (ListProjectAddonsResponseSelectedAddonsVariantId0, error) { + var body ListProjectAddonsResponseSelectedAddonsVariantId0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseSelectedAddonsVariantId0 overwrites any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as the provided ListProjectAddonsResponseSelectedAddonsVariantId0 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) FromListProjectAddonsResponseSelectedAddonsVariantId0(v ListProjectAddonsResponseSelectedAddonsVariantId0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseSelectedAddonsVariantId0 performs a merge with any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id, using the provided ListProjectAddonsResponseSelectedAddonsVariantId0 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) MergeListProjectAddonsResponseSelectedAddonsVariantId0(v ListProjectAddonsResponseSelectedAddonsVariantId0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseSelectedAddonsVariantId1 returns the union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as a ListProjectAddonsResponseSelectedAddonsVariantId1 +func (t ListProjectAddonsResponse_SelectedAddons_Variant_Id) AsListProjectAddonsResponseSelectedAddonsVariantId1() (ListProjectAddonsResponseSelectedAddonsVariantId1, error) { + var body ListProjectAddonsResponseSelectedAddonsVariantId1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseSelectedAddonsVariantId1 overwrites any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as the provided ListProjectAddonsResponseSelectedAddonsVariantId1 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) FromListProjectAddonsResponseSelectedAddonsVariantId1(v ListProjectAddonsResponseSelectedAddonsVariantId1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseSelectedAddonsVariantId1 performs a merge with any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id, using the provided ListProjectAddonsResponseSelectedAddonsVariantId1 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) MergeListProjectAddonsResponseSelectedAddonsVariantId1(v ListProjectAddonsResponseSelectedAddonsVariantId1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseSelectedAddonsVariantId2 returns the union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as a ListProjectAddonsResponseSelectedAddonsVariantId2 +func (t ListProjectAddonsResponse_SelectedAddons_Variant_Id) AsListProjectAddonsResponseSelectedAddonsVariantId2() (ListProjectAddonsResponseSelectedAddonsVariantId2, error) { + var body ListProjectAddonsResponseSelectedAddonsVariantId2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseSelectedAddonsVariantId2 overwrites any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as the provided ListProjectAddonsResponseSelectedAddonsVariantId2 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) FromListProjectAddonsResponseSelectedAddonsVariantId2(v ListProjectAddonsResponseSelectedAddonsVariantId2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseSelectedAddonsVariantId2 performs a merge with any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id, using the provided ListProjectAddonsResponseSelectedAddonsVariantId2 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) MergeListProjectAddonsResponseSelectedAddonsVariantId2(v ListProjectAddonsResponseSelectedAddonsVariantId2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseSelectedAddonsVariantId3 returns the union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as a ListProjectAddonsResponseSelectedAddonsVariantId3 +func (t ListProjectAddonsResponse_SelectedAddons_Variant_Id) AsListProjectAddonsResponseSelectedAddonsVariantId3() (ListProjectAddonsResponseSelectedAddonsVariantId3, error) { + var body ListProjectAddonsResponseSelectedAddonsVariantId3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseSelectedAddonsVariantId3 overwrites any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as the provided ListProjectAddonsResponseSelectedAddonsVariantId3 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) FromListProjectAddonsResponseSelectedAddonsVariantId3(v ListProjectAddonsResponseSelectedAddonsVariantId3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseSelectedAddonsVariantId3 performs a merge with any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id, using the provided ListProjectAddonsResponseSelectedAddonsVariantId3 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) MergeListProjectAddonsResponseSelectedAddonsVariantId3(v ListProjectAddonsResponseSelectedAddonsVariantId3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseSelectedAddonsVariantId4 returns the union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as a ListProjectAddonsResponseSelectedAddonsVariantId4 +func (t ListProjectAddonsResponse_SelectedAddons_Variant_Id) AsListProjectAddonsResponseSelectedAddonsVariantId4() (ListProjectAddonsResponseSelectedAddonsVariantId4, error) { + var body ListProjectAddonsResponseSelectedAddonsVariantId4 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListProjectAddonsResponseSelectedAddonsVariantId4 overwrites any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as the provided ListProjectAddonsResponseSelectedAddonsVariantId4 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) FromListProjectAddonsResponseSelectedAddonsVariantId4(v ListProjectAddonsResponseSelectedAddonsVariantId4) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListProjectAddonsResponseSelectedAddonsVariantId4 performs a merge with any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id, using the provided ListProjectAddonsResponseSelectedAddonsVariantId4 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) MergeListProjectAddonsResponseSelectedAddonsVariantId4(v ListProjectAddonsResponseSelectedAddonsVariantId4) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListProjectAddonsResponseSelectedAddonsVariantId5 returns the union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as a ListProjectAddonsResponseSelectedAddonsVariantId5 +func (t ListProjectAddonsResponse_SelectedAddons_Variant_Id) AsListProjectAddonsResponseSelectedAddonsVariantId5() (ListProjectAddonsResponseSelectedAddonsVariantId5, error) { + var body ListProjectAddonsResponseSelectedAddonsVariantId5 err := json.Unmarshal(t.union, &body) return body, err } -// FromV1AnalyticsResponseError0 overwrites any union data inside the V1AnalyticsResponse_Error as the provided V1AnalyticsResponseError0 -func (t *V1AnalyticsResponse_Error) FromV1AnalyticsResponseError0(v V1AnalyticsResponseError0) error { +// FromListProjectAddonsResponseSelectedAddonsVariantId5 overwrites any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as the provided ListProjectAddonsResponseSelectedAddonsVariantId5 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) FromListProjectAddonsResponseSelectedAddonsVariantId5(v ListProjectAddonsResponseSelectedAddonsVariantId5) error { b, err := json.Marshal(v) t.union = b return err } -// MergeV1AnalyticsResponseError0 performs a merge with any union data inside the V1AnalyticsResponse_Error, using the provided V1AnalyticsResponseError0 -func (t *V1AnalyticsResponse_Error) MergeV1AnalyticsResponseError0(v V1AnalyticsResponseError0) error { +// MergeListProjectAddonsResponseSelectedAddonsVariantId5 performs a merge with any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id, using the provided ListProjectAddonsResponseSelectedAddonsVariantId5 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) MergeListProjectAddonsResponseSelectedAddonsVariantId5(v ListProjectAddonsResponseSelectedAddonsVariantId5) error { b, err := json.Marshal(v) if err != nil { return err @@ -2510,22 +3643,22 @@ func (t *V1AnalyticsResponse_Error) MergeV1AnalyticsResponseError0(v V1Analytics return err } -// AsV1AnalyticsResponseError1 returns the union data inside the V1AnalyticsResponse_Error as a V1AnalyticsResponseError1 -func (t V1AnalyticsResponse_Error) AsV1AnalyticsResponseError1() (V1AnalyticsResponseError1, error) { - var body V1AnalyticsResponseError1 +// AsListProjectAddonsResponseSelectedAddonsVariantId6 returns the union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as a ListProjectAddonsResponseSelectedAddonsVariantId6 +func (t ListProjectAddonsResponse_SelectedAddons_Variant_Id) AsListProjectAddonsResponseSelectedAddonsVariantId6() (ListProjectAddonsResponseSelectedAddonsVariantId6, error) { + var body ListProjectAddonsResponseSelectedAddonsVariantId6 err := json.Unmarshal(t.union, &body) return body, err } -// FromV1AnalyticsResponseError1 overwrites any union data inside the V1AnalyticsResponse_Error as the provided V1AnalyticsResponseError1 -func (t *V1AnalyticsResponse_Error) FromV1AnalyticsResponseError1(v V1AnalyticsResponseError1) error { +// FromListProjectAddonsResponseSelectedAddonsVariantId6 overwrites any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id as the provided ListProjectAddonsResponseSelectedAddonsVariantId6 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) FromListProjectAddonsResponseSelectedAddonsVariantId6(v ListProjectAddonsResponseSelectedAddonsVariantId6) error { b, err := json.Marshal(v) t.union = b return err } -// MergeV1AnalyticsResponseError1 performs a merge with any union data inside the V1AnalyticsResponse_Error, using the provided V1AnalyticsResponseError1 -func (t *V1AnalyticsResponse_Error) MergeV1AnalyticsResponseError1(v V1AnalyticsResponseError1) error { +// MergeListProjectAddonsResponseSelectedAddonsVariantId6 performs a merge with any union data inside the ListProjectAddonsResponse_SelectedAddons_Variant_Id, using the provided ListProjectAddonsResponseSelectedAddonsVariantId6 +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) MergeListProjectAddonsResponseSelectedAddonsVariantId6(v ListProjectAddonsResponseSelectedAddonsVariantId6) error { b, err := json.Marshal(v) if err != nil { return err @@ -2536,32 +3669,32 @@ func (t *V1AnalyticsResponse_Error) MergeV1AnalyticsResponseError1(v V1Analytics return err } -func (t V1AnalyticsResponse_Error) MarshalJSON() ([]byte, error) { +func (t ListProjectAddonsResponse_SelectedAddons_Variant_Id) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *V1AnalyticsResponse_Error) UnmarshalJSON(b []byte) error { +func (t *ListProjectAddonsResponse_SelectedAddons_Variant_Id) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsAuthHealthResponse returns the union data inside the V1ServiceHealthResponse_Info as a AuthHealthResponse -func (t V1ServiceHealthResponse_Info) AsAuthHealthResponse() (AuthHealthResponse, error) { - var body AuthHealthResponse +// AsV1ServiceHealthResponseInfo0 returns the union data inside the V1ServiceHealthResponse_Info as a V1ServiceHealthResponseInfo0 +func (t V1ServiceHealthResponse_Info) AsV1ServiceHealthResponseInfo0() (V1ServiceHealthResponseInfo0, error) { + var body V1ServiceHealthResponseInfo0 err := json.Unmarshal(t.union, &body) return body, err } -// FromAuthHealthResponse overwrites any union data inside the V1ServiceHealthResponse_Info as the provided AuthHealthResponse -func (t *V1ServiceHealthResponse_Info) FromAuthHealthResponse(v AuthHealthResponse) error { +// FromV1ServiceHealthResponseInfo0 overwrites any union data inside the V1ServiceHealthResponse_Info as the provided V1ServiceHealthResponseInfo0 +func (t *V1ServiceHealthResponse_Info) FromV1ServiceHealthResponseInfo0(v V1ServiceHealthResponseInfo0) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAuthHealthResponse performs a merge with any union data inside the V1ServiceHealthResponse_Info, using the provided AuthHealthResponse -func (t *V1ServiceHealthResponse_Info) MergeAuthHealthResponse(v AuthHealthResponse) error { +// MergeV1ServiceHealthResponseInfo0 performs a merge with any union data inside the V1ServiceHealthResponse_Info, using the provided V1ServiceHealthResponseInfo0 +func (t *V1ServiceHealthResponse_Info) MergeV1ServiceHealthResponseInfo0(v V1ServiceHealthResponseInfo0) error { b, err := json.Marshal(v) if err != nil { return err @@ -2572,22 +3705,22 @@ func (t *V1ServiceHealthResponse_Info) MergeAuthHealthResponse(v AuthHealthRespo return err } -// AsRealtimeHealthResponse returns the union data inside the V1ServiceHealthResponse_Info as a RealtimeHealthResponse -func (t V1ServiceHealthResponse_Info) AsRealtimeHealthResponse() (RealtimeHealthResponse, error) { - var body RealtimeHealthResponse +// AsV1ServiceHealthResponseInfo1 returns the union data inside the V1ServiceHealthResponse_Info as a V1ServiceHealthResponseInfo1 +func (t V1ServiceHealthResponse_Info) AsV1ServiceHealthResponseInfo1() (V1ServiceHealthResponseInfo1, error) { + var body V1ServiceHealthResponseInfo1 err := json.Unmarshal(t.union, &body) return body, err } -// FromRealtimeHealthResponse overwrites any union data inside the V1ServiceHealthResponse_Info as the provided RealtimeHealthResponse -func (t *V1ServiceHealthResponse_Info) FromRealtimeHealthResponse(v RealtimeHealthResponse) error { +// FromV1ServiceHealthResponseInfo1 overwrites any union data inside the V1ServiceHealthResponse_Info as the provided V1ServiceHealthResponseInfo1 +func (t *V1ServiceHealthResponse_Info) FromV1ServiceHealthResponseInfo1(v V1ServiceHealthResponseInfo1) error { b, err := json.Marshal(v) t.union = b return err } -// MergeRealtimeHealthResponse performs a merge with any union data inside the V1ServiceHealthResponse_Info, using the provided RealtimeHealthResponse -func (t *V1ServiceHealthResponse_Info) MergeRealtimeHealthResponse(v RealtimeHealthResponse) error { +// MergeV1ServiceHealthResponseInfo1 performs a merge with any union data inside the V1ServiceHealthResponse_Info, using the provided V1ServiceHealthResponseInfo1 +func (t *V1ServiceHealthResponse_Info) MergeV1ServiceHealthResponseInfo1(v V1ServiceHealthResponseInfo1) error { b, err := json.Marshal(v) if err != nil { return err diff --git a/pkg/config/api.go b/pkg/config/api.go index ec7c4f86d..c29b71a9f 100644 --- a/pkg/config/api.go +++ b/pkg/config/api.go @@ -28,8 +28,8 @@ type ( } ) -func (a *api) ToUpdatePostgrestConfigBody() v1API.UpdatePostgrestConfigBody { - body := v1API.UpdatePostgrestConfigBody{} +func (a *api) ToUpdatePostgrestConfigBody() v1API.V1UpdatePostgrestConfigBody { + body := v1API.V1UpdatePostgrestConfigBody{} // When the api is disabled, remote side it just set the dbSchema to an empty value if !a.Enabled { diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 43b175bf2..bdddefae4 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -342,7 +342,7 @@ func (r *rateLimit) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { func (c captcha) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { if body.SecurityCaptchaEnabled = &c.Enabled; c.Enabled { - body.SecurityCaptchaProvider = cast.Ptr(string(c.Provider)) + body.SecurityCaptchaProvider = cast.Ptr(v1API.UpdateAuthConfigBodySecurityCaptchaProvider(c.Provider)) if len(c.Secret.SHA256) > 0 { body.SecurityCaptchaSecret = &c.Secret.Value } @@ -645,39 +645,39 @@ func (s sms) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { if otpString := mapToEnv(s.TestOTP); len(otpString) > 0 { body.SmsTestOtp = &otpString // Set a 10 year validity for test OTP - timestamp := time.Now().UTC().AddDate(10, 0, 0).Format(time.RFC3339) + timestamp := time.Now().UTC().AddDate(10, 0, 0) body.SmsTestOtpValidUntil = ×tamp } // Api only overrides configs of enabled providers switch { case s.Twilio.Enabled: - body.SmsProvider = cast.Ptr("twilio") + body.SmsProvider = cast.Ptr(v1API.Twilio) if len(s.Twilio.AuthToken.SHA256) > 0 { body.SmsTwilioAuthToken = &s.Twilio.AuthToken.Value } body.SmsTwilioAccountSid = &s.Twilio.AccountSid body.SmsTwilioMessageServiceSid = &s.Twilio.MessageServiceSid case s.TwilioVerify.Enabled: - body.SmsProvider = cast.Ptr("twilio_verify") + body.SmsProvider = cast.Ptr(v1API.TwilioVerify) if len(s.TwilioVerify.AuthToken.SHA256) > 0 { body.SmsTwilioVerifyAuthToken = &s.TwilioVerify.AuthToken.Value } body.SmsTwilioVerifyAccountSid = &s.TwilioVerify.AccountSid body.SmsTwilioVerifyMessageServiceSid = &s.TwilioVerify.MessageServiceSid case s.Messagebird.Enabled: - body.SmsProvider = cast.Ptr("messagebird") + body.SmsProvider = cast.Ptr(v1API.Messagebird) if len(s.Messagebird.AccessKey.SHA256) > 0 { body.SmsMessagebirdAccessKey = &s.Messagebird.AccessKey.Value } body.SmsMessagebirdOriginator = &s.Messagebird.Originator case s.Textlocal.Enabled: - body.SmsProvider = cast.Ptr("textlocal") + body.SmsProvider = cast.Ptr(v1API.Textlocal) if len(s.Textlocal.ApiKey.SHA256) > 0 { body.SmsTextlocalApiKey = &s.Textlocal.ApiKey.Value } body.SmsTextlocalSender = &s.Textlocal.Sender case s.Vonage.Enabled: - body.SmsProvider = cast.Ptr("vonage") + body.SmsProvider = cast.Ptr(v1API.Vonage) if len(s.Vonage.ApiSecret.SHA256) > 0 { body.SmsVonageApiSecret = &s.Vonage.ApiSecret.Value } diff --git a/pkg/config/storage.go b/pkg/config/storage.go index fdb3b27ff..fa575653a 100644 --- a/pkg/config/storage.go +++ b/pkg/config/storage.go @@ -44,11 +44,15 @@ func (s *storage) ToUpdateStorageConfigBody() v1API.UpdateStorageConfigBody { } // 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, - }, - } + body.Features = &struct { + ImageTransformation struct { + Enabled bool "json:\"enabled\"" + } "json:\"imageTransformation\"" + S3Protocol struct { + Enabled bool "json:\"enabled\"" + } "json:\"s3Protocol\"" + }{} + body.Features.ImageTransformation.Enabled = s.ImageTransformation.Enabled } return body } diff --git a/pkg/config/updater_test.go b/pkg/config/updater_test.go index 05a5d91d7..db51a2dbd 100644 --- a/pkg/config/updater_test.go +++ b/pkg/config/updater_test.go @@ -219,17 +219,22 @@ func TestUpdateStorageConfig(t *testing.T) { updater := NewConfigUpdater(*client) // Setup mock server defer gock.Off() + mockStorage := v1API.StorageConfigResponse{ + FileSizeLimit: 100, + Features: struct { + ImageTransformation struct { + Enabled bool "json:\"enabled\"" + } "json:\"imageTransformation\"" + S3Protocol struct { + Enabled bool "json:\"enabled\"" + } "json:\"s3Protocol\"" + }{}, + } + mockStorage.Features.ImageTransformation.Enabled = true gock.New(server). Get("/v1/projects/test-project/config/storage"). Reply(http.StatusOK). - JSON(v1API.StorageConfigResponse{ - FileSizeLimit: 100, - Features: v1API.StorageFeatures{ - ImageTransformation: v1API.StorageFeatureImageTransformation{ - Enabled: true, - }, - }, - }) + JSON(mockStorage) gock.New(server). Patch("/v1/projects/test-project/config/storage"). Reply(http.StatusOK) diff --git a/pkg/function/api.go b/pkg/function/api.go index 1070744e4..9b3aa50e7 100644 --- a/pkg/function/api.go +++ b/pkg/function/api.go @@ -14,8 +14,16 @@ type EdgeRuntimeAPI struct { maxJobs uint } +type FunctionDeployMetadata struct { + EntrypointPath string `json:"entrypoint_path"` + ImportMapPath *string `json:"import_map_path,omitempty"` + Name *string `json:"name,omitempty"` + StaticPatterns *[]string `json:"static_patterns,omitempty"` + VerifyJwt *bool `json:"verify_jwt,omitempty"` +} + type EszipBundler interface { - Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (api.FunctionDeployMetadata, error) + Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (FunctionDeployMetadata, error) } func NewEdgeRuntimeAPI(project string, client api.ClientWithResponses, opts ...withOption) EdgeRuntimeAPI { diff --git a/pkg/function/batch.go b/pkg/function/batch.go index 8cb902bdb..19aa4818a 100644 --- a/pkg/function/batch.go +++ b/pkg/function/batch.go @@ -45,7 +45,7 @@ func (s *EdgeRuntimeAPI) UpsertFunctions(ctx context.Context, functionConfig con for _, f := range result { exists[f.Slug] = struct{}{} } - var toUpdate []api.BulkUpdateFunctionBody + var toUpdate api.BulkUpdateFunctionBody OUTER: for slug, function := range functionConfig { if !function.Enabled { @@ -80,7 +80,7 @@ OUTER: if err != nil { return err } - toUpdate = append(toUpdate, result) + toUpdate = append(toUpdate, result...) policy.Reset() } if len(toUpdate) > 1 { @@ -98,7 +98,7 @@ OUTER: return nil } -func (s *EdgeRuntimeAPI) updateFunction(ctx context.Context, slug string, meta api.FunctionDeployMetadata, body io.Reader) (api.BulkUpdateFunctionBody, error) { +func (s *EdgeRuntimeAPI) updateFunction(ctx context.Context, slug string, meta FunctionDeployMetadata, body io.Reader) (api.BulkUpdateFunctionBody, error) { resp, err := s.client.V1UpdateAFunctionWithBodyWithResponse(ctx, s.project, slug, &api.V1UpdateAFunctionParams{ VerifyJwt: meta.VerifyJwt, ImportMapPath: meta.ImportMapPath, @@ -109,7 +109,7 @@ func (s *EdgeRuntimeAPI) updateFunction(ctx context.Context, slug string, meta a } else if resp.JSON200 == nil { return api.BulkUpdateFunctionBody{}, errors.Errorf("unexpected update function status %d: %s", resp.StatusCode(), string(resp.Body)) } - return api.BulkUpdateFunctionBody{ + return api.BulkUpdateFunctionBody{{ Id: resp.JSON200.Id, Name: resp.JSON200.Name, Slug: resp.JSON200.Slug, @@ -120,10 +120,10 @@ func (s *EdgeRuntimeAPI) updateFunction(ctx context.Context, slug string, meta a VerifyJwt: resp.JSON200.VerifyJwt, Status: api.BulkUpdateFunctionBodyStatus(resp.JSON200.Status), CreatedAt: &resp.JSON200.CreatedAt, - }, nil + }}, nil } -func (s *EdgeRuntimeAPI) createFunction(ctx context.Context, slug string, meta api.FunctionDeployMetadata, body io.Reader) (api.BulkUpdateFunctionBody, error) { +func (s *EdgeRuntimeAPI) createFunction(ctx context.Context, slug string, meta FunctionDeployMetadata, body io.Reader) (api.BulkUpdateFunctionBody, error) { resp, err := s.client.V1CreateAFunctionWithBodyWithResponse(ctx, s.project, &api.V1CreateAFunctionParams{ Slug: &slug, Name: &slug, @@ -136,7 +136,7 @@ func (s *EdgeRuntimeAPI) createFunction(ctx context.Context, slug string, meta a } else if resp.JSON201 == nil { return api.BulkUpdateFunctionBody{}, errors.Errorf("unexpected create function status %d: %s", resp.StatusCode(), string(resp.Body)) } - return api.BulkUpdateFunctionBody{ + return api.BulkUpdateFunctionBody{{ Id: resp.JSON201.Id, Name: resp.JSON201.Name, Slug: resp.JSON201.Slug, @@ -147,5 +147,5 @@ func (s *EdgeRuntimeAPI) createFunction(ctx context.Context, slug string, meta a VerifyJwt: resp.JSON201.VerifyJwt, Status: api.BulkUpdateFunctionBodyStatus(resp.JSON201.Status), CreatedAt: &resp.JSON201.CreatedAt, - }, nil + }}, nil } diff --git a/pkg/function/batch_test.go b/pkg/function/batch_test.go index 81e151e8a..94ed6e62f 100644 --- a/pkg/function/batch_test.go +++ b/pkg/function/batch_test.go @@ -18,11 +18,11 @@ import ( type MockBundler struct { } -func (b *MockBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (api.FunctionDeployMetadata, error) { +func (b *MockBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (FunctionDeployMetadata, error) { if staticFiles == nil { staticFiles = []string{} } - return api.FunctionDeployMetadata{ + return FunctionDeployMetadata{ Name: &slug, EntrypointPath: entrypoint, ImportMapPath: &importMap, diff --git a/pkg/function/bundle.go b/pkg/function/bundle.go index 27e4d7660..eb178539a 100644 --- a/pkg/function/bundle.go +++ b/pkg/function/bundle.go @@ -13,7 +13,6 @@ import ( "github.com/andybalholm/brotli" "github.com/go-errors/errors" - "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/cast" ) @@ -37,7 +36,7 @@ var ( } ) -func (b *nativeBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (api.FunctionDeployMetadata, error) { +func (b *nativeBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (FunctionDeployMetadata, error) { meta := NewMetadata(slug, entrypoint, importMap, staticFiles) outputPath := filepath.Join(b.tempDir, slug+".eszip") // TODO: make edge runtime write to stdout @@ -79,8 +78,8 @@ func Compress(r io.Reader, w io.Writer) error { return nil } -func NewMetadata(slug, entrypoint, importMap string, staticFiles []string) api.FunctionDeployMetadata { - meta := api.FunctionDeployMetadata{ +func NewMetadata(slug, entrypoint, importMap string, staticFiles []string) FunctionDeployMetadata { + meta := FunctionDeployMetadata{ Name: &slug, EntrypointPath: toFileURL(entrypoint), } diff --git a/pkg/function/deploy.go b/pkg/function/deploy.go index ed105b668..d2e302deb 100644 --- a/pkg/function/deploy.go +++ b/pkg/function/deploy.go @@ -24,13 +24,13 @@ func (s *EdgeRuntimeAPI) Deploy(ctx context.Context, functionConfig config.Funct return s.UpsertFunctions(ctx, functionConfig) } // Convert all paths in functions config to relative when using api deploy - var toDeploy []api.FunctionDeployMetadata + var toDeploy []FunctionDeployMetadata for slug, fc := range functionConfig { if !fc.Enabled { fmt.Fprintln(os.Stderr, "Skipped deploying Function:", slug) continue } - meta := api.FunctionDeployMetadata{ + meta := FunctionDeployMetadata{ Name: &slug, EntrypointPath: toRelPath(fc.Entrypoint), ImportMapPath: cast.Ptr(toRelPath(fc.ImportMap)), @@ -64,9 +64,9 @@ func toRelPath(fp string) string { return filepath.ToSlash(fp) } -func (s *EdgeRuntimeAPI) bulkUpload(ctx context.Context, toDeploy []api.FunctionDeployMetadata, fsys fs.FS) error { +func (s *EdgeRuntimeAPI) bulkUpload(ctx context.Context, toDeploy []FunctionDeployMetadata, fsys fs.FS) error { jq := queue.NewJobQueue(s.maxJobs) - toUpdate := make([]api.BulkUpdateFunctionBody, len(toDeploy)) + toUpdate := make(api.BulkUpdateFunctionBody, len(toDeploy)) for i, meta := range toDeploy { param := api.V1DeployAFunctionParams{ Slug: meta.Name, @@ -105,7 +105,7 @@ func (s *EdgeRuntimeAPI) bulkUpload(ctx context.Context, toDeploy []api.Function return nil } -func (s *EdgeRuntimeAPI) upload(ctx context.Context, param api.V1DeployAFunctionParams, meta api.FunctionDeployMetadata, fsys fs.FS) (*api.DeployFunctionResponse, error) { +func (s *EdgeRuntimeAPI) upload(ctx context.Context, param api.V1DeployAFunctionParams, meta FunctionDeployMetadata, fsys fs.FS) (*api.DeployFunctionResponse, error) { body, w := io.Pipe() form := multipart.NewWriter(w) ctx, cancel := context.WithCancelCause(ctx) @@ -129,7 +129,7 @@ func (s *EdgeRuntimeAPI) upload(ctx context.Context, param api.V1DeployAFunction return resp.JSON201, nil } -func writeForm(form *multipart.Writer, meta api.FunctionDeployMetadata, fsys fs.FS) error { +func writeForm(form *multipart.Writer, meta FunctionDeployMetadata, fsys fs.FS) error { m, err := form.CreateFormField("metadata") if err != nil { return errors.Errorf("failed to create metadata: %w", err) diff --git a/pkg/function/deploy_test.go b/pkg/function/deploy_test.go index 5655697fa..50e2e859e 100644 --- a/pkg/function/deploy_test.go +++ b/pkg/function/deploy_test.go @@ -36,7 +36,7 @@ func TestWriteForm(t *testing.T) { // Setup in-memory fs fsys := testImports // Run test - err := writeForm(form, api.FunctionDeployMetadata{ + err := writeForm(form, FunctionDeployMetadata{ Name: cast.Ptr("nested"), VerifyJwt: cast.Ptr(true), EntrypointPath: "testdata/nested/index.ts", @@ -55,7 +55,7 @@ func TestWriteForm(t *testing.T) { // Setup in-memory fs fsys := fs.MapFS{} // Run test - err := writeForm(form, api.FunctionDeployMetadata{ + err := writeForm(form, FunctionDeployMetadata{ ImportMapPath: cast.Ptr("testdata/import_map.json"), }, fsys) // Check error @@ -69,7 +69,7 @@ func TestWriteForm(t *testing.T) { // Setup in-memory fs fsys := testImports // Run test - err := writeForm(form, api.FunctionDeployMetadata{ + err := writeForm(form, FunctionDeployMetadata{ StaticPatterns: cast.Ptr([]string{"testdata"}), }, fsys) // Check error From f9058e9a244129808a277c2310f86b2a2dd5cdd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 05:00:39 +0000 Subject: [PATCH 146/359] chore(deps): bump supabase/postgres from 17.4.1.036 to 17.4.1.037 in /pkg/config/templates (#3622) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.036 to 17.4.1.037. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.037 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 42e1f7d12..99b8e7473 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.036 AS pg +FROM supabase/postgres:17.4.1.037 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From d26fc52ccac9377adf8157cc946ec3461f0ebb57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 05:05:42 +0000 Subject: [PATCH 147/359] chore(deps): bump supabase/realtime from v2.35.4 to v2.35.6 in /pkg/config/templates (#3623) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.35.4 to v2.35.6. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.35.6 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 99b8e7473..6d7269394 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.173.0 AS gotrue -FROM supabase/realtime:v2.35.4 AS realtime +FROM supabase/realtime:v2.35.6 AS realtime FROM supabase/storage-api:v1.22.17 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From ebb9f44edf751a3412a3ac07776d7378492d36d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 05:27:11 +0000 Subject: [PATCH 148/359] chore(deps): bump supabase/gotrue from v2.173.0 to v2.174.0 in /pkg/config/templates (#3630) chore(deps): bump supabase/gotrue in /pkg/config/templates Bumps supabase/gotrue from v2.173.0 to v2.174.0. --- updated-dependencies: - dependency-name: supabase/gotrue dependency-version: v2.174.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 6d7269394..c39cedcc6 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -10,7 +10,7 @@ FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor -FROM supabase/gotrue:v2.173.0 AS gotrue +FROM supabase/gotrue:v2.174.0 AS gotrue FROM supabase/realtime:v2.35.6 AS realtime FROM supabase/storage-api:v1.22.17 AS storage FROM supabase/logflare:1.12.0 AS logflare From 5011300ee67d36354036b1a0c3cf456a24392b50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 05:32:20 +0000 Subject: [PATCH 149/359] chore(deps): bump supabase/storage-api from v1.22.17 to v1.23.0 in /pkg/config/templates (#3629) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.22.17 to v1.23.0. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.23.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index c39cedcc6..a289ae51f 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue FROM supabase/realtime:v2.35.6 AS realtime -FROM supabase/storage-api:v1.22.17 AS storage +FROM supabase/storage-api:v1.23.0 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 0cbb76c49df84d28103994a6946559d14724d4c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 05:37:43 +0000 Subject: [PATCH 150/359] chore(deps): bump supabase/realtime from v2.35.6 to v2.36.0 in /pkg/config/templates (#3628) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.35.6 to v2.36.0. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index a289ae51f..e66facc3e 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue -FROM supabase/realtime:v2.35.6 AS realtime +FROM supabase/realtime:v2.36.0 AS realtime FROM supabase/storage-api:v1.23.0 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From f49323d170084606afeac50d165760587a239113 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Thu, 29 May 2025 18:08:42 +0800 Subject: [PATCH 151/359] chore: handle nullable fields --- go.mod | 1 + go.sum | 2 + internal/link/link.go | 8 +- pkg/api/types.cfg.yaml | 2 + pkg/api/types.gen.go | 801 +++++++++++++++++++------------------ pkg/config/auth.go | 650 ++++++++++++++++-------------- pkg/config/auth_test.go | 705 ++++++++++++++++---------------- pkg/config/updater_test.go | 3 +- 8 files changed, 1106 insertions(+), 1066 deletions(-) diff --git a/go.mod b/go.mod index 338374769..8f47d1882 100644 --- a/go.mod +++ b/go.mod @@ -36,6 +36,7 @@ require ( github.com/jackc/pgx/v4 v4.18.3 github.com/joho/godotenv v1.5.1 github.com/muesli/reflow v0.3.0 + github.com/oapi-codegen/nullable v1.1.0 github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 github.com/oapi-codegen/runtime v1.1.1 github.com/slack-go/slack v0.17.0 diff --git a/go.sum b/go.sum index 728858f7c..bf2c25ff1 100644 --- a/go.sum +++ b/go.sum @@ -735,6 +735,8 @@ github.com/nunnatsa/ginkgolinter v0.19.1/go.mod h1:jkQ3naZDmxaZMXPWaS9rblH+i+GWX github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs= +github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY= github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 h1:ykgG34472DWey7TSjd8vIfNykXgjOgYJZoQbKfEeY/Q= github.com/oapi-codegen/oapi-codegen/v2 v2.4.1/go.mod h1:N5+lY1tiTDV3V1BeHtOxeWXHoPVeApvsvjJqegfoaz8= github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= diff --git a/internal/link/link.go b/internal/link/link.go index 9228ef021..2e5747fd5 100644 --- a/internal/link/link.go +++ b/internal/link/link.go @@ -242,11 +242,11 @@ func linkPooler(ctx context.Context, projectRef string, fsys afero.Fs) error { func updatePoolerConfig(config api.SupavisorConfigResponse) { utils.Config.Db.Pooler.ConnectionString = config.ConnectionString utils.Config.Db.Pooler.PoolMode = cliConfig.PoolMode(config.PoolMode) - if config.DefaultPoolSize != nil { - utils.Config.Db.Pooler.DefaultPoolSize = cast.IntToUint(*config.DefaultPoolSize) + if value, err := config.DefaultPoolSize.Get(); err == nil { + utils.Config.Db.Pooler.DefaultPoolSize = cast.IntToUint(value) } - if config.MaxClientConn != nil { - utils.Config.Db.Pooler.MaxClientConn = cast.IntToUint(*config.MaxClientConn) + if value, err := config.MaxClientConn.Get(); err == nil { + utils.Config.Db.Pooler.MaxClientConn = cast.IntToUint(value) } } diff --git a/pkg/api/types.cfg.yaml b/pkg/api/types.cfg.yaml index 6dcd8d6ca..65a557362 100755 --- a/pkg/api/types.cfg.yaml +++ b/pkg/api/types.cfg.yaml @@ -1,4 +1,6 @@ package: api generate: models: true +output-options: + nullable-type: true output: pkg/api/types.gen.go diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 4ef41ea87..44448b799 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -8,6 +8,7 @@ import ( "fmt" "time" + "github.com/oapi-codegen/nullable" "github.com/oapi-codegen/runtime" openapi_types "github.com/oapi-codegen/runtime/types" ) @@ -927,18 +928,18 @@ type AnalyticsResponse_Error struct { // ApiKeyResponse defines model for ApiKeyResponse. type ApiKeyResponse struct { - ApiKey string `json:"api_key"` - Description *string `json:"description"` - Hash *string `json:"hash"` - Id *string `json:"id"` - InsertedAt *time.Time `json:"inserted_at"` - Name string `json:"name"` - Prefix *string `json:"prefix"` - SecretJwtTemplate *struct { + ApiKey string `json:"api_key"` + Description nullable.Nullable[string] `json:"description,omitempty"` + Hash nullable.Nullable[string] `json:"hash,omitempty"` + Id nullable.Nullable[string] `json:"id,omitempty"` + InsertedAt nullable.Nullable[time.Time] `json:"inserted_at,omitempty"` + Name string `json:"name"` + Prefix nullable.Nullable[string] `json:"prefix,omitempty"` + SecretJwtTemplate nullable.Nullable[struct { Role string `json:"role"` - } `json:"secret_jwt_template"` - Type *ApiKeyResponseType `json:"type"` - UpdatedAt *time.Time `json:"updated_at"` + }] `json:"secret_jwt_template,omitempty"` + Type nullable.Nullable[ApiKeyResponseType] `json:"type,omitempty"` + UpdatedAt nullable.Nullable[time.Time] `json:"updated_at,omitempty"` } // ApiKeyResponseType defines model for ApiKeyResponse.Type. @@ -972,178 +973,178 @@ type ApplyProjectAddonBody_AddonVariant struct { // AuthConfigResponse defines model for AuthConfigResponse. type AuthConfigResponse struct { - ApiMaxRequestDuration *int `json:"api_max_request_duration"` - DbMaxPoolSize *int `json:"db_max_pool_size"` - DisableSignup *bool `json:"disable_signup"` - ExternalAnonymousUsersEnabled *bool `json:"external_anonymous_users_enabled"` - ExternalAppleAdditionalClientIds *string `json:"external_apple_additional_client_ids"` - ExternalAppleClientId *string `json:"external_apple_client_id"` - ExternalAppleEnabled *bool `json:"external_apple_enabled"` - ExternalAppleSecret *string `json:"external_apple_secret"` - ExternalAzureClientId *string `json:"external_azure_client_id"` - ExternalAzureEnabled *bool `json:"external_azure_enabled"` - ExternalAzureSecret *string `json:"external_azure_secret"` - ExternalAzureUrl *string `json:"external_azure_url"` - ExternalBitbucketClientId *string `json:"external_bitbucket_client_id"` - ExternalBitbucketEnabled *bool `json:"external_bitbucket_enabled"` - ExternalBitbucketSecret *string `json:"external_bitbucket_secret"` - ExternalDiscordClientId *string `json:"external_discord_client_id"` - ExternalDiscordEnabled *bool `json:"external_discord_enabled"` - ExternalDiscordSecret *string `json:"external_discord_secret"` - ExternalEmailEnabled *bool `json:"external_email_enabled"` - ExternalFacebookClientId *string `json:"external_facebook_client_id"` - ExternalFacebookEnabled *bool `json:"external_facebook_enabled"` - ExternalFacebookSecret *string `json:"external_facebook_secret"` - ExternalFigmaClientId *string `json:"external_figma_client_id"` - ExternalFigmaEnabled *bool `json:"external_figma_enabled"` - ExternalFigmaSecret *string `json:"external_figma_secret"` - ExternalGithubClientId *string `json:"external_github_client_id"` - ExternalGithubEnabled *bool `json:"external_github_enabled"` - ExternalGithubSecret *string `json:"external_github_secret"` - ExternalGitlabClientId *string `json:"external_gitlab_client_id"` - ExternalGitlabEnabled *bool `json:"external_gitlab_enabled"` - ExternalGitlabSecret *string `json:"external_gitlab_secret"` - ExternalGitlabUrl *string `json:"external_gitlab_url"` - ExternalGoogleAdditionalClientIds *string `json:"external_google_additional_client_ids"` - ExternalGoogleClientId *string `json:"external_google_client_id"` - ExternalGoogleEnabled *bool `json:"external_google_enabled"` - ExternalGoogleSecret *string `json:"external_google_secret"` - ExternalGoogleSkipNonceCheck *bool `json:"external_google_skip_nonce_check"` - ExternalKakaoClientId *string `json:"external_kakao_client_id"` - ExternalKakaoEnabled *bool `json:"external_kakao_enabled"` - ExternalKakaoSecret *string `json:"external_kakao_secret"` - ExternalKeycloakClientId *string `json:"external_keycloak_client_id"` - ExternalKeycloakEnabled *bool `json:"external_keycloak_enabled"` - ExternalKeycloakSecret *string `json:"external_keycloak_secret"` - ExternalKeycloakUrl *string `json:"external_keycloak_url"` - ExternalLinkedinOidcClientId *string `json:"external_linkedin_oidc_client_id"` - ExternalLinkedinOidcEnabled *bool `json:"external_linkedin_oidc_enabled"` - ExternalLinkedinOidcSecret *string `json:"external_linkedin_oidc_secret"` - ExternalNotionClientId *string `json:"external_notion_client_id"` - ExternalNotionEnabled *bool `json:"external_notion_enabled"` - ExternalNotionSecret *string `json:"external_notion_secret"` - ExternalPhoneEnabled *bool `json:"external_phone_enabled"` - ExternalSlackClientId *string `json:"external_slack_client_id"` - ExternalSlackEnabled *bool `json:"external_slack_enabled"` - ExternalSlackOidcClientId *string `json:"external_slack_oidc_client_id"` - ExternalSlackOidcEnabled *bool `json:"external_slack_oidc_enabled"` - ExternalSlackOidcSecret *string `json:"external_slack_oidc_secret"` - ExternalSlackSecret *string `json:"external_slack_secret"` - ExternalSpotifyClientId *string `json:"external_spotify_client_id"` - ExternalSpotifyEnabled *bool `json:"external_spotify_enabled"` - ExternalSpotifySecret *string `json:"external_spotify_secret"` - ExternalTwitchClientId *string `json:"external_twitch_client_id"` - ExternalTwitchEnabled *bool `json:"external_twitch_enabled"` - ExternalTwitchSecret *string `json:"external_twitch_secret"` - ExternalTwitterClientId *string `json:"external_twitter_client_id"` - ExternalTwitterEnabled *bool `json:"external_twitter_enabled"` - ExternalTwitterSecret *string `json:"external_twitter_secret"` - ExternalWeb3SolanaEnabled *bool `json:"external_web3_solana_enabled"` - ExternalWorkosClientId *string `json:"external_workos_client_id"` - ExternalWorkosEnabled *bool `json:"external_workos_enabled"` - ExternalWorkosSecret *string `json:"external_workos_secret"` - ExternalWorkosUrl *string `json:"external_workos_url"` - ExternalZoomClientId *string `json:"external_zoom_client_id"` - ExternalZoomEnabled *bool `json:"external_zoom_enabled"` - ExternalZoomSecret *string `json:"external_zoom_secret"` - HookCustomAccessTokenEnabled *bool `json:"hook_custom_access_token_enabled"` - HookCustomAccessTokenSecrets *string `json:"hook_custom_access_token_secrets"` - HookCustomAccessTokenUri *string `json:"hook_custom_access_token_uri"` - HookMfaVerificationAttemptEnabled *bool `json:"hook_mfa_verification_attempt_enabled"` - HookMfaVerificationAttemptSecrets *string `json:"hook_mfa_verification_attempt_secrets"` - HookMfaVerificationAttemptUri *string `json:"hook_mfa_verification_attempt_uri"` - HookPasswordVerificationAttemptEnabled *bool `json:"hook_password_verification_attempt_enabled"` - HookPasswordVerificationAttemptSecrets *string `json:"hook_password_verification_attempt_secrets"` - HookPasswordVerificationAttemptUri *string `json:"hook_password_verification_attempt_uri"` - HookSendEmailEnabled *bool `json:"hook_send_email_enabled"` - HookSendEmailSecrets *string `json:"hook_send_email_secrets"` - HookSendEmailUri *string `json:"hook_send_email_uri"` - HookSendSmsEnabled *bool `json:"hook_send_sms_enabled"` - HookSendSmsSecrets *string `json:"hook_send_sms_secrets"` - HookSendSmsUri *string `json:"hook_send_sms_uri"` - JwtExp *int `json:"jwt_exp"` - MailerAllowUnverifiedEmailSignIns *bool `json:"mailer_allow_unverified_email_sign_ins"` - MailerAutoconfirm *bool `json:"mailer_autoconfirm"` - MailerOtpExp int `json:"mailer_otp_exp"` - MailerOtpLength *int `json:"mailer_otp_length"` - MailerSecureEmailChangeEnabled *bool `json:"mailer_secure_email_change_enabled"` - MailerSubjectsConfirmation *string `json:"mailer_subjects_confirmation"` - MailerSubjectsEmailChange *string `json:"mailer_subjects_email_change"` - MailerSubjectsInvite *string `json:"mailer_subjects_invite"` - MailerSubjectsMagicLink *string `json:"mailer_subjects_magic_link"` - MailerSubjectsReauthentication *string `json:"mailer_subjects_reauthentication"` - MailerSubjectsRecovery *string `json:"mailer_subjects_recovery"` - MailerTemplatesConfirmationContent *string `json:"mailer_templates_confirmation_content"` - MailerTemplatesEmailChangeContent *string `json:"mailer_templates_email_change_content"` - MailerTemplatesInviteContent *string `json:"mailer_templates_invite_content"` - MailerTemplatesMagicLinkContent *string `json:"mailer_templates_magic_link_content"` - MailerTemplatesReauthenticationContent *string `json:"mailer_templates_reauthentication_content"` - MailerTemplatesRecoveryContent *string `json:"mailer_templates_recovery_content"` - MfaMaxEnrolledFactors *int `json:"mfa_max_enrolled_factors"` - MfaPhoneEnrollEnabled *bool `json:"mfa_phone_enroll_enabled"` - MfaPhoneMaxFrequency *int `json:"mfa_phone_max_frequency"` - MfaPhoneOtpLength int `json:"mfa_phone_otp_length"` - MfaPhoneTemplate *string `json:"mfa_phone_template"` - MfaPhoneVerifyEnabled *bool `json:"mfa_phone_verify_enabled"` - MfaTotpEnrollEnabled *bool `json:"mfa_totp_enroll_enabled"` - MfaTotpVerifyEnabled *bool `json:"mfa_totp_verify_enabled"` - MfaWebAuthnEnrollEnabled *bool `json:"mfa_web_authn_enroll_enabled"` - MfaWebAuthnVerifyEnabled *bool `json:"mfa_web_authn_verify_enabled"` - PasswordHibpEnabled *bool `json:"password_hibp_enabled"` - PasswordMinLength *int `json:"password_min_length"` - PasswordRequiredCharacters *string `json:"password_required_characters"` - RateLimitAnonymousUsers *int `json:"rate_limit_anonymous_users"` - RateLimitEmailSent *int `json:"rate_limit_email_sent"` - RateLimitOtp *int `json:"rate_limit_otp"` - RateLimitSmsSent *int `json:"rate_limit_sms_sent"` - RateLimitTokenRefresh *int `json:"rate_limit_token_refresh"` - RateLimitVerify *int `json:"rate_limit_verify"` - RateLimitWeb3 *int `json:"rate_limit_web3"` - RefreshTokenRotationEnabled *bool `json:"refresh_token_rotation_enabled"` - SamlAllowEncryptedAssertions *bool `json:"saml_allow_encrypted_assertions"` - SamlEnabled *bool `json:"saml_enabled"` - SamlExternalUrl *string `json:"saml_external_url"` - SecurityCaptchaEnabled *bool `json:"security_captcha_enabled"` - SecurityCaptchaProvider *string `json:"security_captcha_provider"` - SecurityCaptchaSecret *string `json:"security_captcha_secret"` - SecurityManualLinkingEnabled *bool `json:"security_manual_linking_enabled"` - SecurityRefreshTokenReuseInterval *int `json:"security_refresh_token_reuse_interval"` - SecurityUpdatePasswordRequireReauthentication *bool `json:"security_update_password_require_reauthentication"` - SessionsInactivityTimeout *int `json:"sessions_inactivity_timeout"` - SessionsSinglePerUser *bool `json:"sessions_single_per_user"` - SessionsTags *string `json:"sessions_tags"` - SessionsTimebox *int `json:"sessions_timebox"` - SiteUrl *string `json:"site_url"` - SmsAutoconfirm *bool `json:"sms_autoconfirm"` - SmsMaxFrequency *int `json:"sms_max_frequency"` - SmsMessagebirdAccessKey *string `json:"sms_messagebird_access_key"` - SmsMessagebirdOriginator *string `json:"sms_messagebird_originator"` - SmsOtpExp *int `json:"sms_otp_exp"` - SmsOtpLength int `json:"sms_otp_length"` - SmsProvider *string `json:"sms_provider"` - SmsTemplate *string `json:"sms_template"` - SmsTestOtp *string `json:"sms_test_otp"` - SmsTestOtpValidUntil *string `json:"sms_test_otp_valid_until"` - SmsTextlocalApiKey *string `json:"sms_textlocal_api_key"` - SmsTextlocalSender *string `json:"sms_textlocal_sender"` - SmsTwilioAccountSid *string `json:"sms_twilio_account_sid"` - SmsTwilioAuthToken *string `json:"sms_twilio_auth_token"` - SmsTwilioContentSid *string `json:"sms_twilio_content_sid"` - SmsTwilioMessageServiceSid *string `json:"sms_twilio_message_service_sid"` - SmsTwilioVerifyAccountSid *string `json:"sms_twilio_verify_account_sid"` - SmsTwilioVerifyAuthToken *string `json:"sms_twilio_verify_auth_token"` - SmsTwilioVerifyMessageServiceSid *string `json:"sms_twilio_verify_message_service_sid"` - SmsVonageApiKey *string `json:"sms_vonage_api_key"` - SmsVonageApiSecret *string `json:"sms_vonage_api_secret"` - SmsVonageFrom *string `json:"sms_vonage_from"` - SmtpAdminEmail *string `json:"smtp_admin_email"` - SmtpHost *string `json:"smtp_host"` - SmtpMaxFrequency *int `json:"smtp_max_frequency"` - SmtpPass *string `json:"smtp_pass"` - SmtpPort *string `json:"smtp_port"` - SmtpSenderName *string `json:"smtp_sender_name"` - SmtpUser *string `json:"smtp_user"` - UriAllowList *string `json:"uri_allow_list"` + ApiMaxRequestDuration nullable.Nullable[int] `json:"api_max_request_duration"` + DbMaxPoolSize nullable.Nullable[int] `json:"db_max_pool_size"` + DisableSignup nullable.Nullable[bool] `json:"disable_signup"` + ExternalAnonymousUsersEnabled nullable.Nullable[bool] `json:"external_anonymous_users_enabled"` + ExternalAppleAdditionalClientIds nullable.Nullable[string] `json:"external_apple_additional_client_ids"` + ExternalAppleClientId nullable.Nullable[string] `json:"external_apple_client_id"` + ExternalAppleEnabled nullable.Nullable[bool] `json:"external_apple_enabled"` + ExternalAppleSecret nullable.Nullable[string] `json:"external_apple_secret"` + ExternalAzureClientId nullable.Nullable[string] `json:"external_azure_client_id"` + ExternalAzureEnabled nullable.Nullable[bool] `json:"external_azure_enabled"` + ExternalAzureSecret nullable.Nullable[string] `json:"external_azure_secret"` + ExternalAzureUrl nullable.Nullable[string] `json:"external_azure_url"` + ExternalBitbucketClientId nullable.Nullable[string] `json:"external_bitbucket_client_id"` + ExternalBitbucketEnabled nullable.Nullable[bool] `json:"external_bitbucket_enabled"` + ExternalBitbucketSecret nullable.Nullable[string] `json:"external_bitbucket_secret"` + ExternalDiscordClientId nullable.Nullable[string] `json:"external_discord_client_id"` + ExternalDiscordEnabled nullable.Nullable[bool] `json:"external_discord_enabled"` + ExternalDiscordSecret nullable.Nullable[string] `json:"external_discord_secret"` + ExternalEmailEnabled nullable.Nullable[bool] `json:"external_email_enabled"` + ExternalFacebookClientId nullable.Nullable[string] `json:"external_facebook_client_id"` + ExternalFacebookEnabled nullable.Nullable[bool] `json:"external_facebook_enabled"` + ExternalFacebookSecret nullable.Nullable[string] `json:"external_facebook_secret"` + ExternalFigmaClientId nullable.Nullable[string] `json:"external_figma_client_id"` + ExternalFigmaEnabled nullable.Nullable[bool] `json:"external_figma_enabled"` + ExternalFigmaSecret nullable.Nullable[string] `json:"external_figma_secret"` + ExternalGithubClientId nullable.Nullable[string] `json:"external_github_client_id"` + ExternalGithubEnabled nullable.Nullable[bool] `json:"external_github_enabled"` + ExternalGithubSecret nullable.Nullable[string] `json:"external_github_secret"` + ExternalGitlabClientId nullable.Nullable[string] `json:"external_gitlab_client_id"` + ExternalGitlabEnabled nullable.Nullable[bool] `json:"external_gitlab_enabled"` + ExternalGitlabSecret nullable.Nullable[string] `json:"external_gitlab_secret"` + ExternalGitlabUrl nullable.Nullable[string] `json:"external_gitlab_url"` + ExternalGoogleAdditionalClientIds nullable.Nullable[string] `json:"external_google_additional_client_ids"` + ExternalGoogleClientId nullable.Nullable[string] `json:"external_google_client_id"` + ExternalGoogleEnabled nullable.Nullable[bool] `json:"external_google_enabled"` + ExternalGoogleSecret nullable.Nullable[string] `json:"external_google_secret"` + ExternalGoogleSkipNonceCheck nullable.Nullable[bool] `json:"external_google_skip_nonce_check"` + ExternalKakaoClientId nullable.Nullable[string] `json:"external_kakao_client_id"` + ExternalKakaoEnabled nullable.Nullable[bool] `json:"external_kakao_enabled"` + ExternalKakaoSecret nullable.Nullable[string] `json:"external_kakao_secret"` + ExternalKeycloakClientId nullable.Nullable[string] `json:"external_keycloak_client_id"` + ExternalKeycloakEnabled nullable.Nullable[bool] `json:"external_keycloak_enabled"` + ExternalKeycloakSecret nullable.Nullable[string] `json:"external_keycloak_secret"` + ExternalKeycloakUrl nullable.Nullable[string] `json:"external_keycloak_url"` + ExternalLinkedinOidcClientId nullable.Nullable[string] `json:"external_linkedin_oidc_client_id"` + ExternalLinkedinOidcEnabled nullable.Nullable[bool] `json:"external_linkedin_oidc_enabled"` + ExternalLinkedinOidcSecret nullable.Nullable[string] `json:"external_linkedin_oidc_secret"` + ExternalNotionClientId nullable.Nullable[string] `json:"external_notion_client_id"` + ExternalNotionEnabled nullable.Nullable[bool] `json:"external_notion_enabled"` + ExternalNotionSecret nullable.Nullable[string] `json:"external_notion_secret"` + ExternalPhoneEnabled nullable.Nullable[bool] `json:"external_phone_enabled"` + ExternalSlackClientId nullable.Nullable[string] `json:"external_slack_client_id"` + ExternalSlackEnabled nullable.Nullable[bool] `json:"external_slack_enabled"` + ExternalSlackOidcClientId nullable.Nullable[string] `json:"external_slack_oidc_client_id"` + ExternalSlackOidcEnabled nullable.Nullable[bool] `json:"external_slack_oidc_enabled"` + ExternalSlackOidcSecret nullable.Nullable[string] `json:"external_slack_oidc_secret"` + ExternalSlackSecret nullable.Nullable[string] `json:"external_slack_secret"` + ExternalSpotifyClientId nullable.Nullable[string] `json:"external_spotify_client_id"` + ExternalSpotifyEnabled nullable.Nullable[bool] `json:"external_spotify_enabled"` + ExternalSpotifySecret nullable.Nullable[string] `json:"external_spotify_secret"` + ExternalTwitchClientId nullable.Nullable[string] `json:"external_twitch_client_id"` + ExternalTwitchEnabled nullable.Nullable[bool] `json:"external_twitch_enabled"` + ExternalTwitchSecret nullable.Nullable[string] `json:"external_twitch_secret"` + ExternalTwitterClientId nullable.Nullable[string] `json:"external_twitter_client_id"` + ExternalTwitterEnabled nullable.Nullable[bool] `json:"external_twitter_enabled"` + ExternalTwitterSecret nullable.Nullable[string] `json:"external_twitter_secret"` + ExternalWeb3SolanaEnabled nullable.Nullable[bool] `json:"external_web3_solana_enabled"` + ExternalWorkosClientId nullable.Nullable[string] `json:"external_workos_client_id"` + ExternalWorkosEnabled nullable.Nullable[bool] `json:"external_workos_enabled"` + ExternalWorkosSecret nullable.Nullable[string] `json:"external_workos_secret"` + ExternalWorkosUrl nullable.Nullable[string] `json:"external_workos_url"` + ExternalZoomClientId nullable.Nullable[string] `json:"external_zoom_client_id"` + ExternalZoomEnabled nullable.Nullable[bool] `json:"external_zoom_enabled"` + ExternalZoomSecret nullable.Nullable[string] `json:"external_zoom_secret"` + HookCustomAccessTokenEnabled nullable.Nullable[bool] `json:"hook_custom_access_token_enabled"` + HookCustomAccessTokenSecrets nullable.Nullable[string] `json:"hook_custom_access_token_secrets"` + HookCustomAccessTokenUri nullable.Nullable[string] `json:"hook_custom_access_token_uri"` + HookMfaVerificationAttemptEnabled nullable.Nullable[bool] `json:"hook_mfa_verification_attempt_enabled"` + HookMfaVerificationAttemptSecrets nullable.Nullable[string] `json:"hook_mfa_verification_attempt_secrets"` + HookMfaVerificationAttemptUri nullable.Nullable[string] `json:"hook_mfa_verification_attempt_uri"` + HookPasswordVerificationAttemptEnabled nullable.Nullable[bool] `json:"hook_password_verification_attempt_enabled"` + HookPasswordVerificationAttemptSecrets nullable.Nullable[string] `json:"hook_password_verification_attempt_secrets"` + HookPasswordVerificationAttemptUri nullable.Nullable[string] `json:"hook_password_verification_attempt_uri"` + HookSendEmailEnabled nullable.Nullable[bool] `json:"hook_send_email_enabled"` + HookSendEmailSecrets nullable.Nullable[string] `json:"hook_send_email_secrets"` + HookSendEmailUri nullable.Nullable[string] `json:"hook_send_email_uri"` + HookSendSmsEnabled nullable.Nullable[bool] `json:"hook_send_sms_enabled"` + HookSendSmsSecrets nullable.Nullable[string] `json:"hook_send_sms_secrets"` + HookSendSmsUri nullable.Nullable[string] `json:"hook_send_sms_uri"` + JwtExp nullable.Nullable[int] `json:"jwt_exp"` + MailerAllowUnverifiedEmailSignIns nullable.Nullable[bool] `json:"mailer_allow_unverified_email_sign_ins"` + MailerAutoconfirm nullable.Nullable[bool] `json:"mailer_autoconfirm"` + MailerOtpExp int `json:"mailer_otp_exp"` + MailerOtpLength nullable.Nullable[int] `json:"mailer_otp_length"` + MailerSecureEmailChangeEnabled nullable.Nullable[bool] `json:"mailer_secure_email_change_enabled"` + MailerSubjectsConfirmation nullable.Nullable[string] `json:"mailer_subjects_confirmation"` + MailerSubjectsEmailChange nullable.Nullable[string] `json:"mailer_subjects_email_change"` + MailerSubjectsInvite nullable.Nullable[string] `json:"mailer_subjects_invite"` + MailerSubjectsMagicLink nullable.Nullable[string] `json:"mailer_subjects_magic_link"` + MailerSubjectsReauthentication nullable.Nullable[string] `json:"mailer_subjects_reauthentication"` + MailerSubjectsRecovery nullable.Nullable[string] `json:"mailer_subjects_recovery"` + MailerTemplatesConfirmationContent nullable.Nullable[string] `json:"mailer_templates_confirmation_content"` + MailerTemplatesEmailChangeContent nullable.Nullable[string] `json:"mailer_templates_email_change_content"` + MailerTemplatesInviteContent nullable.Nullable[string] `json:"mailer_templates_invite_content"` + MailerTemplatesMagicLinkContent nullable.Nullable[string] `json:"mailer_templates_magic_link_content"` + MailerTemplatesReauthenticationContent nullable.Nullable[string] `json:"mailer_templates_reauthentication_content"` + MailerTemplatesRecoveryContent nullable.Nullable[string] `json:"mailer_templates_recovery_content"` + MfaMaxEnrolledFactors nullable.Nullable[int] `json:"mfa_max_enrolled_factors"` + MfaPhoneEnrollEnabled nullable.Nullable[bool] `json:"mfa_phone_enroll_enabled"` + MfaPhoneMaxFrequency nullable.Nullable[int] `json:"mfa_phone_max_frequency"` + MfaPhoneOtpLength int `json:"mfa_phone_otp_length"` + MfaPhoneTemplate nullable.Nullable[string] `json:"mfa_phone_template"` + MfaPhoneVerifyEnabled nullable.Nullable[bool] `json:"mfa_phone_verify_enabled"` + MfaTotpEnrollEnabled nullable.Nullable[bool] `json:"mfa_totp_enroll_enabled"` + MfaTotpVerifyEnabled nullable.Nullable[bool] `json:"mfa_totp_verify_enabled"` + MfaWebAuthnEnrollEnabled nullable.Nullable[bool] `json:"mfa_web_authn_enroll_enabled"` + MfaWebAuthnVerifyEnabled nullable.Nullable[bool] `json:"mfa_web_authn_verify_enabled"` + PasswordHibpEnabled nullable.Nullable[bool] `json:"password_hibp_enabled"` + PasswordMinLength nullable.Nullable[int] `json:"password_min_length"` + PasswordRequiredCharacters nullable.Nullable[string] `json:"password_required_characters"` + RateLimitAnonymousUsers nullable.Nullable[int] `json:"rate_limit_anonymous_users"` + RateLimitEmailSent nullable.Nullable[int] `json:"rate_limit_email_sent"` + RateLimitOtp nullable.Nullable[int] `json:"rate_limit_otp"` + RateLimitSmsSent nullable.Nullable[int] `json:"rate_limit_sms_sent"` + RateLimitTokenRefresh nullable.Nullable[int] `json:"rate_limit_token_refresh"` + RateLimitVerify nullable.Nullable[int] `json:"rate_limit_verify"` + RateLimitWeb3 nullable.Nullable[int] `json:"rate_limit_web3"` + RefreshTokenRotationEnabled nullable.Nullable[bool] `json:"refresh_token_rotation_enabled"` + SamlAllowEncryptedAssertions nullable.Nullable[bool] `json:"saml_allow_encrypted_assertions"` + SamlEnabled nullable.Nullable[bool] `json:"saml_enabled"` + SamlExternalUrl nullable.Nullable[string] `json:"saml_external_url"` + SecurityCaptchaEnabled nullable.Nullable[bool] `json:"security_captcha_enabled"` + SecurityCaptchaProvider nullable.Nullable[string] `json:"security_captcha_provider"` + SecurityCaptchaSecret nullable.Nullable[string] `json:"security_captcha_secret"` + SecurityManualLinkingEnabled nullable.Nullable[bool] `json:"security_manual_linking_enabled"` + SecurityRefreshTokenReuseInterval nullable.Nullable[int] `json:"security_refresh_token_reuse_interval"` + SecurityUpdatePasswordRequireReauthentication nullable.Nullable[bool] `json:"security_update_password_require_reauthentication"` + SessionsInactivityTimeout nullable.Nullable[int] `json:"sessions_inactivity_timeout"` + SessionsSinglePerUser nullable.Nullable[bool] `json:"sessions_single_per_user"` + SessionsTags nullable.Nullable[string] `json:"sessions_tags"` + SessionsTimebox nullable.Nullable[int] `json:"sessions_timebox"` + SiteUrl nullable.Nullable[string] `json:"site_url"` + SmsAutoconfirm nullable.Nullable[bool] `json:"sms_autoconfirm"` + SmsMaxFrequency nullable.Nullable[int] `json:"sms_max_frequency"` + SmsMessagebirdAccessKey nullable.Nullable[string] `json:"sms_messagebird_access_key"` + SmsMessagebirdOriginator nullable.Nullable[string] `json:"sms_messagebird_originator"` + SmsOtpExp nullable.Nullable[int] `json:"sms_otp_exp"` + SmsOtpLength int `json:"sms_otp_length"` + SmsProvider nullable.Nullable[string] `json:"sms_provider"` + SmsTemplate nullable.Nullable[string] `json:"sms_template"` + SmsTestOtp nullable.Nullable[string] `json:"sms_test_otp"` + SmsTestOtpValidUntil nullable.Nullable[string] `json:"sms_test_otp_valid_until"` + SmsTextlocalApiKey nullable.Nullable[string] `json:"sms_textlocal_api_key"` + SmsTextlocalSender nullable.Nullable[string] `json:"sms_textlocal_sender"` + SmsTwilioAccountSid nullable.Nullable[string] `json:"sms_twilio_account_sid"` + SmsTwilioAuthToken nullable.Nullable[string] `json:"sms_twilio_auth_token"` + SmsTwilioContentSid nullable.Nullable[string] `json:"sms_twilio_content_sid"` + SmsTwilioMessageServiceSid nullable.Nullable[string] `json:"sms_twilio_message_service_sid"` + SmsTwilioVerifyAccountSid nullable.Nullable[string] `json:"sms_twilio_verify_account_sid"` + SmsTwilioVerifyAuthToken nullable.Nullable[string] `json:"sms_twilio_verify_auth_token"` + SmsTwilioVerifyMessageServiceSid nullable.Nullable[string] `json:"sms_twilio_verify_message_service_sid"` + SmsVonageApiKey nullable.Nullable[string] `json:"sms_vonage_api_key"` + SmsVonageApiSecret nullable.Nullable[string] `json:"sms_vonage_api_secret"` + SmsVonageFrom nullable.Nullable[string] `json:"sms_vonage_from"` + SmtpAdminEmail nullable.Nullable[string] `json:"smtp_admin_email"` + SmtpHost nullable.Nullable[string] `json:"smtp_host"` + SmtpMaxFrequency nullable.Nullable[int] `json:"smtp_max_frequency"` + SmtpPass nullable.Nullable[string] `json:"smtp_pass"` + SmtpPort nullable.Nullable[string] `json:"smtp_port"` + SmtpSenderName nullable.Nullable[string] `json:"smtp_sender_name"` + SmtpUser nullable.Nullable[string] `json:"smtp_user"` + UriAllowList nullable.Nullable[string] `json:"uri_allow_list"` } // BranchActionBody defines model for BranchActionBody. @@ -1246,11 +1247,11 @@ type BulkUpdateFunctionResponseFunctionsStatus string // CreateApiKeyBody defines model for CreateApiKeyBody. type CreateApiKeyBody struct { - Description *string `json:"description"` - Name string `json:"name"` - SecretJwtTemplate *struct { + Description nullable.Nullable[string] `json:"description,omitempty"` + Name string `json:"name"` + SecretJwtTemplate nullable.Nullable[struct { Role string `json:"role"` - } `json:"secret_jwt_template"` + }] `json:"secret_jwt_template,omitempty"` Type CreateApiKeyBodyType `json:"type"` } @@ -1363,14 +1364,14 @@ type CreateThirdPartyAuthBody struct { // DatabaseUpgradeStatusResponse defines model for DatabaseUpgradeStatusResponse. type DatabaseUpgradeStatusResponse struct { - DatabaseUpgradeStatus *struct { + DatabaseUpgradeStatus nullable.Nullable[struct { Error *DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError `json:"error,omitempty"` InitiatedAt string `json:"initiated_at"` LatestStatusAt string `json:"latest_status_at"` Progress *DatabaseUpgradeStatusResponseDatabaseUpgradeStatusProgress `json:"progress,omitempty"` Status float32 `json:"status"` TargetVersion float32 `json:"target_version"` - } `json:"databaseUpgradeStatus"` + }] `json:"databaseUpgradeStatus"` } // DatabaseUpgradeStatusResponseDatabaseUpgradeStatusError defines model for DatabaseUpgradeStatusResponse.DatabaseUpgradeStatus.Error. @@ -1789,10 +1790,10 @@ type PostgrestConfigWithJWTSecretResponse struct { DbExtraSearchPath string `json:"db_extra_search_path"` // DbPool If `null`, the value is automatically configured based on compute size. - DbPool *int `json:"db_pool"` - DbSchema string `json:"db_schema"` - JwtSecret *string `json:"jwt_secret,omitempty"` - MaxRows int `json:"max_rows"` + DbPool nullable.Nullable[int] `json:"db_pool"` + DbSchema string `json:"db_schema"` + JwtSecret *string `json:"jwt_secret,omitempty"` + MaxRows int `json:"max_rows"` } // ProjectUpgradeEligibilityResponse defines model for ProjectUpgradeEligibilityResponse. @@ -1862,12 +1863,12 @@ type SetUpReadReplicaBodyReadReplicaRegion string // SigningKeyResponse defines model for SigningKeyResponse. type SigningKeyResponse struct { - Algorithm SigningKeyResponseAlgorithm `json:"algorithm"` - CreatedAt time.Time `json:"created_at"` - Id openapi_types.UUID `json:"id"` - PublicJwk *interface{} `json:"public_jwk"` - Status SigningKeyResponseStatus `json:"status"` - UpdatedAt time.Time `json:"updated_at"` + Algorithm SigningKeyResponseAlgorithm `json:"algorithm"` + CreatedAt time.Time `json:"created_at"` + Id openapi_types.UUID `json:"id"` + PublicJwk nullable.Nullable[interface{}] `json:"public_jwk,omitempty"` + Status SigningKeyResponseStatus `json:"status"` + UpdatedAt time.Time `json:"updated_at"` } // SigningKeyResponseAlgorithm defines model for SigningKeyResponse.Algorithm. @@ -1882,7 +1883,7 @@ type SigningKeysResponse struct { Algorithm SigningKeysResponseKeysAlgorithm `json:"algorithm"` CreatedAt time.Time `json:"created_at"` Id openapi_types.UUID `json:"id"` - PublicJwk *interface{} `json:"public_jwk"` + PublicJwk nullable.Nullable[interface{}] `json:"public_jwk,omitempty"` Status SigningKeysResponseKeysStatus `json:"status"` UpdatedAt time.Time `json:"updated_at"` } `json:"keys"` @@ -1898,10 +1899,10 @@ type SigningKeysResponseKeysStatus string type SnippetList struct { Cursor *string `json:"cursor,omitempty"` Data []struct { - Description *string `json:"description"` - Id string `json:"id"` - InsertedAt string `json:"inserted_at"` - Name string `json:"name"` + Description nullable.Nullable[string] `json:"description"` + Id string `json:"id"` + InsertedAt string `json:"inserted_at"` + Name string `json:"name"` Owner struct { Id float32 `json:"id"` Username string `json:"username"` @@ -1933,10 +1934,10 @@ type SnippetResponse struct { SchemaVersion string `json:"schema_version"` Sql string `json:"sql"` } `json:"content"` - Description *string `json:"description"` - Id string `json:"id"` - InsertedAt string `json:"inserted_at"` - Name string `json:"name"` + Description nullable.Nullable[string] `json:"description"` + Id string `json:"id"` + InsertedAt string `json:"inserted_at"` + Name string `json:"name"` Owner struct { Id float32 `json:"id"` Username string `json:"username"` @@ -2004,10 +2005,10 @@ type SupavisorConfigResponse struct { DbName string `json:"db_name"` DbPort int `json:"db_port"` DbUser string `json:"db_user"` - DefaultPoolSize *int `json:"default_pool_size"` + DefaultPoolSize nullable.Nullable[int] `json:"default_pool_size"` Identifier string `json:"identifier"` IsUsingScramAuth bool `json:"is_using_scram_auth"` - MaxClientConn *int `json:"max_client_conn"` + MaxClientConn nullable.Nullable[int] `json:"max_client_conn"` PoolMode SupavisorConfigResponsePoolMode `json:"pool_mode"` } @@ -2019,15 +2020,15 @@ type SupavisorConfigResponsePoolMode string // ThirdPartyAuth defines model for ThirdPartyAuth. type ThirdPartyAuth struct { - CustomJwks *interface{} `json:"custom_jwks"` - Id openapi_types.UUID `json:"id"` - InsertedAt string `json:"inserted_at"` - JwksUrl *string `json:"jwks_url"` - OidcIssuerUrl *string `json:"oidc_issuer_url"` - ResolvedAt *string `json:"resolved_at"` - ResolvedJwks *interface{} `json:"resolved_jwks"` - Type string `json:"type"` - UpdatedAt string `json:"updated_at"` + CustomJwks nullable.Nullable[interface{}] `json:"custom_jwks,omitempty"` + Id openapi_types.UUID `json:"id"` + InsertedAt string `json:"inserted_at"` + JwksUrl nullable.Nullable[string] `json:"jwks_url,omitempty"` + OidcIssuerUrl nullable.Nullable[string] `json:"oidc_issuer_url,omitempty"` + ResolvedAt nullable.Nullable[string] `json:"resolved_at,omitempty"` + ResolvedJwks nullable.Nullable[interface{}] `json:"resolved_jwks,omitempty"` + Type string `json:"type"` + UpdatedAt string `json:"updated_at"` } // TypescriptResponse defines model for TypescriptResponse. @@ -2037,186 +2038,186 @@ type TypescriptResponse struct { // UpdateApiKeyBody defines model for UpdateApiKeyBody. type UpdateApiKeyBody struct { - Description *string `json:"description"` - Name *string `json:"name,omitempty"` - SecretJwtTemplate *struct { + Description nullable.Nullable[string] `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + SecretJwtTemplate nullable.Nullable[struct { Role string `json:"role"` - } `json:"secret_jwt_template"` + }] `json:"secret_jwt_template,omitempty"` } // UpdateAuthConfigBody defines model for UpdateAuthConfigBody. type UpdateAuthConfigBody struct { - ApiMaxRequestDuration *int `json:"api_max_request_duration"` - DbMaxPoolSize *int `json:"db_max_pool_size"` - DisableSignup *bool `json:"disable_signup"` - ExternalAnonymousUsersEnabled *bool `json:"external_anonymous_users_enabled"` - ExternalAppleAdditionalClientIds *string `json:"external_apple_additional_client_ids"` - ExternalAppleClientId *string `json:"external_apple_client_id"` - ExternalAppleEnabled *bool `json:"external_apple_enabled"` - ExternalAppleSecret *string `json:"external_apple_secret"` - ExternalAzureClientId *string `json:"external_azure_client_id"` - ExternalAzureEnabled *bool `json:"external_azure_enabled"` - ExternalAzureSecret *string `json:"external_azure_secret"` - ExternalAzureUrl *string `json:"external_azure_url"` - ExternalBitbucketClientId *string `json:"external_bitbucket_client_id"` - ExternalBitbucketEnabled *bool `json:"external_bitbucket_enabled"` - ExternalBitbucketSecret *string `json:"external_bitbucket_secret"` - ExternalDiscordClientId *string `json:"external_discord_client_id"` - ExternalDiscordEnabled *bool `json:"external_discord_enabled"` - ExternalDiscordSecret *string `json:"external_discord_secret"` - ExternalEmailEnabled *bool `json:"external_email_enabled"` - ExternalFacebookClientId *string `json:"external_facebook_client_id"` - ExternalFacebookEnabled *bool `json:"external_facebook_enabled"` - ExternalFacebookSecret *string `json:"external_facebook_secret"` - ExternalFigmaClientId *string `json:"external_figma_client_id"` - ExternalFigmaEnabled *bool `json:"external_figma_enabled"` - ExternalFigmaSecret *string `json:"external_figma_secret"` - ExternalGithubClientId *string `json:"external_github_client_id"` - ExternalGithubEnabled *bool `json:"external_github_enabled"` - ExternalGithubSecret *string `json:"external_github_secret"` - ExternalGitlabClientId *string `json:"external_gitlab_client_id"` - ExternalGitlabEnabled *bool `json:"external_gitlab_enabled"` - ExternalGitlabSecret *string `json:"external_gitlab_secret"` - ExternalGitlabUrl *string `json:"external_gitlab_url"` - ExternalGoogleAdditionalClientIds *string `json:"external_google_additional_client_ids"` - ExternalGoogleClientId *string `json:"external_google_client_id"` - ExternalGoogleEnabled *bool `json:"external_google_enabled"` - ExternalGoogleSecret *string `json:"external_google_secret"` - ExternalGoogleSkipNonceCheck *bool `json:"external_google_skip_nonce_check"` - ExternalKakaoClientId *string `json:"external_kakao_client_id"` - ExternalKakaoEnabled *bool `json:"external_kakao_enabled"` - ExternalKakaoSecret *string `json:"external_kakao_secret"` - ExternalKeycloakClientId *string `json:"external_keycloak_client_id"` - ExternalKeycloakEnabled *bool `json:"external_keycloak_enabled"` - ExternalKeycloakSecret *string `json:"external_keycloak_secret"` - ExternalKeycloakUrl *string `json:"external_keycloak_url"` - ExternalLinkedinOidcClientId *string `json:"external_linkedin_oidc_client_id"` - ExternalLinkedinOidcEnabled *bool `json:"external_linkedin_oidc_enabled"` - ExternalLinkedinOidcSecret *string `json:"external_linkedin_oidc_secret"` - ExternalNotionClientId *string `json:"external_notion_client_id"` - ExternalNotionEnabled *bool `json:"external_notion_enabled"` - ExternalNotionSecret *string `json:"external_notion_secret"` - ExternalPhoneEnabled *bool `json:"external_phone_enabled"` - ExternalSlackClientId *string `json:"external_slack_client_id"` - ExternalSlackEnabled *bool `json:"external_slack_enabled"` - ExternalSlackOidcClientId *string `json:"external_slack_oidc_client_id"` - ExternalSlackOidcEnabled *bool `json:"external_slack_oidc_enabled"` - ExternalSlackOidcSecret *string `json:"external_slack_oidc_secret"` - ExternalSlackSecret *string `json:"external_slack_secret"` - ExternalSpotifyClientId *string `json:"external_spotify_client_id"` - ExternalSpotifyEnabled *bool `json:"external_spotify_enabled"` - ExternalSpotifySecret *string `json:"external_spotify_secret"` - ExternalTwitchClientId *string `json:"external_twitch_client_id"` - ExternalTwitchEnabled *bool `json:"external_twitch_enabled"` - ExternalTwitchSecret *string `json:"external_twitch_secret"` - ExternalTwitterClientId *string `json:"external_twitter_client_id"` - ExternalTwitterEnabled *bool `json:"external_twitter_enabled"` - ExternalTwitterSecret *string `json:"external_twitter_secret"` - ExternalWeb3SolanaEnabled *bool `json:"external_web3_solana_enabled"` - ExternalWorkosClientId *string `json:"external_workos_client_id"` - ExternalWorkosEnabled *bool `json:"external_workos_enabled"` - ExternalWorkosSecret *string `json:"external_workos_secret"` - ExternalWorkosUrl *string `json:"external_workos_url"` - ExternalZoomClientId *string `json:"external_zoom_client_id"` - ExternalZoomEnabled *bool `json:"external_zoom_enabled"` - ExternalZoomSecret *string `json:"external_zoom_secret"` - HookCustomAccessTokenEnabled *bool `json:"hook_custom_access_token_enabled"` - HookCustomAccessTokenSecrets *string `json:"hook_custom_access_token_secrets"` - HookCustomAccessTokenUri *string `json:"hook_custom_access_token_uri"` - HookMfaVerificationAttemptEnabled *bool `json:"hook_mfa_verification_attempt_enabled"` - HookMfaVerificationAttemptSecrets *string `json:"hook_mfa_verification_attempt_secrets"` - HookMfaVerificationAttemptUri *string `json:"hook_mfa_verification_attempt_uri"` - HookPasswordVerificationAttemptEnabled *bool `json:"hook_password_verification_attempt_enabled"` - HookPasswordVerificationAttemptSecrets *string `json:"hook_password_verification_attempt_secrets"` - HookPasswordVerificationAttemptUri *string `json:"hook_password_verification_attempt_uri"` - HookSendEmailEnabled *bool `json:"hook_send_email_enabled"` - HookSendEmailSecrets *string `json:"hook_send_email_secrets"` - HookSendEmailUri *string `json:"hook_send_email_uri"` - HookSendSmsEnabled *bool `json:"hook_send_sms_enabled"` - HookSendSmsSecrets *string `json:"hook_send_sms_secrets"` - HookSendSmsUri *string `json:"hook_send_sms_uri"` - JwtExp *int `json:"jwt_exp"` - MailerAllowUnverifiedEmailSignIns *bool `json:"mailer_allow_unverified_email_sign_ins"` - MailerAutoconfirm *bool `json:"mailer_autoconfirm"` - MailerOtpExp *int `json:"mailer_otp_exp,omitempty"` - MailerOtpLength *int `json:"mailer_otp_length"` - MailerSecureEmailChangeEnabled *bool `json:"mailer_secure_email_change_enabled"` - MailerSubjectsConfirmation *string `json:"mailer_subjects_confirmation"` - MailerSubjectsEmailChange *string `json:"mailer_subjects_email_change"` - MailerSubjectsInvite *string `json:"mailer_subjects_invite"` - MailerSubjectsMagicLink *string `json:"mailer_subjects_magic_link"` - MailerSubjectsReauthentication *string `json:"mailer_subjects_reauthentication"` - MailerSubjectsRecovery *string `json:"mailer_subjects_recovery"` - MailerTemplatesConfirmationContent *string `json:"mailer_templates_confirmation_content"` - MailerTemplatesEmailChangeContent *string `json:"mailer_templates_email_change_content"` - MailerTemplatesInviteContent *string `json:"mailer_templates_invite_content"` - MailerTemplatesMagicLinkContent *string `json:"mailer_templates_magic_link_content"` - MailerTemplatesReauthenticationContent *string `json:"mailer_templates_reauthentication_content"` - MailerTemplatesRecoveryContent *string `json:"mailer_templates_recovery_content"` - MfaMaxEnrolledFactors *int `json:"mfa_max_enrolled_factors"` - MfaPhoneEnrollEnabled *bool `json:"mfa_phone_enroll_enabled"` - MfaPhoneMaxFrequency *int `json:"mfa_phone_max_frequency"` - MfaPhoneOtpLength *int `json:"mfa_phone_otp_length"` - MfaPhoneTemplate *string `json:"mfa_phone_template"` - MfaPhoneVerifyEnabled *bool `json:"mfa_phone_verify_enabled"` - MfaTotpEnrollEnabled *bool `json:"mfa_totp_enroll_enabled"` - MfaTotpVerifyEnabled *bool `json:"mfa_totp_verify_enabled"` - MfaWebAuthnEnrollEnabled *bool `json:"mfa_web_authn_enroll_enabled"` - MfaWebAuthnVerifyEnabled *bool `json:"mfa_web_authn_verify_enabled"` - PasswordHibpEnabled *bool `json:"password_hibp_enabled"` - PasswordMinLength *int `json:"password_min_length"` - PasswordRequiredCharacters *UpdateAuthConfigBodyPasswordRequiredCharacters `json:"password_required_characters"` - RateLimitAnonymousUsers *int `json:"rate_limit_anonymous_users"` - RateLimitEmailSent *int `json:"rate_limit_email_sent"` - RateLimitOtp *int `json:"rate_limit_otp"` - RateLimitSmsSent *int `json:"rate_limit_sms_sent"` - RateLimitTokenRefresh *int `json:"rate_limit_token_refresh"` - RateLimitVerify *int `json:"rate_limit_verify"` - RateLimitWeb3 *int `json:"rate_limit_web3"` - RefreshTokenRotationEnabled *bool `json:"refresh_token_rotation_enabled"` - SamlEnabled *bool `json:"saml_enabled"` - SamlExternalUrl *string `json:"saml_external_url"` - SecurityCaptchaEnabled *bool `json:"security_captcha_enabled"` - SecurityCaptchaProvider *UpdateAuthConfigBodySecurityCaptchaProvider `json:"security_captcha_provider"` - SecurityCaptchaSecret *string `json:"security_captcha_secret"` - SecurityManualLinkingEnabled *bool `json:"security_manual_linking_enabled"` - SecurityRefreshTokenReuseInterval *int `json:"security_refresh_token_reuse_interval"` - SecurityUpdatePasswordRequireReauthentication *bool `json:"security_update_password_require_reauthentication"` - SessionsInactivityTimeout *int `json:"sessions_inactivity_timeout"` - SessionsSinglePerUser *bool `json:"sessions_single_per_user"` - SessionsTags *string `json:"sessions_tags"` - SessionsTimebox *int `json:"sessions_timebox"` - SiteUrl *string `json:"site_url"` - SmsAutoconfirm *bool `json:"sms_autoconfirm"` - SmsMaxFrequency *int `json:"sms_max_frequency"` - SmsMessagebirdAccessKey *string `json:"sms_messagebird_access_key"` - SmsMessagebirdOriginator *string `json:"sms_messagebird_originator"` - SmsOtpExp *int `json:"sms_otp_exp"` - SmsOtpLength *int `json:"sms_otp_length,omitempty"` - SmsProvider *UpdateAuthConfigBodySmsProvider `json:"sms_provider"` - SmsTemplate *string `json:"sms_template"` - SmsTestOtp *string `json:"sms_test_otp"` - SmsTestOtpValidUntil *time.Time `json:"sms_test_otp_valid_until"` - SmsTextlocalApiKey *string `json:"sms_textlocal_api_key"` - SmsTextlocalSender *string `json:"sms_textlocal_sender"` - SmsTwilioAccountSid *string `json:"sms_twilio_account_sid"` - SmsTwilioAuthToken *string `json:"sms_twilio_auth_token"` - SmsTwilioContentSid *string `json:"sms_twilio_content_sid"` - SmsTwilioMessageServiceSid *string `json:"sms_twilio_message_service_sid"` - SmsTwilioVerifyAccountSid *string `json:"sms_twilio_verify_account_sid"` - SmsTwilioVerifyAuthToken *string `json:"sms_twilio_verify_auth_token"` - SmsTwilioVerifyMessageServiceSid *string `json:"sms_twilio_verify_message_service_sid"` - SmsVonageApiKey *string `json:"sms_vonage_api_key"` - SmsVonageApiSecret *string `json:"sms_vonage_api_secret"` - SmsVonageFrom *string `json:"sms_vonage_from"` - SmtpAdminEmail *string `json:"smtp_admin_email"` - SmtpHost *string `json:"smtp_host"` - SmtpMaxFrequency *int `json:"smtp_max_frequency"` - SmtpPass *string `json:"smtp_pass"` - SmtpPort *string `json:"smtp_port"` - SmtpSenderName *string `json:"smtp_sender_name"` - SmtpUser *string `json:"smtp_user"` - UriAllowList *string `json:"uri_allow_list"` + ApiMaxRequestDuration nullable.Nullable[int] `json:"api_max_request_duration,omitempty"` + DbMaxPoolSize nullable.Nullable[int] `json:"db_max_pool_size,omitempty"` + DisableSignup nullable.Nullable[bool] `json:"disable_signup,omitempty"` + ExternalAnonymousUsersEnabled nullable.Nullable[bool] `json:"external_anonymous_users_enabled,omitempty"` + ExternalAppleAdditionalClientIds nullable.Nullable[string] `json:"external_apple_additional_client_ids,omitempty"` + ExternalAppleClientId nullable.Nullable[string] `json:"external_apple_client_id,omitempty"` + ExternalAppleEnabled nullable.Nullable[bool] `json:"external_apple_enabled,omitempty"` + ExternalAppleSecret nullable.Nullable[string] `json:"external_apple_secret,omitempty"` + ExternalAzureClientId nullable.Nullable[string] `json:"external_azure_client_id,omitempty"` + ExternalAzureEnabled nullable.Nullable[bool] `json:"external_azure_enabled,omitempty"` + ExternalAzureSecret nullable.Nullable[string] `json:"external_azure_secret,omitempty"` + ExternalAzureUrl nullable.Nullable[string] `json:"external_azure_url,omitempty"` + ExternalBitbucketClientId nullable.Nullable[string] `json:"external_bitbucket_client_id,omitempty"` + ExternalBitbucketEnabled nullable.Nullable[bool] `json:"external_bitbucket_enabled,omitempty"` + ExternalBitbucketSecret nullable.Nullable[string] `json:"external_bitbucket_secret,omitempty"` + ExternalDiscordClientId nullable.Nullable[string] `json:"external_discord_client_id,omitempty"` + ExternalDiscordEnabled nullable.Nullable[bool] `json:"external_discord_enabled,omitempty"` + ExternalDiscordSecret nullable.Nullable[string] `json:"external_discord_secret,omitempty"` + ExternalEmailEnabled nullable.Nullable[bool] `json:"external_email_enabled,omitempty"` + ExternalFacebookClientId nullable.Nullable[string] `json:"external_facebook_client_id,omitempty"` + ExternalFacebookEnabled nullable.Nullable[bool] `json:"external_facebook_enabled,omitempty"` + ExternalFacebookSecret nullable.Nullable[string] `json:"external_facebook_secret,omitempty"` + ExternalFigmaClientId nullable.Nullable[string] `json:"external_figma_client_id,omitempty"` + ExternalFigmaEnabled nullable.Nullable[bool] `json:"external_figma_enabled,omitempty"` + ExternalFigmaSecret nullable.Nullable[string] `json:"external_figma_secret,omitempty"` + ExternalGithubClientId nullable.Nullable[string] `json:"external_github_client_id,omitempty"` + ExternalGithubEnabled nullable.Nullable[bool] `json:"external_github_enabled,omitempty"` + ExternalGithubSecret nullable.Nullable[string] `json:"external_github_secret,omitempty"` + ExternalGitlabClientId nullable.Nullable[string] `json:"external_gitlab_client_id,omitempty"` + ExternalGitlabEnabled nullable.Nullable[bool] `json:"external_gitlab_enabled,omitempty"` + ExternalGitlabSecret nullable.Nullable[string] `json:"external_gitlab_secret,omitempty"` + ExternalGitlabUrl nullable.Nullable[string] `json:"external_gitlab_url,omitempty"` + ExternalGoogleAdditionalClientIds nullable.Nullable[string] `json:"external_google_additional_client_ids,omitempty"` + ExternalGoogleClientId nullable.Nullable[string] `json:"external_google_client_id,omitempty"` + ExternalGoogleEnabled nullable.Nullable[bool] `json:"external_google_enabled,omitempty"` + ExternalGoogleSecret nullable.Nullable[string] `json:"external_google_secret,omitempty"` + ExternalGoogleSkipNonceCheck nullable.Nullable[bool] `json:"external_google_skip_nonce_check,omitempty"` + ExternalKakaoClientId nullable.Nullable[string] `json:"external_kakao_client_id,omitempty"` + ExternalKakaoEnabled nullable.Nullable[bool] `json:"external_kakao_enabled,omitempty"` + ExternalKakaoSecret nullable.Nullable[string] `json:"external_kakao_secret,omitempty"` + ExternalKeycloakClientId nullable.Nullable[string] `json:"external_keycloak_client_id,omitempty"` + ExternalKeycloakEnabled nullable.Nullable[bool] `json:"external_keycloak_enabled,omitempty"` + ExternalKeycloakSecret nullable.Nullable[string] `json:"external_keycloak_secret,omitempty"` + ExternalKeycloakUrl nullable.Nullable[string] `json:"external_keycloak_url,omitempty"` + ExternalLinkedinOidcClientId nullable.Nullable[string] `json:"external_linkedin_oidc_client_id,omitempty"` + ExternalLinkedinOidcEnabled nullable.Nullable[bool] `json:"external_linkedin_oidc_enabled,omitempty"` + ExternalLinkedinOidcSecret nullable.Nullable[string] `json:"external_linkedin_oidc_secret,omitempty"` + ExternalNotionClientId nullable.Nullable[string] `json:"external_notion_client_id,omitempty"` + ExternalNotionEnabled nullable.Nullable[bool] `json:"external_notion_enabled,omitempty"` + ExternalNotionSecret nullable.Nullable[string] `json:"external_notion_secret,omitempty"` + ExternalPhoneEnabled nullable.Nullable[bool] `json:"external_phone_enabled,omitempty"` + ExternalSlackClientId nullable.Nullable[string] `json:"external_slack_client_id,omitempty"` + ExternalSlackEnabled nullable.Nullable[bool] `json:"external_slack_enabled,omitempty"` + ExternalSlackOidcClientId nullable.Nullable[string] `json:"external_slack_oidc_client_id,omitempty"` + ExternalSlackOidcEnabled nullable.Nullable[bool] `json:"external_slack_oidc_enabled,omitempty"` + ExternalSlackOidcSecret nullable.Nullable[string] `json:"external_slack_oidc_secret,omitempty"` + ExternalSlackSecret nullable.Nullable[string] `json:"external_slack_secret,omitempty"` + ExternalSpotifyClientId nullable.Nullable[string] `json:"external_spotify_client_id,omitempty"` + ExternalSpotifyEnabled nullable.Nullable[bool] `json:"external_spotify_enabled,omitempty"` + ExternalSpotifySecret nullable.Nullable[string] `json:"external_spotify_secret,omitempty"` + ExternalTwitchClientId nullable.Nullable[string] `json:"external_twitch_client_id,omitempty"` + ExternalTwitchEnabled nullable.Nullable[bool] `json:"external_twitch_enabled,omitempty"` + ExternalTwitchSecret nullable.Nullable[string] `json:"external_twitch_secret,omitempty"` + ExternalTwitterClientId nullable.Nullable[string] `json:"external_twitter_client_id,omitempty"` + ExternalTwitterEnabled nullable.Nullable[bool] `json:"external_twitter_enabled,omitempty"` + ExternalTwitterSecret nullable.Nullable[string] `json:"external_twitter_secret,omitempty"` + ExternalWeb3SolanaEnabled nullable.Nullable[bool] `json:"external_web3_solana_enabled,omitempty"` + ExternalWorkosClientId nullable.Nullable[string] `json:"external_workos_client_id,omitempty"` + ExternalWorkosEnabled nullable.Nullable[bool] `json:"external_workos_enabled,omitempty"` + ExternalWorkosSecret nullable.Nullable[string] `json:"external_workos_secret,omitempty"` + ExternalWorkosUrl nullable.Nullable[string] `json:"external_workos_url,omitempty"` + ExternalZoomClientId nullable.Nullable[string] `json:"external_zoom_client_id,omitempty"` + ExternalZoomEnabled nullable.Nullable[bool] `json:"external_zoom_enabled,omitempty"` + ExternalZoomSecret nullable.Nullable[string] `json:"external_zoom_secret,omitempty"` + HookCustomAccessTokenEnabled nullable.Nullable[bool] `json:"hook_custom_access_token_enabled,omitempty"` + HookCustomAccessTokenSecrets nullable.Nullable[string] `json:"hook_custom_access_token_secrets,omitempty"` + HookCustomAccessTokenUri nullable.Nullable[string] `json:"hook_custom_access_token_uri,omitempty"` + HookMfaVerificationAttemptEnabled nullable.Nullable[bool] `json:"hook_mfa_verification_attempt_enabled,omitempty"` + HookMfaVerificationAttemptSecrets nullable.Nullable[string] `json:"hook_mfa_verification_attempt_secrets,omitempty"` + HookMfaVerificationAttemptUri nullable.Nullable[string] `json:"hook_mfa_verification_attempt_uri,omitempty"` + HookPasswordVerificationAttemptEnabled nullable.Nullable[bool] `json:"hook_password_verification_attempt_enabled,omitempty"` + HookPasswordVerificationAttemptSecrets nullable.Nullable[string] `json:"hook_password_verification_attempt_secrets,omitempty"` + HookPasswordVerificationAttemptUri nullable.Nullable[string] `json:"hook_password_verification_attempt_uri,omitempty"` + HookSendEmailEnabled nullable.Nullable[bool] `json:"hook_send_email_enabled,omitempty"` + HookSendEmailSecrets nullable.Nullable[string] `json:"hook_send_email_secrets,omitempty"` + HookSendEmailUri nullable.Nullable[string] `json:"hook_send_email_uri,omitempty"` + HookSendSmsEnabled nullable.Nullable[bool] `json:"hook_send_sms_enabled,omitempty"` + HookSendSmsSecrets nullable.Nullable[string] `json:"hook_send_sms_secrets,omitempty"` + HookSendSmsUri nullable.Nullable[string] `json:"hook_send_sms_uri,omitempty"` + JwtExp nullable.Nullable[int] `json:"jwt_exp,omitempty"` + MailerAllowUnverifiedEmailSignIns nullable.Nullable[bool] `json:"mailer_allow_unverified_email_sign_ins,omitempty"` + MailerAutoconfirm nullable.Nullable[bool] `json:"mailer_autoconfirm,omitempty"` + MailerOtpExp *int `json:"mailer_otp_exp,omitempty"` + MailerOtpLength nullable.Nullable[int] `json:"mailer_otp_length,omitempty"` + MailerSecureEmailChangeEnabled nullable.Nullable[bool] `json:"mailer_secure_email_change_enabled,omitempty"` + MailerSubjectsConfirmation nullable.Nullable[string] `json:"mailer_subjects_confirmation,omitempty"` + MailerSubjectsEmailChange nullable.Nullable[string] `json:"mailer_subjects_email_change,omitempty"` + MailerSubjectsInvite nullable.Nullable[string] `json:"mailer_subjects_invite,omitempty"` + MailerSubjectsMagicLink nullable.Nullable[string] `json:"mailer_subjects_magic_link,omitempty"` + MailerSubjectsReauthentication nullable.Nullable[string] `json:"mailer_subjects_reauthentication,omitempty"` + MailerSubjectsRecovery nullable.Nullable[string] `json:"mailer_subjects_recovery,omitempty"` + MailerTemplatesConfirmationContent nullable.Nullable[string] `json:"mailer_templates_confirmation_content,omitempty"` + MailerTemplatesEmailChangeContent nullable.Nullable[string] `json:"mailer_templates_email_change_content,omitempty"` + MailerTemplatesInviteContent nullable.Nullable[string] `json:"mailer_templates_invite_content,omitempty"` + MailerTemplatesMagicLinkContent nullable.Nullable[string] `json:"mailer_templates_magic_link_content,omitempty"` + MailerTemplatesReauthenticationContent nullable.Nullable[string] `json:"mailer_templates_reauthentication_content,omitempty"` + MailerTemplatesRecoveryContent nullable.Nullable[string] `json:"mailer_templates_recovery_content,omitempty"` + MfaMaxEnrolledFactors nullable.Nullable[int] `json:"mfa_max_enrolled_factors,omitempty"` + MfaPhoneEnrollEnabled nullable.Nullable[bool] `json:"mfa_phone_enroll_enabled,omitempty"` + MfaPhoneMaxFrequency nullable.Nullable[int] `json:"mfa_phone_max_frequency,omitempty"` + MfaPhoneOtpLength nullable.Nullable[int] `json:"mfa_phone_otp_length,omitempty"` + MfaPhoneTemplate nullable.Nullable[string] `json:"mfa_phone_template,omitempty"` + MfaPhoneVerifyEnabled nullable.Nullable[bool] `json:"mfa_phone_verify_enabled,omitempty"` + MfaTotpEnrollEnabled nullable.Nullable[bool] `json:"mfa_totp_enroll_enabled,omitempty"` + MfaTotpVerifyEnabled nullable.Nullable[bool] `json:"mfa_totp_verify_enabled,omitempty"` + MfaWebAuthnEnrollEnabled nullable.Nullable[bool] `json:"mfa_web_authn_enroll_enabled,omitempty"` + MfaWebAuthnVerifyEnabled nullable.Nullable[bool] `json:"mfa_web_authn_verify_enabled,omitempty"` + PasswordHibpEnabled nullable.Nullable[bool] `json:"password_hibp_enabled,omitempty"` + PasswordMinLength nullable.Nullable[int] `json:"password_min_length,omitempty"` + PasswordRequiredCharacters nullable.Nullable[UpdateAuthConfigBodyPasswordRequiredCharacters] `json:"password_required_characters,omitempty"` + RateLimitAnonymousUsers nullable.Nullable[int] `json:"rate_limit_anonymous_users,omitempty"` + RateLimitEmailSent nullable.Nullable[int] `json:"rate_limit_email_sent,omitempty"` + RateLimitOtp nullable.Nullable[int] `json:"rate_limit_otp,omitempty"` + RateLimitSmsSent nullable.Nullable[int] `json:"rate_limit_sms_sent,omitempty"` + RateLimitTokenRefresh nullable.Nullable[int] `json:"rate_limit_token_refresh,omitempty"` + RateLimitVerify nullable.Nullable[int] `json:"rate_limit_verify,omitempty"` + RateLimitWeb3 nullable.Nullable[int] `json:"rate_limit_web3,omitempty"` + RefreshTokenRotationEnabled nullable.Nullable[bool] `json:"refresh_token_rotation_enabled,omitempty"` + SamlEnabled nullable.Nullable[bool] `json:"saml_enabled,omitempty"` + SamlExternalUrl nullable.Nullable[string] `json:"saml_external_url,omitempty"` + SecurityCaptchaEnabled nullable.Nullable[bool] `json:"security_captcha_enabled,omitempty"` + SecurityCaptchaProvider nullable.Nullable[UpdateAuthConfigBodySecurityCaptchaProvider] `json:"security_captcha_provider,omitempty"` + SecurityCaptchaSecret nullable.Nullable[string] `json:"security_captcha_secret,omitempty"` + SecurityManualLinkingEnabled nullable.Nullable[bool] `json:"security_manual_linking_enabled,omitempty"` + SecurityRefreshTokenReuseInterval nullable.Nullable[int] `json:"security_refresh_token_reuse_interval,omitempty"` + SecurityUpdatePasswordRequireReauthentication nullable.Nullable[bool] `json:"security_update_password_require_reauthentication,omitempty"` + SessionsInactivityTimeout nullable.Nullable[int] `json:"sessions_inactivity_timeout,omitempty"` + SessionsSinglePerUser nullable.Nullable[bool] `json:"sessions_single_per_user,omitempty"` + SessionsTags nullable.Nullable[string] `json:"sessions_tags,omitempty"` + SessionsTimebox nullable.Nullable[int] `json:"sessions_timebox,omitempty"` + SiteUrl nullable.Nullable[string] `json:"site_url,omitempty"` + SmsAutoconfirm nullable.Nullable[bool] `json:"sms_autoconfirm,omitempty"` + SmsMaxFrequency nullable.Nullable[int] `json:"sms_max_frequency,omitempty"` + SmsMessagebirdAccessKey nullable.Nullable[string] `json:"sms_messagebird_access_key,omitempty"` + SmsMessagebirdOriginator nullable.Nullable[string] `json:"sms_messagebird_originator,omitempty"` + SmsOtpExp nullable.Nullable[int] `json:"sms_otp_exp,omitempty"` + SmsOtpLength *int `json:"sms_otp_length,omitempty"` + SmsProvider nullable.Nullable[UpdateAuthConfigBodySmsProvider] `json:"sms_provider,omitempty"` + SmsTemplate nullable.Nullable[string] `json:"sms_template,omitempty"` + SmsTestOtp nullable.Nullable[string] `json:"sms_test_otp,omitempty"` + SmsTestOtpValidUntil nullable.Nullable[time.Time] `json:"sms_test_otp_valid_until,omitempty"` + SmsTextlocalApiKey nullable.Nullable[string] `json:"sms_textlocal_api_key,omitempty"` + SmsTextlocalSender nullable.Nullable[string] `json:"sms_textlocal_sender,omitempty"` + SmsTwilioAccountSid nullable.Nullable[string] `json:"sms_twilio_account_sid,omitempty"` + SmsTwilioAuthToken nullable.Nullable[string] `json:"sms_twilio_auth_token,omitempty"` + SmsTwilioContentSid nullable.Nullable[string] `json:"sms_twilio_content_sid,omitempty"` + SmsTwilioMessageServiceSid nullable.Nullable[string] `json:"sms_twilio_message_service_sid,omitempty"` + SmsTwilioVerifyAccountSid nullable.Nullable[string] `json:"sms_twilio_verify_account_sid,omitempty"` + SmsTwilioVerifyAuthToken nullable.Nullable[string] `json:"sms_twilio_verify_auth_token,omitempty"` + SmsTwilioVerifyMessageServiceSid nullable.Nullable[string] `json:"sms_twilio_verify_message_service_sid,omitempty"` + SmsVonageApiKey nullable.Nullable[string] `json:"sms_vonage_api_key,omitempty"` + SmsVonageApiSecret nullable.Nullable[string] `json:"sms_vonage_api_secret,omitempty"` + SmsVonageFrom nullable.Nullable[string] `json:"sms_vonage_from,omitempty"` + SmtpAdminEmail nullable.Nullable[string] `json:"smtp_admin_email,omitempty"` + SmtpHost nullable.Nullable[string] `json:"smtp_host,omitempty"` + SmtpMaxFrequency nullable.Nullable[int] `json:"smtp_max_frequency,omitempty"` + SmtpPass nullable.Nullable[string] `json:"smtp_pass,omitempty"` + SmtpPort nullable.Nullable[string] `json:"smtp_port,omitempty"` + SmtpSenderName nullable.Nullable[string] `json:"smtp_sender_name,omitempty"` + SmtpUser nullable.Nullable[string] `json:"smtp_user,omitempty"` + UriAllowList nullable.Nullable[string] `json:"uri_allow_list,omitempty"` } // UpdateAuthConfigBodyPasswordRequiredCharacters defines model for UpdateAuthConfigBody.PasswordRequiredCharacters. @@ -2385,7 +2386,7 @@ type UpdateStorageConfigBody struct { // UpdateSupavisorConfigBody defines model for UpdateSupavisorConfigBody. type UpdateSupavisorConfigBody struct { - DefaultPoolSize *int `json:"default_pool_size"` + DefaultPoolSize nullable.Nullable[int] `json:"default_pool_size,omitempty"` // PoolMode Dedicated pooler mode for the project PoolMode *UpdateSupavisorConfigBodyPoolMode `json:"pool_mode,omitempty"` @@ -2396,8 +2397,8 @@ type UpdateSupavisorConfigBodyPoolMode string // UpdateSupavisorConfigResponse defines model for UpdateSupavisorConfigResponse. type UpdateSupavisorConfigResponse struct { - DefaultPoolSize *int `json:"default_pool_size"` - PoolMode string `json:"pool_mode"` + DefaultPoolSize nullable.Nullable[int] `json:"default_pool_size"` + PoolMode string `json:"pool_mode"` } // UpgradeDatabaseBody defines model for UpgradeDatabaseBody. @@ -2520,9 +2521,9 @@ type V1PostgrestConfigResponse struct { DbExtraSearchPath string `json:"db_extra_search_path"` // DbPool If `null`, the value is automatically configured based on compute size. - DbPool *int `json:"db_pool"` - DbSchema string `json:"db_schema"` - MaxRows int `json:"max_rows"` + DbPool nullable.Nullable[int] `json:"db_pool"` + DbSchema string `json:"db_schema"` + MaxRows int `json:"max_rows"` } // V1ProjectAdvisorsResponse defines model for V1ProjectAdvisorsResponse. diff --git a/pkg/config/auth.go b/pkg/config/auth.go index bdddefae4..1aeb2029a 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -6,6 +6,7 @@ import ( "time" "github.com/go-errors/errors" + "github.com/oapi-codegen/nullable" v1API "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/diff" @@ -268,21 +269,21 @@ type ( func (a *auth) ToUpdateAuthConfigBody() v1API.UpdateAuthConfigBody { body := v1API.UpdateAuthConfigBody{ - SiteUrl: &a.SiteUrl, - UriAllowList: cast.Ptr(strings.Join(a.AdditionalRedirectUrls, ",")), - JwtExp: cast.UintToIntPtr(&a.JwtExpiry), - RefreshTokenRotationEnabled: &a.EnableRefreshTokenRotation, - SecurityRefreshTokenReuseInterval: cast.UintToIntPtr(&a.RefreshTokenReuseInterval), - SecurityManualLinkingEnabled: &a.EnableManualLinking, - DisableSignup: cast.Ptr(!a.EnableSignup), - ExternalAnonymousUsersEnabled: &a.EnableAnonymousSignIns, - PasswordMinLength: cast.UintToIntPtr(&a.MinimumPasswordLength), - PasswordRequiredCharacters: cast.Ptr(a.PasswordRequirements.ToChar()), + SiteUrl: nullable.NewNullableWithValue(a.SiteUrl), + UriAllowList: nullable.NewNullableWithValue(strings.Join(a.AdditionalRedirectUrls, ",")), + JwtExp: nullable.NewNullableWithValue(cast.UintToInt(a.JwtExpiry)), + RefreshTokenRotationEnabled: nullable.NewNullableWithValue(a.EnableRefreshTokenRotation), + SecurityRefreshTokenReuseInterval: nullable.NewNullableWithValue(cast.UintToInt(a.RefreshTokenReuseInterval)), + SecurityManualLinkingEnabled: nullable.NewNullableWithValue(a.EnableManualLinking), + DisableSignup: nullable.NewNullableWithValue(!a.EnableSignup), + ExternalAnonymousUsersEnabled: nullable.NewNullableWithValue(a.EnableAnonymousSignIns), + PasswordMinLength: nullable.NewNullableWithValue(cast.UintToInt(a.MinimumPasswordLength)), + PasswordRequiredCharacters: nullable.NewNullableWithValue(a.PasswordRequirements.ToChar()), } // Add rate limit fields a.RateLimit.toAuthConfigBody(&body) if s := a.Email.Smtp; s != nil && s.Enabled { - body.RateLimitEmailSent = cast.Ptr(cast.UintToInt(a.RateLimit.EmailSent)) + body.RateLimitEmailSent = nullable.NewNullableWithValue(cast.UintToInt(a.RateLimit.EmailSent)) } // When local config is not set, we assume platform defaults should not change if a.Captcha != nil { @@ -298,20 +299,20 @@ func (a *auth) ToUpdateAuthConfigBody() v1API.UpdateAuthConfigBody { } func (a *auth) FromRemoteAuthConfig(remoteConfig v1API.AuthConfigResponse) { - a.SiteUrl = cast.Val(remoteConfig.SiteUrl, "") - a.AdditionalRedirectUrls = strToArr(cast.Val(remoteConfig.UriAllowList, "")) - a.JwtExpiry = cast.IntToUint(cast.Val(remoteConfig.JwtExp, 0)) - a.EnableRefreshTokenRotation = cast.Val(remoteConfig.RefreshTokenRotationEnabled, false) - a.RefreshTokenReuseInterval = cast.IntToUint(cast.Val(remoteConfig.SecurityRefreshTokenReuseInterval, 0)) - a.EnableManualLinking = cast.Val(remoteConfig.SecurityManualLinkingEnabled, false) - a.EnableSignup = !cast.Val(remoteConfig.DisableSignup, false) - a.EnableAnonymousSignIns = cast.Val(remoteConfig.ExternalAnonymousUsersEnabled, false) - a.MinimumPasswordLength = cast.IntToUint(cast.Val(remoteConfig.PasswordMinLength, 0)) - prc := cast.Val(remoteConfig.PasswordRequiredCharacters, "") + a.SiteUrl = ValOrDefault(remoteConfig.SiteUrl, "") + a.AdditionalRedirectUrls = strToArr(ValOrDefault(remoteConfig.UriAllowList, "")) + a.JwtExpiry = cast.IntToUint(ValOrDefault(remoteConfig.JwtExp, 0)) + a.EnableRefreshTokenRotation = ValOrDefault(remoteConfig.RefreshTokenRotationEnabled, false) + a.RefreshTokenReuseInterval = cast.IntToUint(ValOrDefault(remoteConfig.SecurityRefreshTokenReuseInterval, 0)) + a.EnableManualLinking = ValOrDefault(remoteConfig.SecurityManualLinkingEnabled, false) + a.EnableSignup = !ValOrDefault(remoteConfig.DisableSignup, false) + a.EnableAnonymousSignIns = ValOrDefault(remoteConfig.ExternalAnonymousUsersEnabled, false) + a.MinimumPasswordLength = cast.IntToUint(ValOrDefault(remoteConfig.PasswordMinLength, 0)) + prc := ValOrDefault(remoteConfig.PasswordRequiredCharacters, "") a.PasswordRequirements = NewPasswordRequirement(v1API.UpdateAuthConfigBodyPasswordRequiredCharacters(prc)) a.RateLimit.fromAuthConfig(remoteConfig) if s := a.Email.Smtp; s != nil && s.Enabled { - a.RateLimit.EmailSent = cast.IntToUint(cast.Val(remoteConfig.RateLimitEmailSent, 0)) + a.RateLimit.EmailSent = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitEmailSent, 0)) } a.Captcha.fromAuthConfig(remoteConfig) a.Hook.fromAuthConfig(remoteConfig) @@ -323,28 +324,28 @@ func (a *auth) FromRemoteAuthConfig(remoteConfig v1API.AuthConfigResponse) { } func (r rateLimit) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { - body.RateLimitAnonymousUsers = cast.Ptr(cast.UintToInt(r.AnonymousUsers)) - body.RateLimitTokenRefresh = cast.Ptr(cast.UintToInt(r.TokenRefresh)) - body.RateLimitOtp = cast.Ptr(cast.UintToInt(r.SignInSignUps)) - body.RateLimitVerify = cast.Ptr(cast.UintToInt(r.TokenVerifications)) + body.RateLimitAnonymousUsers = nullable.NewNullableWithValue(cast.UintToInt(r.AnonymousUsers)) + body.RateLimitTokenRefresh = nullable.NewNullableWithValue(cast.UintToInt(r.TokenRefresh)) + body.RateLimitOtp = nullable.NewNullableWithValue(cast.UintToInt(r.SignInSignUps)) + body.RateLimitVerify = nullable.NewNullableWithValue(cast.UintToInt(r.TokenVerifications)) // Email rate limit is only updated when SMTP is enabled - body.RateLimitSmsSent = cast.Ptr(cast.UintToInt(r.SmsSent)) + body.RateLimitSmsSent = nullable.NewNullableWithValue(cast.UintToInt(r.SmsSent)) } func (r *rateLimit) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { - r.AnonymousUsers = cast.IntToUint(cast.Val(remoteConfig.RateLimitAnonymousUsers, 0)) - r.TokenRefresh = cast.IntToUint(cast.Val(remoteConfig.RateLimitTokenRefresh, 0)) - r.SignInSignUps = cast.IntToUint(cast.Val(remoteConfig.RateLimitOtp, 0)) - r.TokenVerifications = cast.IntToUint(cast.Val(remoteConfig.RateLimitVerify, 0)) + r.AnonymousUsers = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitAnonymousUsers, 0)) + r.TokenRefresh = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitTokenRefresh, 0)) + r.SignInSignUps = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitOtp, 0)) + r.TokenVerifications = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitVerify, 0)) // Email rate limit is only updated when SMTP is enabled - r.SmsSent = cast.IntToUint(cast.Val(remoteConfig.RateLimitSmsSent, 0)) + r.SmsSent = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitSmsSent, 0)) } func (c captcha) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { - if body.SecurityCaptchaEnabled = &c.Enabled; c.Enabled { - body.SecurityCaptchaProvider = cast.Ptr(v1API.UpdateAuthConfigBodySecurityCaptchaProvider(c.Provider)) + if body.SecurityCaptchaEnabled = nullable.NewNullableWithValue(c.Enabled); c.Enabled { + body.SecurityCaptchaProvider = nullable.NewNullableWithValue(v1API.UpdateAuthConfigBodySecurityCaptchaProvider(c.Provider)) if len(c.Secret.SHA256) > 0 { - body.SecurityCaptchaSecret = &c.Secret.Value + body.SecurityCaptchaSecret = nullable.NewNullableWithValue(c.Secret.Value) } } } @@ -356,54 +357,54 @@ func (c *captcha) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { } // Ignore disabled captcha fields to minimise config diff if c.Enabled { - c.Provider = CaptchaProvider(cast.Val(remoteConfig.SecurityCaptchaProvider, "")) + c.Provider = CaptchaProvider(ValOrDefault(remoteConfig.SecurityCaptchaProvider, "")) if len(c.Secret.SHA256) > 0 { - c.Secret.SHA256 = cast.Val(remoteConfig.SecurityCaptchaSecret, "") + c.Secret.SHA256 = ValOrDefault(remoteConfig.SecurityCaptchaSecret, "") } } - c.Enabled = cast.Val(remoteConfig.SecurityCaptchaEnabled, false) + c.Enabled = ValOrDefault(remoteConfig.SecurityCaptchaEnabled, false) } func (h hook) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { // 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 body.HookCustomAccessTokenEnabled = nullable.NewNullableWithValue(hook.Enabled); hook.Enabled { + body.HookCustomAccessTokenUri = nullable.NewNullableWithValue(hook.URI) if len(hook.Secrets.SHA256) > 0 { - body.HookCustomAccessTokenSecrets = &hook.Secrets.Value + body.HookCustomAccessTokenSecrets = nullable.NewNullableWithValue(hook.Secrets.Value) } } } if hook := h.SendEmail; hook != nil { - if body.HookSendEmailEnabled = &hook.Enabled; hook.Enabled { - body.HookSendEmailUri = &hook.URI + if body.HookSendEmailEnabled = nullable.NewNullableWithValue(hook.Enabled); hook.Enabled { + body.HookSendEmailUri = nullable.NewNullableWithValue(hook.URI) if len(hook.Secrets.SHA256) > 0 { - body.HookSendEmailSecrets = &hook.Secrets.Value + body.HookSendEmailSecrets = nullable.NewNullableWithValue(hook.Secrets.Value) } } } if hook := h.SendSMS; hook != nil { - if body.HookSendSmsEnabled = &hook.Enabled; hook.Enabled { - body.HookSendSmsUri = &hook.URI + if body.HookSendSmsEnabled = nullable.NewNullableWithValue(hook.Enabled); hook.Enabled { + body.HookSendSmsUri = nullable.NewNullableWithValue(hook.URI) if len(hook.Secrets.SHA256) > 0 { - body.HookSendSmsSecrets = &hook.Secrets.Value + body.HookSendSmsSecrets = nullable.NewNullableWithValue(hook.Secrets.Value) } } } // Enterprise and team only features if hook := h.MFAVerificationAttempt; hook != nil { - if body.HookMfaVerificationAttemptEnabled = &hook.Enabled; hook.Enabled { - body.HookMfaVerificationAttemptUri = &hook.URI + if body.HookMfaVerificationAttemptEnabled = nullable.NewNullableWithValue(hook.Enabled); hook.Enabled { + body.HookMfaVerificationAttemptUri = nullable.NewNullableWithValue(hook.URI) if len(hook.Secrets.SHA256) > 0 { - body.HookMfaVerificationAttemptSecrets = &hook.Secrets.Value + body.HookMfaVerificationAttemptSecrets = nullable.NewNullableWithValue(hook.Secrets.Value) } } } if hook := h.PasswordVerificationAttempt; hook != nil { - if body.HookPasswordVerificationAttemptEnabled = &hook.Enabled; hook.Enabled { - body.HookPasswordVerificationAttemptUri = &hook.URI + if body.HookPasswordVerificationAttemptEnabled = nullable.NewNullableWithValue(hook.Enabled); hook.Enabled { + body.HookPasswordVerificationAttemptUri = nullable.NewNullableWithValue(hook.URI) if len(hook.Secrets.SHA256) > 0 { - body.HookPasswordVerificationAttemptSecrets = &hook.Secrets.Value + body.HookPasswordVerificationAttemptSecrets = nullable.NewNullableWithValue(hook.Secrets.Value) } } } @@ -413,96 +414,96 @@ func (h *hook) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { 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.URI = ValOrDefault(remoteConfig.HookCustomAccessTokenUri, "") if len(hook.Secrets.SHA256) > 0 { - hook.Secrets.SHA256 = cast.Val(remoteConfig.HookCustomAccessTokenSecrets, "") + hook.Secrets.SHA256 = ValOrDefault(remoteConfig.HookCustomAccessTokenSecrets, "") } } - hook.Enabled = cast.Val(remoteConfig.HookCustomAccessTokenEnabled, false) + hook.Enabled = ValOrDefault(remoteConfig.HookCustomAccessTokenEnabled, false) } if hook := h.SendEmail; hook != nil { if hook.Enabled { - hook.URI = cast.Val(remoteConfig.HookSendEmailUri, "") + hook.URI = ValOrDefault(remoteConfig.HookSendEmailUri, "") if len(hook.Secrets.SHA256) > 0 { - hook.Secrets.SHA256 = cast.Val(remoteConfig.HookSendEmailSecrets, "") + hook.Secrets.SHA256 = ValOrDefault(remoteConfig.HookSendEmailSecrets, "") } } - hook.Enabled = cast.Val(remoteConfig.HookSendEmailEnabled, false) + hook.Enabled = ValOrDefault(remoteConfig.HookSendEmailEnabled, false) } if hook := h.SendSMS; hook != nil { if hook.Enabled { - hook.URI = cast.Val(remoteConfig.HookSendSmsUri, "") + hook.URI = ValOrDefault(remoteConfig.HookSendSmsUri, "") if len(hook.Secrets.SHA256) > 0 { - hook.Secrets.SHA256 = cast.Val(remoteConfig.HookSendSmsSecrets, "") + hook.Secrets.SHA256 = ValOrDefault(remoteConfig.HookSendSmsSecrets, "") } } - hook.Enabled = cast.Val(remoteConfig.HookSendSmsEnabled, false) + hook.Enabled = ValOrDefault(remoteConfig.HookSendSmsEnabled, false) } // Enterprise and team only features if hook := h.MFAVerificationAttempt; hook != nil { if hook.Enabled { - hook.URI = cast.Val(remoteConfig.HookMfaVerificationAttemptUri, "") + hook.URI = ValOrDefault(remoteConfig.HookMfaVerificationAttemptUri, "") if len(hook.Secrets.SHA256) > 0 { - hook.Secrets.SHA256 = cast.Val(remoteConfig.HookMfaVerificationAttemptSecrets, "") + hook.Secrets.SHA256 = ValOrDefault(remoteConfig.HookMfaVerificationAttemptSecrets, "") } } - hook.Enabled = cast.Val(remoteConfig.HookMfaVerificationAttemptEnabled, false) + hook.Enabled = ValOrDefault(remoteConfig.HookMfaVerificationAttemptEnabled, false) } if hook := h.PasswordVerificationAttempt; hook != nil { if hook.Enabled { - hook.URI = cast.Val(remoteConfig.HookPasswordVerificationAttemptUri, "") + hook.URI = ValOrDefault(remoteConfig.HookPasswordVerificationAttemptUri, "") if len(hook.Secrets.SHA256) > 0 { - hook.Secrets.SHA256 = cast.Val(remoteConfig.HookPasswordVerificationAttemptSecrets, "") + hook.Secrets.SHA256 = ValOrDefault(remoteConfig.HookPasswordVerificationAttemptSecrets, "") } } - hook.Enabled = cast.Val(remoteConfig.HookPasswordVerificationAttemptEnabled, false) + hook.Enabled = ValOrDefault(remoteConfig.HookPasswordVerificationAttemptEnabled, false) } } func (m mfa) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { - body.MfaMaxEnrolledFactors = cast.UintToIntPtr(&m.MaxEnrolledFactors) - body.MfaTotpEnrollEnabled = &m.TOTP.EnrollEnabled - body.MfaTotpVerifyEnabled = &m.TOTP.VerifyEnabled - body.MfaPhoneEnrollEnabled = &m.Phone.EnrollEnabled - body.MfaPhoneVerifyEnabled = &m.Phone.VerifyEnabled - body.MfaPhoneOtpLength = cast.UintToIntPtr(&m.Phone.OtpLength) - body.MfaPhoneTemplate = &m.Phone.Template - body.MfaPhoneMaxFrequency = cast.Ptr(int(m.Phone.MaxFrequency.Seconds())) - body.MfaWebAuthnEnrollEnabled = &m.WebAuthn.EnrollEnabled - body.MfaWebAuthnVerifyEnabled = &m.WebAuthn.VerifyEnabled + body.MfaMaxEnrolledFactors = nullable.NewNullableWithValue(cast.UintToInt(m.MaxEnrolledFactors)) + body.MfaTotpEnrollEnabled = nullable.NewNullableWithValue(m.TOTP.EnrollEnabled) + body.MfaTotpVerifyEnabled = nullable.NewNullableWithValue(m.TOTP.VerifyEnabled) + body.MfaPhoneEnrollEnabled = nullable.NewNullableWithValue(m.Phone.EnrollEnabled) + body.MfaPhoneVerifyEnabled = nullable.NewNullableWithValue(m.Phone.VerifyEnabled) + body.MfaPhoneOtpLength = nullable.NewNullableWithValue(cast.UintToInt(m.Phone.OtpLength)) + body.MfaPhoneTemplate = nullable.NewNullableWithValue(m.Phone.Template) + body.MfaPhoneMaxFrequency = nullable.NewNullableWithValue(int(m.Phone.MaxFrequency.Seconds())) + body.MfaWebAuthnEnrollEnabled = nullable.NewNullableWithValue(m.WebAuthn.EnrollEnabled) + body.MfaWebAuthnVerifyEnabled = nullable.NewNullableWithValue(m.WebAuthn.VerifyEnabled) } func (m *mfa) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { - m.MaxEnrolledFactors = cast.IntToUint(cast.Val(remoteConfig.MfaMaxEnrolledFactors, 0)) - m.TOTP.EnrollEnabled = cast.Val(remoteConfig.MfaTotpEnrollEnabled, false) - m.TOTP.VerifyEnabled = cast.Val(remoteConfig.MfaTotpVerifyEnabled, false) - m.Phone.EnrollEnabled = cast.Val(remoteConfig.MfaPhoneEnrollEnabled, false) - m.Phone.VerifyEnabled = cast.Val(remoteConfig.MfaPhoneVerifyEnabled, false) + m.MaxEnrolledFactors = cast.IntToUint(ValOrDefault(remoteConfig.MfaMaxEnrolledFactors, 0)) + m.TOTP.EnrollEnabled = ValOrDefault(remoteConfig.MfaTotpEnrollEnabled, false) + m.TOTP.VerifyEnabled = ValOrDefault(remoteConfig.MfaTotpVerifyEnabled, false) + m.Phone.EnrollEnabled = ValOrDefault(remoteConfig.MfaPhoneEnrollEnabled, false) + m.Phone.VerifyEnabled = ValOrDefault(remoteConfig.MfaPhoneVerifyEnabled, false) m.Phone.OtpLength = cast.IntToUint(remoteConfig.MfaPhoneOtpLength) - m.Phone.Template = cast.Val(remoteConfig.MfaPhoneTemplate, "") - m.Phone.MaxFrequency = time.Duration(cast.Val(remoteConfig.MfaPhoneMaxFrequency, 0)) * time.Second - m.WebAuthn.EnrollEnabled = cast.Val(remoteConfig.MfaWebAuthnEnrollEnabled, false) - m.WebAuthn.VerifyEnabled = cast.Val(remoteConfig.MfaWebAuthnVerifyEnabled, false) + m.Phone.Template = ValOrDefault(remoteConfig.MfaPhoneTemplate, "") + m.Phone.MaxFrequency = time.Duration(ValOrDefault(remoteConfig.MfaPhoneMaxFrequency, 0)) * time.Second + m.WebAuthn.EnrollEnabled = ValOrDefault(remoteConfig.MfaWebAuthnEnrollEnabled, false) + m.WebAuthn.VerifyEnabled = ValOrDefault(remoteConfig.MfaWebAuthnVerifyEnabled, false) } func (s sessions) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { - body.SessionsTimebox = cast.Ptr(int(s.Timebox.Hours())) - body.SessionsInactivityTimeout = cast.Ptr(int(s.InactivityTimeout.Hours())) + body.SessionsTimebox = nullable.NewNullableWithValue(int(s.Timebox.Hours())) + body.SessionsInactivityTimeout = nullable.NewNullableWithValue(int(s.InactivityTimeout.Hours())) } func (s *sessions) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { - s.Timebox = time.Duration(cast.Val(remoteConfig.SessionsTimebox, 0)) * time.Hour - s.InactivityTimeout = time.Duration(cast.Val(remoteConfig.SessionsInactivityTimeout, 0)) * time.Hour + s.Timebox = time.Duration(ValOrDefault(remoteConfig.SessionsTimebox, 0)) * time.Hour + s.InactivityTimeout = time.Duration(ValOrDefault(remoteConfig.SessionsInactivityTimeout, 0)) * time.Hour } func (e email) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { - body.ExternalEmailEnabled = &e.EnableSignup - body.MailerSecureEmailChangeEnabled = &e.DoubleConfirmChanges - body.MailerAutoconfirm = cast.Ptr(!e.EnableConfirmations) - body.MailerOtpLength = cast.UintToIntPtr(&e.OtpLength) + body.ExternalEmailEnabled = nullable.NewNullableWithValue(e.EnableSignup) + body.MailerSecureEmailChangeEnabled = nullable.NewNullableWithValue(e.DoubleConfirmChanges) + body.MailerAutoconfirm = nullable.NewNullableWithValue(!e.EnableConfirmations) + body.MailerOtpLength = nullable.NewNullableWithValue(cast.UintToInt(e.OtpLength)) body.MailerOtpExp = cast.UintToIntPtr(&e.OtpExpiry) - body.SecurityUpdatePasswordRequireReauthentication = &e.SecurePasswordChange - body.SmtpMaxFrequency = cast.Ptr(int(e.MaxFrequency.Seconds())) + body.SecurityUpdatePasswordRequireReauthentication = nullable.NewNullableWithValue(e.SecurePasswordChange) + body.SmtpMaxFrequency = nullable.NewNullableWithValue(int(e.MaxFrequency.Seconds())) // When local config is not set, we assume platform defaults should not change if e.Smtp != nil { e.Smtp.toAuthConfigBody(body) @@ -512,88 +513,112 @@ func (e email) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { } var tmpl *emailTemplate tmpl = cast.Ptr(e.Template["invite"]) - body.MailerSubjectsInvite = tmpl.Subject - body.MailerTemplatesInviteContent = tmpl.Content + if tmpl.Subject != nil { + body.MailerSubjectsInvite = nullable.NewNullableWithValue(*tmpl.Subject) + } + if tmpl.Content != nil { + body.MailerTemplatesInviteContent = nullable.NewNullableWithValue(*tmpl.Content) + } tmpl = cast.Ptr(e.Template["confirmation"]) - body.MailerSubjectsConfirmation = tmpl.Subject - body.MailerTemplatesConfirmationContent = tmpl.Content + if tmpl.Subject != nil { + body.MailerSubjectsConfirmation = nullable.NewNullableWithValue(*tmpl.Subject) + } + if tmpl.Content != nil { + body.MailerTemplatesConfirmationContent = nullable.NewNullableWithValue(*tmpl.Content) + } tmpl = cast.Ptr(e.Template["recovery"]) - body.MailerSubjectsRecovery = tmpl.Subject - body.MailerTemplatesRecoveryContent = tmpl.Content + if tmpl.Subject != nil { + body.MailerSubjectsRecovery = nullable.NewNullableWithValue(*tmpl.Subject) + } + if tmpl.Content != nil { + body.MailerTemplatesRecoveryContent = nullable.NewNullableWithValue(*tmpl.Content) + } tmpl = cast.Ptr(e.Template["magic_link"]) - body.MailerSubjectsMagicLink = tmpl.Subject - body.MailerTemplatesMagicLinkContent = tmpl.Content + if tmpl.Subject != nil { + body.MailerSubjectsMagicLink = nullable.NewNullableWithValue(*tmpl.Subject) + } + if tmpl.Content != nil { + body.MailerTemplatesMagicLinkContent = nullable.NewNullableWithValue(*tmpl.Content) + } tmpl = cast.Ptr(e.Template["email_change"]) - body.MailerSubjectsEmailChange = tmpl.Subject - body.MailerTemplatesEmailChangeContent = tmpl.Content + if tmpl.Subject != nil { + body.MailerSubjectsEmailChange = nullable.NewNullableWithValue(*tmpl.Subject) + } + if tmpl.Content != nil { + body.MailerTemplatesEmailChangeContent = nullable.NewNullableWithValue(*tmpl.Content) + } tmpl = cast.Ptr(e.Template["reauthentication"]) - body.MailerSubjectsReauthentication = tmpl.Subject - body.MailerTemplatesReauthenticationContent = tmpl.Content + if tmpl.Subject != nil { + body.MailerSubjectsReauthentication = nullable.NewNullableWithValue(*tmpl.Subject) + } + if tmpl.Content != nil { + body.MailerTemplatesReauthenticationContent = nullable.NewNullableWithValue(*tmpl.Content) + } } func (e *email) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { - e.EnableSignup = cast.Val(remoteConfig.ExternalEmailEnabled, false) - e.DoubleConfirmChanges = cast.Val(remoteConfig.MailerSecureEmailChangeEnabled, false) - e.EnableConfirmations = !cast.Val(remoteConfig.MailerAutoconfirm, false) - e.OtpLength = cast.IntToUint(cast.Val(remoteConfig.MailerOtpLength, 0)) + e.EnableSignup = ValOrDefault(remoteConfig.ExternalEmailEnabled, false) + e.DoubleConfirmChanges = ValOrDefault(remoteConfig.MailerSecureEmailChangeEnabled, false) + e.EnableConfirmations = !ValOrDefault(remoteConfig.MailerAutoconfirm, false) + e.OtpLength = cast.IntToUint(ValOrDefault(remoteConfig.MailerOtpLength, 0)) e.OtpExpiry = cast.IntToUint(remoteConfig.MailerOtpExp) - e.SecurePasswordChange = cast.Val(remoteConfig.SecurityUpdatePasswordRequireReauthentication, false) - e.MaxFrequency = time.Duration(cast.Val(remoteConfig.SmtpMaxFrequency, 0)) * time.Second + e.SecurePasswordChange = ValOrDefault(remoteConfig.SecurityUpdatePasswordRequireReauthentication, false) + e.MaxFrequency = time.Duration(ValOrDefault(remoteConfig.SmtpMaxFrequency, 0)) * time.Second e.Smtp.fromAuthConfig(remoteConfig) if len(e.Template) == 0 { return } if t, ok := e.Template["invite"]; ok { if t.Subject != nil { - t.Subject = remoteConfig.MailerSubjectsInvite + t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsInvite, "")) } if t.Content != nil { - t.Content = remoteConfig.MailerTemplatesInviteContent + t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesInviteContent, "")) } e.Template["invite"] = t } if t, ok := e.Template["confirmation"]; ok { if t.Subject != nil { - t.Subject = remoteConfig.MailerSubjectsConfirmation + t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsConfirmation, "")) } if t.Content != nil { - t.Content = remoteConfig.MailerTemplatesConfirmationContent + t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesConfirmationContent, "")) } e.Template["confirmation"] = t } if t, ok := e.Template["recovery"]; ok { if t.Subject != nil { - t.Subject = remoteConfig.MailerSubjectsRecovery + t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsRecovery, "")) } if t.Content != nil { - t.Content = remoteConfig.MailerTemplatesRecoveryContent + t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesRecoveryContent, "")) } e.Template["recovery"] = t } if t, ok := e.Template["magic_link"]; ok { if t.Subject != nil { - t.Subject = remoteConfig.MailerSubjectsMagicLink + t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsMagicLink, "")) } if t.Content != nil { - t.Content = remoteConfig.MailerTemplatesMagicLinkContent + t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesMagicLinkContent, "")) } e.Template["magic_link"] = t } if t, ok := e.Template["email_change"]; ok { if t.Subject != nil { - t.Subject = remoteConfig.MailerSubjectsEmailChange + t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsEmailChange, "")) } if t.Content != nil { - t.Content = remoteConfig.MailerTemplatesEmailChangeContent + t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesEmailChangeContent, "")) } e.Template["email_change"] = t } if t, ok := e.Template["reauthentication"]; ok { if t.Subject != nil { - t.Subject = remoteConfig.MailerSubjectsReauthentication + t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsReauthentication, "")) } if t.Content != nil { - t.Content = remoteConfig.MailerTemplatesReauthenticationContent + t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesReauthenticationContent, "")) } e.Template["reauthentication"] = t } @@ -602,17 +627,17 @@ func (e *email) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { func (s smtp) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { if !s.Enabled { // Setting a single empty string disables SMTP - body.SmtpHost = cast.Ptr("") + body.SmtpHost = nullable.NewNullableWithValue("") return } - body.SmtpHost = &s.Host - body.SmtpPort = cast.Ptr(strconv.Itoa(int(s.Port))) - body.SmtpUser = &s.User + body.SmtpHost = nullable.NewNullableWithValue(s.Host) + body.SmtpPort = nullable.NewNullableWithValue(strconv.Itoa(int(s.Port))) + body.SmtpUser = nullable.NewNullableWithValue(s.User) if len(s.Pass.SHA256) > 0 { - body.SmtpPass = &s.Pass.Value + body.SmtpPass = nullable.NewNullableWithValue(s.Pass.Value) } - body.SmtpAdminEmail = &s.AdminEmail - body.SmtpSenderName = &s.SenderName + body.SmtpAdminEmail = nullable.NewNullableWithValue(s.AdminEmail) + body.SmtpSenderName = nullable.NewNullableWithValue(s.SenderName) } func (s *smtp) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { @@ -621,14 +646,14 @@ func (s *smtp) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { return } if s.Enabled { - s.Host = cast.Val(remoteConfig.SmtpHost, "") - s.User = cast.Val(remoteConfig.SmtpUser, "") + s.Host = ValOrDefault(remoteConfig.SmtpHost, "") + s.User = ValOrDefault(remoteConfig.SmtpUser, "") if len(s.Pass.SHA256) > 0 { - s.Pass.SHA256 = cast.Val(remoteConfig.SmtpPass, "") + s.Pass.SHA256 = ValOrDefault(remoteConfig.SmtpPass, "") } - s.AdminEmail = cast.Val(remoteConfig.SmtpAdminEmail, "") - s.SenderName = cast.Val(remoteConfig.SmtpSenderName, "") - portStr := cast.Val(remoteConfig.SmtpPort, "0") + s.AdminEmail = ValOrDefault(remoteConfig.SmtpAdminEmail, "") + s.SenderName = ValOrDefault(remoteConfig.SmtpSenderName, "") + portStr := ValOrDefault(remoteConfig.SmtpPort, "0") if port, err := strconv.ParseUint(portStr, 10, 16); err == nil { s.Port = uint16(port) } @@ -638,95 +663,95 @@ func (s *smtp) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { } func (s sms) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { - body.ExternalPhoneEnabled = &s.EnableSignup - body.SmsMaxFrequency = cast.Ptr(int(s.MaxFrequency.Seconds())) - body.SmsAutoconfirm = &s.EnableConfirmations - body.SmsTemplate = &s.Template + body.ExternalPhoneEnabled = nullable.NewNullableWithValue(s.EnableSignup) + body.SmsMaxFrequency = nullable.NewNullableWithValue(int(s.MaxFrequency.Seconds())) + body.SmsAutoconfirm = nullable.NewNullableWithValue(s.EnableConfirmations) + body.SmsTemplate = nullable.NewNullableWithValue(s.Template) if otpString := mapToEnv(s.TestOTP); len(otpString) > 0 { - body.SmsTestOtp = &otpString + body.SmsTestOtp = nullable.NewNullableWithValue(otpString) // Set a 10 year validity for test OTP timestamp := time.Now().UTC().AddDate(10, 0, 0) - body.SmsTestOtpValidUntil = ×tamp + body.SmsTestOtpValidUntil = nullable.NewNullableWithValue(timestamp) } // Api only overrides configs of enabled providers switch { case s.Twilio.Enabled: - body.SmsProvider = cast.Ptr(v1API.Twilio) + body.SmsProvider = nullable.NewNullableWithValue(v1API.Twilio) if len(s.Twilio.AuthToken.SHA256) > 0 { - body.SmsTwilioAuthToken = &s.Twilio.AuthToken.Value + body.SmsTwilioAuthToken = nullable.NewNullableWithValue(s.Twilio.AuthToken.Value) } - body.SmsTwilioAccountSid = &s.Twilio.AccountSid - body.SmsTwilioMessageServiceSid = &s.Twilio.MessageServiceSid + body.SmsTwilioAccountSid = nullable.NewNullableWithValue(s.Twilio.AccountSid) + body.SmsTwilioMessageServiceSid = nullable.NewNullableWithValue(s.Twilio.MessageServiceSid) case s.TwilioVerify.Enabled: - body.SmsProvider = cast.Ptr(v1API.TwilioVerify) + body.SmsProvider = nullable.NewNullableWithValue(v1API.TwilioVerify) if len(s.TwilioVerify.AuthToken.SHA256) > 0 { - body.SmsTwilioVerifyAuthToken = &s.TwilioVerify.AuthToken.Value + body.SmsTwilioVerifyAuthToken = nullable.NewNullableWithValue(s.TwilioVerify.AuthToken.Value) } - body.SmsTwilioVerifyAccountSid = &s.TwilioVerify.AccountSid - body.SmsTwilioVerifyMessageServiceSid = &s.TwilioVerify.MessageServiceSid + body.SmsTwilioVerifyAccountSid = nullable.NewNullableWithValue(s.TwilioVerify.AccountSid) + body.SmsTwilioVerifyMessageServiceSid = nullable.NewNullableWithValue(s.TwilioVerify.MessageServiceSid) case s.Messagebird.Enabled: - body.SmsProvider = cast.Ptr(v1API.Messagebird) + body.SmsProvider = nullable.NewNullableWithValue(v1API.Messagebird) if len(s.Messagebird.AccessKey.SHA256) > 0 { - body.SmsMessagebirdAccessKey = &s.Messagebird.AccessKey.Value + body.SmsMessagebirdAccessKey = nullable.NewNullableWithValue(s.Messagebird.AccessKey.Value) } - body.SmsMessagebirdOriginator = &s.Messagebird.Originator + body.SmsMessagebirdOriginator = nullable.NewNullableWithValue(s.Messagebird.Originator) case s.Textlocal.Enabled: - body.SmsProvider = cast.Ptr(v1API.Textlocal) + body.SmsProvider = nullable.NewNullableWithValue(v1API.Textlocal) if len(s.Textlocal.ApiKey.SHA256) > 0 { - body.SmsTextlocalApiKey = &s.Textlocal.ApiKey.Value + body.SmsTextlocalApiKey = nullable.NewNullableWithValue(s.Textlocal.ApiKey.Value) } - body.SmsTextlocalSender = &s.Textlocal.Sender + body.SmsTextlocalSender = nullable.NewNullableWithValue(s.Textlocal.Sender) case s.Vonage.Enabled: - body.SmsProvider = cast.Ptr(v1API.Vonage) + body.SmsProvider = nullable.NewNullableWithValue(v1API.Vonage) if len(s.Vonage.ApiSecret.SHA256) > 0 { - body.SmsVonageApiSecret = &s.Vonage.ApiSecret.Value + body.SmsVonageApiSecret = nullable.NewNullableWithValue(s.Vonage.ApiSecret.Value) } - body.SmsVonageApiKey = &s.Vonage.ApiKey - body.SmsVonageFrom = &s.Vonage.From + body.SmsVonageApiKey = nullable.NewNullableWithValue(s.Vonage.ApiKey) + body.SmsVonageFrom = nullable.NewNullableWithValue(s.Vonage.From) } } func (s *sms) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { - s.EnableSignup = cast.Val(remoteConfig.ExternalPhoneEnabled, false) - s.MaxFrequency = time.Duration(cast.Val(remoteConfig.SmsMaxFrequency, 0)) * time.Second - s.EnableConfirmations = cast.Val(remoteConfig.SmsAutoconfirm, false) - s.Template = cast.Val(remoteConfig.SmsTemplate, "") - s.TestOTP = envToMap(cast.Val(remoteConfig.SmsTestOtp, "")) + s.EnableSignup = ValOrDefault(remoteConfig.ExternalPhoneEnabled, false) + s.MaxFrequency = time.Duration(ValOrDefault(remoteConfig.SmsMaxFrequency, 0)) * time.Second + s.EnableConfirmations = ValOrDefault(remoteConfig.SmsAutoconfirm, false) + s.Template = ValOrDefault(remoteConfig.SmsTemplate, "") + s.TestOTP = envToMap(ValOrDefault(remoteConfig.SmsTestOtp, "")) // We are only interested in the provider that's enabled locally switch { case s.Twilio.Enabled: if len(s.Twilio.AuthToken.SHA256) > 0 { - s.Twilio.AuthToken.SHA256 = cast.Val(remoteConfig.SmsTwilioAuthToken, "") + s.Twilio.AuthToken.SHA256 = ValOrDefault(remoteConfig.SmsTwilioAuthToken, "") } - s.Twilio.AccountSid = cast.Val(remoteConfig.SmsTwilioAccountSid, "") - s.Twilio.MessageServiceSid = cast.Val(remoteConfig.SmsTwilioMessageServiceSid, "") + s.Twilio.AccountSid = ValOrDefault(remoteConfig.SmsTwilioAccountSid, "") + s.Twilio.MessageServiceSid = ValOrDefault(remoteConfig.SmsTwilioMessageServiceSid, "") case s.TwilioVerify.Enabled: if len(s.TwilioVerify.AuthToken.SHA256) > 0 { - s.TwilioVerify.AuthToken.SHA256 = cast.Val(remoteConfig.SmsTwilioVerifyAuthToken, "") + s.TwilioVerify.AuthToken.SHA256 = ValOrDefault(remoteConfig.SmsTwilioVerifyAuthToken, "") } - s.TwilioVerify.AccountSid = cast.Val(remoteConfig.SmsTwilioVerifyAccountSid, "") - s.TwilioVerify.MessageServiceSid = cast.Val(remoteConfig.SmsTwilioVerifyMessageServiceSid, "") + s.TwilioVerify.AccountSid = ValOrDefault(remoteConfig.SmsTwilioVerifyAccountSid, "") + s.TwilioVerify.MessageServiceSid = ValOrDefault(remoteConfig.SmsTwilioVerifyMessageServiceSid, "") case s.Messagebird.Enabled: if len(s.Messagebird.AccessKey.SHA256) > 0 { - s.Messagebird.AccessKey.SHA256 = cast.Val(remoteConfig.SmsMessagebirdAccessKey, "") + s.Messagebird.AccessKey.SHA256 = ValOrDefault(remoteConfig.SmsMessagebirdAccessKey, "") } - s.Messagebird.Originator = cast.Val(remoteConfig.SmsMessagebirdOriginator, "") + s.Messagebird.Originator = ValOrDefault(remoteConfig.SmsMessagebirdOriginator, "") case s.Textlocal.Enabled: if len(s.Textlocal.ApiKey.SHA256) > 0 { - s.Textlocal.ApiKey.SHA256 = cast.Val(remoteConfig.SmsTextlocalApiKey, "") + s.Textlocal.ApiKey.SHA256 = ValOrDefault(remoteConfig.SmsTextlocalApiKey, "") } - s.Textlocal.Sender = cast.Val(remoteConfig.SmsTextlocalSender, "") + s.Textlocal.Sender = ValOrDefault(remoteConfig.SmsTextlocalSender, "") case s.Vonage.Enabled: if len(s.Vonage.ApiSecret.SHA256) > 0 { - s.Vonage.ApiSecret.SHA256 = cast.Val(remoteConfig.SmsVonageApiSecret, "") + s.Vonage.ApiSecret.SHA256 = ValOrDefault(remoteConfig.SmsVonageApiSecret, "") } - s.Vonage.ApiKey = cast.Val(remoteConfig.SmsVonageApiKey, "") - s.Vonage.From = cast.Val(remoteConfig.SmsVonageFrom, "") + s.Vonage.ApiKey = ValOrDefault(remoteConfig.SmsVonageApiKey, "") + s.Vonage.From = ValOrDefault(remoteConfig.SmsVonageFrom, "") case !s.EnableSignup: // Nothing to do if both local and remote providers are disabled. return } - if provider := cast.Val(remoteConfig.SmsProvider, ""); len(provider) > 0 { + if provider := ValOrDefault(remoteConfig.SmsProvider, ""); len(provider) > 0 { s.Twilio.Enabled = provider == "twilio" s.TwilioVerify.Enabled = provider == "twilio_verify" s.Messagebird.Enabled = provider == "messagebird" @@ -741,159 +766,159 @@ func (e external) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { } // Ignore configs of disabled providers because their envs are not loaded if p, ok := e["apple"]; ok { - if body.ExternalAppleEnabled = &p.Enabled; *body.ExternalAppleEnabled { - body.ExternalAppleClientId = &p.ClientId + if body.ExternalAppleEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalAppleClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalAppleSecret = &p.Secret.Value + body.ExternalAppleSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["azure"]; ok { - if body.ExternalAzureEnabled = &p.Enabled; *body.ExternalAzureEnabled { - body.ExternalAzureClientId = &p.ClientId + if body.ExternalAzureEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalAzureClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalAzureSecret = &p.Secret.Value + body.ExternalAzureSecret = nullable.NewNullableWithValue(p.Secret.Value) } - body.ExternalAzureUrl = &p.Url + body.ExternalAzureUrl = nullable.NewNullableWithValue(p.Url) } } if p, ok := e["bitbucket"]; ok { - if body.ExternalBitbucketEnabled = &p.Enabled; *body.ExternalBitbucketEnabled { - body.ExternalBitbucketClientId = &p.ClientId + if body.ExternalBitbucketEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalBitbucketClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalBitbucketSecret = &p.Secret.Value + body.ExternalBitbucketSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["discord"]; ok { - if body.ExternalDiscordEnabled = &p.Enabled; *body.ExternalDiscordEnabled { - body.ExternalDiscordClientId = &p.ClientId + if body.ExternalDiscordEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalDiscordClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalDiscordSecret = &p.Secret.Value + body.ExternalDiscordSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["facebook"]; ok { - if body.ExternalFacebookEnabled = &p.Enabled; *body.ExternalFacebookEnabled { - body.ExternalFacebookClientId = &p.ClientId + if body.ExternalFacebookEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalFacebookClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalFacebookSecret = &p.Secret.Value + body.ExternalFacebookSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["figma"]; ok { - if body.ExternalFigmaEnabled = &p.Enabled; *body.ExternalFigmaEnabled { - body.ExternalFigmaClientId = &p.ClientId + if body.ExternalFigmaEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalFigmaClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalFigmaSecret = &p.Secret.Value + body.ExternalFigmaSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["github"]; ok { - if body.ExternalGithubEnabled = &p.Enabled; *body.ExternalGithubEnabled { - body.ExternalGithubClientId = &p.ClientId + if body.ExternalGithubEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalGithubClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalGithubSecret = &p.Secret.Value + body.ExternalGithubSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["gitlab"]; ok { - if body.ExternalGitlabEnabled = &p.Enabled; *body.ExternalGitlabEnabled { - body.ExternalGitlabClientId = &p.ClientId + if body.ExternalGitlabEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalGitlabClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalGitlabSecret = &p.Secret.Value + body.ExternalGitlabSecret = nullable.NewNullableWithValue(p.Secret.Value) } - body.ExternalGitlabUrl = &p.Url + body.ExternalGitlabUrl = nullable.NewNullableWithValue(p.Url) } } if p, ok := e["google"]; ok { - if body.ExternalGoogleEnabled = &p.Enabled; *body.ExternalGoogleEnabled { - body.ExternalGoogleClientId = &p.ClientId + if body.ExternalGoogleEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalGoogleClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalGoogleSecret = &p.Secret.Value + body.ExternalGoogleSecret = nullable.NewNullableWithValue(p.Secret.Value) } - body.ExternalGoogleSkipNonceCheck = &p.SkipNonceCheck + body.ExternalGoogleSkipNonceCheck = nullable.NewNullableWithValue(p.SkipNonceCheck) } } if p, ok := e["kakao"]; ok { - if body.ExternalKakaoEnabled = &p.Enabled; *body.ExternalKakaoEnabled { - body.ExternalKakaoClientId = &p.ClientId + if body.ExternalKakaoEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalKakaoClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalKakaoSecret = &p.Secret.Value + body.ExternalKakaoSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["keycloak"]; ok { - if body.ExternalKeycloakEnabled = &p.Enabled; *body.ExternalKeycloakEnabled { - body.ExternalKeycloakClientId = &p.ClientId + if body.ExternalKeycloakEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalKeycloakClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalKeycloakSecret = &p.Secret.Value + body.ExternalKeycloakSecret = nullable.NewNullableWithValue(p.Secret.Value) } - body.ExternalKeycloakUrl = &p.Url + body.ExternalKeycloakUrl = nullable.NewNullableWithValue(p.Url) } } if p, ok := e["linkedin_oidc"]; ok { - if body.ExternalLinkedinOidcEnabled = &p.Enabled; *body.ExternalLinkedinOidcEnabled { - body.ExternalLinkedinOidcClientId = &p.ClientId + if body.ExternalLinkedinOidcEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalLinkedinOidcClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalLinkedinOidcSecret = &p.Secret.Value + body.ExternalLinkedinOidcSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["notion"]; ok { - if body.ExternalNotionEnabled = &p.Enabled; *body.ExternalNotionEnabled { - body.ExternalNotionClientId = &p.ClientId + if body.ExternalNotionEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalNotionClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalNotionSecret = &p.Secret.Value + body.ExternalNotionSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["slack_oidc"]; ok { - if body.ExternalSlackOidcEnabled = &p.Enabled; *body.ExternalSlackOidcEnabled { - body.ExternalSlackOidcClientId = &p.ClientId + if body.ExternalSlackOidcEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalSlackOidcClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalSlackOidcSecret = &p.Secret.Value + body.ExternalSlackOidcSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["spotify"]; ok { - if body.ExternalSpotifyEnabled = &p.Enabled; *body.ExternalSpotifyEnabled { - body.ExternalSpotifyClientId = &p.ClientId + if body.ExternalSpotifyEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalSpotifyClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalSpotifySecret = &p.Secret.Value + body.ExternalSpotifySecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["twitch"]; ok { - if body.ExternalTwitchEnabled = &p.Enabled; *body.ExternalTwitchEnabled { - body.ExternalTwitchClientId = &p.ClientId + if body.ExternalTwitchEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalTwitchClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalTwitchSecret = &p.Secret.Value + body.ExternalTwitchSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["twitter"]; ok { - if body.ExternalTwitterEnabled = &p.Enabled; *body.ExternalTwitterEnabled { - body.ExternalTwitterClientId = &p.ClientId + if body.ExternalTwitterEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalTwitterClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalTwitterSecret = &p.Secret.Value + body.ExternalTwitterSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } if p, ok := e["workos"]; ok { - if body.ExternalWorkosEnabled = &p.Enabled; *body.ExternalWorkosEnabled { - body.ExternalWorkosClientId = &p.ClientId + if body.ExternalWorkosEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalWorkosClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalWorkosSecret = &p.Secret.Value + body.ExternalWorkosSecret = nullable.NewNullableWithValue(p.Secret.Value) } - body.ExternalWorkosUrl = &p.Url + body.ExternalWorkosUrl = nullable.NewNullableWithValue(p.Url) } } if p, ok := e["zoom"]; ok { - if body.ExternalZoomEnabled = &p.Enabled; *body.ExternalZoomEnabled { - body.ExternalZoomClientId = &p.ClientId + if body.ExternalZoomEnabled = nullable.NewNullableWithValue(p.Enabled); p.Enabled { + body.ExternalZoomClientId = nullable.NewNullableWithValue(p.ClientId) if len(p.Secret.SHA256) > 0 { - body.ExternalZoomSecret = &p.Secret.Value + body.ExternalZoomSecret = nullable.NewNullableWithValue(p.Secret.Value) } } } @@ -906,221 +931,221 @@ func (e external) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { // Ignore configs of disabled providers because their envs are not loaded 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 = ValOrDefault(remoteConfig.ExternalAppleClientId, "") + if ids := ValOrDefault(remoteConfig.ExternalAppleAdditionalClientIds, ""); len(ids) > 0 { p.ClientId += "," + ids } if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalAppleSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalAppleSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalAppleEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalAppleEnabled, false) e["apple"] = p } if p, ok := e["azure"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalAzureClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalAzureClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalAzureSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalAzureSecret, "") } - p.Url = cast.Val(remoteConfig.ExternalAzureUrl, "") + p.Url = ValOrDefault(remoteConfig.ExternalAzureUrl, "") } - p.Enabled = cast.Val(remoteConfig.ExternalAzureEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalAzureEnabled, false) e["azure"] = p } if p, ok := e["bitbucket"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalBitbucketClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalBitbucketClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalBitbucketSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalBitbucketSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalBitbucketEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalBitbucketEnabled, false) e["bitbucket"] = p } if p, ok := e["discord"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalDiscordClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalDiscordClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalDiscordSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalDiscordSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalDiscordEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalDiscordEnabled, false) e["discord"] = p } if p, ok := e["facebook"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalFacebookClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalFacebookClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalFacebookSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalFacebookSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalFacebookEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalFacebookEnabled, false) e["facebook"] = p } if p, ok := e["figma"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalFigmaClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalFigmaClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalFigmaSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalFigmaSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalFigmaEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalFigmaEnabled, false) e["figma"] = p } if p, ok := e["github"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalGithubClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalGithubClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalGithubSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalGithubSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalGithubEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalGithubEnabled, false) e["github"] = p } if p, ok := e["gitlab"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalGitlabClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalGitlabClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalGitlabSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalGitlabSecret, "") } - p.Url = cast.Val(remoteConfig.ExternalGitlabUrl, "") + p.Url = ValOrDefault(remoteConfig.ExternalGitlabUrl, "") } - p.Enabled = cast.Val(remoteConfig.ExternalGitlabEnabled, false) + p.Enabled = ValOrDefault(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 = ValOrDefault(remoteConfig.ExternalGoogleClientId, "") + if ids := ValOrDefault(remoteConfig.ExternalGoogleAdditionalClientIds, ""); len(ids) > 0 { p.ClientId += "," + ids } if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalGoogleSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalGoogleSecret, "") } - p.SkipNonceCheck = cast.Val(remoteConfig.ExternalGoogleSkipNonceCheck, false) + p.SkipNonceCheck = ValOrDefault(remoteConfig.ExternalGoogleSkipNonceCheck, false) } - p.Enabled = cast.Val(remoteConfig.ExternalGoogleEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalGoogleEnabled, false) e["google"] = p } if p, ok := e["kakao"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalKakaoClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalKakaoClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalKakaoSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalKakaoSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalKakaoEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalKakaoEnabled, false) e["kakao"] = p } if p, ok := e["keycloak"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalKeycloakClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalKeycloakClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalKeycloakSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalKeycloakSecret, "") } - p.Url = cast.Val(remoteConfig.ExternalKeycloakUrl, "") + p.Url = ValOrDefault(remoteConfig.ExternalKeycloakUrl, "") } - p.Enabled = cast.Val(remoteConfig.ExternalKeycloakEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalKeycloakEnabled, false) e["keycloak"] = p } if p, ok := e["linkedin_oidc"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalLinkedinOidcClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalLinkedinOidcClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalLinkedinOidcSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalLinkedinOidcSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalLinkedinOidcEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalLinkedinOidcEnabled, false) e["linkedin_oidc"] = p } if p, ok := e["notion"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalNotionClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalNotionClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalNotionSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalNotionSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalNotionEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalNotionEnabled, false) e["notion"] = p } if p, ok := e["slack_oidc"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalSlackOidcClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalSlackOidcClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalSlackOidcSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalSlackOidcSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalSlackOidcEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalSlackOidcEnabled, false) e["slack_oidc"] = p } if p, ok := e["spotify"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalSpotifyClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalSpotifyClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalSpotifySecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalSpotifySecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalSpotifyEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalSpotifyEnabled, false) e["spotify"] = p } if p, ok := e["twitch"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalTwitchClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalTwitchClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalTwitchSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalTwitchSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalTwitchEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalTwitchEnabled, false) e["twitch"] = p } if p, ok := e["twitter"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalTwitterClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalTwitterClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalTwitterSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalTwitterSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalTwitterEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalTwitterEnabled, false) e["twitter"] = p } if p, ok := e["workos"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalWorkosClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalWorkosClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalWorkosSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalWorkosSecret, "") } - p.Url = cast.Val(remoteConfig.ExternalWorkosUrl, "") + p.Url = ValOrDefault(remoteConfig.ExternalWorkosUrl, "") } - p.Enabled = cast.Val(remoteConfig.ExternalWorkosEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalWorkosEnabled, false) e["workos"] = p } if p, ok := e["zoom"]; ok { if p.Enabled { - p.ClientId = cast.Val(remoteConfig.ExternalZoomClientId, "") + p.ClientId = ValOrDefault(remoteConfig.ExternalZoomClientId, "") if len(p.Secret.SHA256) > 0 { - p.Secret.SHA256 = cast.Val(remoteConfig.ExternalZoomSecret, "") + p.Secret.SHA256 = ValOrDefault(remoteConfig.ExternalZoomSecret, "") } } - p.Enabled = cast.Val(remoteConfig.ExternalZoomEnabled, false) + p.Enabled = ValOrDefault(remoteConfig.ExternalZoomEnabled, false) e["zoom"] = p } } @@ -1139,3 +1164,10 @@ func (a *auth) DiffWithRemote(remoteConfig v1API.AuthConfigResponse) ([]byte, er } return diff.Diff("remote[auth]", remoteCompare, "local[auth]", currentValue), nil } + +func ValOrDefault[T any](v nullable.Nullable[T], def T) T { + if value, err := v.Get(); err == nil { + return value + } + return def +} diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index 3bf9dae1f..09bf1fea7 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -7,6 +7,7 @@ import ( "time" "github.com/go-errors/errors" + "github.com/oapi-codegen/nullable" "github.com/stretchr/testify/assert" v1API "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/cast" @@ -50,16 +51,16 @@ func TestAuthDiff(t *testing.T) { c.PasswordRequirements = LettersDigits // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - SiteUrl: cast.Ptr("http://127.0.0.1:3000"), - UriAllowList: cast.Ptr("https://127.0.0.1:3000"), - JwtExp: cast.Ptr(3600), - RefreshTokenRotationEnabled: cast.Ptr(true), - SecurityRefreshTokenReuseInterval: cast.Ptr(10), - SecurityManualLinkingEnabled: cast.Ptr(true), - DisableSignup: cast.Ptr(false), - ExternalAnonymousUsersEnabled: cast.Ptr(true), - PasswordMinLength: cast.Ptr(6), - PasswordRequiredCharacters: cast.Ptr(string(v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)), + SiteUrl: nullable.NewNullableWithValue("http://127.0.0.1:3000"), + UriAllowList: nullable.NewNullableWithValue("https://127.0.0.1:3000"), + JwtExp: nullable.NewNullableWithValue(3600), + RefreshTokenRotationEnabled: nullable.NewNullableWithValue(true), + SecurityRefreshTokenReuseInterval: nullable.NewNullableWithValue(10), + SecurityManualLinkingEnabled: nullable.NewNullableWithValue(true), + DisableSignup: nullable.NewNullableWithValue(false), + ExternalAnonymousUsersEnabled: nullable.NewNullableWithValue(true), + PasswordMinLength: nullable.NewNullableWithValue(6), + PasswordRequiredCharacters: nullable.NewNullableWithValue(string(v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)), }) // Check error assert.NoError(t, err) @@ -80,16 +81,16 @@ func TestAuthDiff(t *testing.T) { c.PasswordRequirements = LowerUpperLettersDigitsSymbols // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - SiteUrl: cast.Ptr(""), - UriAllowList: cast.Ptr("https://127.0.0.1:3000,https://ref.supabase.co"), - JwtExp: cast.Ptr(0), - RefreshTokenRotationEnabled: cast.Ptr(true), - SecurityRefreshTokenReuseInterval: cast.Ptr(0), - SecurityManualLinkingEnabled: cast.Ptr(true), - DisableSignup: cast.Ptr(false), - ExternalAnonymousUsersEnabled: cast.Ptr(true), - PasswordMinLength: cast.Ptr(8), - PasswordRequiredCharacters: cast.Ptr(string(v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)), + SiteUrl: nullable.NewNullableWithValue(""), + UriAllowList: nullable.NewNullableWithValue("https://127.0.0.1:3000,https://ref.supabase.co"), + JwtExp: nullable.NewNullableWithValue(0), + RefreshTokenRotationEnabled: nullable.NewNullableWithValue(true), + SecurityRefreshTokenReuseInterval: nullable.NewNullableWithValue(0), + SecurityManualLinkingEnabled: nullable.NewNullableWithValue(true), + DisableSignup: nullable.NewNullableWithValue(false), + ExternalAnonymousUsersEnabled: nullable.NewNullableWithValue(true), + PasswordMinLength: nullable.NewNullableWithValue(8), + PasswordRequiredCharacters: nullable.NewNullableWithValue(string(v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)), }) // Check error assert.NoError(t, err) @@ -101,16 +102,16 @@ func TestAuthDiff(t *testing.T) { c.EnableSignup = false // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - SiteUrl: cast.Ptr(""), - UriAllowList: cast.Ptr(""), - JwtExp: cast.Ptr(0), - RefreshTokenRotationEnabled: cast.Ptr(false), - SecurityRefreshTokenReuseInterval: cast.Ptr(0), - SecurityManualLinkingEnabled: cast.Ptr(false), - DisableSignup: cast.Ptr(true), - ExternalAnonymousUsersEnabled: cast.Ptr(false), - PasswordMinLength: cast.Ptr(0), - PasswordRequiredCharacters: cast.Ptr(""), + SiteUrl: nullable.NewNullableWithValue(""), + UriAllowList: nullable.NewNullableWithValue(""), + JwtExp: nullable.NewNullableWithValue(0), + RefreshTokenRotationEnabled: nullable.NewNullableWithValue(false), + SecurityRefreshTokenReuseInterval: nullable.NewNullableWithValue(0), + SecurityManualLinkingEnabled: nullable.NewNullableWithValue(false), + DisableSignup: nullable.NewNullableWithValue(true), + ExternalAnonymousUsersEnabled: nullable.NewNullableWithValue(false), + PasswordMinLength: nullable.NewNullableWithValue(0), + PasswordRequiredCharacters: nullable.NewNullableWithValue(""), }) // Check error assert.NoError(t, err) @@ -131,9 +132,9 @@ func TestCaptchaDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - SecurityCaptchaEnabled: cast.Ptr(true), - SecurityCaptchaProvider: cast.Ptr("hcaptcha"), - SecurityCaptchaSecret: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + SecurityCaptchaEnabled: nullable.NewNullableWithValue(true), + SecurityCaptchaProvider: nullable.NewNullableWithValue("hcaptcha"), + SecurityCaptchaSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error assert.NoError(t, err) @@ -152,9 +153,9 @@ func TestCaptchaDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - SecurityCaptchaEnabled: cast.Ptr(true), - SecurityCaptchaProvider: cast.Ptr("hcaptcha"), - SecurityCaptchaSecret: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + SecurityCaptchaEnabled: nullable.NewNullableWithValue(true), + SecurityCaptchaProvider: nullable.NewNullableWithValue("hcaptcha"), + SecurityCaptchaSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error assert.NoError(t, err) @@ -173,9 +174,9 @@ func TestCaptchaDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - SecurityCaptchaEnabled: cast.Ptr(false), - SecurityCaptchaProvider: cast.Ptr("hcaptcha"), - SecurityCaptchaSecret: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + SecurityCaptchaEnabled: nullable.NewNullableWithValue(false), + SecurityCaptchaProvider: nullable.NewNullableWithValue("hcaptcha"), + SecurityCaptchaSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error assert.NoError(t, err) @@ -189,7 +190,7 @@ func TestCaptchaDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - SecurityCaptchaEnabled: cast.Ptr(false), + SecurityCaptchaEnabled: nullable.NewNullableWithValue(false), }) // Check error assert.NoError(t, err) @@ -200,9 +201,9 @@ func TestCaptchaDiff(t *testing.T) { c := newWithDefaults() // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - SecurityCaptchaEnabled: cast.Ptr(true), - SecurityCaptchaProvider: cast.Ptr("hcaptcha"), - SecurityCaptchaSecret: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + SecurityCaptchaEnabled: nullable.NewNullableWithValue(true), + SecurityCaptchaProvider: nullable.NewNullableWithValue("hcaptcha"), + SecurityCaptchaSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error assert.NoError(t, err) @@ -253,20 +254,20 @@ func TestHookDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - HookCustomAccessTokenEnabled: cast.Ptr(true), - HookCustomAccessTokenUri: cast.Ptr("http://example.com"), - HookCustomAccessTokenSecrets: 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"), - HookPasswordVerificationAttemptEnabled: cast.Ptr(true), - HookPasswordVerificationAttemptUri: cast.Ptr("pg-functions://verifyPassword"), + HookCustomAccessTokenEnabled: nullable.NewNullableWithValue(true), + HookCustomAccessTokenUri: nullable.NewNullableWithValue("http://example.com"), + HookCustomAccessTokenSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookSendSmsEnabled: nullable.NewNullableWithValue(true), + HookSendSmsUri: nullable.NewNullableWithValue("http://example.com"), + HookSendSmsSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookSendEmailEnabled: nullable.NewNullableWithValue(true), + HookSendEmailUri: nullable.NewNullableWithValue("https://example.com"), + HookSendEmailSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookMfaVerificationAttemptEnabled: nullable.NewNullableWithValue(true), + HookMfaVerificationAttemptUri: nullable.NewNullableWithValue("https://example.com"), + HookMfaVerificationAttemptSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookPasswordVerificationAttemptEnabled: nullable.NewNullableWithValue(true), + HookPasswordVerificationAttemptUri: nullable.NewNullableWithValue("pg-functions://verifyPassword"), }) // Check error assert.NoError(t, err) @@ -295,19 +296,19 @@ func TestHookDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - HookCustomAccessTokenEnabled: cast.Ptr(true), - HookCustomAccessTokenUri: cast.Ptr("http://example.com"), - HookCustomAccessTokenSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), - HookSendSmsEnabled: cast.Ptr(true), - 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://postgres/public/verifyMFA"), - HookPasswordVerificationAttemptEnabled: cast.Ptr(true), - HookPasswordVerificationAttemptUri: cast.Ptr("https://example.com"), - HookPasswordVerificationAttemptSecrets: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookCustomAccessTokenEnabled: nullable.NewNullableWithValue(true), + HookCustomAccessTokenUri: nullable.NewNullableWithValue("http://example.com"), + HookCustomAccessTokenSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookSendSmsEnabled: nullable.NewNullableWithValue(true), + HookSendSmsUri: nullable.NewNullableWithValue("https://example.com"), + HookSendSmsSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookSendEmailEnabled: nullable.NewNullableWithValue(true), + HookSendEmailUri: nullable.NewNullableWithValue("pg-functions://postgres/public/sendEmail"), + HookMfaVerificationAttemptEnabled: nullable.NewNullableWithValue(true), + HookMfaVerificationAttemptUri: nullable.NewNullableWithValue("pg-functions://postgres/public/verifyMFA"), + HookPasswordVerificationAttemptEnabled: nullable.NewNullableWithValue(true), + HookPasswordVerificationAttemptUri: nullable.NewNullableWithValue("https://example.com"), + HookPasswordVerificationAttemptSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error assert.NoError(t, err) @@ -345,17 +346,17 @@ func TestHookDiff(t *testing.T) { } // 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), + HookCustomAccessTokenEnabled: nullable.NewNullableWithValue(false), + HookCustomAccessTokenUri: nullable.NewNullableWithValue("pg-functions://postgres/public/customToken"), + HookSendSmsEnabled: nullable.NewNullableWithValue(false), + HookSendSmsUri: nullable.NewNullableWithValue("https://example.com"), + HookSendSmsSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookSendEmailEnabled: nullable.NewNullableWithValue(false), + HookSendEmailUri: nullable.NewNullableWithValue("https://example.com"), + HookSendEmailSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + HookMfaVerificationAttemptEnabled: nullable.NewNullableWithValue(false), + HookMfaVerificationAttemptUri: nullable.NewNullableWithValue("pg-functions://postgres/public/verifyMFA"), + HookPasswordVerificationAttemptEnabled: nullable.NewNullableWithValue(false), }) // Check error assert.NoError(t, err) @@ -373,11 +374,11 @@ func TestHookDiff(t *testing.T) { } // 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), + HookCustomAccessTokenEnabled: nullable.NewNullableWithValue(false), + HookSendSmsEnabled: nullable.NewNullableWithValue(false), + HookSendEmailEnabled: nullable.NewNullableWithValue(false), + HookMfaVerificationAttemptEnabled: nullable.NewNullableWithValue(false), + HookPasswordVerificationAttemptEnabled: nullable.NewNullableWithValue(false), }) // Check error assert.NoError(t, err) @@ -410,16 +411,16 @@ func TestMfaDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - MfaMaxEnrolledFactors: cast.Ptr(10), - MfaTotpEnrollEnabled: cast.Ptr(true), - MfaTotpVerifyEnabled: cast.Ptr(true), - MfaPhoneEnrollEnabled: cast.Ptr(true), - MfaPhoneVerifyEnabled: cast.Ptr(true), + MfaMaxEnrolledFactors: nullable.NewNullableWithValue(10), + MfaTotpEnrollEnabled: nullable.NewNullableWithValue(true), + MfaTotpVerifyEnabled: nullable.NewNullableWithValue(true), + MfaPhoneEnrollEnabled: nullable.NewNullableWithValue(true), + MfaPhoneVerifyEnabled: nullable.NewNullableWithValue(true), MfaPhoneOtpLength: 6, - MfaPhoneTemplate: cast.Ptr("Your code is {{ .Code }}"), - MfaPhoneMaxFrequency: cast.Ptr(5), - MfaWebAuthnEnrollEnabled: cast.Ptr(true), - MfaWebAuthnVerifyEnabled: cast.Ptr(true), + MfaPhoneTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), + MfaPhoneMaxFrequency: nullable.NewNullableWithValue(5), + MfaWebAuthnEnrollEnabled: nullable.NewNullableWithValue(true), + MfaWebAuthnVerifyEnabled: nullable.NewNullableWithValue(true), }) // Check error assert.NoError(t, err) @@ -442,16 +443,16 @@ func TestMfaDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - MfaMaxEnrolledFactors: cast.Ptr(10), - MfaTotpEnrollEnabled: cast.Ptr(false), - MfaTotpVerifyEnabled: cast.Ptr(false), - MfaPhoneEnrollEnabled: cast.Ptr(false), - MfaPhoneVerifyEnabled: cast.Ptr(false), + MfaMaxEnrolledFactors: nullable.NewNullableWithValue(10), + MfaTotpEnrollEnabled: nullable.NewNullableWithValue(false), + MfaTotpVerifyEnabled: nullable.NewNullableWithValue(false), + MfaPhoneEnrollEnabled: nullable.NewNullableWithValue(false), + MfaPhoneVerifyEnabled: nullable.NewNullableWithValue(false), MfaPhoneOtpLength: 6, - MfaPhoneTemplate: cast.Ptr("Your code is {{ .Code }}"), - MfaPhoneMaxFrequency: cast.Ptr(5), - MfaWebAuthnEnrollEnabled: cast.Ptr(false), - MfaWebAuthnVerifyEnabled: cast.Ptr(false), + MfaPhoneTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), + MfaPhoneMaxFrequency: nullable.NewNullableWithValue(5), + MfaWebAuthnEnrollEnabled: nullable.NewNullableWithValue(false), + MfaWebAuthnVerifyEnabled: nullable.NewNullableWithValue(false), }) // Check error assert.NoError(t, err) @@ -470,16 +471,16 @@ func TestMfaDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - MfaMaxEnrolledFactors: cast.Ptr(10), - MfaTotpEnrollEnabled: cast.Ptr(false), - MfaTotpVerifyEnabled: cast.Ptr(false), - MfaPhoneEnrollEnabled: cast.Ptr(false), - MfaPhoneVerifyEnabled: cast.Ptr(false), + MfaMaxEnrolledFactors: nullable.NewNullableWithValue(10), + MfaTotpEnrollEnabled: nullable.NewNullableWithValue(false), + MfaTotpVerifyEnabled: nullable.NewNullableWithValue(false), + MfaPhoneEnrollEnabled: nullable.NewNullableWithValue(false), + MfaPhoneVerifyEnabled: nullable.NewNullableWithValue(false), MfaPhoneOtpLength: 6, - MfaPhoneTemplate: cast.Ptr("Your code is {{ .Code }}"), - MfaPhoneMaxFrequency: cast.Ptr(5), - MfaWebAuthnEnrollEnabled: cast.Ptr(false), - MfaWebAuthnVerifyEnabled: cast.Ptr(false), + MfaPhoneTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), + MfaPhoneMaxFrequency: nullable.NewNullableWithValue(5), + MfaWebAuthnEnrollEnabled: nullable.NewNullableWithValue(false), + MfaWebAuthnVerifyEnabled: nullable.NewNullableWithValue(false), }) // Check error assert.NoError(t, err) @@ -539,32 +540,32 @@ func TestEmailDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalEmailEnabled: cast.Ptr(true), - MailerSecureEmailChangeEnabled: cast.Ptr(true), - MailerAutoconfirm: cast.Ptr(false), - MailerOtpLength: cast.Ptr(6), + ExternalEmailEnabled: nullable.NewNullableWithValue(true), + MailerSecureEmailChangeEnabled: nullable.NewNullableWithValue(true), + MailerAutoconfirm: nullable.NewNullableWithValue(false), + MailerOtpLength: nullable.NewNullableWithValue(6), MailerOtpExp: 3600, - SecurityUpdatePasswordRequireReauthentication: cast.Ptr(true), - SmtpHost: cast.Ptr("smtp.sendgrid.net"), - SmtpPort: cast.Ptr("587"), - SmtpUser: cast.Ptr("apikey"), - SmtpPass: cast.Ptr("ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e"), - SmtpAdminEmail: cast.Ptr("admin@email.com"), - SmtpSenderName: cast.Ptr("Admin"), - SmtpMaxFrequency: cast.Ptr(1), + SecurityUpdatePasswordRequireReauthentication: nullable.NewNullableWithValue(true), + SmtpHost: nullable.NewNullableWithValue("smtp.sendgrid.net"), + SmtpPort: nullable.NewNullableWithValue("587"), + SmtpUser: nullable.NewNullableWithValue("apikey"), + SmtpPass: nullable.NewNullableWithValue("ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e"), + SmtpAdminEmail: nullable.NewNullableWithValue("admin@email.com"), + SmtpSenderName: nullable.NewNullableWithValue("Admin"), + SmtpMaxFrequency: nullable.NewNullableWithValue(1), // Custom templates - MailerSubjectsInvite: cast.Ptr("invite-subject"), - MailerTemplatesInviteContent: cast.Ptr("invite-content"), - MailerSubjectsConfirmation: cast.Ptr("confirmation-subject"), - MailerTemplatesConfirmationContent: cast.Ptr("confirmation-content"), - MailerSubjectsRecovery: cast.Ptr("recovery-subject"), - MailerTemplatesRecoveryContent: cast.Ptr("recovery-content"), - MailerSubjectsMagicLink: cast.Ptr("magic-link-subject"), - MailerTemplatesMagicLinkContent: cast.Ptr("magic-link-content"), - MailerSubjectsEmailChange: cast.Ptr("email-change-subject"), - MailerTemplatesEmailChangeContent: cast.Ptr("email-change-content"), - MailerSubjectsReauthentication: cast.Ptr("reauthentication-subject"), - MailerTemplatesReauthenticationContent: cast.Ptr("reauthentication-content"), + MailerSubjectsInvite: nullable.NewNullableWithValue("invite-subject"), + MailerTemplatesInviteContent: nullable.NewNullableWithValue("invite-content"), + MailerSubjectsConfirmation: nullable.NewNullableWithValue("confirmation-subject"), + MailerTemplatesConfirmationContent: nullable.NewNullableWithValue("confirmation-content"), + MailerSubjectsRecovery: nullable.NewNullableWithValue("recovery-subject"), + MailerTemplatesRecoveryContent: nullable.NewNullableWithValue("recovery-content"), + MailerSubjectsMagicLink: nullable.NewNullableWithValue("magic-link-subject"), + MailerTemplatesMagicLinkContent: nullable.NewNullableWithValue("magic-link-content"), + MailerSubjectsEmailChange: nullable.NewNullableWithValue("email-change-subject"), + MailerTemplatesEmailChangeContent: nullable.NewNullableWithValue("email-change-content"), + MailerSubjectsReauthentication: nullable.NewNullableWithValue("reauthentication-subject"), + MailerTemplatesReauthenticationContent: nullable.NewNullableWithValue("reauthentication-content"), }) // Check error assert.NoError(t, err) @@ -620,18 +621,18 @@ func TestEmailDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalEmailEnabled: cast.Ptr(false), - MailerSecureEmailChangeEnabled: cast.Ptr(false), - MailerAutoconfirm: cast.Ptr(true), - MailerOtpLength: cast.Ptr(6), + ExternalEmailEnabled: nullable.NewNullableWithValue(false), + MailerSecureEmailChangeEnabled: nullable.NewNullableWithValue(false), + MailerAutoconfirm: nullable.NewNullableWithValue(true), + MailerOtpLength: nullable.NewNullableWithValue(6), MailerOtpExp: 3600, - SecurityUpdatePasswordRequireReauthentication: cast.Ptr(false), - SmtpMaxFrequency: cast.Ptr(60), + SecurityUpdatePasswordRequireReauthentication: nullable.NewNullableWithValue(false), + SmtpMaxFrequency: nullable.NewNullableWithValue(60), // Custom templates - MailerTemplatesConfirmationContent: cast.Ptr("confirmation-content"), - MailerSubjectsRecovery: cast.Ptr("recovery-subject"), - MailerSubjectsMagicLink: cast.Ptr("magic-link-subject"), - MailerTemplatesEmailChangeContent: cast.Ptr("email-change-content"), + MailerTemplatesConfirmationContent: nullable.NewNullableWithValue("confirmation-content"), + MailerSubjectsRecovery: nullable.NewNullableWithValue("recovery-subject"), + MailerSubjectsMagicLink: nullable.NewNullableWithValue("magic-link-subject"), + MailerTemplatesEmailChangeContent: nullable.NewNullableWithValue("email-change-content"), }) // Check error assert.NoError(t, err) @@ -656,32 +657,32 @@ func TestEmailDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalEmailEnabled: cast.Ptr(true), - MailerSecureEmailChangeEnabled: cast.Ptr(true), - MailerAutoconfirm: cast.Ptr(false), - MailerOtpLength: cast.Ptr(6), + ExternalEmailEnabled: nullable.NewNullableWithValue(true), + MailerSecureEmailChangeEnabled: nullable.NewNullableWithValue(true), + MailerAutoconfirm: nullable.NewNullableWithValue(false), + MailerOtpLength: nullable.NewNullableWithValue(6), MailerOtpExp: 3600, - SecurityUpdatePasswordRequireReauthentication: cast.Ptr(true), - SmtpHost: cast.Ptr("smtp.sendgrid.net"), - SmtpPort: cast.Ptr("587"), - SmtpUser: cast.Ptr("apikey"), - SmtpPass: cast.Ptr("ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e"), - SmtpAdminEmail: cast.Ptr("admin@email.com"), - SmtpSenderName: cast.Ptr("Admin"), - SmtpMaxFrequency: cast.Ptr(1), + SecurityUpdatePasswordRequireReauthentication: nullable.NewNullableWithValue(true), + SmtpHost: nullable.NewNullableWithValue("smtp.sendgrid.net"), + SmtpPort: nullable.NewNullableWithValue("587"), + SmtpUser: nullable.NewNullableWithValue("apikey"), + SmtpPass: nullable.NewNullableWithValue("ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e"), + SmtpAdminEmail: nullable.NewNullableWithValue("admin@email.com"), + SmtpSenderName: nullable.NewNullableWithValue("Admin"), + SmtpMaxFrequency: nullable.NewNullableWithValue(1), // Custom templates - MailerSubjectsInvite: cast.Ptr("invite-subject"), - MailerTemplatesInviteContent: cast.Ptr("invite-content"), - MailerSubjectsConfirmation: cast.Ptr("confirmation-subject"), - MailerTemplatesConfirmationContent: cast.Ptr("confirmation-content"), - MailerSubjectsRecovery: cast.Ptr("recovery-subject"), - MailerTemplatesRecoveryContent: cast.Ptr("recovery-content"), - MailerSubjectsMagicLink: cast.Ptr("magic-link-subject"), - MailerTemplatesMagicLinkContent: cast.Ptr("magic-link-content"), - MailerSubjectsEmailChange: cast.Ptr("email-change-subject"), - MailerTemplatesEmailChangeContent: cast.Ptr("email-change-content"), - MailerSubjectsReauthentication: cast.Ptr("reauthentication-subject"), - MailerTemplatesReauthenticationContent: cast.Ptr("reauthentication-content"), + MailerSubjectsInvite: nullable.NewNullableWithValue("invite-subject"), + MailerTemplatesInviteContent: nullable.NewNullableWithValue("invite-content"), + MailerSubjectsConfirmation: nullable.NewNullableWithValue("confirmation-subject"), + MailerTemplatesConfirmationContent: nullable.NewNullableWithValue("confirmation-content"), + MailerSubjectsRecovery: nullable.NewNullableWithValue("recovery-subject"), + MailerTemplatesRecoveryContent: nullable.NewNullableWithValue("recovery-content"), + MailerSubjectsMagicLink: nullable.NewNullableWithValue("magic-link-subject"), + MailerTemplatesMagicLinkContent: nullable.NewNullableWithValue("magic-link-content"), + MailerSubjectsEmailChange: nullable.NewNullableWithValue("email-change-subject"), + MailerTemplatesEmailChangeContent: nullable.NewNullableWithValue("email-change-content"), + MailerSubjectsReauthentication: nullable.NewNullableWithValue("reauthentication-subject"), + MailerTemplatesReauthenticationContent: nullable.NewNullableWithValue("reauthentication-content"), }) // Check error assert.NoError(t, err) @@ -718,13 +719,13 @@ func TestEmailDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalEmailEnabled: cast.Ptr(false), - MailerSecureEmailChangeEnabled: cast.Ptr(false), - MailerAutoconfirm: cast.Ptr(true), - MailerOtpLength: cast.Ptr(6), + ExternalEmailEnabled: nullable.NewNullableWithValue(false), + MailerSecureEmailChangeEnabled: nullable.NewNullableWithValue(false), + MailerAutoconfirm: nullable.NewNullableWithValue(true), + MailerOtpLength: nullable.NewNullableWithValue(6), MailerOtpExp: 3600, - SecurityUpdatePasswordRequireReauthentication: cast.Ptr(false), - SmtpMaxFrequency: cast.Ptr(60), + SecurityUpdatePasswordRequireReauthentication: nullable.NewNullableWithValue(false), + SmtpMaxFrequency: nullable.NewNullableWithValue(60), }) // Check error assert.NoError(t, err) @@ -753,30 +754,30 @@ func TestSmsDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalPhoneEnabled: cast.Ptr(true), - SmsAutoconfirm: cast.Ptr(true), - SmsMaxFrequency: cast.Ptr(60), - SmsOtpExp: cast.Ptr(3600), + ExternalPhoneEnabled: nullable.NewNullableWithValue(true), + SmsAutoconfirm: nullable.NewNullableWithValue(true), + SmsMaxFrequency: nullable.NewNullableWithValue(60), + SmsOtpExp: nullable.NewNullableWithValue(3600), SmsOtpLength: 6, - SmsProvider: cast.Ptr("twilio"), - SmsTemplate: cast.Ptr("Your code is {{ .Code }}"), - SmsTestOtp: cast.Ptr("123=456"), - SmsTestOtpValidUntil: cast.Ptr("2050-01-01T01:00:00Z"), - SmsTwilioAccountSid: cast.Ptr("test-account"), - SmsTwilioAuthToken: cast.Ptr("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), - SmsTwilioContentSid: cast.Ptr("test-content"), - SmsTwilioMessageServiceSid: cast.Ptr("test-service"), + SmsProvider: nullable.NewNullableWithValue("twilio"), + SmsTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), + SmsTestOtp: nullable.NewNullableWithValue("123=456"), + SmsTestOtpValidUntil: nullable.NewNullableWithValue("2050-01-01T01:00:00Z"), + SmsTwilioAccountSid: nullable.NewNullableWithValue("test-account"), + SmsTwilioAuthToken: nullable.NewNullableWithValue("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), + SmsTwilioContentSid: nullable.NewNullableWithValue("test-content"), + SmsTwilioMessageServiceSid: nullable.NewNullableWithValue("test-service"), // Extra configs returned from api can be ignored - SmsMessagebirdAccessKey: cast.Ptr("test-messagebird-key"), - SmsMessagebirdOriginator: cast.Ptr("test-messagebird-originator"), - SmsTextlocalApiKey: cast.Ptr("test-textlocal-key"), - SmsTextlocalSender: cast.Ptr("test-textlocal-sencer"), - SmsTwilioVerifyAccountSid: cast.Ptr("test-verify-account"), - SmsTwilioVerifyAuthToken: cast.Ptr("test-verify-token"), - SmsTwilioVerifyMessageServiceSid: cast.Ptr("test-verify-service"), - SmsVonageApiKey: cast.Ptr("test-vonage-key"), - SmsVonageApiSecret: cast.Ptr("test-vonage-secret"), - SmsVonageFrom: cast.Ptr("test-vonage-from"), + SmsMessagebirdAccessKey: nullable.NewNullableWithValue("test-messagebird-key"), + SmsMessagebirdOriginator: nullable.NewNullableWithValue("test-messagebird-originator"), + SmsTextlocalApiKey: nullable.NewNullableWithValue("test-textlocal-key"), + SmsTextlocalSender: nullable.NewNullableWithValue("test-textlocal-sencer"), + SmsTwilioVerifyAccountSid: nullable.NewNullableWithValue("test-verify-account"), + SmsTwilioVerifyAuthToken: nullable.NewNullableWithValue("test-verify-token"), + SmsTwilioVerifyMessageServiceSid: nullable.NewNullableWithValue("test-verify-service"), + SmsVonageApiKey: nullable.NewNullableWithValue("test-vonage-key"), + SmsVonageApiSecret: nullable.NewNullableWithValue("test-vonage-secret"), + SmsVonageFrom: nullable.NewNullableWithValue("test-vonage-from"), }) // Check error assert.NoError(t, err) @@ -787,19 +788,19 @@ func TestSmsDiff(t *testing.T) { c := newWithDefaults() // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalPhoneEnabled: cast.Ptr(true), - SmsAutoconfirm: cast.Ptr(true), - SmsMaxFrequency: cast.Ptr(60), - SmsOtpExp: cast.Ptr(3600), + ExternalPhoneEnabled: nullable.NewNullableWithValue(true), + SmsAutoconfirm: nullable.NewNullableWithValue(true), + SmsMaxFrequency: nullable.NewNullableWithValue(60), + SmsOtpExp: nullable.NewNullableWithValue(3600), SmsOtpLength: 6, - SmsProvider: cast.Ptr("twilio"), - SmsTemplate: cast.Ptr("Your code is {{ .Code }}"), - SmsTestOtp: cast.Ptr("123=456,456=123"), - SmsTestOtpValidUntil: cast.Ptr("2050-01-01T01:00:00Z"), - SmsTwilioAccountSid: cast.Ptr("test-account"), - SmsTwilioAuthToken: cast.Ptr("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), - SmsTwilioContentSid: cast.Ptr("test-content"), - SmsTwilioMessageServiceSid: cast.Ptr("test-service"), + SmsProvider: nullable.NewNullableWithValue("twilio"), + SmsTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), + SmsTestOtp: nullable.NewNullableWithValue("123=456,456=123"), + SmsTestOtpValidUntil: nullable.NewNullableWithValue("2050-01-01T01:00:00Z"), + SmsTwilioAccountSid: nullable.NewNullableWithValue("test-account"), + SmsTwilioAuthToken: nullable.NewNullableWithValue("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), + SmsTwilioContentSid: nullable.NewNullableWithValue("test-content"), + SmsTwilioMessageServiceSid: nullable.NewNullableWithValue("test-service"), }) // Check error assert.NoError(t, err) @@ -825,17 +826,17 @@ func TestSmsDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalPhoneEnabled: cast.Ptr(false), - SmsAutoconfirm: cast.Ptr(false), - SmsMaxFrequency: cast.Ptr(0), - SmsOtpExp: cast.Ptr(3600), + ExternalPhoneEnabled: nullable.NewNullableWithValue(false), + SmsAutoconfirm: nullable.NewNullableWithValue(false), + SmsMaxFrequency: nullable.NewNullableWithValue(0), + SmsOtpExp: nullable.NewNullableWithValue(3600), SmsOtpLength: 6, - SmsProvider: cast.Ptr("twilio"), - SmsTemplate: cast.Ptr(""), - SmsTwilioAccountSid: cast.Ptr("test-account"), - SmsTwilioAuthToken: cast.Ptr("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), - SmsTwilioContentSid: cast.Ptr("test-content"), - SmsTwilioMessageServiceSid: cast.Ptr("test-service"), + SmsProvider: nullable.NewNullableWithValue("twilio"), + SmsTemplate: nullable.NewNullableWithValue(""), + SmsTwilioAccountSid: nullable.NewNullableWithValue("test-account"), + SmsTwilioAuthToken: nullable.NewNullableWithValue("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), + SmsTwilioContentSid: nullable.NewNullableWithValue("test-content"), + SmsTwilioMessageServiceSid: nullable.NewNullableWithValue("test-service"), }) // Check error assert.NoError(t, err) @@ -853,17 +854,17 @@ func TestSmsDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalPhoneEnabled: cast.Ptr(false), - SmsAutoconfirm: cast.Ptr(true), - SmsMaxFrequency: cast.Ptr(60), - SmsOtpExp: cast.Ptr(3600), + ExternalPhoneEnabled: nullable.NewNullableWithValue(false), + SmsAutoconfirm: nullable.NewNullableWithValue(true), + SmsMaxFrequency: nullable.NewNullableWithValue(60), + SmsOtpExp: nullable.NewNullableWithValue(3600), SmsOtpLength: 6, - SmsTemplate: cast.Ptr("Your code is {{ .Code }}"), - SmsTestOtp: cast.Ptr("123=456"), - SmsTestOtpValidUntil: cast.Ptr("2050-01-01T01:00:00Z"), - SmsProvider: cast.Ptr("messagebird"), - SmsMessagebirdAccessKey: cast.Ptr("test-messagebird-key"), - SmsMessagebirdOriginator: cast.Ptr("test-messagebird-originator"), + SmsTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), + SmsTestOtp: nullable.NewNullableWithValue("123=456"), + SmsTestOtpValidUntil: nullable.NewNullableWithValue("2050-01-01T01:00:00Z"), + SmsProvider: nullable.NewNullableWithValue("messagebird"), + SmsMessagebirdAccessKey: nullable.NewNullableWithValue("test-messagebird-key"), + SmsMessagebirdOriginator: nullable.NewNullableWithValue("test-messagebird-originator"), }) // Check error assert.NoError(t, err) @@ -877,8 +878,8 @@ func TestSmsDiff(t *testing.T) { c.Sms.EnableSignup = true // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalPhoneEnabled: cast.Ptr(false), - SmsProvider: cast.Ptr("twilio"), + ExternalPhoneEnabled: nullable.NewNullableWithValue(false), + SmsProvider: nullable.NewNullableWithValue("twilio"), }) // Check error assert.NoError(t, err) @@ -890,9 +891,9 @@ func TestSmsDiff(t *testing.T) { c.Sms.Messagebird.Enabled = true // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalPhoneEnabled: cast.Ptr(false), - SmsProvider: cast.Ptr("messagebird"), - SmsMessagebirdAccessKey: cast.Ptr(""), + ExternalPhoneEnabled: nullable.NewNullableWithValue(false), + SmsProvider: nullable.NewNullableWithValue("messagebird"), + SmsMessagebirdAccessKey: nullable.NewNullableWithValue(""), }) // Check error assert.NoError(t, err) @@ -926,74 +927,74 @@ func TestExternalDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalAppleAdditionalClientIds: cast.Ptr(""), - ExternalAppleClientId: cast.Ptr(""), - ExternalAppleEnabled: cast.Ptr(true), - ExternalAppleSecret: cast.Ptr(""), - ExternalAzureClientId: cast.Ptr(""), - ExternalAzureEnabled: cast.Ptr(true), - ExternalAzureSecret: cast.Ptr(""), - ExternalAzureUrl: cast.Ptr(""), - ExternalBitbucketClientId: cast.Ptr(""), - ExternalBitbucketEnabled: cast.Ptr(true), - ExternalBitbucketSecret: cast.Ptr(""), - ExternalDiscordClientId: cast.Ptr(""), - ExternalDiscordEnabled: cast.Ptr(true), - ExternalDiscordSecret: cast.Ptr(""), - ExternalFacebookClientId: cast.Ptr(""), - ExternalFacebookEnabled: cast.Ptr(true), - ExternalFacebookSecret: cast.Ptr(""), - ExternalFigmaClientId: cast.Ptr(""), - ExternalFigmaEnabled: cast.Ptr(true), - ExternalFigmaSecret: cast.Ptr(""), - ExternalGithubClientId: cast.Ptr(""), - ExternalGithubEnabled: cast.Ptr(true), - ExternalGithubSecret: cast.Ptr(""), - ExternalGitlabClientId: cast.Ptr(""), - ExternalGitlabEnabled: cast.Ptr(true), - ExternalGitlabSecret: cast.Ptr(""), - ExternalGitlabUrl: cast.Ptr(""), - ExternalGoogleAdditionalClientIds: cast.Ptr(""), - ExternalGoogleClientId: cast.Ptr(""), - ExternalGoogleEnabled: cast.Ptr(true), - ExternalGoogleSecret: cast.Ptr(""), - ExternalGoogleSkipNonceCheck: cast.Ptr(false), - ExternalKakaoClientId: cast.Ptr(""), - ExternalKakaoEnabled: cast.Ptr(true), - ExternalKakaoSecret: cast.Ptr(""), - ExternalKeycloakClientId: cast.Ptr(""), - ExternalKeycloakEnabled: cast.Ptr(true), - ExternalKeycloakSecret: cast.Ptr(""), - ExternalKeycloakUrl: cast.Ptr(""), - ExternalLinkedinOidcClientId: cast.Ptr(""), - ExternalLinkedinOidcEnabled: cast.Ptr(true), - ExternalLinkedinOidcSecret: cast.Ptr(""), - ExternalNotionClientId: cast.Ptr(""), - ExternalNotionEnabled: cast.Ptr(true), - ExternalNotionSecret: cast.Ptr(""), - ExternalSlackOidcClientId: cast.Ptr(""), - ExternalSlackOidcEnabled: cast.Ptr(true), - ExternalSlackOidcSecret: cast.Ptr(""), - ExternalSpotifyClientId: cast.Ptr(""), - ExternalSpotifyEnabled: cast.Ptr(true), - ExternalSpotifySecret: cast.Ptr(""), - ExternalTwitchClientId: cast.Ptr(""), - ExternalTwitchEnabled: cast.Ptr(true), - ExternalTwitchSecret: cast.Ptr(""), - ExternalTwitterClientId: cast.Ptr(""), - ExternalTwitterEnabled: cast.Ptr(true), - ExternalTwitterSecret: cast.Ptr(""), - ExternalWorkosClientId: cast.Ptr(""), - ExternalWorkosEnabled: cast.Ptr(true), - ExternalWorkosSecret: cast.Ptr(""), - ExternalWorkosUrl: cast.Ptr(""), - ExternalZoomClientId: cast.Ptr(""), - ExternalZoomEnabled: cast.Ptr(true), - ExternalZoomSecret: cast.Ptr(""), + ExternalAppleAdditionalClientIds: nullable.NewNullableWithValue(""), + ExternalAppleClientId: nullable.NewNullableWithValue(""), + ExternalAppleEnabled: nullable.NewNullableWithValue(true), + ExternalAppleSecret: nullable.NewNullableWithValue(""), + ExternalAzureClientId: nullable.NewNullableWithValue(""), + ExternalAzureEnabled: nullable.NewNullableWithValue(true), + ExternalAzureSecret: nullable.NewNullableWithValue(""), + ExternalAzureUrl: nullable.NewNullableWithValue(""), + ExternalBitbucketClientId: nullable.NewNullableWithValue(""), + ExternalBitbucketEnabled: nullable.NewNullableWithValue(true), + ExternalBitbucketSecret: nullable.NewNullableWithValue(""), + ExternalDiscordClientId: nullable.NewNullableWithValue(""), + ExternalDiscordEnabled: nullable.NewNullableWithValue(true), + ExternalDiscordSecret: nullable.NewNullableWithValue(""), + ExternalFacebookClientId: nullable.NewNullableWithValue(""), + ExternalFacebookEnabled: nullable.NewNullableWithValue(true), + ExternalFacebookSecret: nullable.NewNullableWithValue(""), + ExternalFigmaClientId: nullable.NewNullableWithValue(""), + ExternalFigmaEnabled: nullable.NewNullableWithValue(true), + ExternalFigmaSecret: nullable.NewNullableWithValue(""), + ExternalGithubClientId: nullable.NewNullableWithValue(""), + ExternalGithubEnabled: nullable.NewNullableWithValue(true), + ExternalGithubSecret: nullable.NewNullableWithValue(""), + ExternalGitlabClientId: nullable.NewNullableWithValue(""), + ExternalGitlabEnabled: nullable.NewNullableWithValue(true), + ExternalGitlabSecret: nullable.NewNullableWithValue(""), + ExternalGitlabUrl: nullable.NewNullableWithValue(""), + ExternalGoogleAdditionalClientIds: nullable.NewNullableWithValue(""), + ExternalGoogleClientId: nullable.NewNullableWithValue(""), + ExternalGoogleEnabled: nullable.NewNullableWithValue(true), + ExternalGoogleSecret: nullable.NewNullableWithValue(""), + ExternalGoogleSkipNonceCheck: nullable.NewNullableWithValue(false), + ExternalKakaoClientId: nullable.NewNullableWithValue(""), + ExternalKakaoEnabled: nullable.NewNullableWithValue(true), + ExternalKakaoSecret: nullable.NewNullableWithValue(""), + ExternalKeycloakClientId: nullable.NewNullableWithValue(""), + ExternalKeycloakEnabled: nullable.NewNullableWithValue(true), + ExternalKeycloakSecret: nullable.NewNullableWithValue(""), + ExternalKeycloakUrl: nullable.NewNullableWithValue(""), + ExternalLinkedinOidcClientId: nullable.NewNullableWithValue(""), + ExternalLinkedinOidcEnabled: nullable.NewNullableWithValue(true), + ExternalLinkedinOidcSecret: nullable.NewNullableWithValue(""), + ExternalNotionClientId: nullable.NewNullableWithValue(""), + ExternalNotionEnabled: nullable.NewNullableWithValue(true), + ExternalNotionSecret: nullable.NewNullableWithValue(""), + ExternalSlackOidcClientId: nullable.NewNullableWithValue(""), + ExternalSlackOidcEnabled: nullable.NewNullableWithValue(true), + ExternalSlackOidcSecret: nullable.NewNullableWithValue(""), + ExternalSpotifyClientId: nullable.NewNullableWithValue(""), + ExternalSpotifyEnabled: nullable.NewNullableWithValue(true), + ExternalSpotifySecret: nullable.NewNullableWithValue(""), + ExternalTwitchClientId: nullable.NewNullableWithValue(""), + ExternalTwitchEnabled: nullable.NewNullableWithValue(true), + ExternalTwitchSecret: nullable.NewNullableWithValue(""), + ExternalTwitterClientId: nullable.NewNullableWithValue(""), + ExternalTwitterEnabled: nullable.NewNullableWithValue(true), + ExternalTwitterSecret: nullable.NewNullableWithValue(""), + ExternalWorkosClientId: nullable.NewNullableWithValue(""), + ExternalWorkosEnabled: nullable.NewNullableWithValue(true), + ExternalWorkosSecret: nullable.NewNullableWithValue(""), + ExternalWorkosUrl: nullable.NewNullableWithValue(""), + ExternalZoomClientId: nullable.NewNullableWithValue(""), + ExternalZoomEnabled: nullable.NewNullableWithValue(true), + ExternalZoomSecret: nullable.NewNullableWithValue(""), // Deprecated fields should be ignored - ExternalSlackClientId: cast.Ptr(""), - ExternalSlackEnabled: cast.Ptr(true), - ExternalSlackSecret: cast.Ptr(""), + ExternalSlackClientId: nullable.NewNullableWithValue(""), + ExternalSlackEnabled: nullable.NewNullableWithValue(true), + ExternalSlackSecret: nullable.NewNullableWithValue(""), }) // Check error assert.NoError(t, err) @@ -1044,18 +1045,18 @@ func TestExternalDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalAppleAdditionalClientIds: cast.Ptr("test-client-2"), - ExternalAppleClientId: cast.Ptr("test-client-1"), - ExternalAppleEnabled: cast.Ptr(false), - ExternalAppleSecret: cast.Ptr("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), - ExternalGoogleAdditionalClientIds: cast.Ptr("test-client-2"), - ExternalGoogleClientId: cast.Ptr("test-client-1"), - 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"), + ExternalAppleAdditionalClientIds: nullable.NewNullableWithValue("test-client-2"), + ExternalAppleClientId: nullable.NewNullableWithValue("test-client-1"), + ExternalAppleEnabled: nullable.NewNullableWithValue(false), + ExternalAppleSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), + ExternalGoogleAdditionalClientIds: nullable.NewNullableWithValue("test-client-2"), + ExternalGoogleClientId: nullable.NewNullableWithValue("test-client-1"), + ExternalGoogleEnabled: nullable.NewNullableWithValue(true), + ExternalGoogleSecret: nullable.NewNullableWithValue("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), + ExternalGoogleSkipNonceCheck: nullable.NewNullableWithValue(true), + ExternalKakaoClientId: nullable.NewNullableWithValue("test-client-2"), + ExternalKakaoEnabled: nullable.NewNullableWithValue(true), + ExternalKakaoSecret: nullable.NewNullableWithValue("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad"), }) // Check error assert.NoError(t, err) @@ -1087,28 +1088,28 @@ func TestExternalDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - ExternalAppleEnabled: cast.Ptr(false), - ExternalAzureEnabled: cast.Ptr(false), - ExternalBitbucketEnabled: cast.Ptr(false), - ExternalDiscordEnabled: cast.Ptr(false), - ExternalFacebookEnabled: cast.Ptr(false), - ExternalFigmaEnabled: cast.Ptr(false), - ExternalGithubEnabled: cast.Ptr(false), - ExternalGitlabEnabled: cast.Ptr(false), - ExternalGoogleEnabled: cast.Ptr(false), - ExternalGoogleSkipNonceCheck: cast.Ptr(false), - ExternalKakaoEnabled: cast.Ptr(false), - ExternalKeycloakEnabled: cast.Ptr(false), - ExternalLinkedinOidcEnabled: cast.Ptr(false), - ExternalNotionEnabled: cast.Ptr(false), - ExternalSlackOidcEnabled: cast.Ptr(false), - ExternalSpotifyEnabled: cast.Ptr(false), - ExternalTwitchEnabled: cast.Ptr(false), - ExternalTwitterEnabled: cast.Ptr(false), - ExternalWorkosEnabled: cast.Ptr(false), - ExternalZoomEnabled: cast.Ptr(false), + ExternalAppleEnabled: nullable.NewNullableWithValue(false), + ExternalAzureEnabled: nullable.NewNullableWithValue(false), + ExternalBitbucketEnabled: nullable.NewNullableWithValue(false), + ExternalDiscordEnabled: nullable.NewNullableWithValue(false), + ExternalFacebookEnabled: nullable.NewNullableWithValue(false), + ExternalFigmaEnabled: nullable.NewNullableWithValue(false), + ExternalGithubEnabled: nullable.NewNullableWithValue(false), + ExternalGitlabEnabled: nullable.NewNullableWithValue(false), + ExternalGoogleEnabled: nullable.NewNullableWithValue(false), + ExternalGoogleSkipNonceCheck: nullable.NewNullableWithValue(false), + ExternalKakaoEnabled: nullable.NewNullableWithValue(false), + ExternalKeycloakEnabled: nullable.NewNullableWithValue(false), + ExternalLinkedinOidcEnabled: nullable.NewNullableWithValue(false), + ExternalNotionEnabled: nullable.NewNullableWithValue(false), + ExternalSlackOidcEnabled: nullable.NewNullableWithValue(false), + ExternalSpotifyEnabled: nullable.NewNullableWithValue(false), + ExternalTwitchEnabled: nullable.NewNullableWithValue(false), + ExternalTwitterEnabled: nullable.NewNullableWithValue(false), + ExternalWorkosEnabled: nullable.NewNullableWithValue(false), + ExternalZoomEnabled: nullable.NewNullableWithValue(false), // Deprecated fields should be ignored - ExternalSlackEnabled: cast.Ptr(false), + ExternalSlackEnabled: nullable.NewNullableWithValue(false), }) // Check error assert.NoError(t, err) @@ -1129,13 +1130,13 @@ func TestRateLimitsDiff(t *testing.T) { c.Email.Smtp = &smtp{Enabled: true} // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - RateLimitAnonymousUsers: cast.Ptr(20), - RateLimitTokenRefresh: cast.Ptr(30), - RateLimitOtp: cast.Ptr(40), - RateLimitVerify: cast.Ptr(50), - RateLimitEmailSent: cast.Ptr(25), - RateLimitSmsSent: cast.Ptr(35), - SmtpHost: cast.Ptr(""), + RateLimitAnonymousUsers: nullable.NewNullableWithValue(20), + RateLimitTokenRefresh: nullable.NewNullableWithValue(30), + RateLimitOtp: nullable.NewNullableWithValue(40), + RateLimitVerify: nullable.NewNullableWithValue(50), + RateLimitEmailSent: nullable.NewNullableWithValue(25), + RateLimitSmsSent: nullable.NewNullableWithValue(35), + SmtpHost: nullable.NewNullableWithValue(""), }) // Check error assert.NoError(t, err) @@ -1154,13 +1155,13 @@ func TestRateLimitsDiff(t *testing.T) { c.Email.Smtp = &smtp{Enabled: true} // Run test with different remote values diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - RateLimitAnonymousUsers: cast.Ptr(10), // Different value - RateLimitTokenRefresh: cast.Ptr(30), - RateLimitOtp: cast.Ptr(45), // Different value - RateLimitVerify: cast.Ptr(50), - RateLimitEmailSent: cast.Ptr(15), // Different value - RateLimitSmsSent: cast.Ptr(55), // Different value - SmtpHost: cast.Ptr(""), + RateLimitAnonymousUsers: nullable.NewNullableWithValue(10), // Different value + RateLimitTokenRefresh: nullable.NewNullableWithValue(30), + RateLimitOtp: nullable.NewNullableWithValue(45), // Different value + RateLimitVerify: nullable.NewNullableWithValue(50), + RateLimitEmailSent: nullable.NewNullableWithValue(15), // Different value + RateLimitSmsSent: nullable.NewNullableWithValue(55), // Different value + SmtpHost: nullable.NewNullableWithValue(""), }) // Check error assert.NoError(t, err) @@ -1174,8 +1175,8 @@ func TestRateLimitsDiff(t *testing.T) { c.RateLimit.EmailSent = 25 // Run test with remote rate limits diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ - RateLimitEmailSent: cast.Ptr(15), - SmtpHost: cast.Ptr(""), + RateLimitEmailSent: nullable.NewNullableWithValue(15), + SmtpHost: nullable.NewNullableWithValue(""), }) // Check error assert.NoError(t, err) diff --git a/pkg/config/updater_test.go b/pkg/config/updater_test.go index db51a2dbd..bad62f4dd 100644 --- a/pkg/config/updater_test.go +++ b/pkg/config/updater_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/h2non/gock" + "github.com/oapi-codegen/nullable" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" v1API "github.com/supabase/cli/pkg/api" @@ -168,7 +169,7 @@ func TestUpdateAuthConfig(t *testing.T) { Get("/v1/projects/test-project/config/auth"). Reply(http.StatusOK). JSON(v1API.AuthConfigResponse{ - SiteUrl: cast.Ptr("http://localhost:3000"), + SiteUrl: nullable.NewNullableWithValue("http://localhost:3000"), }) gock.New(server). Patch("/v1/projects/test-project/config/auth"). From b2ac6585fcbd44520abfc9fe35f7bc202e436784 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Thu, 29 May 2025 18:44:13 +0800 Subject: [PATCH 152/359] fix: account for nullable auth config types --- pkg/config/auth.go | 72 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 1aeb2029a..3e0cf2364 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -570,55 +570,103 @@ func (e *email) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { } if t, ok := e.Template["invite"]; ok { if t.Subject != nil { - t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsInvite, "")) + if value, err := remoteConfig.MailerSubjectsInvite.Get(); err == nil { + t.Subject = &value + } else { + t.Subject = nil + } } if t.Content != nil { - t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesInviteContent, "")) + if value, err := remoteConfig.MailerTemplatesInviteContent.Get(); err == nil { + t.Content = &value + } else { + t.Content = nil + } } e.Template["invite"] = t } if t, ok := e.Template["confirmation"]; ok { if t.Subject != nil { - t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsConfirmation, "")) + if value, err := remoteConfig.MailerSubjectsConfirmation.Get(); err == nil { + t.Subject = &value + } else { + t.Subject = nil + } } if t.Content != nil { - t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesConfirmationContent, "")) + if value, err := remoteConfig.MailerTemplatesConfirmationContent.Get(); err == nil { + t.Content = &value + } else { + t.Content = nil + } } e.Template["confirmation"] = t } if t, ok := e.Template["recovery"]; ok { if t.Subject != nil { - t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsRecovery, "")) + if value, err := remoteConfig.MailerSubjectsRecovery.Get(); err == nil { + t.Subject = &value + } else { + t.Subject = nil + } } if t.Content != nil { - t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesRecoveryContent, "")) + if value, err := remoteConfig.MailerTemplatesRecoveryContent.Get(); err == nil { + t.Content = &value + } else { + t.Content = nil + } } e.Template["recovery"] = t } if t, ok := e.Template["magic_link"]; ok { if t.Subject != nil { - t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsMagicLink, "")) + if value, err := remoteConfig.MailerSubjectsMagicLink.Get(); err == nil { + t.Subject = &value + } else { + t.Subject = nil + } } if t.Content != nil { - t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesMagicLinkContent, "")) + if value, err := remoteConfig.MailerTemplatesMagicLinkContent.Get(); err == nil { + t.Content = &value + } else { + t.Content = nil + } } e.Template["magic_link"] = t } if t, ok := e.Template["email_change"]; ok { if t.Subject != nil { - t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsEmailChange, "")) + if value, err := remoteConfig.MailerSubjectsEmailChange.Get(); err == nil { + t.Subject = &value + } else { + t.Subject = nil + } } if t.Content != nil { - t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesEmailChangeContent, "")) + if value, err := remoteConfig.MailerTemplatesEmailChangeContent.Get(); err == nil { + t.Content = &value + } else { + t.Content = nil + } } e.Template["email_change"] = t } if t, ok := e.Template["reauthentication"]; ok { if t.Subject != nil { - t.Subject = cast.Ptr(ValOrDefault(remoteConfig.MailerSubjectsReauthentication, "")) + if value, err := remoteConfig.MailerSubjectsReauthentication.Get(); err == nil { + t.Subject = &value + } else { + t.Subject = nil + } } if t.Content != nil { - t.Content = cast.Ptr(ValOrDefault(remoteConfig.MailerTemplatesReauthenticationContent, "")) + if value, err := remoteConfig.MailerTemplatesReauthenticationContent.Get(); err == nil { + t.Content = &value + } else { + t.Content = nil + } } e.Template["reauthentication"] = t } From 917b61a726fd05ac68709c151d98d91a6e9a5ffc Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Thu, 29 May 2025 15:16:01 +0200 Subject: [PATCH 153/359] feat: add web3 solana configs (#3605) --- internal/start/start.go | 2 ++ pkg/config/auth.go | 24 +++++++++++++++++++ pkg/config/templates/config.toml | 7 ++++++ .../local_disabled_remote_enabled.diff | 4 ++-- .../local_enabled_remote_disabled.diff | 4 ++-- .../local_disabled_remote_enabled.diff | 2 +- .../local_enabled_remote_disabled.diff | 2 +- .../local_enabled_and_disabled.diff | 6 ++--- .../local_disabled_remote_enabled.diff | 2 +- .../local_enabled_remote_disabled.diff | 2 +- .../local_enabled_and_disabled.diff | 2 +- .../local_and_remote_rate_limits_differ.diff | 2 +- .../enable_sign_up_without_provider.diff | 2 +- .../local_disabled_remote_enabled.diff | 8 +++---- .../local_enabled_remote_disabled.diff | 10 ++++---- pkg/config/testdata/config.toml | 7 ++++++ 16 files changed, 63 insertions(+), 23 deletions(-) diff --git a/internal/start/start.go b/internal/start/start.go index d97d72f56..da619fe13 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -505,6 +505,7 @@ EOF fmt.Sprintf("GOTRUE_RATE_LIMIT_OTP=%v", utils.Config.Auth.RateLimit.SignInSignUps), fmt.Sprintf("GOTRUE_RATE_LIMIT_VERIFY=%v", utils.Config.Auth.RateLimit.TokenVerifications), fmt.Sprintf("GOTRUE_RATE_LIMIT_SMS_SENT=%v", utils.Config.Auth.RateLimit.SmsSent), + fmt.Sprintf("GOTRUE_RATE_LIMIT_WEB3=%v", utils.Config.Auth.RateLimit.Web3), } if utils.Config.Auth.Email.Smtp != nil && utils.Config.Auth.Email.Smtp.Enabled { @@ -669,6 +670,7 @@ EOF env = append(env, fmt.Sprintf("GOTRUE_EXTERNAL_%s_URL=%s", strings.ToUpper(name), config.Url)) } } + env = append(env, fmt.Sprintf("GOTRUE_EXTERNAL_WEB3_SOLANA_ENABLED=%v", utils.Config.Auth.Web3.Solana.Enabled)) if _, err := utils.DockerStart( ctx, diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 3e0cf2364..f8c431309 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -92,6 +92,7 @@ type ( Email email `toml:"email"` Sms sms `toml:"sms"` External external `toml:"external"` + Web3 web3 `toml:"web3"` // Custom secrets can be injected from .env file JwtSecret Secret `toml:"jwt_secret"` @@ -117,6 +118,7 @@ type ( TokenVerifications uint `toml:"token_verifications"` EmailSent uint `toml:"email_sent"` SmsSent uint `toml:"sms_sent"` + Web3 uint `toml:"web3"` } tpaFirebase struct { @@ -265,6 +267,14 @@ type ( RedirectUri string `toml:"redirect_uri"` SkipNonceCheck bool `toml:"skip_nonce_check"` } + + solana struct { + Enabled bool `toml:"enabled"` + } + + web3 struct { + Solana solana `toml:"solana"` + } ) func (a *auth) ToUpdateAuthConfigBody() v1API.UpdateAuthConfigBody { @@ -295,6 +305,7 @@ func (a *auth) ToUpdateAuthConfigBody() v1API.UpdateAuthConfigBody { a.Email.toAuthConfigBody(&body) a.Sms.toAuthConfigBody(&body) a.External.toAuthConfigBody(&body) + a.Web3.toAuthConfigBody(&body) return body } @@ -321,6 +332,7 @@ func (a *auth) FromRemoteAuthConfig(remoteConfig v1API.AuthConfigResponse) { a.Email.fromAuthConfig(remoteConfig) a.Sms.fromAuthConfig(remoteConfig) a.External.fromAuthConfig(remoteConfig) + a.Web3.fromAuthConfig(remoteConfig) } func (r rateLimit) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { @@ -330,6 +342,7 @@ func (r rateLimit) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { body.RateLimitVerify = nullable.NewNullableWithValue(cast.UintToInt(r.TokenVerifications)) // Email rate limit is only updated when SMTP is enabled body.RateLimitSmsSent = nullable.NewNullableWithValue(cast.UintToInt(r.SmsSent)) + body.RateLimitWeb3 = nullable.NewNullableWithValue((cast.UintToInt(r.Web3))) } func (r *rateLimit) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { @@ -339,6 +352,7 @@ func (r *rateLimit) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { r.TokenVerifications = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitVerify, 0)) // Email rate limit is only updated when SMTP is enabled r.SmsSent = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitSmsSent, 0)) + r.Web3 = cast.IntToUint(ValOrDefault(remoteConfig.RateLimitWeb3, 0)) } func (c captcha) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { @@ -1198,6 +1212,16 @@ func (e external) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { } } +func (w web3) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { + body.ExternalWeb3SolanaEnabled = nullable.NewNullableWithValue(w.Solana.Enabled) +} + +func (w *web3) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { + if value, err := remoteConfig.ExternalWeb3SolanaEnabled.Get(); err == nil { + w.Solana.Enabled = value + } +} + func (a *auth) DiffWithRemote(remoteConfig v1API.AuthConfigResponse) ([]byte, error) { copy := a.Clone() // Convert the config values into easily comparable remoteConfig values diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index 9f48426aa..c8aa68ad1 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -140,6 +140,8 @@ token_refresh = 150 sign_in_sign_ups = 30 # Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address. token_verifications = 30 +# Number of Web3 logins that can be made in a 5 minute interval per IP address. +web3 = 30 # Configure one of the supported captcha providers: `hcaptcha`, `turnstile`. # [auth.captcha] @@ -252,6 +254,11 @@ url = "" # If enabled, the nonce check will be skipped. Required for local sign in with Google auth. skip_nonce_check = false +# Allow Solana wallet holders to sign in to your project via the Sign in with Solana (SIWS, EIP-4361) standard. +# You can configure "web3" rate limit in the [auth.rate_limit] section and set up [auth.captcha] if self-hosting. +[auth.web3.solana] +enabled = false + # Use Firebase Auth as a third-party provider alongside Supabase Auth. [auth.third_party.firebase] enabled = false diff --git a/pkg/config/testdata/TestCaptchaDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestCaptchaDiff/local_disabled_remote_enabled.diff index 33e424e85..87790083c 100644 --- a/pkg/config/testdata/TestCaptchaDiff/local_disabled_remote_enabled.diff +++ b/pkg/config/testdata/TestCaptchaDiff/local_disabled_remote_enabled.diff @@ -1,8 +1,8 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -22,7 +22,7 @@ - sms_sent = 0 +@@ -23,7 +23,7 @@ + web3 = 0 [captcha] -enabled = true diff --git a/pkg/config/testdata/TestCaptchaDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestCaptchaDiff/local_enabled_remote_disabled.diff index 9b8e0a2cc..2865d6d71 100644 --- a/pkg/config/testdata/TestCaptchaDiff/local_enabled_remote_disabled.diff +++ b/pkg/config/testdata/TestCaptchaDiff/local_enabled_remote_disabled.diff @@ -1,8 +1,8 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -22,9 +22,9 @@ - sms_sent = 0 +@@ -23,9 +23,9 @@ + web3 = 0 [captcha] -enabled = false diff --git a/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestEmailDiff/local_disabled_remote_enabled.diff index 9c65fd39e..42105313b 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] -@@ -43,13 +43,13 @@ +@@ -44,13 +44,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 aac657d91..536c34712 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] -@@ -43,36 +43,44 @@ +@@ -44,36 +44,44 @@ 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 e1c72aea2..5c885eeff 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] -@@ -83,7 +83,7 @@ +@@ -84,7 +84,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 = "" -@@ -90,9 +90,9 @@ +@@ -91,9 +91,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 -@@ -139,7 +139,7 @@ +@@ -140,7 +140,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 index 2f58f7348..459c58f42 100644 --- a/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff +++ b/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -23,19 +23,19 @@ +@@ -24,19 +24,19 @@ [hook] [hook.mfa_verification_attempt] diff --git a/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff index ca8d99e1e..6065f9d20 100644 --- a/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff +++ b/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -23,20 +23,20 @@ +@@ -24,20 +24,20 @@ [hook] [hook.mfa_verification_attempt] diff --git a/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff b/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff index 66918e27b..ae67613cb 100644 --- a/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff +++ b/pkg/config/testdata/TestMfaDiff/local_enabled_and_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -24,16 +24,16 @@ +@@ -25,16 +25,16 @@ [hook] [mfa] diff --git a/pkg/config/testdata/TestRateLimitsDiff/local_and_remote_rate_limits_differ.diff b/pkg/config/testdata/TestRateLimitsDiff/local_and_remote_rate_limits_differ.diff index 04a638630..26f0fe484 100644 --- a/pkg/config/testdata/TestRateLimitsDiff/local_and_remote_rate_limits_differ.diff +++ b/pkg/config/testdata/TestRateLimitsDiff/local_and_remote_rate_limits_differ.diff @@ -15,6 +15,6 @@ diff remote[auth] local[auth] -sms_sent = 55 +email_sent = 25 +sms_sent = 35 + web3 = 0 [hook] - 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 27c9d143d..66250c8c7 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] -@@ -52,7 +52,7 @@ +@@ -53,7 +53,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 6cf27da6e..a59f66f56 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] -@@ -52,12 +52,12 @@ +@@ -53,12 +53,12 @@ otp_expiry = 0 [sms] @@ -19,12 +19,12 @@ diff remote[auth] local[auth] account_sid = "" message_service_sid = "" auth_token = "" -@@ -80,8 +80,6 @@ +@@ -81,8 +81,6 @@ api_key = "" api_secret = "" [sms.test_otp] -123 = "456" -456 = "123" - [third_party] - [third_party.firebase] + [web3] + [web3.solana] diff --git a/pkg/config/testdata/TestSmsDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestSmsDiff/local_enabled_remote_disabled.diff index 3cbb49a40..0c5271719 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] -@@ -52,12 +52,12 @@ +@@ -53,12 +53,12 @@ otp_expiry = 0 [sms] @@ -19,7 +19,7 @@ diff remote[auth] local[auth] account_sid = "" message_service_sid = "" auth_token = "" -@@ -67,9 +67,9 @@ +@@ -68,9 +68,9 @@ message_service_sid = "" auth_token = "" [sms.messagebird] @@ -32,11 +32,11 @@ diff remote[auth] local[auth] [sms.textlocal] enabled = false sender = "" -@@ -80,6 +80,7 @@ +@@ -81,6 +81,7 @@ api_key = "" api_secret = "" [sms.test_otp] +123 = "456" - [third_party] - [third_party.firebase] + [web3] + [web3.solana] diff --git a/pkg/config/testdata/config.toml b/pkg/config/testdata/config.toml index aa0131ab1..98ad26ecf 100644 --- a/pkg/config/testdata/config.toml +++ b/pkg/config/testdata/config.toml @@ -140,6 +140,8 @@ token_refresh = 150 sign_in_sign_ups = 30 # Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address. token_verifications = 30 +# Number of Web3 logins that can be made in a 5 minute interval per IP address. +web3 = 30 # Configure one of the supported captcha providers: `hcaptcha`, `turnstile`. [auth.captcha] @@ -253,6 +255,11 @@ url = "https://login.microsoftonline.com/tenant" # If enabled, the nonce check will be skipped. Required for local sign in with Google auth. skip_nonce_check = true +# Allow Solana wallet holders to sign in to your project via the Sign in with Solana (SIWS, EIP-4361) standard. +# You can configure "web3" rate limit in the [auth.rate_limit] section and set up [auth.captcha] if self-hosting. +[auth.web3.solana] +enabled = true + [edge_runtime] enabled = true # Configure one of the supported request policies: `oneshot`, `per_worker`. From c11c59ccde142f81b5f40d53429e8d73eca395ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 05:22:13 +0000 Subject: [PATCH 154/359] chore(deps): bump supabase/postgres-meta from v0.89.2 to v0.89.3 in /pkg/config/templates (#3633) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.89.2 to v0.89.3. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.89.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e66facc3e..8ebf1e5d5 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.037 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.89.2 AS pgmeta +FROM supabase/postgres-meta:v0.89.3 AS pgmeta FROM supabase/studio:2025.05.26-sha-bd7334d AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From bc6387dc030405d11537baafc1af8341336f37d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 05:27:09 +0000 Subject: [PATCH 155/359] chore(deps): bump supabase/realtime from v2.36.0 to v2.36.5 in /pkg/config/templates (#3634) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.0 to v2.36.5. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 8ebf1e5d5..ddf5611e8 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue -FROM supabase/realtime:v2.36.0 AS realtime +FROM supabase/realtime:v2.36.5 AS realtime FROM supabase/storage-api:v1.23.0 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From 2d00291f73e64cb94f272de7567fd5431aa568f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 00:14:20 +0800 Subject: [PATCH 156/359] chore(deps): bump github.com/docker/cli from 28.1.1+incompatible to 28.2.1+incompatible (#3627) * chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.1.1+incompatible to 28.2.1+incompatible. - [Commits](https://github.com/docker/cli/compare/v28.1.1...v28.2.1) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-version: 28.2.1+incompatible dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: update deprecated reference --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han --- go.mod | 6 ++++-- go.sum | 12 ++++++++---- internal/db/reset/reset.go | 2 +- internal/db/start/start.go | 4 ++-- internal/utils/docker.go | 4 ++-- internal/utils/misc.go | 3 ++- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 8f47d1882..273e58729 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 github.com/containers/common v0.63.0 - github.com/docker/cli v28.1.1+incompatible - github.com/docker/docker v28.1.1+incompatible + github.com/docker/cli v28.2.2+incompatible + github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.11 @@ -109,6 +109,8 @@ require ( github.com/ckaznocha/intrange v0.3.1 // indirect github.com/cloudflare/circl v1.6.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect + github.com/containerd/errdefs v1.0.0 // indirect + github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containers/storage v1.58.0 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect diff --git a/go.sum b/go.sum index bf2c25ff1..1388a0c3e 100644 --- a/go.sum +++ b/go.sum @@ -193,6 +193,10 @@ github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containers/common v0.63.0 h1:ox6vgUYX5TSvt4W+bE36sYBVz/aXMAfRGVAgvknSjBg= @@ -233,13 +237,13 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k= -github.com/docker/cli v28.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.2.2+incompatible h1:qzx5BNUDFqlvyq4AHzdNB7gSyVTmU4cgsyN9SdInc1A= +github.com/docker/cli v28.2.2+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= -github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I= -github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw= +github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= diff --git a/internal/db/reset/reset.go b/internal/db/reset/reset.go index d3e33e582..3455ffbc0 100644 --- a/internal/db/reset/reset.go +++ b/internal/db/reset/reset.go @@ -11,10 +11,10 @@ import ( "time" "github.com/cenkalti/backoff/v4" + "github.com/containerd/errdefs" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" - "github.com/docker/docker/errdefs" "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/jackc/pgerrcode" diff --git a/internal/db/start/start.go b/internal/db/start/start.go index 790e565c9..ff4b237f0 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -12,9 +12,9 @@ import ( "time" "github.com/cenkalti/backoff/v4" + "github.com/containerd/errdefs" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" - "github.com/docker/docker/client" "github.com/docker/go-connections/nat" "github.com/go-errors/errors" "github.com/jackc/pgconn" @@ -169,7 +169,7 @@ EOF`} } // Creating volume will not override existing volume, so we must inspect explicitly _, err := utils.Docker.VolumeInspect(ctx, utils.DbId) - utils.NoBackupVolume = client.IsErrNotFound(err) + utils.NoBackupVolume = errdefs.IsNotFound(err) if utils.NoBackupVolume { fmt.Fprintln(w, "Starting database...") } else if len(fromBackup) > 0 { diff --git a/internal/utils/docker.go b/internal/utils/docker.go index 792ffb3db..1ee1da7ef 100644 --- a/internal/utils/docker.go +++ b/internal/utils/docker.go @@ -14,6 +14,7 @@ import ( "sync" "time" + "github.com/containerd/errdefs" podman "github.com/containers/common/libnetwork/types" "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/compose/loader" @@ -28,7 +29,6 @@ import ( "github.com/docker/docker/api/types/versions" "github.com/docker/docker/api/types/volume" "github.com/docker/docker/client" - "github.com/docker/docker/errdefs" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/pkg/stdcopy" "github.com/go-errors/errors" @@ -241,7 +241,7 @@ func DockerPullImageIfNotCached(ctx context.Context, imageName string) error { imageUrl := GetRegistryImageUrl(imageName) if _, err := Docker.ImageInspect(ctx, imageUrl); err == nil { return nil - } else if !client.IsErrNotFound(err) { + } else if !errdefs.IsNotFound(err) { return errors.Errorf("failed to inspect docker image: %w", err) } return DockerImagePullWithRetry(ctx, imageUrl, 2) diff --git a/internal/utils/misc.go b/internal/utils/misc.go index d7d9fd33c..4d58b81c8 100644 --- a/internal/utils/misc.go +++ b/internal/utils/misc.go @@ -10,6 +10,7 @@ import ( "regexp" "time" + "github.com/containerd/errdefs" "github.com/docker/docker/client" "github.com/go-errors/errors" "github.com/go-git/go-git/v5" @@ -167,7 +168,7 @@ func AssertSupabaseDbIsRunning() error { func AssertServiceIsRunning(ctx context.Context, containerId string) error { if _, err := Docker.ContainerInspect(ctx, containerId); err != nil { - if client.IsErrNotFound(err) { + if errdefs.IsNotFound(err) { return errors.New(ErrNotRunning) } if client.IsErrConnectionFailed(err) { From f6034ae9cf10d7d1f10272c7c1930e7723b6b92b Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Mon, 2 Jun 2025 01:14:22 +0800 Subject: [PATCH 157/359] chore: separate pkg module --- pkg/go.mod | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 pkg/go.mod diff --git a/pkg/go.mod b/pkg/go.mod new file mode 100644 index 000000000..9aad68632 --- /dev/null +++ b/pkg/go.mod @@ -0,0 +1,80 @@ +module github.com/supabase/cli/pkg + +go 1.24.2 + +require ( + github.com/BurntSushi/toml v1.5.0 + github.com/andybalholm/brotli v1.1.1 + github.com/cenkalti/backoff/v4 v4.3.0 + github.com/docker/go-units v0.5.0 + github.com/ecies/go/v2 v2.0.11 + github.com/go-errors/errors v1.5.1 + github.com/go-viper/mapstructure/v2 v2.2.1 + github.com/golang-jwt/jwt/v5 v5.2.2 + github.com/h2non/gock v1.2.0 + github.com/jackc/pgconn v1.14.3 + github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 + github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 + github.com/jackc/pgproto3/v2 v2.3.3 + github.com/jackc/pgtype v1.14.4 + github.com/jackc/pgx/v4 v4.18.3 + github.com/joho/godotenv v1.5.1 + github.com/oapi-codegen/nullable v1.1.0 + github.com/oapi-codegen/runtime v1.1.1 + github.com/spf13/afero v1.14.0 + github.com/spf13/viper v1.20.1 + github.com/stretchr/testify v1.10.0 + github.com/supabase/cli v1.226.5 + github.com/tidwall/jsonc v0.3.2 + golang.org/x/mod v0.24.0 + google.golang.org/grpc v1.72.2 +) + +require ( + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect + github.com/containerd/errdefs v1.0.0 // indirect + github.com/containerd/errdefs/pkg v0.3.0 // indirect + github.com/containerd/log v0.1.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/docker v28.2.2+incompatible // indirect + github.com/docker/go-connections v0.5.0 // indirect + github.com/ethereum/go-ethereum v1.15.8 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/stretchr/objx v0.5.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect + go.opentelemetry.io/otel v1.36.0 // indirect + go.opentelemetry.io/otel/metric v1.36.0 // indirect + go.opentelemetry.io/otel/trace v1.36.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/crypto v0.37.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.24.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.2 // indirect +) From 67a5c491c51e76c664a3a3b3af6055735b37878a Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 2 Jun 2025 16:55:29 +0800 Subject: [PATCH 158/359] fix: import pkg module in cli (#3640) --- go.mod | 23 ++++++++++++----------- go.sum | 2 ++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 273e58729..0205d4e43 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,24 @@ module github.com/supabase/cli -go 1.24.1 +go 1.24.2 require ( github.com/BurntSushi/toml v1.5.0 github.com/Netflix/go-env v0.1.2 - github.com/andybalholm/brotli v1.1.1 github.com/cenkalti/backoff/v4 v4.3.0 github.com/charmbracelet/bubbles v0.18.0 github.com/charmbracelet/bubbletea v0.25.0 github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 + github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.63.0 github.com/docker/cli v28.2.2+incompatible github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 - github.com/docker/go-units v0.5.0 - github.com/ecies/go/v2 v2.0.11 github.com/getsentry/sentry-go v0.33.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.16.0 - github.com/go-viper/mapstructure/v2 v2.2.1 github.com/go-xmlfmt/xmlfmt v1.1.3 - github.com/golang-jwt/jwt/v5 v5.2.2 github.com/golangci/golangci-lint/v2 v2.1.6 github.com/google/go-github/v62 v62.0.0 github.com/google/go-querystring v1.1.0 @@ -30,15 +26,11 @@ require ( github.com/h2non/gock v1.2.0 github.com/jackc/pgconn v1.14.3 github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 - github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 github.com/jackc/pgproto3/v2 v2.3.3 - github.com/jackc/pgtype v1.14.4 github.com/jackc/pgx/v4 v4.18.3 github.com/joho/godotenv v1.5.1 github.com/muesli/reflow v0.3.0 - github.com/oapi-codegen/nullable v1.1.0 github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 - github.com/oapi-codegen/runtime v1.1.1 github.com/slack-go/slack v0.17.0 github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 @@ -46,6 +38,7 @@ require ( github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 github.com/stripe/pg-schema-diff v0.9.0 + github.com/supabase/cli/pkg v1.0.0 github.com/tidwall/jsonc v0.3.2 github.com/withfig/autocomplete-tools/packages/cobra v1.2.0 github.com/zalando/go-keyring v0.2.6 @@ -81,6 +74,7 @@ require ( github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect github.com/alingse/nilnesserr v0.2.0 // indirect + github.com/andybalholm/brotli v1.1.1 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.2.0 // indirect @@ -109,7 +103,6 @@ require ( github.com/ckaznocha/intrange v0.3.1 // indirect github.com/cloudflare/circl v1.6.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect - github.com/containerd/errdefs v1.0.0 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containers/storage v1.58.0 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect @@ -125,7 +118,9 @@ require ( github.com/dnephin/pflag v1.0.7 // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-metrics v0.0.1 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect + github.com/ecies/go/v2 v2.0.11 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/ethereum/go-ethereum v1.15.8 // indirect github.com/ettle/strcase v0.2.0 // indirect @@ -152,10 +147,12 @@ require ( github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect 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/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.2 // 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 @@ -184,8 +181,10 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgtype v1.14.4 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jgautheron/goconst v1.8.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect @@ -238,6 +237,8 @@ require ( github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.19.1 // indirect + github.com/oapi-codegen/nullable v1.1.0 // indirect + github.com/oapi-codegen/runtime v1.1.1 // indirect github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect diff --git a/go.sum b/go.sum index 1388a0c3e..955f2f850 100644 --- a/go.sum +++ b/go.sum @@ -948,6 +948,8 @@ github.com/stripe/pg-schema-diff v0.9.0 h1:qzm2VUdbZ2kYwqxoQqtEP3uLQI0B+ymS947zq github.com/stripe/pg-schema-diff v0.9.0/go.mod h1:cl2VC6te/cCTOewTRvv4pYsgQqAOhvRQmatCHfYwy8c= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/supabase/cli/pkg v1.0.0 h1:6HjiXCedX8CCFjjkPd5GXq4wQGPKKJnPwIfkcW1bj7U= +github.com/supabase/cli/pkg v1.0.0/go.mod h1:xdOGROmegVXhSEZ1sCNTVicTCVb+NWW8JMIMQvQk8BQ= github.com/tdakkota/asciicheck v0.4.1 h1:bm0tbcmi0jezRA2b5kg4ozmMuGAFotKI3RZfrhfovg8= github.com/tdakkota/asciicheck v0.4.1/go.mod h1:0k7M3rCfRXb0Z6bwgvkEIMleKH3kXNz9UqJ9Xuqopr8= github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= From 36c892327ae566c497e602ed56b054a9aaca8154 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 02:25:03 +0000 Subject: [PATCH 159/359] chore(deps): bump supabase/studio from 2025.05.26-sha-bd7334d to 2025.06.02-sha-8f2993d in /pkg/config/templates (#3642) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.05.26-sha-bd7334d to 2025.06.02-sha-8f2993d. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.06.02-sha-8f2993d dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index ddf5611e8..12f03f7bf 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.3 AS pgmeta -FROM supabase/studio:2025.05.26-sha-bd7334d AS studio +FROM supabase/studio:2025.06.02-sha-8f2993d AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 6d127604924451d2cbc71f8c9751ae0f9b178ff7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 02:30:05 +0000 Subject: [PATCH 160/359] chore(deps): bump supabase/realtime from v2.36.5 to v2.36.6 in /pkg/config/templates (#3641) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.5 to v2.36.6. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.6 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 12f03f7bf..1096134ed 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue -FROM supabase/realtime:v2.36.5 AS realtime +FROM supabase/realtime:v2.36.7 AS realtime FROM supabase/storage-api:v1.23.0 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From ab0817e53383b29a17fa54db05891f1d7f9c9c9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 02:35:09 +0000 Subject: [PATCH 161/359] chore(deps): bump supabase/logflare from 1.12.0 to 1.14.2 in /pkg/config/templates (#3624) chore(deps): bump supabase/logflare in /pkg/config/templates Bumps supabase/logflare from 1.12.0 to 1.14.2. --- updated-dependencies: - dependency-name: supabase/logflare dependency-version: 1.14.2 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 1096134ed..348956f33 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -13,7 +13,7 @@ FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue FROM supabase/realtime:v2.36.7 AS realtime FROM supabase/storage-api:v1.23.0 AS storage -FROM supabase/logflare:1.12.0 AS logflare +FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ FROM supabase/migra:3.0.1663481299 AS migra From 5cf08449ab846c8af88a1a44cb225f8973c96b10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 02:40:08 +0000 Subject: [PATCH 162/359] chore(deps): bump supabase/postgres from 17.4.1.037 to 17.4.1.038 in /pkg/config/templates (#3644) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.037 to 17.4.1.038. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.038 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 348956f33..5241beb0d 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.037 AS pg +FROM supabase/postgres:17.4.1.038 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 8c396cf90f09a6cebf4a47c63839003c4b08d335 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 3 Jun 2025 10:46:56 +0800 Subject: [PATCH 163/359] fix: always use the latest pkg (#3645) * chore: use overlay spec * fix: always use the latest pkg * chore: update dependabot for pkg module * chore: reorder statements --- .github/dependabot.yml | 4 + api/beta.yaml | 7906 ------------------------------- api/overlay.yaml | 28 + go.mod | 2 + go.sum | 2 - internal/bootstrap/bootstrap.go | 2 +- internal/utils/flags/db_url.go | 4 +- main.go | 4 +- pkg/api/client.gen.go | 572 +++ pkg/api/types.cfg.yaml | 2 + pkg/api/types.gen.go | 509 +- pkg/config/auth.go | 24 +- pkg/config/auth_test.go | 32 +- 13 files changed, 960 insertions(+), 8131 deletions(-) delete mode 100644 api/beta.yaml create mode 100644 api/overlay.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 172917207..2df6491a5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,10 @@ updates: directory: "/" schedule: interval: "daily" + - package-ecosystem: "gomod" + directory: "pkg" + schedule: + interval: "daily" - package-ecosystem: "npm" directory: "/" schedule: diff --git a/api/beta.yaml b/api/beta.yaml deleted file mode 100644 index 11ea9f55a..000000000 --- a/api/beta.yaml +++ /dev/null @@ -1,7906 +0,0 @@ -openapi: 3.0.0 -paths: - /v1/branches/{branch_id}: - get: - operationId: v1-get-a-branch-config - summary: Get database branch config - description: Fetches configurations of the specified database branch - parameters: - - name: branch_id - required: true - in: path - description: Branch ID - schema: - format: uuid - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/BranchDetailResponse' - '500': - description: Failed to retrieve database branch - tags: - - Environments - security: - - bearer: [] - patch: - operationId: v1-update-a-branch-config - summary: Update database branch config - description: Updates the configuration of the specified database branch - parameters: - - name: branch_id - required: true - in: path - description: Branch ID - schema: - format: uuid - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateBranchBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/BranchResponse' - '500': - description: Failed to update database branch - tags: - - Environments - security: - - bearer: [] - delete: - operationId: v1-delete-a-branch - summary: Delete a database branch - description: Deletes the specified database branch - parameters: - - name: branch_id - required: true - in: path - description: Branch ID - schema: - format: uuid - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/BranchDeleteResponse' - '500': - description: Failed to delete database branch - tags: - - Environments - security: - - bearer: [] - /v1/branches/{branch_id}/push: - post: - operationId: v1-push-a-branch - summary: Pushes a database branch - description: Pushes the specified database branch - parameters: - - name: branch_id - required: true - in: path - description: Branch ID - schema: - format: uuid - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BranchActionBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/BranchUpdateResponse' - '500': - description: Failed to push database branch - tags: - - Environments - security: - - bearer: [] - /v1/branches/{branch_id}/merge: - post: - operationId: v1-merge-a-branch - summary: Merges a database branch - description: Merges the specified database branch - parameters: - - name: branch_id - required: true - in: path - description: Branch ID - schema: - format: uuid - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BranchActionBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/BranchUpdateResponse' - '500': - description: Failed to merge database branch - tags: - - Environments - security: - - bearer: [] - /v1/branches/{branch_id}/reset: - post: - operationId: v1-reset-a-branch - summary: Resets a database branch - description: Resets the specified database branch - parameters: - - name: branch_id - required: true - in: path - description: Branch ID - schema: - format: uuid - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BranchActionBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/BranchUpdateResponse' - '500': - description: Failed to reset database branch - tags: - - Environments - security: - - bearer: [] - /v1/projects: - get: - operationId: v1-list-all-projects - summary: List all projects - description: Returns a list of all projects you've previously created. - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V1ProjectWithDatabaseResponse' - tags: - - Projects - security: - - bearer: [] - post: - operationId: v1-create-a-project - summary: Create a project - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/V1CreateProjectBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1ProjectResponse' - tags: - - Projects - security: - - bearer: [] - /v1/organizations: - get: - operationId: v1-list-all-organizations - summary: List all organizations - description: Returns a list of organizations that you currently belong to. - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/OrganizationResponseV1' - '500': - description: Unexpected error listing organizations - tags: - - Organizations - security: - - bearer: [] - post: - operationId: v1-create-an-organization - summary: Create an organization - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateOrganizationV1' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationResponseV1' - '500': - description: Unexpected error creating an organization - tags: - - Organizations - security: - - bearer: [] - /v1/oauth/authorize: - get: - operationId: v1-authorize-user - summary: '[Beta] Authorize user through oauth' - parameters: - - name: client_id - required: true - in: query - schema: - format: uuid - type: string - - name: response_type - required: true - in: query - schema: - enum: - - code - - token - - id_token token - type: string - - name: redirect_uri - required: true - in: query - schema: - type: string - - name: scope - required: false - in: query - schema: - type: string - - name: state - required: false - in: query - schema: - type: string - - name: response_mode - required: false - in: query - schema: - type: string - - name: code_challenge - required: false - in: query - schema: - type: string - - name: code_challenge_method - required: false - in: query - schema: - enum: - - plain - - sha256 - - S256 - type: string - responses: - '204': - description: '' - tags: - - OAuth - security: - - oauth2: - - read - /v1/oauth/token: - post: - operationId: v1-exchange-oauth-token - summary: '[Beta] Exchange auth code for user''s access and refresh token' - parameters: [] - requestBody: - required: true - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/OAuthTokenBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/OAuthTokenResponse' - tags: - - OAuth - security: - - oauth2: - - write - /v1/oauth/revoke: - post: - operationId: v1-revoke-token - summary: '[Beta] Revoke oauth app authorization and it''s corresponding tokens' - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OAuthRevokeTokenBody' - responses: - '204': - description: '' - tags: - - OAuth - security: - - oauth2: - - write - /v1/snippets: - get: - operationId: v1-list-all-snippets - summary: Lists SQL snippets for the logged in user - parameters: - - name: project_ref - required: false - in: query - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: cursor - required: false - in: query - schema: - type: string - - name: limit - required: false - in: query - schema: - type: string - minimum: 1 - maximum: 100 - - name: sort_by - required: false - in: query - schema: - enum: - - name - - inserted_at - type: string - - name: sort_order - required: false - in: query - schema: - enum: - - asc - - desc - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SnippetList' - '500': - description: Failed to list user's SQL snippets - tags: - - Database - security: - - bearer: [] - /v1/snippets/{id}: - get: - operationId: v1-get-a-snippet - summary: Gets a specific SQL snippet - parameters: - - name: id - required: true - in: path - schema: - format: uuid - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SnippetResponse' - '500': - description: Failed to retrieve SQL snippet - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/api-keys: - get: - operationId: v1-get-project-api-keys - summary: Get project api keys - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: reveal - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ApiKeyResponse' - '403': - description: '' - tags: - - Secrets - security: - - bearer: [] - post: - operationId: createApiKey - summary: '[Alpha] Creates a new API key for the project' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: reveal - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateApiKeyBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ApiKeyResponse' - '403': - description: '' - tags: - - Secrets - security: - - bearer: [] - /v1/projects/{ref}/api-keys/{id}: - patch: - operationId: updateApiKey - summary: '[Alpha] Updates an API key for the project' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: id - required: true - in: path - schema: - format: uuid - type: string - - name: reveal - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateApiKeyBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ApiKeyResponse' - '403': - description: '' - tags: - - Secrets - security: - - bearer: [] - get: - operationId: getApiKey - summary: '[Alpha] Get API key' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: id - required: true - in: path - schema: - format: uuid - type: string - - name: reveal - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ApiKeyResponse' - '403': - description: '' - tags: - - Secrets - security: - - bearer: [] - delete: - operationId: deleteApiKey - summary: '[Alpha] Deletes an API key for the project' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: id - required: true - in: path - schema: - format: uuid - type: string - - name: reveal - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ApiKeyResponse' - '403': - description: '' - tags: - - Secrets - security: - - bearer: [] - /v1/projects/{ref}/branches: - get: - operationId: v1-list-all-branches - summary: List all database branches - description: Returns all database branches of the specified project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/BranchResponse' - '403': - description: '' - '500': - description: Failed to retrieve database branches - tags: - - Environments - security: - - bearer: [] - post: - operationId: v1-create-a-branch - summary: Create a database branch - description: Creates a database branch from the specified project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateBranchBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/BranchResponse' - '403': - description: '' - '500': - description: Failed to create database branch - tags: - - Environments - security: - - bearer: [] - delete: - operationId: v1-disable-preview-branching - summary: Disables preview branching - description: Disables preview branching for the specified project - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to disable preview branching - tags: - - Environments - security: - - bearer: [] - /v1/projects/{ref}/custom-hostname: - get: - operationId: v1-get-hostname-config - summary: '[Beta] Gets project''s custom hostname config' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateCustomHostnameResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's custom hostname config - tags: - - Domains - security: - - bearer: [] - delete: - operationId: v1-Delete hostname config - summary: '[Beta] Deletes a project''s custom hostname configuration' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to delete project custom hostname configuration - tags: - - Domains - security: - - bearer: [] - /v1/projects/{ref}/custom-hostname/initialize: - post: - operationId: v1-update-hostname-config - summary: '[Beta] Updates project''s custom hostname configuration' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateCustomHostnameBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateCustomHostnameResponse' - '403': - description: '' - '500': - description: Failed to update project custom hostname configuration - tags: - - Domains - security: - - bearer: [] - /v1/projects/{ref}/custom-hostname/reverify: - post: - operationId: v1-verify-dns-config - summary: >- - [Beta] Attempts to verify the DNS configuration for project's custom - hostname configuration - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateCustomHostnameResponse' - '403': - description: '' - '500': - description: Failed to verify project custom hostname configuration - tags: - - Domains - security: - - bearer: [] - /v1/projects/{ref}/custom-hostname/activate: - post: - operationId: v1-activate-custom-hostname - summary: '[Beta] Activates a custom hostname for a project.' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateCustomHostnameResponse' - '403': - description: '' - '500': - description: Failed to activate project custom hostname configuration - tags: - - Domains - security: - - bearer: [] - /v1/projects/{ref}/network-bans/retrieve: - post: - operationId: v1-list-all-network-bans - summary: '[Beta] Gets project''s network bans' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/NetworkBanResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's network bans - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/network-bans/retrieve/enriched: - post: - operationId: v1-list-all-network-bans-enriched - summary: >- - [Beta] Gets project's network bans with additional information about - which databases they affect - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/NetworkBanResponseEnriched' - '403': - description: '' - '500': - description: Failed to retrieve project's enriched network bans - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/network-bans: - delete: - operationId: v1-delete-network-bans - summary: '[Beta] Remove network bans.' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RemoveNetworkBanRequest' - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to remove network bans. - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/network-restrictions: - get: - operationId: v1-get-network-restrictions - summary: '[Beta] Gets project''s network restrictions' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/NetworkRestrictionsResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's network restrictions - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/network-restrictions/apply: - post: - operationId: v1-update-network-restrictions - summary: '[Beta] Updates project''s network restrictions' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/NetworkRestrictionsRequest' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/NetworkRestrictionsResponse' - '403': - description: '' - '500': - description: Failed to update project network restrictions - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/pgsodium: - get: - operationId: v1-get-pgsodium-config - summary: '[Beta] Gets project''s pgsodium config' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PgsodiumConfigResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's pgsodium config - tags: - - Secrets - security: - - bearer: [] - put: - operationId: v1-update-pgsodium-config - summary: >- - [Beta] Updates project's pgsodium config. Updating the root_key can - cause all data encrypted with the older key to become inaccessible. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePgsodiumConfigBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PgsodiumConfigResponse' - '403': - description: '' - '500': - description: Failed to update project's pgsodium config - tags: - - Secrets - security: - - bearer: [] - /v1/projects/{ref}/postgrest: - get: - operationId: v1-get-postgrest-service-config - summary: Gets project's postgrest config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PostgrestConfigWithJWTSecretResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's postgrest config - tags: - - Rest - security: - - bearer: [] - patch: - operationId: v1-update-postgrest-service-config - summary: Updates project's postgrest config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/V1UpdatePostgrestConfigBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1PostgrestConfigResponse' - '403': - description: '' - '500': - description: Failed to update project's postgrest config - tags: - - Rest - security: - - bearer: [] - /v1/projects/{ref}: - get: - operationId: v1-get-project - summary: Gets a specific project that belongs to the authenticated user - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1ProjectWithDatabaseResponse' - '403': - description: '' - '500': - description: Failed to retrieve project - tags: - - Projects - security: - - bearer: [] - delete: - operationId: v1-delete-a-project - summary: Deletes the given project - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1ProjectRefResponse' - '403': - description: '' - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/secrets: - get: - operationId: v1-list-all-secrets - summary: List all secrets - description: Returns all secrets you've previously added to the specified project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SecretResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's secrets - tags: - - Secrets - security: - - bearer: [] - post: - operationId: v1-bulk-create-secrets - summary: Bulk create secrets - description: Creates multiple secrets and adds them to the specified project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSecretBody' - responses: - '201': - description: '' - '403': - description: '' - '500': - description: Failed to create project's secrets - tags: - - Secrets - security: - - bearer: [] - delete: - operationId: v1-bulk-delete-secrets - summary: Bulk delete secrets - description: Deletes all secrets with the given names from the specified project - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - type: array - items: - type: string - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to delete secrets with given names - tags: - - Secrets - security: - - bearer: [] - /v1/projects/{ref}/ssl-enforcement: - get: - operationId: v1-get-ssl-enforcement-config - summary: '[Beta] Get project''s SSL enforcement configuration.' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SslEnforcementResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's SSL enforcement config - tags: - - Database - security: - - bearer: [] - put: - operationId: v1-update-ssl-enforcement-config - summary: '[Beta] Update project''s SSL enforcement configuration.' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SslEnforcementRequest' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SslEnforcementResponse' - '403': - description: '' - '500': - description: Failed to update project's SSL enforcement configuration. - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/types/typescript: - get: - operationId: v1-generate-typescript-types - summary: Generate TypeScript types - description: Returns the TypeScript types of your schema for use with supabase-js. - parameters: - - name: included_schemas - required: false - in: query - schema: - default: public - type: string - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/TypescriptResponse' - '403': - description: '' - '500': - description: Failed to generate TypeScript types - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/vanity-subdomain: - get: - operationId: v1-get-vanity-subdomain-config - summary: '[Beta] Gets current vanity subdomain config' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/VanitySubdomainConfigResponse' - '403': - description: '' - '500': - description: Failed to get project vanity subdomain configuration - tags: - - Domains - security: - - bearer: [] - delete: - operationId: v1-deactivate-vanity-subdomain-config - summary: '[Beta] Deletes a project''s vanity subdomain configuration' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to delete project vanity subdomain configuration - tags: - - Domains - security: - - bearer: [] - /v1/projects/{ref}/vanity-subdomain/check-availability: - post: - operationId: v1-check-vanity-subdomain-availability - summary: '[Beta] Checks vanity subdomain availability' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/VanitySubdomainBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SubdomainAvailabilityResponse' - '403': - description: '' - '500': - description: Failed to check project vanity subdomain configuration - tags: - - Domains - security: - - bearer: [] - /v1/projects/{ref}/vanity-subdomain/activate: - post: - operationId: v1-activate-vanity-subdomain-config - summary: '[Beta] Activates a vanity subdomain for a project.' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/VanitySubdomainBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ActivateVanitySubdomainResponse' - '403': - description: '' - '500': - description: Failed to activate project vanity subdomain configuration - tags: - - Domains - security: - - bearer: [] - /v1/projects/{ref}/upgrade: - post: - operationId: v1-upgrade-postgres-version - summary: '[Beta] Upgrades the project''s Postgres version' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpgradeDatabaseBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectUpgradeInitiateResponse' - '403': - description: '' - '500': - description: Failed to initiate project upgrade - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/upgrade/eligibility: - get: - operationId: v1-get-postgres-upgrade-eligibility - summary: '[Beta] Returns the project''s eligibility for upgrades' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectUpgradeEligibilityResponse' - '403': - description: '' - '500': - description: Failed to determine project upgrade eligibility - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/upgrade/status: - get: - operationId: v1-get-postgres-upgrade-status - summary: '[Beta] Gets the latest status of the project''s upgrade' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: tracking_id - required: false - in: query - schema: - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseUpgradeStatusResponse' - '403': - description: '' - '500': - description: Failed to retrieve project upgrade status - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/readonly: - get: - operationId: v1-get-readonly-mode-status - summary: Returns project's readonly mode status - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ReadOnlyStatusResponse' - '403': - description: '' - '500': - description: Failed to get project readonly mode status - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/readonly/temporary-disable: - post: - operationId: v1-disable-readonly-mode-temporarily - summary: Disables project's readonly mode for the next 15 minutes - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '201': - description: '' - '403': - description: '' - '500': - description: Failed to disable project's readonly mode - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/read-replicas/setup: - post: - operationId: v1-setup-a-read-replica - summary: '[Beta] Set up a read replica' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SetUpReadReplicaBody' - responses: - '201': - description: '' - '403': - description: '' - '500': - description: Failed to set up read replica - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/read-replicas/remove: - post: - operationId: v1-remove-a-read-replica - summary: '[Beta] Remove a read replica' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RemoveReadReplicaBody' - responses: - '201': - description: '' - '403': - description: '' - '500': - description: Failed to remove read replica - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/health: - get: - operationId: v1-get-services-health - summary: Gets project's service health status - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: services - required: true - in: query - schema: - type: array - items: - enum: - - auth - - db - - pooler - - realtime - - rest - - storage - - name: timeout_ms - required: false - in: query - schema: - minimum: 0 - maximum: 10000 - type: integer - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V1ServiceHealthResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's service health status - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/config/auth/signing-keys: - post: - operationId: createSigningKeyForProject - summary: '[Alpha] Create a new signing key for the project in standby status' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSigningKeyBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SigningKeyResponse' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - get: - operationId: listSigningKeysForProject - summary: '[Alpha] List all signing keys for the project' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SigningKeysResponse' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - /v1/projects/{ref}/config/auth/signing-keys/{id}: - get: - operationId: getSigningKeyForProject - summary: '[Alpha] Get information about a signing key' - parameters: - - name: id - required: true - in: path - schema: - format: uuid - type: string - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SigningKeyResponse' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - delete: - operationId: deleteSigningKey - summary: >- - [Alpha] Remove a signing key from a project, where the status is - previously_used - parameters: - - name: id - required: true - in: path - schema: - format: uuid - type: string - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SigningKeyResponse' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - patch: - operationId: patchSigningKey - summary: '[Alpha] Update a signing key, mainly its status' - parameters: - - name: id - required: true - in: path - schema: - format: uuid - type: string - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSigningKeyBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/SigningKeyResponse' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - /v1/projects/{ref}/config/storage: - get: - operationId: v1-get-storage-config - summary: Gets project's storage config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/StorageConfigResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's storage config - tags: - - Storage - security: - - bearer: [] - patch: - operationId: v1-update-storage-config - summary: Updates project's storage config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateStorageConfigBody' - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to update project's storage config - tags: - - Storage - security: - - bearer: [] - /v1/projects/{ref}/config/database/postgres: - get: - operationId: v1-get-postgres-config - summary: Gets project's Postgres config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PostgresConfigResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's Postgres config - tags: - - Database - security: - - bearer: [] - put: - operationId: v1-update-postgres-config - summary: Updates project's Postgres config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePostgresConfigBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/PostgresConfigResponse' - '403': - description: '' - '500': - description: Failed to update project's Postgres config - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/config/database/pgbouncer: - get: - operationId: v1-get-project-pgbouncer-config - summary: Get project's pgbouncer config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1PgbouncerConfigResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's pgbouncer config - tags: - - Database - /v1/projects/{ref}/config/database/pooler: - get: - operationId: v1-get-pooler-config - summary: Gets project's supavisor config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SupavisorConfigResponse' - '500': - description: Failed to retrieve project's supavisor config - tags: - - Database - security: - - bearer: [] - patch: - operationId: v1-update-pooler-config - summary: Updates project's supavisor config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSupavisorConfigBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSupavisorConfigResponse' - '403': - description: '' - '500': - description: Failed to update project's supavisor config - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/config/auth: - get: - operationId: v1-get-auth-service-config - summary: Gets project's auth config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/AuthConfigResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's auth config - tags: - - Auth - security: - - bearer: [] - patch: - operationId: v1-update-auth-service-config - summary: Updates a project's auth config - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAuthConfigBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/AuthConfigResponse' - '403': - description: '' - '500': - description: Failed to update project's auth config - tags: - - Auth - security: - - bearer: [] - /v1/projects/{ref}/config/auth/third-party-auth: - post: - operationId: createTPAForProject - summary: Creates a new third-party auth integration - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateThirdPartyAuthBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ThirdPartyAuth' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - get: - operationId: listTPAForProject - summary: Lists all third-party auth integrations - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ThirdPartyAuth' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - /v1/projects/{ref}/config/auth/third-party-auth/{tpa_id}: - delete: - operationId: deleteTPAForProject - summary: Removes a third-party auth integration - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: tpa_id - required: true - in: path - schema: - format: uuid - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ThirdPartyAuth' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - get: - operationId: getTPAForProject - summary: Get a third-party integration - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: tpa_id - required: true - in: path - schema: - format: uuid - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ThirdPartyAuth' - '403': - description: '' - tags: - - Auth - security: - - bearer: [] - /v1/projects/{ref}/pause: - post: - operationId: v1-pause-a-project - summary: Pauses the given project - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - '403': - description: '' - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/restore: - get: - operationId: v1-list-available-restore-versions - summary: Lists available restore versions for the given project - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: >- - #/components/schemas/GetProjectAvailableRestoreVersionsResponse - '403': - description: '' - tags: - - Projects - security: - - bearer: [] - post: - operationId: v1-restore-a-project - summary: Restores the given project - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - '403': - description: '' - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/restore/cancel: - post: - operationId: v1-cancel-a-project-restoration - summary: Cancels the given project restoration - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - '403': - description: '' - tags: - - Projects - security: - - bearer: [] - /v1/projects/{ref}/billing/addons: - get: - operationId: v1-list-project-addons - summary: Lists project addons - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ListProjectAddonsResponse' - '403': - description: '' - '500': - description: Failed to list project addons - security: - - bearer: [] - patch: - operationId: v1-apply-project-addon - summary: Applies project addon - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ApplyProjectAddonBody' - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to apply project addon - security: - - bearer: [] - /v1/projects/{ref}/billing/addons/{addon_variant}: - delete: - operationId: v1-remove-project-addon - summary: Removes project addon - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: addon_variant - required: true - in: path - oneOf: - - type: string - enum: - - ci_micro - - ci_small - - ci_medium - - ci_large - - ci_xlarge - - ci_2xlarge - - ci_4xlarge - - ci_8xlarge - - ci_12xlarge - - ci_16xlarge - - ci_24xlarge - - ci_24xlarge_optimized_cpu - - ci_24xlarge_optimized_memory - - ci_24xlarge_high_memory - - ci_48xlarge - - ci_48xlarge_optimized_cpu - - ci_48xlarge_optimized_memory - - ci_48xlarge_high_memory - - type: string - enum: - - cd_default - - type: string - enum: - - pitr_7 - - pitr_14 - - pitr_28 - - type: string - enum: - - ipv4_default - schema: {} - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to remove project addon - security: - - bearer: [] - /v1/projects/{ref}/advisors/performance: - get: - operationId: getPerformanceAdvisors - summary: Gets project performance advisors. - description: >- - This is an **experimental** endpoint. It is subject to change or removal - in future versions. Use it with caution, as it may not remain supported - or stable. - deprecated: true - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1ProjectAdvisorsResponse' - '403': - description: '' - tags: - - Projects Advisors - security: - - bearer: [] - /v1/projects/{ref}/advisors/security: - get: - operationId: getSecurityAdvisors - summary: Gets project security advisors. - description: >- - This is an **experimental** endpoint. It is subject to change or removal - in future versions. Use it with caution, as it may not remain supported - or stable. - deprecated: true - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1ProjectAdvisorsResponse' - '403': - description: '' - tags: - - Projects Advisors - security: - - bearer: [] - /v1/projects/{ref}/analytics/endpoints/logs.all: - get: - operationId: getLogs - summary: Gets project's logs - description: > - Executes a SQL query on the project's logs. - - - Either the 'iso_timestamp_start' and 'iso_timestamp_end' parameters must - be provided. - - If both are not provided, only the last 1 minute of logs will be - queried. - - The timestamp range must be no more than 24 hours and is rounded to the - nearest minute. If the range is more than 24 hours, a validation error - will be thrown. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: sql - required: false - in: query - schema: - type: string - - name: iso_timestamp_start - required: false - in: query - schema: - format: date-time - type: string - - name: iso_timestamp_end - required: false - in: query - schema: - format: date-time - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/AnalyticsResponse' - '403': - description: '' - tags: - - Analytics - security: - - bearer: [] - /v1/projects/{ref}/analytics/endpoints/usage.api-counts: - get: - operationId: getApiCounts - summary: Gets project's usage api counts - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: interval - required: false - in: query - schema: - enum: - - 15min - - 30min - - 1hr - - 3hr - - 1day - - 3day - - 7day - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/AnalyticsResponse' - '403': - description: '' - '500': - description: Failed to get project's usage api counts - tags: - - Projects Analytics - security: - - bearer: [] - /v1/projects/{ref}/analytics/endpoints/usage.api-requests-count: - get: - operationId: getApiRequestsCount - summary: Gets project's usage api requests count - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/AnalyticsResponse' - '500': - description: Failed to get project's usage api requests count - tags: - - Projects Analytics - security: - - bearer: [] - /v1/projects/{ref}/database/migrations: - get: - operationId: v1-list-migration-history - summary: '[Beta] List applied migration versions' - description: Only available to selected partner OAuth apps - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1ListMigrationsResponse' - '403': - description: '' - '500': - description: Failed to list database migrations - tags: - - Database - security: - - bearer: [] - post: - operationId: v1-apply-a-migration - summary: '[Beta] Apply a database migration' - description: Only available to selected partner OAuth apps - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: Idempotency-Key - required: false - in: header - description: A unique key to ensure the same migration is tracked only once. - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/V1CreateMigrationBody' - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to apply database migration - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/database/query: - post: - operationId: v1-run-a-query - summary: '[Beta] Run sql query' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/V1RunQueryBody' - responses: - '201': - description: '' - '403': - description: '' - '500': - description: Failed to run sql query - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/database/webhooks/enable: - post: - operationId: v1-enable-database-webhook - summary: '[Beta] Enables Database Webhooks on the project' - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '201': - description: '' - '403': - description: '' - '500': - description: Failed to enable Database Webhooks on the project - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/database/context: - get: - operationId: getDatabaseMetadata - summary: Gets database metadata for the given project. - description: >- - This is an **experimental** endpoint. It is subject to change or removal - in future versions. Use it with caution, as it may not remain supported - or stable. - deprecated: true - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/GetProjectDbMetadataResponse' - '403': - description: '' - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/functions: - get: - operationId: v1-list-all-functions - summary: List all functions - description: Returns all functions you've previously added to the specified project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/FunctionResponse' - '403': - description: '' - '500': - description: Failed to retrieve project's functions - tags: - - Edge Functions - security: - - bearer: [] - post: - operationId: v1-create-a-function - summary: Create a function - description: >- - This endpoint is deprecated - use the deploy endpoint. Creates a - function and adds it to the specified project. - deprecated: true - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: slug - required: false - in: query - schema: - pattern: ^[A-Za-z0-9_-]+$ - type: string - - name: name - required: false - in: query - schema: - type: string - - name: verify_jwt - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - - name: import_map - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - - name: entrypoint_path - required: false - in: query - schema: - type: string - - name: import_map_path - required: false - in: query - schema: - type: string - requestBody: - required: true - content: - application/vnd.denoland.eszip: - type: string - format: binary - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/FunctionResponse' - '403': - description: '' - '500': - description: Failed to create project's function - tags: - - Edge Functions - security: - - bearer: [] - put: - operationId: v1-bulk-update-functions - summary: Bulk update functions - description: >- - Bulk update functions. It will create a new function or replace - existing. The operation is idempotent. NOTE: You will need to manually - bump the version. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkUpdateFunctionBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/BulkUpdateFunctionResponse' - '403': - description: '' - '500': - description: Failed to update functions - tags: - - Edge Functions - security: - - bearer: [] - /v1/projects/{ref}/functions/deploy: - post: - operationId: v1-deploy-a-function - summary: Deploy a function - description: >- - A new endpoint to deploy functions. It will create if function does not - exist. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: slug - required: false - in: query - schema: - pattern: ^[A-Za-z0-9_-]+$ - type: string - - name: bundleOnly - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - requestBody: - required: true - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/FunctionDeployBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeployFunctionResponse' - '403': - description: '' - '500': - description: Failed to deploy function - tags: - - Edge Functions - security: - - bearer: [] - /v1/projects/{ref}/functions/{function_slug}: - get: - operationId: v1-get-a-function - summary: Retrieve a function - description: Retrieves a function with the specified slug and project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: function_slug - required: true - in: path - description: Function slug - schema: - pattern: ^[A-Za-z0-9_-]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/FunctionSlugResponse' - '403': - description: '' - '500': - description: Failed to retrieve function with given slug - tags: - - Edge Functions - security: - - bearer: [] - patch: - operationId: v1-update-a-function - summary: Update a function - description: Updates a function with the specified slug and project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: function_slug - required: true - in: path - description: Function slug - schema: - pattern: ^[A-Za-z0-9_-]+$ - type: string - - name: slug - required: false - in: query - schema: - pattern: ^[A-Za-z0-9_-]+$ - type: string - - name: name - required: false - in: query - schema: - type: string - - name: verify_jwt - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - - name: import_map - required: false - in: query - description: Boolean string, true or false - schema: - type: boolean - - name: entrypoint_path - required: false - in: query - schema: - type: string - - name: import_map_path - required: false - in: query - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/V1UpdateFunctionBody' - application/vnd.denoland.eszip: - schema: - $ref: '#/components/schemas/V1UpdateFunctionBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/FunctionResponse' - '403': - description: '' - '500': - description: Failed to update function with given slug - tags: - - Edge Functions - security: - - bearer: [] - delete: - operationId: v1-delete-a-function - summary: Delete a function - description: Deletes a function with the specified slug from the specified project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: function_slug - required: true - in: path - description: Function slug - schema: - pattern: ^[A-Za-z0-9_-]+$ - type: string - responses: - '200': - description: '' - '403': - description: '' - '500': - description: Failed to delete function with given slug - tags: - - Edge Functions - security: - - bearer: [] - /v1/projects/{ref}/functions/{function_slug}/body: - get: - operationId: v1-get-a-function-body - summary: Retrieve a function body - description: Retrieves a function body for the specified slug and project. - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: function_slug - required: true - in: path - description: Function slug - schema: - pattern: ^[A-Za-z0-9_-]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/StreamableFile' - '403': - description: '' - '500': - description: Failed to retrieve function body with given slug - tags: - - Edge Functions - security: - - bearer: [] - /v1/projects/{ref}/storage/buckets: - get: - operationId: v1-list-all-buckets - summary: Lists all buckets - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V1StorageBucketResponse' - '403': - description: '' - '500': - description: Failed to get list of buckets - tags: - - Storage - security: - - bearer: [] - /v1/projects/{ref}/config/auth/sso/providers: - post: - operationId: v1-create-a-sso-provider - summary: Creates a new SSO provider - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProviderBody' - responses: - '201': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProviderResponse' - '403': - description: '' - '404': - description: SAML 2.0 support is not enabled for this project - tags: - - Auth - security: - - bearer: [] - get: - operationId: v1-list-all-sso-provider - summary: Lists all SSO providers - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ListProvidersResponse' - '403': - description: '' - '404': - description: SAML 2.0 support is not enabled for this project - tags: - - Auth - security: - - bearer: [] - /v1/projects/{ref}/config/auth/sso/providers/{provider_id}: - get: - operationId: v1-get-a-sso-provider - summary: Gets a SSO provider by its UUID - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: provider_id - required: true - in: path - schema: - format: uuid - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/GetProviderResponse' - '403': - description: '' - '404': - description: >- - Either SAML 2.0 was not enabled for this project, or the provider - does not exist - tags: - - Auth - security: - - bearer: [] - put: - operationId: v1-update-a-sso-provider - summary: Updates a SSO provider by its UUID - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: provider_id - required: true - in: path - schema: - format: uuid - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProviderBody' - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProviderResponse' - '403': - description: '' - '404': - description: >- - Either SAML 2.0 was not enabled for this project, or the provider - does not exist - tags: - - Auth - security: - - bearer: [] - delete: - operationId: v1-delete-a-sso-provider - summary: Removes a SSO provider by its UUID - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - - name: provider_id - required: true - in: path - schema: - format: uuid - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteProviderResponse' - '403': - description: '' - '404': - description: >- - Either SAML 2.0 was not enabled for this project, or the provider - does not exist - tags: - - Auth - security: - - bearer: [] - /v1/projects/{ref}/database/backups: - get: - operationId: v1-list-all-backups - summary: Lists all backups - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1BackupsResponse' - '403': - description: '' - '500': - description: Failed to get backups - tags: - - Database - security: - - bearer: [] - /v1/projects/{ref}/database/backups/restore-pitr: - post: - operationId: v1-restore-pitr-backup - summary: Restores a PITR backup for a database - parameters: - - name: ref - required: true - in: path - description: Project ref - schema: - minLength: 20 - maxLength: 20 - pattern: ^[a-z]+$ - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/V1RestorePitrBody' - responses: - '201': - description: '' - '403': - description: '' - tags: - - Database - security: - - bearer: [] - /v1/organizations/{slug}/members: - get: - operationId: v1-list-organization-members - summary: List members of an organization - parameters: - - name: slug - required: true - in: path - description: Organization slug - schema: - pattern: ^[\w-]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V1OrganizationMemberResponse' - '403': - description: '' - tags: - - Organizations - security: - - bearer: [] - /v1/organizations/{slug}: - get: - operationId: v1-get-an-organization - summary: Gets information about the organization - parameters: - - name: slug - required: true - in: path - description: Organization slug - schema: - pattern: ^[\w-]+$ - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/V1OrganizationSlugResponse' - '403': - description: '' - tags: - - Organizations - security: - - bearer: [] -info: - title: Supabase API (v1) - description: >- - Supabase API generated from the OpenAPI specification.
Visit - [https://supabase.com/docs](https://supabase.com/docs) for a complete - documentation. - version: 1.0.0 - contact: {} -tags: - - name: Auth - description: Auth related endpoints - - name: Database - description: Database related endpoints - - name: Domains - description: Domains related endpoints - - name: Edge Functions - description: Edge related endpoints - - name: Environments - description: Environments related endpoints - - name: OAuth - description: OAuth related endpoints - - name: Organizations - description: Organizations related endpoints - - name: Projects - description: Projects related endpoints - - name: Rest - description: Rest related endpoints - - name: Secrets - description: Secrets related endpoints - - name: Storage - description: Storage related endpoints -servers: [] -components: - securitySchemes: - bearer: - scheme: bearer - bearerFormat: JWT - type: http - schemas: - BranchDetailResponse: - type: object - properties: - ref: - type: string - postgres_version: - type: string - postgres_engine: - type: string - release_channel: - type: string - status: - type: string - enum: - - INACTIVE - - ACTIVE_HEALTHY - - ACTIVE_UNHEALTHY - - COMING_UP - - UNKNOWN - - GOING_DOWN - - INIT_FAILED - - REMOVED - - RESTORING - - UPGRADING - - PAUSING - - RESTORE_FAILED - - RESTARTING - - PAUSE_FAILED - - RESIZING - db_host: - type: string - db_port: - type: integer - db_user: - type: string - db_pass: - type: string - jwt_secret: - type: string - required: - - ref - - postgres_version - - postgres_engine - - release_channel - - status - - db_host - - db_port - UpdateBranchBody: - type: object - properties: - branch_name: - type: string - git_branch: - type: string - reset_on_push: - type: boolean - description: >- - This field is deprecated and will be ignored. Use v1-reset-a-branch - endpoint directly instead. - deprecated: true - persistent: - type: boolean - status: - type: string - enum: - - CREATING_PROJECT - - RUNNING_MIGRATIONS - - MIGRATIONS_PASSED - - MIGRATIONS_FAILED - - FUNCTIONS_DEPLOYED - - FUNCTIONS_FAILED - BranchResponse: - type: object - properties: - id: - type: string - name: - type: string - project_ref: - type: string - parent_project_ref: - type: string - is_default: - type: boolean - git_branch: - type: string - pr_number: - type: integer - format: int32 - latest_check_run_id: - type: number - description: This field is deprecated and will not be populated. - deprecated: true - persistent: - type: boolean - status: - type: string - enum: - - CREATING_PROJECT - - RUNNING_MIGRATIONS - - MIGRATIONS_PASSED - - MIGRATIONS_FAILED - - FUNCTIONS_DEPLOYED - - FUNCTIONS_FAILED - created_at: - type: string - updated_at: - type: string - required: - - id - - name - - project_ref - - parent_project_ref - - is_default - - persistent - - status - - created_at - - updated_at - BranchDeleteResponse: - type: object - properties: - message: - type: string - enum: - - ok - required: - - message - BranchActionBody: - type: object - properties: - migration_version: - type: string - BranchUpdateResponse: - type: object - properties: - workflow_run_id: - type: string - message: - type: string - enum: - - ok - required: - - workflow_run_id - - message - V1ProjectWithDatabaseResponse: - type: object - properties: - id: - type: string - description: Id of your project - organization_id: - type: string - description: Slug of your organization - name: - type: string - description: Name of your project - region: - type: string - description: Region of your project - example: us-east-1 - created_at: - type: string - description: Creation timestamp - example: '2023-03-29T16:32:59Z' - status: - type: string - enum: - - INACTIVE - - ACTIVE_HEALTHY - - ACTIVE_UNHEALTHY - - COMING_UP - - UNKNOWN - - GOING_DOWN - - INIT_FAILED - - REMOVED - - RESTORING - - UPGRADING - - PAUSING - - RESTORE_FAILED - - RESTARTING - - PAUSE_FAILED - - RESIZING - database: - type: object - properties: - host: - type: string - description: Database host - version: - type: string - description: Database version - postgres_engine: - type: string - description: Database engine - release_channel: - type: string - description: Release channel - required: - - host - - version - - postgres_engine - - release_channel - required: - - id - - organization_id - - name - - region - - created_at - - status - - database - V1CreateProjectBody: - type: object - properties: - db_pass: - type: string - description: Database password - name: - type: string - maxLength: 256 - description: Name of your project - organization_id: - type: string - description: Slug of your organization - plan: - type: string - enum: - - free - - pro - deprecated: true - description: >- - Subscription Plan is now set on organization level and is ignored in - this request - region: - type: string - description: Region you want your server to reside in - enum: - - us-east-1 - - us-east-2 - - us-west-1 - - us-west-2 - - ap-east-1 - - ap-southeast-1 - - ap-northeast-1 - - ap-northeast-2 - - ap-southeast-2 - - eu-west-1 - - eu-west-2 - - eu-west-3 - - eu-north-1 - - eu-central-1 - - eu-central-2 - - ca-central-1 - - ap-south-1 - - sa-east-1 - kps_enabled: - type: boolean - deprecated: true - description: This field is deprecated and is ignored in this request - desired_instance_size: - type: string - enum: - - pico - - micro - - small - - medium - - large - - xlarge - - 2xlarge - - 4xlarge - - 8xlarge - - 12xlarge - - 16xlarge - - 24xlarge - - 24xlarge_optimized_memory - - 24xlarge_optimized_cpu - - 24xlarge_high_memory - - 48xlarge - - 48xlarge_optimized_memory - - 48xlarge_optimized_cpu - - 48xlarge_high_memory - template_url: - type: string - format: uri - description: Template URL used to create the project from the CLI. - example: >- - https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone - required: - - db_pass - - name - - organization_id - - region - additionalProperties: false - hideDefinitions: - - release_channel - - postgres_engine - V1ProjectResponse: - type: object - properties: - id: - type: string - description: Id of your project - organization_id: - type: string - description: Slug of your organization - name: - type: string - description: Name of your project - region: - type: string - description: Region of your project - example: us-east-1 - created_at: - type: string - description: Creation timestamp - example: '2023-03-29T16:32:59Z' - status: - type: string - enum: - - INACTIVE - - ACTIVE_HEALTHY - - ACTIVE_UNHEALTHY - - COMING_UP - - UNKNOWN - - GOING_DOWN - - INIT_FAILED - - REMOVED - - RESTORING - - UPGRADING - - PAUSING - - RESTORE_FAILED - - RESTARTING - - PAUSE_FAILED - - RESIZING - required: - - id - - organization_id - - name - - region - - created_at - - status - OrganizationResponseV1: - type: object - properties: - id: - type: string - name: - type: string - required: - - id - - name - CreateOrganizationV1: - type: object - properties: - name: - type: string - required: - - name - additionalProperties: false - OAuthTokenBody: - type: object - properties: - grant_type: - type: string - enum: - - authorization_code - - refresh_token - client_id: - type: string - format: uuid - client_secret: - type: string - code: - type: string - code_verifier: - type: string - redirect_uri: - type: string - refresh_token: - type: string - additionalProperties: false - OAuthTokenResponse: - type: object - properties: - access_token: - type: string - refresh_token: - type: string - expires_in: - type: integer - token_type: - type: string - enum: - - Bearer - required: - - access_token - - refresh_token - - expires_in - - token_type - additionalProperties: false - OAuthRevokeTokenBody: - type: object - properties: - client_id: - type: string - format: uuid - client_secret: - type: string - refresh_token: - type: string - required: - - client_id - - client_secret - - refresh_token - additionalProperties: false - SnippetList: - type: object - properties: - data: - type: array - items: - type: object - properties: - id: - type: string - inserted_at: - type: string - updated_at: - type: string - type: - type: string - enum: - - sql - visibility: - type: string - enum: - - user - - project - - org - - public - name: - type: string - description: - type: string - nullable: true - project: - type: object - properties: - id: - type: number - name: - type: string - required: - - id - - name - owner: - type: object - properties: - id: - type: number - username: - type: string - required: - - id - - username - updated_by: - type: object - properties: - id: - type: number - username: - type: string - required: - - id - - username - required: - - id - - inserted_at - - updated_at - - type - - visibility - - name - - description - - project - - owner - - updated_by - cursor: - type: string - required: - - data - SnippetResponse: - type: object - properties: - id: - type: string - inserted_at: - type: string - updated_at: - type: string - type: - type: string - enum: - - sql - visibility: - type: string - enum: - - user - - project - - org - - public - name: - type: string - description: - type: string - nullable: true - project: - type: object - properties: - id: - type: number - name: - type: string - required: - - id - - name - owner: - type: object - properties: - id: - type: number - username: - type: string - required: - - id - - username - updated_by: - type: object - properties: - id: - type: number - username: - type: string - required: - - id - - username - content: - type: object - properties: - favorite: - type: boolean - schema_version: - type: string - sql: - type: string - required: - - favorite - - schema_version - - sql - required: - - id - - inserted_at - - updated_at - - type - - visibility - - name - - description - - project - - owner - - updated_by - - content - ApiKeyResponse: - type: object - properties: - api_key: - type: string - id: - type: string - nullable: true - type: - type: string - enum: - - publishable - - secret - - legacy - nullable: true - prefix: - type: string - nullable: true - name: - type: string - description: - type: string - nullable: true - hash: - type: string - nullable: true - secret_jwt_template: - type: object - properties: - role: - type: string - minLength: 1 - required: - - role - nullable: true - inserted_at: - type: string - format: date-time - nullable: true - updated_at: - type: string - format: date-time - nullable: true - required: - - api_key - - name - CreateApiKeyBody: - type: object - properties: - type: - type: string - enum: - - publishable - - secret - name: - type: string - minLength: 4 - maxLength: 64 - pattern: ^[a-z_][a-z0-9_]+$ - description: - type: string - nullable: true - secret_jwt_template: - type: object - properties: - role: - type: string - minLength: 1 - required: - - role - nullable: true - required: - - type - - name - UpdateApiKeyBody: - type: object - properties: - name: - type: string - minLength: 4 - maxLength: 64 - pattern: ^[a-z_][a-z0-9_]+$ - description: - type: string - nullable: true - secret_jwt_template: - type: object - properties: - role: - type: string - minLength: 1 - required: - - role - nullable: true - CreateBranchBody: - type: object - properties: - branch_name: - type: string - minLength: 1 - git_branch: - type: string - persistent: - type: boolean - region: - type: string - desired_instance_size: - type: string - enum: - - pico - - nano - - micro - - small - - medium - - large - - xlarge - - 2xlarge - - 4xlarge - - 8xlarge - - 12xlarge - - 16xlarge - - 24xlarge - - 24xlarge_optimized_memory - - 24xlarge_optimized_cpu - - 24xlarge_high_memory - - 48xlarge - - 48xlarge_optimized_memory - - 48xlarge_optimized_cpu - - 48xlarge_high_memory - release_channel: - type: string - enum: - - internal - - alpha - - beta - - ga - - withdrawn - - preview - description: Release channel. If not provided, GA will be used. - postgres_engine: - type: string - enum: - - '15' - - '17' - - 17-oriole - description: >- - Postgres engine version. If not provided, the latest version will be - used. - secrets: - type: object - additionalProperties: - type: string - required: - - branch_name - UpdateCustomHostnameResponse: - type: object - properties: - status: - type: string - enum: - - 1_not_started - - 2_initiated - - 3_challenge_verified - - 4_origin_setup_completed - - 5_services_reconfigured - custom_hostname: - type: string - data: - type: object - properties: - success: - type: boolean - errors: - type: array - items: - description: Any JSON-serializable value - messages: - type: array - items: - description: Any JSON-serializable value - result: - type: object - properties: - id: - type: string - hostname: - type: string - ssl: - type: object - properties: - status: - type: string - validation_records: - type: array - items: - type: object - properties: - txt_name: - type: string - txt_value: - type: string - required: - - txt_name - - txt_value - validation_errors: - type: array - items: - type: object - properties: - message: - type: string - required: - - message - required: - - status - - validation_records - ownership_verification: - type: object - properties: - type: - type: string - name: - type: string - value: - type: string - required: - - type - - name - - value - custom_origin_server: - type: string - verification_errors: - type: array - items: - type: string - status: - type: string - required: - - id - - hostname - - ssl - - ownership_verification - - custom_origin_server - - status - required: - - success - - errors - - messages - - result - required: - - status - - custom_hostname - - data - UpdateCustomHostnameBody: - type: object - properties: - custom_hostname: - type: string - required: - - custom_hostname - NetworkBanResponse: - type: object - properties: - banned_ipv4_addresses: - type: array - items: - type: string - required: - - banned_ipv4_addresses - NetworkBanResponseEnriched: - type: object - properties: - banned_ipv4_addresses: - type: array - items: - type: object - properties: - banned_address: - type: string - identifier: - type: string - type: - type: string - required: - - banned_address - - identifier - - type - required: - - banned_ipv4_addresses - RemoveNetworkBanRequest: - type: object - properties: - ipv4_addresses: - type: array - items: - type: string - identifier: - type: string - required: - - ipv4_addresses - NetworkRestrictionsResponse: - type: object - properties: - entitlement: - type: string - enum: - - disallowed - - allowed - config: - type: object - properties: - dbAllowedCidrs: - type: array - items: - type: string - dbAllowedCidrsV6: - type: array - items: - type: string - description: >- - At any given point in time, this is the config that the user has - requested be applied to their project. The `status` field indicates - if it has been applied to the project, or is pending. When an - updated config is received, the applied config is moved to - `old_config`. - old_config: - type: object - properties: - dbAllowedCidrs: - type: array - items: - type: string - dbAllowedCidrsV6: - type: array - items: - type: string - description: >- - Populated when a new config has been received, but not registered as - successfully applied to a project. - status: - type: string - enum: - - stored - - applied - required: - - entitlement - - config - - status - NetworkRestrictionsRequest: - type: object - properties: - dbAllowedCidrs: - type: array - items: - type: string - dbAllowedCidrsV6: - type: array - items: - type: string - PgsodiumConfigResponse: - type: object - properties: - root_key: - type: string - required: - - root_key - UpdatePgsodiumConfigBody: - type: object - properties: - root_key: - type: string - required: - - root_key - PostgrestConfigWithJWTSecretResponse: - type: object - properties: - db_schema: - type: string - max_rows: - type: integer - db_extra_search_path: - type: string - db_pool: - type: integer - nullable: true - description: >- - If `null`, the value is automatically configured based on compute - size. - jwt_secret: - type: string - required: - - db_schema - - max_rows - - db_extra_search_path - - db_pool - V1UpdatePostgrestConfigBody: - type: object - properties: - db_extra_search_path: - type: string - db_schema: - type: string - max_rows: - type: integer - minimum: 0 - maximum: 1000000 - db_pool: - type: integer - minimum: 0 - maximum: 1000 - V1PostgrestConfigResponse: - type: object - properties: - db_schema: - type: string - max_rows: - type: integer - db_extra_search_path: - type: string - db_pool: - type: integer - nullable: true - description: >- - If `null`, the value is automatically configured based on compute - size. - required: - - db_schema - - max_rows - - db_extra_search_path - - db_pool - V1ProjectRefResponse: - type: object - properties: - id: - type: integer - ref: - type: string - name: - type: string - required: - - id - - ref - - name - SecretResponse: - type: object - properties: - name: - type: string - value: - type: string - updated_at: - type: string - required: - - name - - value - CreateSecretBody: - type: array - items: - type: object - properties: - name: - type: string - maxLength: 256 - pattern: ^(?!SUPABASE_).* - description: Secret name must not start with the SUPABASE_ prefix. - example: string - value: - type: string - maxLength: 24576 - required: - - name - - value - SslEnforcementResponse: - type: object - properties: - currentConfig: - type: object - properties: - database: - type: boolean - required: - - database - appliedSuccessfully: - type: boolean - required: - - currentConfig - - appliedSuccessfully - SslEnforcementRequest: - type: object - properties: - requestedConfig: - type: object - properties: - database: - type: boolean - required: - - database - required: - - requestedConfig - TypescriptResponse: - type: object - properties: - types: - type: string - required: - - types - VanitySubdomainConfigResponse: - type: object - properties: - status: - type: string - enum: - - not-used - - custom-domain-used - - active - custom_domain: - type: string - required: - - status - VanitySubdomainBody: - type: object - properties: - vanity_subdomain: - type: string - required: - - vanity_subdomain - SubdomainAvailabilityResponse: - type: object - properties: - available: - type: boolean - required: - - available - ActivateVanitySubdomainResponse: - type: object - properties: - custom_domain: - type: string - required: - - custom_domain - UpgradeDatabaseBody: - type: object - properties: - target_version: - type: string - release_channel: - type: string - enum: - - internal - - alpha - - beta - - ga - - withdrawn - - preview - required: - - target_version - ProjectUpgradeInitiateResponse: - type: object - properties: - tracking_id: - type: string - required: - - tracking_id - ProjectUpgradeEligibilityResponse: - type: object - properties: - eligible: - type: boolean - current_app_version: - type: string - current_app_version_release_channel: - type: string - enum: - - internal - - alpha - - beta - - ga - - withdrawn - - preview - latest_app_version: - type: string - target_upgrade_versions: - type: array - items: - type: object - properties: - postgres_version: - type: string - enum: - - '15' - - '17' - - 17-oriole - release_channel: - type: string - enum: - - internal - - alpha - - beta - - ga - - withdrawn - - preview - app_version: - type: string - required: - - postgres_version - - release_channel - - app_version - potential_breaking_changes: - type: array - items: - type: string - duration_estimate_hours: - type: number - legacy_auth_custom_roles: - type: array - items: - type: string - extension_dependent_objects: - type: array - items: - type: string - required: - - eligible - - current_app_version - - current_app_version_release_channel - - latest_app_version - - target_upgrade_versions - - potential_breaking_changes - - duration_estimate_hours - - legacy_auth_custom_roles - - extension_dependent_objects - DatabaseUpgradeStatusResponse: - type: object - properties: - databaseUpgradeStatus: - type: object - properties: - initiated_at: - type: string - latest_status_at: - type: string - target_version: - type: number - error: - type: string - enum: - - 1_upgraded_instance_launch_failed - - 2_volume_detachchment_from_upgraded_instance_failed - - 3_volume_attachment_to_original_instance_failed - - 4_data_upgrade_initiation_failed - - 5_data_upgrade_completion_failed - - 6_volume_detachchment_from_original_instance_failed - - 7_volume_attachment_to_upgraded_instance_failed - - 8_upgrade_completion_failed - - 9_post_physical_backup_failed - progress: - type: string - enum: - - 0_requested - - 1_started - - 2_launched_upgraded_instance - - 3_detached_volume_from_upgraded_instance - - 4_attached_volume_to_original_instance - - 5_initiated_data_upgrade - - 6_completed_data_upgrade - - 7_detached_volume_from_original_instance - - 8_attached_volume_to_upgraded_instance - - 9_completed_upgrade - - 10_completed_post_physical_backup - status: - type: number - required: - - initiated_at - - latest_status_at - - target_version - - status - nullable: true - required: - - databaseUpgradeStatus - ReadOnlyStatusResponse: - type: object - properties: - enabled: - type: boolean - override_enabled: - type: boolean - override_active_until: - type: string - required: - - enabled - - override_enabled - - override_active_until - SetUpReadReplicaBody: - type: object - properties: - read_replica_region: - type: string - enum: - - us-east-1 - - us-east-2 - - us-west-1 - - us-west-2 - - ap-east-1 - - ap-southeast-1 - - ap-northeast-1 - - ap-northeast-2 - - ap-southeast-2 - - eu-west-1 - - eu-west-2 - - eu-west-3 - - eu-north-1 - - eu-central-1 - - eu-central-2 - - ca-central-1 - - ap-south-1 - - sa-east-1 - description: Region you want your read replica to reside in - example: us-east-1 - required: - - read_replica_region - RemoveReadReplicaBody: - type: object - properties: - database_identifier: - type: string - required: - - database_identifier - V1ServiceHealthResponse: - type: object - properties: - name: - type: string - enum: - - auth - - db - - pooler - - realtime - - rest - - storage - healthy: - type: boolean - status: - type: string - enum: - - COMING_UP - - ACTIVE_HEALTHY - - UNHEALTHY - info: - oneOf: - - type: object - properties: - name: - type: string - enum: - - GoTrue - version: - type: string - description: - type: string - required: - - name - - version - - description - - type: object - properties: - healthy: - type: boolean - db_connected: - type: boolean - connected_cluster: - type: integer - required: - - healthy - - db_connected - - connected_cluster - error: - type: string - required: - - name - - healthy - - status - CreateSigningKeyBody: - type: object - properties: - algorithm: - type: string - enum: - - EdDSA - - ES256 - - RS256 - - HS256 - status: - type: string - enum: - - in_use - - standby - required: - - algorithm - additionalProperties: false - SigningKeyResponse: - type: object - properties: - id: - type: string - format: uuid - algorithm: - type: string - enum: - - EdDSA - - ES256 - - RS256 - - HS256 - status: - type: string - enum: - - in_use - - previously_used - - revoked - - standby - public_jwk: - nullable: true - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - required: - - id - - algorithm - - status - - created_at - - updated_at - additionalProperties: false - SigningKeysResponse: - type: object - properties: - keys: - type: array - items: - type: object - properties: - id: - type: string - format: uuid - algorithm: - type: string - enum: - - EdDSA - - ES256 - - RS256 - - HS256 - status: - type: string - enum: - - in_use - - previously_used - - revoked - - standby - public_jwk: - nullable: true - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - required: - - id - - algorithm - - status - - created_at - - updated_at - additionalProperties: false - required: - - keys - additionalProperties: false - UpdateSigningKeyBody: - type: object - properties: - status: - type: string - enum: - - in_use - - previously_used - - revoked - - standby - required: - - status - additionalProperties: false - StorageConfigResponse: - type: object - properties: - fileSizeLimit: - type: integer - format: int64 - features: - type: object - properties: - imageTransformation: - type: object - properties: - enabled: - type: boolean - required: - - enabled - s3Protocol: - type: object - properties: - enabled: - type: boolean - required: - - enabled - required: - - imageTransformation - - s3Protocol - required: - - fileSizeLimit - - features - UpdateStorageConfigBody: - type: object - properties: - fileSizeLimit: - type: integer - minimum: 0 - maximum: 53687091200 - format: int64 - features: - type: object - properties: - imageTransformation: - type: object - properties: - enabled: - type: boolean - required: - - enabled - s3Protocol: - type: object - properties: - enabled: - type: boolean - required: - - enabled - required: - - imageTransformation - - s3Protocol - PostgresConfigResponse: - type: object - properties: - effective_cache_size: - type: string - logical_decoding_work_mem: - type: string - maintenance_work_mem: - type: string - track_activity_query_size: - type: string - max_connections: - type: integer - minimum: 1 - maximum: 262143 - max_locks_per_transaction: - type: integer - minimum: 10 - maximum: 2147483640 - max_parallel_maintenance_workers: - type: integer - minimum: 0 - maximum: 1024 - max_parallel_workers: - type: integer - minimum: 0 - maximum: 1024 - max_parallel_workers_per_gather: - type: integer - minimum: 0 - maximum: 1024 - max_replication_slots: - type: integer - max_slot_wal_keep_size: - type: string - max_standby_archive_delay: - type: string - max_standby_streaming_delay: - type: string - max_wal_size: - type: string - max_wal_senders: - type: integer - max_worker_processes: - type: integer - minimum: 0 - maximum: 262143 - session_replication_role: - type: string - enum: - - origin - - replica - - local - shared_buffers: - type: string - statement_timeout: - type: string - track_commit_timestamp: - type: boolean - wal_keep_size: - type: string - wal_sender_timeout: - type: string - work_mem: - type: string - UpdatePostgresConfigBody: - type: object - properties: - effective_cache_size: - type: string - logical_decoding_work_mem: - type: string - maintenance_work_mem: - type: string - track_activity_query_size: - type: string - max_connections: - type: integer - minimum: 1 - maximum: 262143 - max_locks_per_transaction: - type: integer - minimum: 10 - maximum: 2147483640 - max_parallel_maintenance_workers: - type: integer - minimum: 0 - maximum: 1024 - max_parallel_workers: - type: integer - minimum: 0 - maximum: 1024 - max_parallel_workers_per_gather: - type: integer - minimum: 0 - maximum: 1024 - max_replication_slots: - type: integer - max_slot_wal_keep_size: - type: string - max_standby_archive_delay: - type: string - max_standby_streaming_delay: - type: string - max_wal_size: - type: string - max_wal_senders: - type: integer - max_worker_processes: - type: integer - minimum: 0 - maximum: 262143 - session_replication_role: - type: string - enum: - - origin - - replica - - local - shared_buffers: - type: string - statement_timeout: - type: string - track_commit_timestamp: - type: boolean - wal_keep_size: - type: string - wal_sender_timeout: - type: string - work_mem: - type: string - restart_database: - type: boolean - V1PgbouncerConfigResponse: - type: object - properties: - default_pool_size: - type: number - ignore_startup_parameters: - type: string - max_client_conn: - type: number - pool_mode: - type: string - enum: - - transaction - - session - - statement - connection_string: - type: string - SupavisorConfigResponse: - type: object - properties: - identifier: - type: string - database_type: - type: string - enum: - - PRIMARY - - READ_REPLICA - is_using_scram_auth: - type: boolean - db_user: - type: string - db_host: - type: string - db_port: - type: integer - db_name: - type: string - exclusiveMinimum: true - minimum: 0 - connection_string: - type: string - default_pool_size: - type: integer - nullable: true - max_client_conn: - type: integer - nullable: true - pool_mode: - type: string - enum: - - transaction - - session - required: - - identifier - - database_type - - is_using_scram_auth - - db_user - - db_host - - db_port - - db_name - - connection_string - - connectionString - - default_pool_size - - max_client_conn - - pool_mode - UpdateSupavisorConfigBody: - type: object - properties: - default_pool_size: - type: integer - minimum: 0 - maximum: 3000 - nullable: true - pool_mode: - type: string - enum: - - transaction - - session - description: Dedicated pooler mode for the project - UpdateSupavisorConfigResponse: - type: object - properties: - default_pool_size: - type: integer - nullable: true - pool_mode: - type: string - required: - - default_pool_size - - pool_mode - AuthConfigResponse: - type: object - properties: - api_max_request_duration: - type: integer - nullable: true - db_max_pool_size: - type: integer - nullable: true - disable_signup: - type: boolean - nullable: true - external_anonymous_users_enabled: - type: boolean - nullable: true - external_apple_additional_client_ids: - type: string - nullable: true - external_apple_client_id: - type: string - nullable: true - external_apple_enabled: - type: boolean - nullable: true - external_apple_secret: - type: string - nullable: true - external_azure_client_id: - type: string - nullable: true - external_azure_enabled: - type: boolean - nullable: true - external_azure_secret: - type: string - nullable: true - external_azure_url: - type: string - nullable: true - external_bitbucket_client_id: - type: string - nullable: true - external_bitbucket_enabled: - type: boolean - nullable: true - external_bitbucket_secret: - type: string - nullable: true - external_discord_client_id: - type: string - nullable: true - external_discord_enabled: - type: boolean - nullable: true - external_discord_secret: - type: string - nullable: true - external_email_enabled: - type: boolean - nullable: true - external_facebook_client_id: - type: string - nullable: true - external_facebook_enabled: - type: boolean - nullable: true - external_facebook_secret: - type: string - nullable: true - external_figma_client_id: - type: string - nullable: true - external_figma_enabled: - type: boolean - nullable: true - external_figma_secret: - type: string - nullable: true - external_github_client_id: - type: string - nullable: true - external_github_enabled: - type: boolean - nullable: true - external_github_secret: - type: string - nullable: true - external_gitlab_client_id: - type: string - nullable: true - external_gitlab_enabled: - type: boolean - nullable: true - external_gitlab_secret: - type: string - nullable: true - external_gitlab_url: - type: string - nullable: true - external_google_additional_client_ids: - type: string - nullable: true - external_google_client_id: - type: string - nullable: true - external_google_enabled: - type: boolean - nullable: true - external_google_secret: - type: string - nullable: true - external_google_skip_nonce_check: - type: boolean - nullable: true - external_kakao_client_id: - type: string - nullable: true - external_kakao_enabled: - type: boolean - nullable: true - external_kakao_secret: - type: string - nullable: true - external_keycloak_client_id: - type: string - nullable: true - external_keycloak_enabled: - type: boolean - nullable: true - external_keycloak_secret: - type: string - nullable: true - external_keycloak_url: - type: string - nullable: true - external_linkedin_oidc_client_id: - type: string - nullable: true - external_linkedin_oidc_enabled: - type: boolean - nullable: true - external_linkedin_oidc_secret: - type: string - nullable: true - external_slack_oidc_client_id: - type: string - nullable: true - external_slack_oidc_enabled: - type: boolean - nullable: true - external_slack_oidc_secret: - type: string - nullable: true - external_notion_client_id: - type: string - nullable: true - external_notion_enabled: - type: boolean - nullable: true - external_notion_secret: - type: string - nullable: true - external_phone_enabled: - type: boolean - nullable: true - external_slack_client_id: - type: string - nullable: true - external_slack_enabled: - type: boolean - nullable: true - external_slack_secret: - type: string - nullable: true - external_spotify_client_id: - type: string - nullable: true - external_spotify_enabled: - type: boolean - nullable: true - external_spotify_secret: - type: string - nullable: true - external_twitch_client_id: - type: string - nullable: true - external_twitch_enabled: - type: boolean - nullable: true - external_twitch_secret: - type: string - nullable: true - external_twitter_client_id: - type: string - nullable: true - external_twitter_enabled: - type: boolean - nullable: true - external_twitter_secret: - type: string - nullable: true - external_workos_client_id: - type: string - nullable: true - external_workos_enabled: - type: boolean - nullable: true - external_workos_secret: - type: string - nullable: true - external_workos_url: - type: string - nullable: true - external_web3_solana_enabled: - type: boolean - nullable: true - external_zoom_client_id: - type: string - nullable: true - external_zoom_enabled: - type: boolean - nullable: true - external_zoom_secret: - type: string - nullable: true - hook_custom_access_token_enabled: - type: boolean - nullable: true - hook_custom_access_token_uri: - type: string - nullable: true - hook_custom_access_token_secrets: - type: string - nullable: true - hook_mfa_verification_attempt_enabled: - type: boolean - nullable: true - hook_mfa_verification_attempt_uri: - type: string - nullable: true - hook_mfa_verification_attempt_secrets: - type: string - nullable: true - hook_password_verification_attempt_enabled: - type: boolean - nullable: true - hook_password_verification_attempt_uri: - type: string - nullable: true - hook_password_verification_attempt_secrets: - type: string - nullable: true - hook_send_sms_enabled: - type: boolean - nullable: true - hook_send_sms_uri: - type: string - nullable: true - hook_send_sms_secrets: - type: string - nullable: true - hook_send_email_enabled: - type: boolean - nullable: true - hook_send_email_uri: - type: string - nullable: true - hook_send_email_secrets: - type: string - nullable: true - jwt_exp: - type: integer - nullable: true - mailer_allow_unverified_email_sign_ins: - type: boolean - nullable: true - mailer_autoconfirm: - type: boolean - nullable: true - mailer_otp_exp: - type: integer - mailer_otp_length: - type: integer - nullable: true - mailer_secure_email_change_enabled: - type: boolean - nullable: true - mailer_subjects_confirmation: - type: string - nullable: true - mailer_subjects_email_change: - type: string - nullable: true - mailer_subjects_invite: - type: string - nullable: true - mailer_subjects_magic_link: - type: string - nullable: true - mailer_subjects_reauthentication: - type: string - nullable: true - mailer_subjects_recovery: - type: string - nullable: true - mailer_templates_confirmation_content: - type: string - nullable: true - mailer_templates_email_change_content: - type: string - nullable: true - mailer_templates_invite_content: - type: string - nullable: true - mailer_templates_magic_link_content: - type: string - nullable: true - mailer_templates_reauthentication_content: - type: string - nullable: true - mailer_templates_recovery_content: - type: string - nullable: true - mfa_max_enrolled_factors: - type: integer - nullable: true - mfa_totp_enroll_enabled: - type: boolean - nullable: true - mfa_totp_verify_enabled: - type: boolean - nullable: true - mfa_phone_enroll_enabled: - type: boolean - nullable: true - mfa_phone_verify_enabled: - type: boolean - nullable: true - mfa_web_authn_enroll_enabled: - type: boolean - nullable: true - mfa_web_authn_verify_enabled: - type: boolean - nullable: true - mfa_phone_otp_length: - type: integer - mfa_phone_template: - type: string - nullable: true - mfa_phone_max_frequency: - type: integer - nullable: true - password_hibp_enabled: - type: boolean - nullable: true - password_min_length: - type: integer - nullable: true - password_required_characters: - type: string - nullable: true - rate_limit_anonymous_users: - type: integer - nullable: true - rate_limit_email_sent: - type: integer - nullable: true - rate_limit_sms_sent: - type: integer - nullable: true - rate_limit_token_refresh: - type: integer - nullable: true - rate_limit_verify: - type: integer - nullable: true - rate_limit_otp: - type: integer - nullable: true - rate_limit_web3: - type: integer - nullable: true - refresh_token_rotation_enabled: - type: boolean - nullable: true - saml_enabled: - type: boolean - nullable: true - saml_external_url: - type: string - nullable: true - saml_allow_encrypted_assertions: - type: boolean - nullable: true - security_captcha_enabled: - type: boolean - nullable: true - security_captcha_provider: - type: string - nullable: true - security_captcha_secret: - type: string - nullable: true - security_manual_linking_enabled: - type: boolean - nullable: true - security_refresh_token_reuse_interval: - type: integer - nullable: true - security_update_password_require_reauthentication: - type: boolean - nullable: true - sessions_inactivity_timeout: - type: integer - nullable: true - sessions_single_per_user: - type: boolean - nullable: true - sessions_tags: - type: string - nullable: true - sessions_timebox: - type: integer - nullable: true - site_url: - type: string - nullable: true - sms_autoconfirm: - type: boolean - nullable: true - sms_max_frequency: - type: integer - nullable: true - sms_messagebird_access_key: - type: string - nullable: true - sms_messagebird_originator: - type: string - nullable: true - sms_otp_exp: - type: integer - nullable: true - sms_otp_length: - type: integer - sms_provider: - type: string - nullable: true - sms_template: - type: string - nullable: true - sms_test_otp: - type: string - nullable: true - sms_test_otp_valid_until: - type: string - nullable: true - sms_textlocal_api_key: - type: string - nullable: true - sms_textlocal_sender: - type: string - nullable: true - sms_twilio_account_sid: - type: string - nullable: true - sms_twilio_auth_token: - type: string - nullable: true - sms_twilio_content_sid: - type: string - nullable: true - sms_twilio_message_service_sid: - type: string - nullable: true - sms_twilio_verify_account_sid: - type: string - nullable: true - sms_twilio_verify_auth_token: - type: string - nullable: true - sms_twilio_verify_message_service_sid: - type: string - nullable: true - sms_vonage_api_key: - type: string - nullable: true - sms_vonage_api_secret: - type: string - nullable: true - sms_vonage_from: - type: string - nullable: true - smtp_admin_email: - type: string - nullable: true - smtp_host: - type: string - nullable: true - smtp_max_frequency: - type: integer - nullable: true - smtp_pass: - type: string - nullable: true - smtp_port: - type: string - nullable: true - smtp_sender_name: - type: string - nullable: true - smtp_user: - type: string - nullable: true - uri_allow_list: - type: string - nullable: true - required: - - api_max_request_duration - - db_max_pool_size - - disable_signup - - external_anonymous_users_enabled - - external_apple_additional_client_ids - - external_apple_client_id - - external_apple_enabled - - external_apple_secret - - external_azure_client_id - - external_azure_enabled - - external_azure_secret - - external_azure_url - - external_bitbucket_client_id - - external_bitbucket_enabled - - external_bitbucket_secret - - external_discord_client_id - - external_discord_enabled - - external_discord_secret - - external_email_enabled - - external_facebook_client_id - - external_facebook_enabled - - external_facebook_secret - - external_figma_client_id - - external_figma_enabled - - external_figma_secret - - external_github_client_id - - external_github_enabled - - external_github_secret - - external_gitlab_client_id - - external_gitlab_enabled - - external_gitlab_secret - - external_gitlab_url - - external_google_additional_client_ids - - external_google_client_id - - external_google_enabled - - external_google_secret - - external_google_skip_nonce_check - - external_kakao_client_id - - external_kakao_enabled - - external_kakao_secret - - external_keycloak_client_id - - external_keycloak_enabled - - external_keycloak_secret - - external_keycloak_url - - external_linkedin_oidc_client_id - - external_linkedin_oidc_enabled - - external_linkedin_oidc_secret - - external_slack_oidc_client_id - - external_slack_oidc_enabled - - external_slack_oidc_secret - - external_notion_client_id - - external_notion_enabled - - external_notion_secret - - external_phone_enabled - - external_slack_client_id - - external_slack_enabled - - external_slack_secret - - external_spotify_client_id - - external_spotify_enabled - - external_spotify_secret - - external_twitch_client_id - - external_twitch_enabled - - external_twitch_secret - - external_twitter_client_id - - external_twitter_enabled - - external_twitter_secret - - external_workos_client_id - - external_workos_enabled - - external_workos_secret - - external_workos_url - - external_web3_solana_enabled - - external_zoom_client_id - - external_zoom_enabled - - external_zoom_secret - - hook_custom_access_token_enabled - - hook_custom_access_token_uri - - hook_custom_access_token_secrets - - hook_mfa_verification_attempt_enabled - - hook_mfa_verification_attempt_uri - - hook_mfa_verification_attempt_secrets - - hook_password_verification_attempt_enabled - - hook_password_verification_attempt_uri - - hook_password_verification_attempt_secrets - - hook_send_sms_enabled - - hook_send_sms_uri - - hook_send_sms_secrets - - hook_send_email_enabled - - hook_send_email_uri - - hook_send_email_secrets - - jwt_exp - - mailer_allow_unverified_email_sign_ins - - mailer_autoconfirm - - mailer_otp_exp - - mailer_otp_length - - mailer_secure_email_change_enabled - - mailer_subjects_confirmation - - mailer_subjects_email_change - - mailer_subjects_invite - - mailer_subjects_magic_link - - mailer_subjects_reauthentication - - mailer_subjects_recovery - - mailer_templates_confirmation_content - - mailer_templates_email_change_content - - mailer_templates_invite_content - - mailer_templates_magic_link_content - - mailer_templates_reauthentication_content - - mailer_templates_recovery_content - - mfa_max_enrolled_factors - - mfa_totp_enroll_enabled - - mfa_totp_verify_enabled - - mfa_phone_enroll_enabled - - mfa_phone_verify_enabled - - mfa_web_authn_enroll_enabled - - mfa_web_authn_verify_enabled - - mfa_phone_otp_length - - mfa_phone_template - - mfa_phone_max_frequency - - password_hibp_enabled - - password_min_length - - password_required_characters - - rate_limit_anonymous_users - - rate_limit_email_sent - - rate_limit_sms_sent - - rate_limit_token_refresh - - rate_limit_verify - - rate_limit_otp - - rate_limit_web3 - - refresh_token_rotation_enabled - - saml_enabled - - saml_external_url - - saml_allow_encrypted_assertions - - security_captcha_enabled - - security_captcha_provider - - security_captcha_secret - - security_manual_linking_enabled - - security_refresh_token_reuse_interval - - security_update_password_require_reauthentication - - sessions_inactivity_timeout - - sessions_single_per_user - - sessions_tags - - sessions_timebox - - site_url - - sms_autoconfirm - - sms_max_frequency - - sms_messagebird_access_key - - sms_messagebird_originator - - sms_otp_exp - - sms_otp_length - - sms_provider - - sms_template - - sms_test_otp - - sms_test_otp_valid_until - - sms_textlocal_api_key - - sms_textlocal_sender - - sms_twilio_account_sid - - sms_twilio_auth_token - - sms_twilio_content_sid - - sms_twilio_message_service_sid - - sms_twilio_verify_account_sid - - sms_twilio_verify_auth_token - - sms_twilio_verify_message_service_sid - - sms_vonage_api_key - - sms_vonage_api_secret - - sms_vonage_from - - smtp_admin_email - - smtp_host - - smtp_max_frequency - - smtp_pass - - smtp_port - - smtp_sender_name - - smtp_user - - uri_allow_list - UpdateAuthConfigBody: - type: object - properties: - site_url: - type: string - pattern: ^[^,]+$ - nullable: true - disable_signup: - type: boolean - nullable: true - jwt_exp: - type: integer - minimum: 0 - maximum: 604800 - nullable: true - smtp_admin_email: - type: string - nullable: true - smtp_host: - type: string - nullable: true - smtp_port: - type: string - nullable: true - smtp_user: - type: string - nullable: true - smtp_pass: - type: string - nullable: true - smtp_max_frequency: - type: integer - minimum: 0 - maximum: 32767 - nullable: true - smtp_sender_name: - type: string - nullable: true - mailer_allow_unverified_email_sign_ins: - type: boolean - nullable: true - mailer_autoconfirm: - type: boolean - nullable: true - mailer_subjects_invite: - type: string - nullable: true - mailer_subjects_confirmation: - type: string - nullable: true - mailer_subjects_recovery: - type: string - nullable: true - mailer_subjects_email_change: - type: string - nullable: true - mailer_subjects_magic_link: - type: string - nullable: true - mailer_subjects_reauthentication: - type: string - nullable: true - mailer_templates_invite_content: - type: string - nullable: true - mailer_templates_confirmation_content: - type: string - nullable: true - mailer_templates_recovery_content: - type: string - nullable: true - mailer_templates_email_change_content: - type: string - nullable: true - mailer_templates_magic_link_content: - type: string - nullable: true - mailer_templates_reauthentication_content: - type: string - nullable: true - mfa_max_enrolled_factors: - type: integer - minimum: 0 - maximum: 2147483647 - nullable: true - uri_allow_list: - type: string - nullable: true - external_anonymous_users_enabled: - type: boolean - nullable: true - external_email_enabled: - type: boolean - nullable: true - external_phone_enabled: - type: boolean - nullable: true - saml_enabled: - type: boolean - nullable: true - saml_external_url: - type: string - pattern: ^[^,]+$ - nullable: true - security_captcha_enabled: - type: boolean - nullable: true - security_captcha_provider: - type: string - enum: - - turnstile - - hcaptcha - nullable: true - security_captcha_secret: - type: string - nullable: true - sessions_timebox: - type: integer - minimum: 0 - nullable: true - sessions_inactivity_timeout: - type: integer - minimum: 0 - nullable: true - sessions_single_per_user: - type: boolean - nullable: true - sessions_tags: - type: string - pattern: ^\s*([a-zA-Z0-9_-]+(\s*,+\s*)?)*\s*$ - nullable: true - rate_limit_anonymous_users: - type: integer - minimum: 1 - maximum: 2147483647 - nullable: true - rate_limit_email_sent: - type: integer - minimum: 1 - maximum: 2147483647 - nullable: true - rate_limit_sms_sent: - type: integer - minimum: 1 - maximum: 2147483647 - nullable: true - rate_limit_verify: - type: integer - minimum: 1 - maximum: 2147483647 - nullable: true - rate_limit_token_refresh: - type: integer - minimum: 1 - maximum: 2147483647 - nullable: true - rate_limit_otp: - type: integer - minimum: 1 - maximum: 2147483647 - nullable: true - rate_limit_web3: - type: integer - minimum: 1 - maximum: 2147483647 - nullable: true - mailer_secure_email_change_enabled: - type: boolean - nullable: true - refresh_token_rotation_enabled: - type: boolean - nullable: true - password_hibp_enabled: - type: boolean - nullable: true - password_min_length: - type: integer - minimum: 6 - maximum: 32767 - nullable: true - password_required_characters: - type: string - enum: - - abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789 - - abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789 - - abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~ - - '' - nullable: true - security_manual_linking_enabled: - type: boolean - nullable: true - security_update_password_require_reauthentication: - type: boolean - nullable: true - security_refresh_token_reuse_interval: - type: integer - minimum: 0 - maximum: 2147483647 - nullable: true - mailer_otp_exp: - type: integer - minimum: 0 - maximum: 2147483647 - mailer_otp_length: - type: integer - minimum: 6 - maximum: 10 - nullable: true - sms_autoconfirm: - type: boolean - nullable: true - sms_max_frequency: - type: integer - minimum: 0 - maximum: 32767 - nullable: true - sms_otp_exp: - type: integer - minimum: 0 - maximum: 2147483647 - nullable: true - sms_otp_length: - type: integer - minimum: 0 - maximum: 32767 - sms_provider: - type: string - enum: - - messagebird - - textlocal - - twilio - - twilio_verify - - vonage - nullable: true - sms_messagebird_access_key: - type: string - nullable: true - sms_messagebird_originator: - type: string - nullable: true - sms_test_otp: - type: string - pattern: ^([0-9]{1,15}=[0-9]+,?)*$ - nullable: true - sms_test_otp_valid_until: - type: string - format: date-time - nullable: true - sms_textlocal_api_key: - type: string - nullable: true - sms_textlocal_sender: - type: string - nullable: true - sms_twilio_account_sid: - type: string - nullable: true - sms_twilio_auth_token: - type: string - nullable: true - sms_twilio_content_sid: - type: string - nullable: true - sms_twilio_message_service_sid: - type: string - nullable: true - sms_twilio_verify_account_sid: - type: string - nullable: true - sms_twilio_verify_auth_token: - type: string - nullable: true - sms_twilio_verify_message_service_sid: - type: string - nullable: true - sms_vonage_api_key: - type: string - nullable: true - sms_vonage_api_secret: - type: string - nullable: true - sms_vonage_from: - type: string - nullable: true - sms_template: - type: string - nullable: true - hook_mfa_verification_attempt_enabled: - type: boolean - nullable: true - hook_mfa_verification_attempt_uri: - type: string - nullable: true - hook_mfa_verification_attempt_secrets: - type: string - nullable: true - hook_password_verification_attempt_enabled: - type: boolean - nullable: true - hook_password_verification_attempt_uri: - type: string - nullable: true - hook_password_verification_attempt_secrets: - type: string - nullable: true - hook_custom_access_token_enabled: - type: boolean - nullable: true - hook_custom_access_token_uri: - type: string - nullable: true - hook_custom_access_token_secrets: - type: string - nullable: true - hook_send_sms_enabled: - type: boolean - nullable: true - hook_send_sms_uri: - type: string - nullable: true - hook_send_sms_secrets: - type: string - nullable: true - hook_send_email_enabled: - type: boolean - nullable: true - hook_send_email_uri: - type: string - nullable: true - hook_send_email_secrets: - type: string - nullable: true - external_apple_enabled: - type: boolean - nullable: true - external_apple_client_id: - type: string - nullable: true - external_apple_secret: - type: string - nullable: true - external_apple_additional_client_ids: - type: string - nullable: true - external_azure_enabled: - type: boolean - nullable: true - external_azure_client_id: - type: string - nullable: true - external_azure_secret: - type: string - nullable: true - external_azure_url: - type: string - nullable: true - external_bitbucket_enabled: - type: boolean - nullable: true - external_bitbucket_client_id: - type: string - nullable: true - external_bitbucket_secret: - type: string - nullable: true - external_discord_enabled: - type: boolean - nullable: true - external_discord_client_id: - type: string - nullable: true - external_discord_secret: - type: string - nullable: true - external_facebook_enabled: - type: boolean - nullable: true - external_facebook_client_id: - type: string - nullable: true - external_facebook_secret: - type: string - nullable: true - external_figma_enabled: - type: boolean - nullable: true - external_figma_client_id: - type: string - nullable: true - external_figma_secret: - type: string - nullable: true - external_github_enabled: - type: boolean - nullable: true - external_github_client_id: - type: string - nullable: true - external_github_secret: - type: string - nullable: true - external_gitlab_enabled: - type: boolean - nullable: true - external_gitlab_client_id: - type: string - nullable: true - external_gitlab_secret: - type: string - nullable: true - external_gitlab_url: - type: string - nullable: true - external_google_enabled: - type: boolean - nullable: true - external_google_client_id: - type: string - nullable: true - external_google_secret: - type: string - nullable: true - external_google_additional_client_ids: - type: string - nullable: true - external_google_skip_nonce_check: - type: boolean - nullable: true - external_kakao_enabled: - type: boolean - nullable: true - external_kakao_client_id: - type: string - nullable: true - external_kakao_secret: - type: string - nullable: true - external_keycloak_enabled: - type: boolean - nullable: true - external_keycloak_client_id: - type: string - nullable: true - external_keycloak_secret: - type: string - nullable: true - external_keycloak_url: - type: string - nullable: true - external_linkedin_oidc_enabled: - type: boolean - nullable: true - external_linkedin_oidc_client_id: - type: string - nullable: true - external_linkedin_oidc_secret: - type: string - nullable: true - external_slack_oidc_enabled: - type: boolean - nullable: true - external_slack_oidc_client_id: - type: string - nullable: true - external_slack_oidc_secret: - type: string - nullable: true - external_notion_enabled: - type: boolean - nullable: true - external_notion_client_id: - type: string - nullable: true - external_notion_secret: - type: string - nullable: true - external_slack_enabled: - type: boolean - nullable: true - external_slack_client_id: - type: string - nullable: true - external_slack_secret: - type: string - nullable: true - external_spotify_enabled: - type: boolean - nullable: true - external_spotify_client_id: - type: string - nullable: true - external_spotify_secret: - type: string - nullable: true - external_twitch_enabled: - type: boolean - nullable: true - external_twitch_client_id: - type: string - nullable: true - external_twitch_secret: - type: string - nullable: true - external_twitter_enabled: - type: boolean - nullable: true - external_twitter_client_id: - type: string - nullable: true - external_twitter_secret: - type: string - nullable: true - external_workos_enabled: - type: boolean - nullable: true - external_workos_client_id: - type: string - nullable: true - external_workos_secret: - type: string - nullable: true - external_workos_url: - type: string - nullable: true - external_web3_solana_enabled: - type: boolean - nullable: true - external_zoom_enabled: - type: boolean - nullable: true - external_zoom_client_id: - type: string - nullable: true - external_zoom_secret: - type: string - nullable: true - db_max_pool_size: - type: integer - nullable: true - api_max_request_duration: - type: integer - nullable: true - mfa_totp_enroll_enabled: - type: boolean - nullable: true - mfa_totp_verify_enabled: - type: boolean - nullable: true - mfa_web_authn_enroll_enabled: - type: boolean - nullable: true - mfa_web_authn_verify_enabled: - type: boolean - nullable: true - mfa_phone_enroll_enabled: - type: boolean - nullable: true - mfa_phone_verify_enabled: - type: boolean - nullable: true - mfa_phone_max_frequency: - type: integer - minimum: 0 - maximum: 32767 - nullable: true - mfa_phone_otp_length: - type: integer - minimum: 0 - maximum: 32767 - nullable: true - mfa_phone_template: - type: string - nullable: true - CreateThirdPartyAuthBody: - type: object - properties: - oidc_issuer_url: - type: string - jwks_url: - type: string - custom_jwks: {} - ThirdPartyAuth: - type: object - properties: - id: - type: string - format: uuid - type: - type: string - oidc_issuer_url: - type: string - nullable: true - jwks_url: - type: string - nullable: true - custom_jwks: - nullable: true - resolved_jwks: - nullable: true - inserted_at: - type: string - updated_at: - type: string - resolved_at: - type: string - nullable: true - required: - - id - - type - - inserted_at - - updated_at - GetProjectAvailableRestoreVersionsResponse: - type: object - properties: - available_versions: - type: array - items: - type: object - properties: - version: - type: string - release_channel: - type: string - enum: - - internal - - alpha - - beta - - ga - - withdrawn - - preview - postgres_engine: - type: string - enum: - - '13' - - '14' - - '15' - - '17' - - 17-oriole - required: - - version - - release_channel - - postgres_engine - required: - - available_versions - ListProjectAddonsResponse: - type: object - properties: - selected_addons: - type: array - items: - type: object - properties: - type: - type: string - enum: - - custom_domain - - compute_instance - - pitr - - ipv4 - - auth_mfa_phone - - auth_mfa_web_authn - - log_drain - variant: - type: object - properties: - id: - oneOf: - - type: string - enum: - - ci_micro - - ci_small - - ci_medium - - ci_large - - ci_xlarge - - ci_2xlarge - - ci_4xlarge - - ci_8xlarge - - ci_12xlarge - - ci_16xlarge - - ci_24xlarge - - ci_24xlarge_optimized_cpu - - ci_24xlarge_optimized_memory - - ci_24xlarge_high_memory - - ci_48xlarge - - ci_48xlarge_optimized_cpu - - ci_48xlarge_optimized_memory - - ci_48xlarge_high_memory - - type: string - enum: - - cd_default - - type: string - enum: - - pitr_7 - - pitr_14 - - pitr_28 - - type: string - enum: - - ipv4_default - - type: string - enum: - - auth_mfa_phone_default - - type: string - enum: - - auth_mfa_web_authn_default - - type: string - enum: - - log_drain_default - name: - type: string - price: - type: object - properties: - description: - type: string - type: - type: string - enum: - - fixed - - usage - interval: - type: string - enum: - - monthly - - hourly - amount: - type: number - required: - - description - - type - - interval - - amount - meta: - description: Any JSON-serializable value - required: - - id - - name - - price - required: - - type - - variant - available_addons: - type: array - items: - type: object - properties: - type: - type: string - enum: - - custom_domain - - compute_instance - - pitr - - ipv4 - - auth_mfa_phone - - auth_mfa_web_authn - - log_drain - name: - type: string - variants: - type: array - items: - type: object - properties: - id: - oneOf: - - type: string - enum: - - ci_micro - - ci_small - - ci_medium - - ci_large - - ci_xlarge - - ci_2xlarge - - ci_4xlarge - - ci_8xlarge - - ci_12xlarge - - ci_16xlarge - - ci_24xlarge - - ci_24xlarge_optimized_cpu - - ci_24xlarge_optimized_memory - - ci_24xlarge_high_memory - - ci_48xlarge - - ci_48xlarge_optimized_cpu - - ci_48xlarge_optimized_memory - - ci_48xlarge_high_memory - - type: string - enum: - - cd_default - - type: string - enum: - - pitr_7 - - pitr_14 - - pitr_28 - - type: string - enum: - - ipv4_default - - type: string - enum: - - auth_mfa_phone_default - - type: string - enum: - - auth_mfa_web_authn_default - - type: string - enum: - - log_drain_default - name: - type: string - price: - type: object - properties: - description: - type: string - type: - type: string - enum: - - fixed - - usage - interval: - type: string - enum: - - monthly - - hourly - amount: - type: number - required: - - description - - type - - interval - - amount - meta: - description: Any JSON-serializable value - required: - - id - - name - - price - required: - - type - - name - - variants - required: - - selected_addons - - available_addons - ApplyProjectAddonBody: - type: object - properties: - addon_variant: - oneOf: - - type: string - enum: - - ci_micro - - ci_small - - ci_medium - - ci_large - - ci_xlarge - - ci_2xlarge - - ci_4xlarge - - ci_8xlarge - - ci_12xlarge - - ci_16xlarge - - ci_24xlarge - - ci_24xlarge_optimized_cpu - - ci_24xlarge_optimized_memory - - ci_24xlarge_high_memory - - ci_48xlarge - - ci_48xlarge_optimized_cpu - - ci_48xlarge_optimized_memory - - ci_48xlarge_high_memory - - type: string - enum: - - cd_default - - type: string - enum: - - pitr_7 - - pitr_14 - - pitr_28 - - type: string - enum: - - ipv4_default - addon_type: - type: string - enum: - - custom_domain - - compute_instance - - pitr - - ipv4 - - auth_mfa_phone - - auth_mfa_web_authn - - log_drain - required: - - addon_variant - - addon_type - V1ProjectAdvisorsResponse: - type: object - properties: - lints: - type: array - items: - type: object - properties: - name: - type: string - enum: - - unindexed_foreign_keys - - auth_users_exposed - - auth_rls_initplan - - no_primary_key - - unused_index - - multiple_permissive_policies - - policy_exists_rls_disabled - - rls_enabled_no_policy - - duplicate_index - - security_definer_view - - function_search_path_mutable - - rls_disabled_in_public - - extension_in_public - - rls_references_user_metadata - - materialized_view_in_api - - foreign_table_in_api - - unsupported_reg_types - - auth_otp_long_expiry - - auth_otp_short_length - - ssl_not_enforced - - network_restrictions_not_set - - password_requirements_min_length - - pitr_not_enabled - - auth_leaked_password_protection - - auth_insufficient_mfa_options - - auth_password_policy_missing - - leaked_service_key - - no_backup_admin - title: - type: string - level: - type: string - enum: - - ERROR - - WARN - - INFO - facing: - type: string - enum: - - EXTERNAL - categories: - type: array - items: - type: string - enum: - - PERFORMANCE - - SECURITY - description: - type: string - detail: - type: string - remediation: - type: string - metadata: - type: object - properties: - schema: - type: string - name: - type: string - entity: - type: string - type: - type: string - enum: - - table - - view - - auth - - function - - extension - - compliance - fkey_name: - type: string - fkey_columns: - type: array - items: - type: number - cache_key: - type: string - required: - - name - - title - - level - - facing - - categories - - description - - detail - - remediation - - cache_key - required: - - lints - AnalyticsResponse: - type: object - properties: - result: - type: array - items: {} - error: - oneOf: - - type: string - - type: object - properties: - code: - type: number - errors: - type: array - items: - type: object - properties: - domain: - type: string - location: - type: string - locationType: - type: string - message: - type: string - reason: - type: string - required: - - domain - - location - - locationType - - message - - reason - message: - type: string - status: - type: string - required: - - code - - errors - - message - - status - V1ListMigrationsResponse: - type: array - items: - type: object - properties: - version: - type: string - minLength: 1 - name: - type: string - required: - - version - V1CreateMigrationBody: - type: object - properties: - query: - type: string - minLength: 1 - name: - type: string - required: - - query - V1RunQueryBody: - type: object - properties: - query: - type: string - minLength: 1 - read_only: - type: boolean - required: - - query - GetProjectDbMetadataResponse: - type: object - properties: - databases: - type: array - items: - type: object - properties: - name: - type: string - schemas: - type: array - items: - type: object - properties: - name: - type: string - required: - - name - additionalProperties: true - required: - - name - - schemas - additionalProperties: true - required: - - databases - FunctionResponse: - type: object - properties: - id: - type: string - slug: - type: string - name: - type: string - status: - type: string - enum: - - ACTIVE - - REMOVED - - THROTTLED - version: - type: integer - created_at: - type: integer - format: int64 - updated_at: - type: integer - format: int64 - verify_jwt: - type: boolean - import_map: - type: boolean - entrypoint_path: - type: string - import_map_path: - type: string - required: - - id - - slug - - name - - status - - version - - created_at - - updated_at - BulkUpdateFunctionBody: - type: array - items: - type: object - properties: - id: - type: string - slug: - type: string - pattern: ^[A-Za-z0-9_-]+$ - name: - type: string - status: - type: string - enum: - - ACTIVE - - REMOVED - - THROTTLED - version: - type: integer - created_at: - type: integer - format: int64 - verify_jwt: - type: boolean - import_map: - type: boolean - entrypoint_path: - type: string - import_map_path: - type: string - required: - - id - - slug - - name - - status - - version - BulkUpdateFunctionResponse: - type: object - properties: - functions: - type: array - items: - type: object - properties: - id: - type: string - slug: - type: string - name: - type: string - status: - type: string - enum: - - ACTIVE - - REMOVED - - THROTTLED - version: - type: integer - created_at: - type: integer - updated_at: - type: integer - verify_jwt: - type: boolean - import_map: - type: boolean - entrypoint_path: - type: string - import_map_path: - type: string - required: - - id - - slug - - name - - status - - version - - created_at - - updated_at - required: - - functions - FunctionDeployBody: - type: object - properties: - file: - type: array - items: - type: string - format: binary - metadata: - type: object - properties: - entrypoint_path: - type: string - import_map_path: - type: string - static_patterns: - type: array - items: - type: string - verify_jwt: - type: boolean - name: - type: string - required: - - entrypoint_path - required: - - metadata - DeployFunctionResponse: - type: object - properties: - id: - type: string - slug: - type: string - name: - type: string - status: - type: string - enum: - - ACTIVE - - REMOVED - - THROTTLED - version: - type: integer - created_at: - type: integer - format: int64 - updated_at: - type: integer - format: int64 - verify_jwt: - type: boolean - import_map: - type: boolean - entrypoint_path: - type: string - import_map_path: - type: string - required: - - id - - slug - - name - - status - - version - FunctionSlugResponse: - type: object - properties: - id: - type: string - slug: - type: string - name: - type: string - status: - type: string - enum: - - ACTIVE - - REMOVED - - THROTTLED - version: - type: integer - created_at: - type: integer - updated_at: - type: integer - verify_jwt: - type: boolean - import_map: - type: boolean - entrypoint_path: - type: string - import_map_path: - type: string - required: - - id - - slug - - name - - status - - version - - created_at - - updated_at - StreamableFile: - type: object - properties: {} - V1UpdateFunctionBody: - type: object - properties: - name: - type: string - body: - type: string - verify_jwt: - type: boolean - V1StorageBucketResponse: - type: object - properties: - id: - type: string - name: - type: string - owner: - type: string - created_at: - type: string - updated_at: - type: string - public: - type: boolean - required: - - id - - name - - owner - - created_at - - updated_at - - public - CreateProviderBody: - type: object - properties: - type: - type: string - enum: - - saml - description: What type of provider will be created - metadata_xml: - type: string - metadata_url: - type: string - domains: - type: array - items: - type: string - attribute_mapping: - type: object - properties: - keys: - type: object - additionalProperties: - type: object - properties: - name: - type: string - names: - type: array - items: - type: string - default: {} - array: - type: boolean - required: - - keys - required: - - type - CreateProviderResponse: - type: object - properties: - id: - type: string - saml: - type: object - properties: - id: - type: string - entity_id: - type: string - metadata_url: - type: string - metadata_xml: - type: string - attribute_mapping: - type: object - properties: - keys: - type: object - additionalProperties: - type: object - properties: - name: - type: string - names: - type: array - items: - type: string - default: {} - array: - type: boolean - required: - - keys - required: - - id - - entity_id - domains: - type: array - items: - type: object - properties: - id: - type: string - domain: - type: string - created_at: - type: string - updated_at: - type: string - required: - - id - created_at: - type: string - updated_at: - type: string - required: - - id - ListProvidersResponse: - type: object - properties: - items: - type: array - items: - type: object - properties: - id: - type: string - saml: - type: object - properties: - id: - type: string - entity_id: - type: string - metadata_url: - type: string - metadata_xml: - type: string - attribute_mapping: - type: object - properties: - keys: - type: object - additionalProperties: - type: object - properties: - name: - type: string - names: - type: array - items: - type: string - default: {} - array: - type: boolean - required: - - keys - required: - - id - - entity_id - domains: - type: array - items: - type: object - properties: - id: - type: string - domain: - type: string - created_at: - type: string - updated_at: - type: string - required: - - id - created_at: - type: string - updated_at: - type: string - required: - - id - required: - - items - GetProviderResponse: - type: object - properties: - id: - type: string - saml: - type: object - properties: - id: - type: string - entity_id: - type: string - metadata_url: - type: string - metadata_xml: - type: string - attribute_mapping: - type: object - properties: - keys: - type: object - additionalProperties: - type: object - properties: - name: - type: string - names: - type: array - items: - type: string - default: {} - array: - type: boolean - required: - - keys - required: - - id - - entity_id - domains: - type: array - items: - type: object - properties: - id: - type: string - domain: - type: string - created_at: - type: string - updated_at: - type: string - required: - - id - created_at: - type: string - updated_at: - type: string - required: - - id - UpdateProviderBody: - type: object - properties: - metadata_xml: - type: string - metadata_url: - type: string - domains: - type: array - items: - type: string - attribute_mapping: - type: object - properties: - keys: - type: object - additionalProperties: - type: object - properties: - name: - type: string - names: - type: array - items: - type: string - default: {} - array: - type: boolean - required: - - keys - UpdateProviderResponse: - type: object - properties: - id: - type: string - saml: - type: object - properties: - id: - type: string - entity_id: - type: string - metadata_url: - type: string - metadata_xml: - type: string - attribute_mapping: - type: object - properties: - keys: - type: object - additionalProperties: - type: object - properties: - name: - type: string - names: - type: array - items: - type: string - default: {} - array: - type: boolean - required: - - keys - required: - - id - - entity_id - domains: - type: array - items: - type: object - properties: - id: - type: string - domain: - type: string - created_at: - type: string - updated_at: - type: string - required: - - id - created_at: - type: string - updated_at: - type: string - required: - - id - DeleteProviderResponse: - type: object - properties: - id: - type: string - saml: - type: object - properties: - id: - type: string - entity_id: - type: string - metadata_url: - type: string - metadata_xml: - type: string - attribute_mapping: - type: object - properties: - keys: - type: object - additionalProperties: - type: object - properties: - name: - type: string - names: - type: array - items: - type: string - default: {} - array: - type: boolean - required: - - keys - required: - - id - - entity_id - domains: - type: array - items: - type: object - properties: - id: - type: string - domain: - type: string - created_at: - type: string - updated_at: - type: string - required: - - id - created_at: - type: string - updated_at: - type: string - required: - - id - V1BackupsResponse: - type: object - properties: - region: - type: string - walg_enabled: - type: boolean - pitr_enabled: - type: boolean - backups: - type: array - items: - type: object - properties: - is_physical_backup: - type: boolean - status: - type: string - enum: - - COMPLETED - - FAILED - - PENDING - - REMOVED - - ARCHIVED - - CANCELLED - inserted_at: - type: string - required: - - is_physical_backup - - status - - inserted_at - physical_backup_data: - type: object - properties: - earliest_physical_backup_date_unix: - type: integer - latest_physical_backup_date_unix: - type: integer - required: - - region - - walg_enabled - - pitr_enabled - - backups - - physical_backup_data - V1RestorePitrBody: - type: object - properties: - recovery_time_target_unix: - type: integer - minimum: 0 - format: int64 - required: - - recovery_time_target_unix - V1OrganizationMemberResponse: - type: object - properties: - user_id: - type: string - user_name: - type: string - email: - type: string - role_name: - type: string - mfa_enabled: - type: boolean - required: - - user_id - - user_name - - role_name - - mfa_enabled - V1OrganizationSlugResponse: - type: object - properties: - id: - type: string - name: - type: string - plan: - type: string - enum: - - free - - pro - - team - - enterprise - opt_in_tags: - type: array - items: - type: string - enum: - - AI_SQL_GENERATOR_OPT_IN - allowed_release_channels: - type: array - items: - type: string - enum: - - internal - - alpha - - beta - - ga - - withdrawn - - preview - required: - - id - - name - - opt_in_tags - - allowed_release_channels diff --git a/api/overlay.yaml b/api/overlay.yaml new file mode 100644 index 000000000..92b28afae --- /dev/null +++ b/api/overlay.yaml @@ -0,0 +1,28 @@ +overlay: 1.0.0 +info: + title: Overlay + version: 0.0.0 +actions: +- target: $.components.schemas.*.properties.password_required_characters.enum + description: Converts enum with special characters to a string + remove: true +- target: $.components.schemas.*.properties.password_required_characters + description: Optionally adds back the enum with escaped backslash and quotes + update: + enum: + - abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789 + - abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789 + - abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~ + - '' +- target: $.components.schemas.*.properties.attribute_mapping.properties.keys.additionalProperties.properties.default.oneOf + description: Replaces request union type with interface for easier casting + remove: true +- target: $.components.schemas.*.properties.saml.properties.attribute_mapping.properties.keys.additionalProperties.properties.default.oneOf + description: Replaces response union type with interface for easier casting + remove: true +- target: $.components.schemas.*.properties.items.items.properties.saml.properties.attribute_mapping.properties.keys.additionalProperties.properties.default.oneOf + description: Replaces list union type with interface for easier casting + remove: true +- target: $.components.schemas.*.properties.connectionString + description: Removes deprecated field that conflicts with naming convention + remove: true diff --git a/go.mod b/go.mod index 0205d4e43..7edb9539d 100644 --- a/go.mod +++ b/go.mod @@ -342,3 +342,5 @@ require ( mvdan.cc/gofumpt v0.8.0 // indirect mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect ) + +replace github.com/supabase/cli/pkg v1.0.0 => ./pkg diff --git a/go.sum b/go.sum index 955f2f850..1388a0c3e 100644 --- a/go.sum +++ b/go.sum @@ -948,8 +948,6 @@ github.com/stripe/pg-schema-diff v0.9.0 h1:qzm2VUdbZ2kYwqxoQqtEP3uLQI0B+ymS947zq github.com/stripe/pg-schema-diff v0.9.0/go.mod h1:cl2VC6te/cCTOewTRvv4pYsgQqAOhvRQmatCHfYwy8c= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/supabase/cli/pkg v1.0.0 h1:6HjiXCedX8CCFjjkPd5GXq4wQGPKKJnPwIfkcW1bj7U= -github.com/supabase/cli/pkg v1.0.0/go.mod h1:xdOGROmegVXhSEZ1sCNTVicTCVb+NWW8JMIMQvQk8BQ= github.com/tdakkota/asciicheck v0.4.1 h1:bm0tbcmi0jezRA2b5kg4ozmMuGAFotKI3RZfrhfovg8= github.com/tdakkota/asciicheck v0.4.1/go.mod h1:0k7M3rCfRXb0Z6bwgvkEIMleKH3kXNz9UqJ9Xuqopr8= github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index d7a22b500..9615256ca 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -152,7 +152,7 @@ func suggestAppStart(cwd, command string) string { func checkProjectHealth(ctx context.Context) error { params := api.V1GetServicesHealthParams{ - Services: []interface{}{"db"}, + Services: []api.V1GetServicesHealthParamsServices{api.Db}, } resp, err := utils.GetSupabase().V1GetServicesHealthWithResponse(ctx, flags.ProjectRef, ¶ms) if err != nil { diff --git a/internal/utils/flags/db_url.go b/internal/utils/flags/db_url.go index 2a9134c6b..46aad3734 100644 --- a/internal/utils/flags/db_url.go +++ b/internal/utils/flags/db_url.go @@ -14,7 +14,7 @@ import ( "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/pkg/config" ) type connection int @@ -123,7 +123,7 @@ func PromptPassword(stdin *os.File) string { } // Generate a password, see ./Settings/Database/DatabaseSettings/ResetDbPassword.tsx#L83 var password []byte - charset := string(api.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891) + charset := string(config.LowerUpperLettersDigits.ToChar()) charset = strings.ReplaceAll(charset, ":", "") maxRange := big.NewInt(int64(len(charset))) for i := 0; i < PASSWORD_LENGTH; i++ { diff --git a/main.go b/main.go index 55a2e9a50..17774e656 100644 --- a/main.go +++ b/main.go @@ -4,8 +4,8 @@ import ( "github.com/supabase/cli/cmd" ) -//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=pkg/api/types.cfg.yaml api/beta.yaml -//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=pkg/api/client.cfg.yaml api/beta.yaml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=pkg/api/types.cfg.yaml https://api.supabase.green/api/v1-yaml +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=pkg/api/client.cfg.yaml https://api.supabase.green/api/v1-yaml func main() { cmd.Execute() diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index 4ec88e1b5..50cd731ea 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -143,6 +143,12 @@ type ClientInterface interface { // V1ListOrganizationMembers request V1ListOrganizationMembers(ctx context.Context, slug string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetOrganizationProjectClaim request + V1GetOrganizationProjectClaim(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1ClaimProjectForOrganization request + V1ClaimProjectForOrganization(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1ListAllProjects request V1ListAllProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -213,6 +219,15 @@ type ClientInterface interface { V1CreateABranch(ctx context.Context, ref string, body V1CreateABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1DeleteProjectClaimToken request + V1DeleteProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1GetProjectClaimToken request + V1GetProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1CreateProjectClaimToken request + V1CreateProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetAuthServiceConfig request V1GetAuthServiceConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -350,6 +365,8 @@ type ClientInterface interface { // V1CreateAFunctionWithBody request with any body V1CreateAFunctionWithBody(ctx context.Context, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + V1CreateAFunction(ctx context.Context, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1BulkUpdateFunctionsWithBody request with any body V1BulkUpdateFunctionsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -739,6 +756,30 @@ func (c *Client) V1ListOrganizationMembers(ctx context.Context, slug string, req return c.Client.Do(req) } +func (c *Client) V1GetOrganizationProjectClaim(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetOrganizationProjectClaimRequest(c.Server, slug, token) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1ClaimProjectForOrganization(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ClaimProjectForOrganizationRequest(c.Server, slug, token) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1ListAllProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1ListAllProjectsRequest(c.Server) if err != nil { @@ -1039,6 +1080,42 @@ func (c *Client) V1CreateABranch(ctx context.Context, ref string, body V1CreateA return c.Client.Do(req) } +func (c *Client) V1DeleteProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1DeleteProjectClaimTokenRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1GetProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectClaimTokenRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1CreateProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateProjectClaimTokenRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1GetAuthServiceConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1GetAuthServiceConfigRequest(c.Server, ref) if err != nil { @@ -1639,6 +1716,18 @@ func (c *Client) V1CreateAFunctionWithBody(ctx context.Context, ref string, para return c.Client.Do(req) } +func (c *Client) V1CreateAFunction(ctx context.Context, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateAFunctionRequest(c.Server, ref, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1BulkUpdateFunctionsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1BulkUpdateFunctionsRequestWithBody(c.Server, ref, contentType, body) if err != nil { @@ -2907,6 +2996,88 @@ func NewV1ListOrganizationMembersRequest(server string, slug string) (*http.Requ return req, nil } +// NewV1GetOrganizationProjectClaimRequest generates requests for V1GetOrganizationProjectClaim +func NewV1GetOrganizationProjectClaimRequest(server string, slug string, token string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "slug", runtime.ParamLocationPath, slug) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "token", runtime.ParamLocationPath, token) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/organizations/%s/project-claim/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1ClaimProjectForOrganizationRequest generates requests for V1ClaimProjectForOrganization +func NewV1ClaimProjectForOrganizationRequest(server string, slug string, token string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "slug", runtime.ParamLocationPath, slug) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "token", runtime.ParamLocationPath, token) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/organizations/%s/project-claim/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1ListAllProjectsRequest generates requests for V1ListAllProjects func NewV1ListAllProjectsRequest(server string) (*http.Request, error) { var err error @@ -3852,6 +4023,108 @@ func NewV1CreateABranchRequestWithBody(server string, ref string, contentType st return req, nil } +// NewV1DeleteProjectClaimTokenRequest generates requests for V1DeleteProjectClaimToken +func NewV1DeleteProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1GetProjectClaimTokenRequest generates requests for V1GetProjectClaimToken +func NewV1GetProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1CreateProjectClaimTokenRequest generates requests for V1CreateProjectClaimToken +func NewV1CreateProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1GetAuthServiceConfigRequest generates requests for V1GetAuthServiceConfig func NewV1GetAuthServiceConfigRequest(server string, ref string) (*http.Request, error) { var err error @@ -5316,6 +5589,17 @@ func NewV1ListAllFunctionsRequest(server string, ref string) (*http.Request, err return req, nil } +// NewV1CreateAFunctionRequest calls the generic V1CreateAFunction builder with application/json body +func NewV1CreateAFunctionRequest(server string, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1CreateAFunctionRequestWithBody(server, ref, params, "application/json", bodyReader) +} + // NewV1CreateAFunctionRequestWithBody generates requests for V1CreateAFunction with any type of body func NewV1CreateAFunctionRequestWithBody(server string, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -7419,6 +7703,12 @@ type ClientWithResponsesInterface interface { // V1ListOrganizationMembersWithResponse request V1ListOrganizationMembersWithResponse(ctx context.Context, slug string, reqEditors ...RequestEditorFn) (*V1ListOrganizationMembersResponse, error) + // V1GetOrganizationProjectClaimWithResponse request + V1GetOrganizationProjectClaimWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1GetOrganizationProjectClaimResponse, error) + + // V1ClaimProjectForOrganizationWithResponse request + V1ClaimProjectForOrganizationWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1ClaimProjectForOrganizationResponse, error) + // V1ListAllProjectsWithResponse request V1ListAllProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*V1ListAllProjectsResponse, error) @@ -7489,6 +7779,15 @@ type ClientWithResponsesInterface interface { V1CreateABranchWithResponse(ctx context.Context, ref string, body V1CreateABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateABranchResponse, error) + // V1DeleteProjectClaimTokenWithResponse request + V1DeleteProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeleteProjectClaimTokenResponse, error) + + // V1GetProjectClaimTokenWithResponse request + V1GetProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectClaimTokenResponse, error) + + // V1CreateProjectClaimTokenWithResponse request + V1CreateProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CreateProjectClaimTokenResponse, error) + // V1GetAuthServiceConfigWithResponse request V1GetAuthServiceConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetAuthServiceConfigResponse, error) @@ -7626,6 +7925,8 @@ type ClientWithResponsesInterface interface { // V1CreateAFunctionWithBodyWithResponse request with any body V1CreateAFunctionWithBodyWithResponse(ctx context.Context, ref string, params *V1CreateAFunctionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateAFunctionResponse, error) + V1CreateAFunctionWithResponse(ctx context.Context, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateAFunctionResponse, error) + // V1BulkUpdateFunctionsWithBodyWithResponse request with any body V1BulkUpdateFunctionsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkUpdateFunctionsResponse, error) @@ -8059,6 +8360,49 @@ func (r V1ListOrganizationMembersResponse) StatusCode() int { return 0 } +type V1GetOrganizationProjectClaimResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OrganizationProjectClaimResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetOrganizationProjectClaimResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetOrganizationProjectClaimResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1ClaimProjectForOrganizationResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1ClaimProjectForOrganizationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1ClaimProjectForOrganizationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1ListAllProjectsResponse struct { Body []byte HTTPResponse *http.Response @@ -8496,6 +8840,71 @@ func (r V1CreateABranchResponse) StatusCode() int { return 0 } +type V1DeleteProjectClaimTokenResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1DeleteProjectClaimTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1DeleteProjectClaimTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1GetProjectClaimTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ProjectClaimTokenResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetProjectClaimTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetProjectClaimTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1CreateProjectClaimTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CreateProjectClaimTokenResponse +} + +// Status returns HTTPResponse.Status +func (r V1CreateProjectClaimTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1CreateProjectClaimTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1GetAuthServiceConfigResponse struct { Body []byte HTTPResponse *http.Response @@ -10346,6 +10755,24 @@ func (c *ClientWithResponses) V1ListOrganizationMembersWithResponse(ctx context. return ParseV1ListOrganizationMembersResponse(rsp) } +// V1GetOrganizationProjectClaimWithResponse request returning *V1GetOrganizationProjectClaimResponse +func (c *ClientWithResponses) V1GetOrganizationProjectClaimWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1GetOrganizationProjectClaimResponse, error) { + rsp, err := c.V1GetOrganizationProjectClaim(ctx, slug, token, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetOrganizationProjectClaimResponse(rsp) +} + +// V1ClaimProjectForOrganizationWithResponse request returning *V1ClaimProjectForOrganizationResponse +func (c *ClientWithResponses) V1ClaimProjectForOrganizationWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1ClaimProjectForOrganizationResponse, error) { + rsp, err := c.V1ClaimProjectForOrganization(ctx, slug, token, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ClaimProjectForOrganizationResponse(rsp) +} + // V1ListAllProjectsWithResponse request returning *V1ListAllProjectsResponse func (c *ClientWithResponses) V1ListAllProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*V1ListAllProjectsResponse, error) { rsp, err := c.V1ListAllProjects(ctx, reqEditors...) @@ -10566,6 +10993,33 @@ func (c *ClientWithResponses) V1CreateABranchWithResponse(ctx context.Context, r return ParseV1CreateABranchResponse(rsp) } +// V1DeleteProjectClaimTokenWithResponse request returning *V1DeleteProjectClaimTokenResponse +func (c *ClientWithResponses) V1DeleteProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeleteProjectClaimTokenResponse, error) { + rsp, err := c.V1DeleteProjectClaimToken(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1DeleteProjectClaimTokenResponse(rsp) +} + +// V1GetProjectClaimTokenWithResponse request returning *V1GetProjectClaimTokenResponse +func (c *ClientWithResponses) V1GetProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectClaimTokenResponse, error) { + rsp, err := c.V1GetProjectClaimToken(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetProjectClaimTokenResponse(rsp) +} + +// V1CreateProjectClaimTokenWithResponse request returning *V1CreateProjectClaimTokenResponse +func (c *ClientWithResponses) V1CreateProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CreateProjectClaimTokenResponse, error) { + rsp, err := c.V1CreateProjectClaimToken(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1CreateProjectClaimTokenResponse(rsp) +} + // V1GetAuthServiceConfigWithResponse request returning *V1GetAuthServiceConfigResponse func (c *ClientWithResponses) V1GetAuthServiceConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetAuthServiceConfigResponse, error) { rsp, err := c.V1GetAuthServiceConfig(ctx, ref, reqEditors...) @@ -11003,6 +11457,14 @@ func (c *ClientWithResponses) V1CreateAFunctionWithBodyWithResponse(ctx context. return ParseV1CreateAFunctionResponse(rsp) } +func (c *ClientWithResponses) V1CreateAFunctionWithResponse(ctx context.Context, ref string, params *V1CreateAFunctionParams, body V1CreateAFunctionJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateAFunctionResponse, error) { + rsp, err := c.V1CreateAFunction(ctx, ref, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1CreateAFunctionResponse(rsp) +} + // V1BulkUpdateFunctionsWithBodyWithResponse request with arbitrary body returning *V1BulkUpdateFunctionsResponse func (c *ClientWithResponses) V1BulkUpdateFunctionsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1BulkUpdateFunctionsResponse, error) { rsp, err := c.V1BulkUpdateFunctionsWithBody(ctx, ref, contentType, body, reqEditors...) @@ -11793,6 +12255,48 @@ func ParseV1ListOrganizationMembersResponse(rsp *http.Response) (*V1ListOrganiza return response, nil } +// ParseV1GetOrganizationProjectClaimResponse parses an HTTP response from a V1GetOrganizationProjectClaimWithResponse call +func ParseV1GetOrganizationProjectClaimResponse(rsp *http.Response) (*V1GetOrganizationProjectClaimResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetOrganizationProjectClaimResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OrganizationProjectClaimResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1ClaimProjectForOrganizationResponse parses an HTTP response from a V1ClaimProjectForOrganizationWithResponse call +func ParseV1ClaimProjectForOrganizationResponse(rsp *http.Response) (*V1ClaimProjectForOrganizationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1ClaimProjectForOrganizationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseV1ListAllProjectsResponse parses an HTTP response from a V1ListAllProjectsWithResponse call func ParseV1ListAllProjectsResponse(rsp *http.Response) (*V1ListAllProjectsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -12283,6 +12787,74 @@ func ParseV1CreateABranchResponse(rsp *http.Response) (*V1CreateABranchResponse, return response, nil } +// ParseV1DeleteProjectClaimTokenResponse parses an HTTP response from a V1DeleteProjectClaimTokenWithResponse call +func ParseV1DeleteProjectClaimTokenResponse(rsp *http.Response) (*V1DeleteProjectClaimTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1DeleteProjectClaimTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseV1GetProjectClaimTokenResponse parses an HTTP response from a V1GetProjectClaimTokenWithResponse call +func ParseV1GetProjectClaimTokenResponse(rsp *http.Response) (*V1GetProjectClaimTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetProjectClaimTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ProjectClaimTokenResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1CreateProjectClaimTokenResponse parses an HTTP response from a V1CreateProjectClaimTokenWithResponse call +func ParseV1CreateProjectClaimTokenResponse(rsp *http.Response) (*V1CreateProjectClaimTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1CreateProjectClaimTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CreateProjectClaimTokenResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseV1GetAuthServiceConfigResponse parses an HTTP response from a V1GetAuthServiceConfigWithResponse call func ParseV1GetAuthServiceConfigResponse(rsp *http.Response) (*V1GetAuthServiceConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.cfg.yaml b/pkg/api/types.cfg.yaml index 65a557362..128f4a387 100755 --- a/pkg/api/types.cfg.yaml +++ b/pkg/api/types.cfg.yaml @@ -3,4 +3,6 @@ generate: models: true output-options: nullable-type: true + overlay: + path: api/overlay.yaml output: pkg/api/types.gen.go diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 44448b799..5d6a77197 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -75,6 +75,29 @@ const ( ApplyProjectAddonBodyAddonVariant3Ipv4Default ApplyProjectAddonBodyAddonVariant3 = "ipv4_default" ) +// Defines values for AuthConfigResponsePasswordRequiredCharacters. +const ( + AuthConfigResponsePasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 AuthConfigResponsePasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789" + AuthConfigResponsePasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891 AuthConfigResponsePasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789" + AuthConfigResponsePasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567892 AuthConfigResponsePasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~" + AuthConfigResponsePasswordRequiredCharactersEmpty AuthConfigResponsePasswordRequiredCharacters = "" +) + +// Defines values for AuthConfigResponseSecurityCaptchaProvider. +const ( + AuthConfigResponseSecurityCaptchaProviderHcaptcha AuthConfigResponseSecurityCaptchaProvider = "hcaptcha" + AuthConfigResponseSecurityCaptchaProviderTurnstile AuthConfigResponseSecurityCaptchaProvider = "turnstile" +) + +// Defines values for AuthConfigResponseSmsProvider. +const ( + AuthConfigResponseSmsProviderMessagebird AuthConfigResponseSmsProvider = "messagebird" + AuthConfigResponseSmsProviderTextlocal AuthConfigResponseSmsProvider = "textlocal" + AuthConfigResponseSmsProviderTwilio AuthConfigResponseSmsProvider = "twilio" + AuthConfigResponseSmsProviderTwilioVerify AuthConfigResponseSmsProvider = "twilio_verify" + AuthConfigResponseSmsProviderVonage AuthConfigResponseSmsProvider = "vonage" +) + // Defines values for BranchDeleteResponseMessage. const ( BranchDeleteResponseMessageOk BranchDeleteResponseMessage = "ok" @@ -439,6 +462,22 @@ const ( Bearer OAuthTokenResponseTokenType = "Bearer" ) +// Defines values for OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan. +const ( + OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanEnterprise OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "enterprise" + OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanFree OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "free" + OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanPro OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "pro" + OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanTeam OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "team" +) + +// Defines values for OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan. +const ( + OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanEnterprise OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "enterprise" + OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanFree OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "free" + OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanPro OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "pro" + OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanTeam OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "team" +) + // Defines values for PostgresConfigResponseSessionReplicationRole. const ( PostgresConfigResponseSessionReplicationRoleLocal PostgresConfigResponseSessionReplicationRole = "local" @@ -567,25 +606,25 @@ const ( // Defines values for UpdateAuthConfigBodyPasswordRequiredCharacters. const ( - AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 UpdateAuthConfigBodyPasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789" - AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891 UpdateAuthConfigBodyPasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789" - AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567892 UpdateAuthConfigBodyPasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~" - Empty UpdateAuthConfigBodyPasswordRequiredCharacters = "" + UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 UpdateAuthConfigBodyPasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789" + UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891 UpdateAuthConfigBodyPasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789" + UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567892 UpdateAuthConfigBodyPasswordRequiredCharacters = "abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};'\\\\:\"|<>?,./`~" + UpdateAuthConfigBodyPasswordRequiredCharactersEmpty UpdateAuthConfigBodyPasswordRequiredCharacters = "" ) // Defines values for UpdateAuthConfigBodySecurityCaptchaProvider. const ( - Hcaptcha UpdateAuthConfigBodySecurityCaptchaProvider = "hcaptcha" - Turnstile UpdateAuthConfigBodySecurityCaptchaProvider = "turnstile" + UpdateAuthConfigBodySecurityCaptchaProviderHcaptcha UpdateAuthConfigBodySecurityCaptchaProvider = "hcaptcha" + UpdateAuthConfigBodySecurityCaptchaProviderTurnstile UpdateAuthConfigBodySecurityCaptchaProvider = "turnstile" ) // Defines values for UpdateAuthConfigBodySmsProvider. const ( - Messagebird UpdateAuthConfigBodySmsProvider = "messagebird" - Textlocal UpdateAuthConfigBodySmsProvider = "textlocal" - Twilio UpdateAuthConfigBodySmsProvider = "twilio" - TwilioVerify UpdateAuthConfigBodySmsProvider = "twilio_verify" - Vonage UpdateAuthConfigBodySmsProvider = "vonage" + UpdateAuthConfigBodySmsProviderMessagebird UpdateAuthConfigBodySmsProvider = "messagebird" + UpdateAuthConfigBodySmsProviderTextlocal UpdateAuthConfigBodySmsProvider = "textlocal" + UpdateAuthConfigBodySmsProviderTwilio UpdateAuthConfigBodySmsProvider = "twilio" + UpdateAuthConfigBodySmsProviderTwilioVerify UpdateAuthConfigBodySmsProvider = "twilio_verify" + UpdateAuthConfigBodySmsProviderVonage UpdateAuthConfigBodySmsProvider = "vonage" ) // Defines values for UpdateBranchBodyStatus. @@ -881,6 +920,16 @@ const ( N7day GetApiCountsParamsInterval = "7day" ) +// Defines values for V1GetServicesHealthParamsServices. +const ( + Auth V1GetServicesHealthParamsServices = "auth" + Db V1GetServicesHealthParamsServices = "db" + Pooler V1GetServicesHealthParamsServices = "pooler" + Realtime V1GetServicesHealthParamsServices = "realtime" + Rest V1GetServicesHealthParamsServices = "rest" + Storage V1GetServicesHealthParamsServices = "storage" +) + // Defines values for V1ListAllSnippetsParamsSortBy. const ( InsertedAt V1ListAllSnippetsParamsSortBy = "inserted_at" @@ -973,179 +1022,188 @@ type ApplyProjectAddonBody_AddonVariant struct { // AuthConfigResponse defines model for AuthConfigResponse. type AuthConfigResponse struct { - ApiMaxRequestDuration nullable.Nullable[int] `json:"api_max_request_duration"` - DbMaxPoolSize nullable.Nullable[int] `json:"db_max_pool_size"` - DisableSignup nullable.Nullable[bool] `json:"disable_signup"` - ExternalAnonymousUsersEnabled nullable.Nullable[bool] `json:"external_anonymous_users_enabled"` - ExternalAppleAdditionalClientIds nullable.Nullable[string] `json:"external_apple_additional_client_ids"` - ExternalAppleClientId nullable.Nullable[string] `json:"external_apple_client_id"` - ExternalAppleEnabled nullable.Nullable[bool] `json:"external_apple_enabled"` - ExternalAppleSecret nullable.Nullable[string] `json:"external_apple_secret"` - ExternalAzureClientId nullable.Nullable[string] `json:"external_azure_client_id"` - ExternalAzureEnabled nullable.Nullable[bool] `json:"external_azure_enabled"` - ExternalAzureSecret nullable.Nullable[string] `json:"external_azure_secret"` - ExternalAzureUrl nullable.Nullable[string] `json:"external_azure_url"` - ExternalBitbucketClientId nullable.Nullable[string] `json:"external_bitbucket_client_id"` - ExternalBitbucketEnabled nullable.Nullable[bool] `json:"external_bitbucket_enabled"` - ExternalBitbucketSecret nullable.Nullable[string] `json:"external_bitbucket_secret"` - ExternalDiscordClientId nullable.Nullable[string] `json:"external_discord_client_id"` - ExternalDiscordEnabled nullable.Nullable[bool] `json:"external_discord_enabled"` - ExternalDiscordSecret nullable.Nullable[string] `json:"external_discord_secret"` - ExternalEmailEnabled nullable.Nullable[bool] `json:"external_email_enabled"` - ExternalFacebookClientId nullable.Nullable[string] `json:"external_facebook_client_id"` - ExternalFacebookEnabled nullable.Nullable[bool] `json:"external_facebook_enabled"` - ExternalFacebookSecret nullable.Nullable[string] `json:"external_facebook_secret"` - ExternalFigmaClientId nullable.Nullable[string] `json:"external_figma_client_id"` - ExternalFigmaEnabled nullable.Nullable[bool] `json:"external_figma_enabled"` - ExternalFigmaSecret nullable.Nullable[string] `json:"external_figma_secret"` - ExternalGithubClientId nullable.Nullable[string] `json:"external_github_client_id"` - ExternalGithubEnabled nullable.Nullable[bool] `json:"external_github_enabled"` - ExternalGithubSecret nullable.Nullable[string] `json:"external_github_secret"` - ExternalGitlabClientId nullable.Nullable[string] `json:"external_gitlab_client_id"` - ExternalGitlabEnabled nullable.Nullable[bool] `json:"external_gitlab_enabled"` - ExternalGitlabSecret nullable.Nullable[string] `json:"external_gitlab_secret"` - ExternalGitlabUrl nullable.Nullable[string] `json:"external_gitlab_url"` - ExternalGoogleAdditionalClientIds nullable.Nullable[string] `json:"external_google_additional_client_ids"` - ExternalGoogleClientId nullable.Nullable[string] `json:"external_google_client_id"` - ExternalGoogleEnabled nullable.Nullable[bool] `json:"external_google_enabled"` - ExternalGoogleSecret nullable.Nullable[string] `json:"external_google_secret"` - ExternalGoogleSkipNonceCheck nullable.Nullable[bool] `json:"external_google_skip_nonce_check"` - ExternalKakaoClientId nullable.Nullable[string] `json:"external_kakao_client_id"` - ExternalKakaoEnabled nullable.Nullable[bool] `json:"external_kakao_enabled"` - ExternalKakaoSecret nullable.Nullable[string] `json:"external_kakao_secret"` - ExternalKeycloakClientId nullable.Nullable[string] `json:"external_keycloak_client_id"` - ExternalKeycloakEnabled nullable.Nullable[bool] `json:"external_keycloak_enabled"` - ExternalKeycloakSecret nullable.Nullable[string] `json:"external_keycloak_secret"` - ExternalKeycloakUrl nullable.Nullable[string] `json:"external_keycloak_url"` - ExternalLinkedinOidcClientId nullable.Nullable[string] `json:"external_linkedin_oidc_client_id"` - ExternalLinkedinOidcEnabled nullable.Nullable[bool] `json:"external_linkedin_oidc_enabled"` - ExternalLinkedinOidcSecret nullable.Nullable[string] `json:"external_linkedin_oidc_secret"` - ExternalNotionClientId nullable.Nullable[string] `json:"external_notion_client_id"` - ExternalNotionEnabled nullable.Nullable[bool] `json:"external_notion_enabled"` - ExternalNotionSecret nullable.Nullable[string] `json:"external_notion_secret"` - ExternalPhoneEnabled nullable.Nullable[bool] `json:"external_phone_enabled"` - ExternalSlackClientId nullable.Nullable[string] `json:"external_slack_client_id"` - ExternalSlackEnabled nullable.Nullable[bool] `json:"external_slack_enabled"` - ExternalSlackOidcClientId nullable.Nullable[string] `json:"external_slack_oidc_client_id"` - ExternalSlackOidcEnabled nullable.Nullable[bool] `json:"external_slack_oidc_enabled"` - ExternalSlackOidcSecret nullable.Nullable[string] `json:"external_slack_oidc_secret"` - ExternalSlackSecret nullable.Nullable[string] `json:"external_slack_secret"` - ExternalSpotifyClientId nullable.Nullable[string] `json:"external_spotify_client_id"` - ExternalSpotifyEnabled nullable.Nullable[bool] `json:"external_spotify_enabled"` - ExternalSpotifySecret nullable.Nullable[string] `json:"external_spotify_secret"` - ExternalTwitchClientId nullable.Nullable[string] `json:"external_twitch_client_id"` - ExternalTwitchEnabled nullable.Nullable[bool] `json:"external_twitch_enabled"` - ExternalTwitchSecret nullable.Nullable[string] `json:"external_twitch_secret"` - ExternalTwitterClientId nullable.Nullable[string] `json:"external_twitter_client_id"` - ExternalTwitterEnabled nullable.Nullable[bool] `json:"external_twitter_enabled"` - ExternalTwitterSecret nullable.Nullable[string] `json:"external_twitter_secret"` - ExternalWeb3SolanaEnabled nullable.Nullable[bool] `json:"external_web3_solana_enabled"` - ExternalWorkosClientId nullable.Nullable[string] `json:"external_workos_client_id"` - ExternalWorkosEnabled nullable.Nullable[bool] `json:"external_workos_enabled"` - ExternalWorkosSecret nullable.Nullable[string] `json:"external_workos_secret"` - ExternalWorkosUrl nullable.Nullable[string] `json:"external_workos_url"` - ExternalZoomClientId nullable.Nullable[string] `json:"external_zoom_client_id"` - ExternalZoomEnabled nullable.Nullable[bool] `json:"external_zoom_enabled"` - ExternalZoomSecret nullable.Nullable[string] `json:"external_zoom_secret"` - HookCustomAccessTokenEnabled nullable.Nullable[bool] `json:"hook_custom_access_token_enabled"` - HookCustomAccessTokenSecrets nullable.Nullable[string] `json:"hook_custom_access_token_secrets"` - HookCustomAccessTokenUri nullable.Nullable[string] `json:"hook_custom_access_token_uri"` - HookMfaVerificationAttemptEnabled nullable.Nullable[bool] `json:"hook_mfa_verification_attempt_enabled"` - HookMfaVerificationAttemptSecrets nullable.Nullable[string] `json:"hook_mfa_verification_attempt_secrets"` - HookMfaVerificationAttemptUri nullable.Nullable[string] `json:"hook_mfa_verification_attempt_uri"` - HookPasswordVerificationAttemptEnabled nullable.Nullable[bool] `json:"hook_password_verification_attempt_enabled"` - HookPasswordVerificationAttemptSecrets nullable.Nullable[string] `json:"hook_password_verification_attempt_secrets"` - HookPasswordVerificationAttemptUri nullable.Nullable[string] `json:"hook_password_verification_attempt_uri"` - HookSendEmailEnabled nullable.Nullable[bool] `json:"hook_send_email_enabled"` - HookSendEmailSecrets nullable.Nullable[string] `json:"hook_send_email_secrets"` - HookSendEmailUri nullable.Nullable[string] `json:"hook_send_email_uri"` - HookSendSmsEnabled nullable.Nullable[bool] `json:"hook_send_sms_enabled"` - HookSendSmsSecrets nullable.Nullable[string] `json:"hook_send_sms_secrets"` - HookSendSmsUri nullable.Nullable[string] `json:"hook_send_sms_uri"` - JwtExp nullable.Nullable[int] `json:"jwt_exp"` - MailerAllowUnverifiedEmailSignIns nullable.Nullable[bool] `json:"mailer_allow_unverified_email_sign_ins"` - MailerAutoconfirm nullable.Nullable[bool] `json:"mailer_autoconfirm"` - MailerOtpExp int `json:"mailer_otp_exp"` - MailerOtpLength nullable.Nullable[int] `json:"mailer_otp_length"` - MailerSecureEmailChangeEnabled nullable.Nullable[bool] `json:"mailer_secure_email_change_enabled"` - MailerSubjectsConfirmation nullable.Nullable[string] `json:"mailer_subjects_confirmation"` - MailerSubjectsEmailChange nullable.Nullable[string] `json:"mailer_subjects_email_change"` - MailerSubjectsInvite nullable.Nullable[string] `json:"mailer_subjects_invite"` - MailerSubjectsMagicLink nullable.Nullable[string] `json:"mailer_subjects_magic_link"` - MailerSubjectsReauthentication nullable.Nullable[string] `json:"mailer_subjects_reauthentication"` - MailerSubjectsRecovery nullable.Nullable[string] `json:"mailer_subjects_recovery"` - MailerTemplatesConfirmationContent nullable.Nullable[string] `json:"mailer_templates_confirmation_content"` - MailerTemplatesEmailChangeContent nullable.Nullable[string] `json:"mailer_templates_email_change_content"` - MailerTemplatesInviteContent nullable.Nullable[string] `json:"mailer_templates_invite_content"` - MailerTemplatesMagicLinkContent nullable.Nullable[string] `json:"mailer_templates_magic_link_content"` - MailerTemplatesReauthenticationContent nullable.Nullable[string] `json:"mailer_templates_reauthentication_content"` - MailerTemplatesRecoveryContent nullable.Nullable[string] `json:"mailer_templates_recovery_content"` - MfaMaxEnrolledFactors nullable.Nullable[int] `json:"mfa_max_enrolled_factors"` - MfaPhoneEnrollEnabled nullable.Nullable[bool] `json:"mfa_phone_enroll_enabled"` - MfaPhoneMaxFrequency nullable.Nullable[int] `json:"mfa_phone_max_frequency"` - MfaPhoneOtpLength int `json:"mfa_phone_otp_length"` - MfaPhoneTemplate nullable.Nullable[string] `json:"mfa_phone_template"` - MfaPhoneVerifyEnabled nullable.Nullable[bool] `json:"mfa_phone_verify_enabled"` - MfaTotpEnrollEnabled nullable.Nullable[bool] `json:"mfa_totp_enroll_enabled"` - MfaTotpVerifyEnabled nullable.Nullable[bool] `json:"mfa_totp_verify_enabled"` - MfaWebAuthnEnrollEnabled nullable.Nullable[bool] `json:"mfa_web_authn_enroll_enabled"` - MfaWebAuthnVerifyEnabled nullable.Nullable[bool] `json:"mfa_web_authn_verify_enabled"` - PasswordHibpEnabled nullable.Nullable[bool] `json:"password_hibp_enabled"` - PasswordMinLength nullable.Nullable[int] `json:"password_min_length"` - PasswordRequiredCharacters nullable.Nullable[string] `json:"password_required_characters"` - RateLimitAnonymousUsers nullable.Nullable[int] `json:"rate_limit_anonymous_users"` - RateLimitEmailSent nullable.Nullable[int] `json:"rate_limit_email_sent"` - RateLimitOtp nullable.Nullable[int] `json:"rate_limit_otp"` - RateLimitSmsSent nullable.Nullable[int] `json:"rate_limit_sms_sent"` - RateLimitTokenRefresh nullable.Nullable[int] `json:"rate_limit_token_refresh"` - RateLimitVerify nullable.Nullable[int] `json:"rate_limit_verify"` - RateLimitWeb3 nullable.Nullable[int] `json:"rate_limit_web3"` - RefreshTokenRotationEnabled nullable.Nullable[bool] `json:"refresh_token_rotation_enabled"` - SamlAllowEncryptedAssertions nullable.Nullable[bool] `json:"saml_allow_encrypted_assertions"` - SamlEnabled nullable.Nullable[bool] `json:"saml_enabled"` - SamlExternalUrl nullable.Nullable[string] `json:"saml_external_url"` - SecurityCaptchaEnabled nullable.Nullable[bool] `json:"security_captcha_enabled"` - SecurityCaptchaProvider nullable.Nullable[string] `json:"security_captcha_provider"` - SecurityCaptchaSecret nullable.Nullable[string] `json:"security_captcha_secret"` - SecurityManualLinkingEnabled nullable.Nullable[bool] `json:"security_manual_linking_enabled"` - SecurityRefreshTokenReuseInterval nullable.Nullable[int] `json:"security_refresh_token_reuse_interval"` - SecurityUpdatePasswordRequireReauthentication nullable.Nullable[bool] `json:"security_update_password_require_reauthentication"` - SessionsInactivityTimeout nullable.Nullable[int] `json:"sessions_inactivity_timeout"` - SessionsSinglePerUser nullable.Nullable[bool] `json:"sessions_single_per_user"` - SessionsTags nullable.Nullable[string] `json:"sessions_tags"` - SessionsTimebox nullable.Nullable[int] `json:"sessions_timebox"` - SiteUrl nullable.Nullable[string] `json:"site_url"` - SmsAutoconfirm nullable.Nullable[bool] `json:"sms_autoconfirm"` - SmsMaxFrequency nullable.Nullable[int] `json:"sms_max_frequency"` - SmsMessagebirdAccessKey nullable.Nullable[string] `json:"sms_messagebird_access_key"` - SmsMessagebirdOriginator nullable.Nullable[string] `json:"sms_messagebird_originator"` - SmsOtpExp nullable.Nullable[int] `json:"sms_otp_exp"` - SmsOtpLength int `json:"sms_otp_length"` - SmsProvider nullable.Nullable[string] `json:"sms_provider"` - SmsTemplate nullable.Nullable[string] `json:"sms_template"` - SmsTestOtp nullable.Nullable[string] `json:"sms_test_otp"` - SmsTestOtpValidUntil nullable.Nullable[string] `json:"sms_test_otp_valid_until"` - SmsTextlocalApiKey nullable.Nullable[string] `json:"sms_textlocal_api_key"` - SmsTextlocalSender nullable.Nullable[string] `json:"sms_textlocal_sender"` - SmsTwilioAccountSid nullable.Nullable[string] `json:"sms_twilio_account_sid"` - SmsTwilioAuthToken nullable.Nullable[string] `json:"sms_twilio_auth_token"` - SmsTwilioContentSid nullable.Nullable[string] `json:"sms_twilio_content_sid"` - SmsTwilioMessageServiceSid nullable.Nullable[string] `json:"sms_twilio_message_service_sid"` - SmsTwilioVerifyAccountSid nullable.Nullable[string] `json:"sms_twilio_verify_account_sid"` - SmsTwilioVerifyAuthToken nullable.Nullable[string] `json:"sms_twilio_verify_auth_token"` - SmsTwilioVerifyMessageServiceSid nullable.Nullable[string] `json:"sms_twilio_verify_message_service_sid"` - SmsVonageApiKey nullable.Nullable[string] `json:"sms_vonage_api_key"` - SmsVonageApiSecret nullable.Nullable[string] `json:"sms_vonage_api_secret"` - SmsVonageFrom nullable.Nullable[string] `json:"sms_vonage_from"` - SmtpAdminEmail nullable.Nullable[string] `json:"smtp_admin_email"` - SmtpHost nullable.Nullable[string] `json:"smtp_host"` - SmtpMaxFrequency nullable.Nullable[int] `json:"smtp_max_frequency"` - SmtpPass nullable.Nullable[string] `json:"smtp_pass"` - SmtpPort nullable.Nullable[string] `json:"smtp_port"` - SmtpSenderName nullable.Nullable[string] `json:"smtp_sender_name"` - SmtpUser nullable.Nullable[string] `json:"smtp_user"` - UriAllowList nullable.Nullable[string] `json:"uri_allow_list"` -} + ApiMaxRequestDuration nullable.Nullable[int] `json:"api_max_request_duration"` + DbMaxPoolSize nullable.Nullable[int] `json:"db_max_pool_size"` + DisableSignup nullable.Nullable[bool] `json:"disable_signup"` + ExternalAnonymousUsersEnabled nullable.Nullable[bool] `json:"external_anonymous_users_enabled"` + ExternalAppleAdditionalClientIds nullable.Nullable[string] `json:"external_apple_additional_client_ids"` + ExternalAppleClientId nullable.Nullable[string] `json:"external_apple_client_id"` + ExternalAppleEnabled nullable.Nullable[bool] `json:"external_apple_enabled"` + ExternalAppleSecret nullable.Nullable[string] `json:"external_apple_secret"` + ExternalAzureClientId nullable.Nullable[string] `json:"external_azure_client_id"` + ExternalAzureEnabled nullable.Nullable[bool] `json:"external_azure_enabled"` + ExternalAzureSecret nullable.Nullable[string] `json:"external_azure_secret"` + ExternalAzureUrl nullable.Nullable[string] `json:"external_azure_url"` + ExternalBitbucketClientId nullable.Nullable[string] `json:"external_bitbucket_client_id"` + ExternalBitbucketEnabled nullable.Nullable[bool] `json:"external_bitbucket_enabled"` + ExternalBitbucketSecret nullable.Nullable[string] `json:"external_bitbucket_secret"` + ExternalDiscordClientId nullable.Nullable[string] `json:"external_discord_client_id"` + ExternalDiscordEnabled nullable.Nullable[bool] `json:"external_discord_enabled"` + ExternalDiscordSecret nullable.Nullable[string] `json:"external_discord_secret"` + ExternalEmailEnabled nullable.Nullable[bool] `json:"external_email_enabled"` + ExternalFacebookClientId nullable.Nullable[string] `json:"external_facebook_client_id"` + ExternalFacebookEnabled nullable.Nullable[bool] `json:"external_facebook_enabled"` + ExternalFacebookSecret nullable.Nullable[string] `json:"external_facebook_secret"` + ExternalFigmaClientId nullable.Nullable[string] `json:"external_figma_client_id"` + ExternalFigmaEnabled nullable.Nullable[bool] `json:"external_figma_enabled"` + ExternalFigmaSecret nullable.Nullable[string] `json:"external_figma_secret"` + ExternalGithubClientId nullable.Nullable[string] `json:"external_github_client_id"` + ExternalGithubEnabled nullable.Nullable[bool] `json:"external_github_enabled"` + ExternalGithubSecret nullable.Nullable[string] `json:"external_github_secret"` + ExternalGitlabClientId nullable.Nullable[string] `json:"external_gitlab_client_id"` + ExternalGitlabEnabled nullable.Nullable[bool] `json:"external_gitlab_enabled"` + ExternalGitlabSecret nullable.Nullable[string] `json:"external_gitlab_secret"` + ExternalGitlabUrl nullable.Nullable[string] `json:"external_gitlab_url"` + ExternalGoogleAdditionalClientIds nullable.Nullable[string] `json:"external_google_additional_client_ids"` + ExternalGoogleClientId nullable.Nullable[string] `json:"external_google_client_id"` + ExternalGoogleEnabled nullable.Nullable[bool] `json:"external_google_enabled"` + ExternalGoogleSecret nullable.Nullable[string] `json:"external_google_secret"` + ExternalGoogleSkipNonceCheck nullable.Nullable[bool] `json:"external_google_skip_nonce_check"` + ExternalKakaoClientId nullable.Nullable[string] `json:"external_kakao_client_id"` + ExternalKakaoEnabled nullable.Nullable[bool] `json:"external_kakao_enabled"` + ExternalKakaoSecret nullable.Nullable[string] `json:"external_kakao_secret"` + ExternalKeycloakClientId nullable.Nullable[string] `json:"external_keycloak_client_id"` + ExternalKeycloakEnabled nullable.Nullable[bool] `json:"external_keycloak_enabled"` + ExternalKeycloakSecret nullable.Nullable[string] `json:"external_keycloak_secret"` + ExternalKeycloakUrl nullable.Nullable[string] `json:"external_keycloak_url"` + ExternalLinkedinOidcClientId nullable.Nullable[string] `json:"external_linkedin_oidc_client_id"` + ExternalLinkedinOidcEnabled nullable.Nullable[bool] `json:"external_linkedin_oidc_enabled"` + ExternalLinkedinOidcSecret nullable.Nullable[string] `json:"external_linkedin_oidc_secret"` + ExternalNotionClientId nullable.Nullable[string] `json:"external_notion_client_id"` + ExternalNotionEnabled nullable.Nullable[bool] `json:"external_notion_enabled"` + ExternalNotionSecret nullable.Nullable[string] `json:"external_notion_secret"` + ExternalPhoneEnabled nullable.Nullable[bool] `json:"external_phone_enabled"` + ExternalSlackClientId nullable.Nullable[string] `json:"external_slack_client_id"` + ExternalSlackEnabled nullable.Nullable[bool] `json:"external_slack_enabled"` + ExternalSlackOidcClientId nullable.Nullable[string] `json:"external_slack_oidc_client_id"` + ExternalSlackOidcEnabled nullable.Nullable[bool] `json:"external_slack_oidc_enabled"` + ExternalSlackOidcSecret nullable.Nullable[string] `json:"external_slack_oidc_secret"` + ExternalSlackSecret nullable.Nullable[string] `json:"external_slack_secret"` + ExternalSpotifyClientId nullable.Nullable[string] `json:"external_spotify_client_id"` + ExternalSpotifyEnabled nullable.Nullable[bool] `json:"external_spotify_enabled"` + ExternalSpotifySecret nullable.Nullable[string] `json:"external_spotify_secret"` + ExternalTwitchClientId nullable.Nullable[string] `json:"external_twitch_client_id"` + ExternalTwitchEnabled nullable.Nullable[bool] `json:"external_twitch_enabled"` + ExternalTwitchSecret nullable.Nullable[string] `json:"external_twitch_secret"` + ExternalTwitterClientId nullable.Nullable[string] `json:"external_twitter_client_id"` + ExternalTwitterEnabled nullable.Nullable[bool] `json:"external_twitter_enabled"` + ExternalTwitterSecret nullable.Nullable[string] `json:"external_twitter_secret"` + ExternalWeb3SolanaEnabled nullable.Nullable[bool] `json:"external_web3_solana_enabled"` + ExternalWorkosClientId nullable.Nullable[string] `json:"external_workos_client_id"` + ExternalWorkosEnabled nullable.Nullable[bool] `json:"external_workos_enabled"` + ExternalWorkosSecret nullable.Nullable[string] `json:"external_workos_secret"` + ExternalWorkosUrl nullable.Nullable[string] `json:"external_workos_url"` + ExternalZoomClientId nullable.Nullable[string] `json:"external_zoom_client_id"` + ExternalZoomEnabled nullable.Nullable[bool] `json:"external_zoom_enabled"` + ExternalZoomSecret nullable.Nullable[string] `json:"external_zoom_secret"` + HookCustomAccessTokenEnabled nullable.Nullable[bool] `json:"hook_custom_access_token_enabled"` + HookCustomAccessTokenSecrets nullable.Nullable[string] `json:"hook_custom_access_token_secrets"` + HookCustomAccessTokenUri nullable.Nullable[string] `json:"hook_custom_access_token_uri"` + HookMfaVerificationAttemptEnabled nullable.Nullable[bool] `json:"hook_mfa_verification_attempt_enabled"` + HookMfaVerificationAttemptSecrets nullable.Nullable[string] `json:"hook_mfa_verification_attempt_secrets"` + HookMfaVerificationAttemptUri nullable.Nullable[string] `json:"hook_mfa_verification_attempt_uri"` + HookPasswordVerificationAttemptEnabled nullable.Nullable[bool] `json:"hook_password_verification_attempt_enabled"` + HookPasswordVerificationAttemptSecrets nullable.Nullable[string] `json:"hook_password_verification_attempt_secrets"` + HookPasswordVerificationAttemptUri nullable.Nullable[string] `json:"hook_password_verification_attempt_uri"` + HookSendEmailEnabled nullable.Nullable[bool] `json:"hook_send_email_enabled"` + HookSendEmailSecrets nullable.Nullable[string] `json:"hook_send_email_secrets"` + HookSendEmailUri nullable.Nullable[string] `json:"hook_send_email_uri"` + HookSendSmsEnabled nullable.Nullable[bool] `json:"hook_send_sms_enabled"` + HookSendSmsSecrets nullable.Nullable[string] `json:"hook_send_sms_secrets"` + HookSendSmsUri nullable.Nullable[string] `json:"hook_send_sms_uri"` + JwtExp nullable.Nullable[int] `json:"jwt_exp"` + MailerAllowUnverifiedEmailSignIns nullable.Nullable[bool] `json:"mailer_allow_unverified_email_sign_ins"` + MailerAutoconfirm nullable.Nullable[bool] `json:"mailer_autoconfirm"` + MailerOtpExp int `json:"mailer_otp_exp"` + MailerOtpLength nullable.Nullable[int] `json:"mailer_otp_length"` + MailerSecureEmailChangeEnabled nullable.Nullable[bool] `json:"mailer_secure_email_change_enabled"` + MailerSubjectsConfirmation nullable.Nullable[string] `json:"mailer_subjects_confirmation"` + MailerSubjectsEmailChange nullable.Nullable[string] `json:"mailer_subjects_email_change"` + MailerSubjectsInvite nullable.Nullable[string] `json:"mailer_subjects_invite"` + MailerSubjectsMagicLink nullable.Nullable[string] `json:"mailer_subjects_magic_link"` + MailerSubjectsReauthentication nullable.Nullable[string] `json:"mailer_subjects_reauthentication"` + MailerSubjectsRecovery nullable.Nullable[string] `json:"mailer_subjects_recovery"` + MailerTemplatesConfirmationContent nullable.Nullable[string] `json:"mailer_templates_confirmation_content"` + MailerTemplatesEmailChangeContent nullable.Nullable[string] `json:"mailer_templates_email_change_content"` + MailerTemplatesInviteContent nullable.Nullable[string] `json:"mailer_templates_invite_content"` + MailerTemplatesMagicLinkContent nullable.Nullable[string] `json:"mailer_templates_magic_link_content"` + MailerTemplatesReauthenticationContent nullable.Nullable[string] `json:"mailer_templates_reauthentication_content"` + MailerTemplatesRecoveryContent nullable.Nullable[string] `json:"mailer_templates_recovery_content"` + MfaMaxEnrolledFactors nullable.Nullable[int] `json:"mfa_max_enrolled_factors"` + MfaPhoneEnrollEnabled nullable.Nullable[bool] `json:"mfa_phone_enroll_enabled"` + MfaPhoneMaxFrequency nullable.Nullable[int] `json:"mfa_phone_max_frequency"` + MfaPhoneOtpLength int `json:"mfa_phone_otp_length"` + MfaPhoneTemplate nullable.Nullable[string] `json:"mfa_phone_template"` + MfaPhoneVerifyEnabled nullable.Nullable[bool] `json:"mfa_phone_verify_enabled"` + MfaTotpEnrollEnabled nullable.Nullable[bool] `json:"mfa_totp_enroll_enabled"` + MfaTotpVerifyEnabled nullable.Nullable[bool] `json:"mfa_totp_verify_enabled"` + MfaWebAuthnEnrollEnabled nullable.Nullable[bool] `json:"mfa_web_authn_enroll_enabled"` + MfaWebAuthnVerifyEnabled nullable.Nullable[bool] `json:"mfa_web_authn_verify_enabled"` + PasswordHibpEnabled nullable.Nullable[bool] `json:"password_hibp_enabled"` + PasswordMinLength nullable.Nullable[int] `json:"password_min_length"` + PasswordRequiredCharacters nullable.Nullable[AuthConfigResponsePasswordRequiredCharacters] `json:"password_required_characters"` + RateLimitAnonymousUsers nullable.Nullable[int] `json:"rate_limit_anonymous_users"` + RateLimitEmailSent nullable.Nullable[int] `json:"rate_limit_email_sent"` + RateLimitOtp nullable.Nullable[int] `json:"rate_limit_otp"` + RateLimitSmsSent nullable.Nullable[int] `json:"rate_limit_sms_sent"` + RateLimitTokenRefresh nullable.Nullable[int] `json:"rate_limit_token_refresh"` + RateLimitVerify nullable.Nullable[int] `json:"rate_limit_verify"` + RateLimitWeb3 nullable.Nullable[int] `json:"rate_limit_web3"` + RefreshTokenRotationEnabled nullable.Nullable[bool] `json:"refresh_token_rotation_enabled"` + SamlAllowEncryptedAssertions nullable.Nullable[bool] `json:"saml_allow_encrypted_assertions"` + SamlEnabled nullable.Nullable[bool] `json:"saml_enabled"` + SamlExternalUrl nullable.Nullable[string] `json:"saml_external_url"` + SecurityCaptchaEnabled nullable.Nullable[bool] `json:"security_captcha_enabled"` + SecurityCaptchaProvider nullable.Nullable[AuthConfigResponseSecurityCaptchaProvider] `json:"security_captcha_provider"` + SecurityCaptchaSecret nullable.Nullable[string] `json:"security_captcha_secret"` + SecurityManualLinkingEnabled nullable.Nullable[bool] `json:"security_manual_linking_enabled"` + SecurityRefreshTokenReuseInterval nullable.Nullable[int] `json:"security_refresh_token_reuse_interval"` + SecurityUpdatePasswordRequireReauthentication nullable.Nullable[bool] `json:"security_update_password_require_reauthentication"` + SessionsInactivityTimeout nullable.Nullable[int] `json:"sessions_inactivity_timeout"` + SessionsSinglePerUser nullable.Nullable[bool] `json:"sessions_single_per_user"` + SessionsTags nullable.Nullable[string] `json:"sessions_tags"` + SessionsTimebox nullable.Nullable[int] `json:"sessions_timebox"` + SiteUrl nullable.Nullable[string] `json:"site_url"` + SmsAutoconfirm nullable.Nullable[bool] `json:"sms_autoconfirm"` + SmsMaxFrequency nullable.Nullable[int] `json:"sms_max_frequency"` + SmsMessagebirdAccessKey nullable.Nullable[string] `json:"sms_messagebird_access_key"` + SmsMessagebirdOriginator nullable.Nullable[string] `json:"sms_messagebird_originator"` + SmsOtpExp nullable.Nullable[int] `json:"sms_otp_exp"` + SmsOtpLength int `json:"sms_otp_length"` + SmsProvider nullable.Nullable[AuthConfigResponseSmsProvider] `json:"sms_provider"` + SmsTemplate nullable.Nullable[string] `json:"sms_template"` + SmsTestOtp nullable.Nullable[string] `json:"sms_test_otp"` + SmsTestOtpValidUntil nullable.Nullable[time.Time] `json:"sms_test_otp_valid_until"` + SmsTextlocalApiKey nullable.Nullable[string] `json:"sms_textlocal_api_key"` + SmsTextlocalSender nullable.Nullable[string] `json:"sms_textlocal_sender"` + SmsTwilioAccountSid nullable.Nullable[string] `json:"sms_twilio_account_sid"` + SmsTwilioAuthToken nullable.Nullable[string] `json:"sms_twilio_auth_token"` + SmsTwilioContentSid nullable.Nullable[string] `json:"sms_twilio_content_sid"` + SmsTwilioMessageServiceSid nullable.Nullable[string] `json:"sms_twilio_message_service_sid"` + SmsTwilioVerifyAccountSid nullable.Nullable[string] `json:"sms_twilio_verify_account_sid"` + SmsTwilioVerifyAuthToken nullable.Nullable[string] `json:"sms_twilio_verify_auth_token"` + SmsTwilioVerifyMessageServiceSid nullable.Nullable[string] `json:"sms_twilio_verify_message_service_sid"` + SmsVonageApiKey nullable.Nullable[string] `json:"sms_vonage_api_key"` + SmsVonageApiSecret nullable.Nullable[string] `json:"sms_vonage_api_secret"` + SmsVonageFrom nullable.Nullable[string] `json:"sms_vonage_from"` + SmtpAdminEmail nullable.Nullable[string] `json:"smtp_admin_email"` + SmtpHost nullable.Nullable[string] `json:"smtp_host"` + SmtpMaxFrequency nullable.Nullable[int] `json:"smtp_max_frequency"` + SmtpPass nullable.Nullable[string] `json:"smtp_pass"` + SmtpPort nullable.Nullable[string] `json:"smtp_port"` + SmtpSenderName nullable.Nullable[string] `json:"smtp_sender_name"` + SmtpUser nullable.Nullable[string] `json:"smtp_user"` + UriAllowList nullable.Nullable[string] `json:"uri_allow_list"` +} + +// AuthConfigResponsePasswordRequiredCharacters defines model for AuthConfigResponse.PasswordRequiredCharacters. +type AuthConfigResponsePasswordRequiredCharacters string + +// AuthConfigResponseSecurityCaptchaProvider defines model for AuthConfigResponse.SecurityCaptchaProvider. +type AuthConfigResponseSecurityCaptchaProvider string + +// AuthConfigResponseSmsProvider defines model for AuthConfigResponse.SmsProvider. +type AuthConfigResponseSmsProvider string // BranchActionBody defines model for BranchActionBody. type BranchActionBody struct { @@ -1228,7 +1286,7 @@ type BulkUpdateFunctionBodyStatus string // BulkUpdateFunctionResponse defines model for BulkUpdateFunctionResponse. type BulkUpdateFunctionResponse struct { Functions []struct { - CreatedAt int `json:"created_at"` + CreatedAt int64 `json:"created_at"` EntrypointPath *string `json:"entrypoint_path,omitempty"` Id string `json:"id"` ImportMap *bool `json:"import_map,omitempty"` @@ -1236,7 +1294,7 @@ type BulkUpdateFunctionResponse struct { Name string `json:"name"` Slug string `json:"slug"` Status BulkUpdateFunctionResponseFunctionsStatus `json:"status"` - UpdatedAt int `json:"updated_at"` + UpdatedAt int64 `json:"updated_at"` VerifyJwt *bool `json:"verify_jwt,omitempty"` Version int `json:"version"` } `json:"functions"` @@ -1288,6 +1346,15 @@ type CreateOrganizationV1 struct { Name string `json:"name"` } +// CreateProjectClaimTokenResponse defines model for CreateProjectClaimTokenResponse. +type CreateProjectClaimTokenResponse struct { + CreatedAt string `json:"created_at"` + CreatedBy openapi_types.UUID `json:"created_by"` + ExpiresAt string `json:"expires_at"` + Token string `json:"token"` + TokenAlias string `json:"token_alias"` +} + // CreateProviderBody defines model for CreateProviderBody. type CreateProviderBody struct { AttributeMapping *struct { @@ -1457,7 +1524,7 @@ type FunctionResponseStatus string // FunctionSlugResponse defines model for FunctionSlugResponse. type FunctionSlugResponse struct { - CreatedAt int `json:"created_at"` + CreatedAt int64 `json:"created_at"` EntrypointPath *string `json:"entrypoint_path,omitempty"` Id string `json:"id"` ImportMap *bool `json:"import_map,omitempty"` @@ -1465,7 +1532,7 @@ type FunctionSlugResponse struct { Name string `json:"name"` Slug string `json:"slug"` Status FunctionSlugResponseStatus `json:"status"` - UpdatedAt int `json:"updated_at"` + UpdatedAt int64 `json:"updated_at"` VerifyJwt *bool `json:"verify_jwt,omitempty"` Version int `json:"version"` } @@ -1744,6 +1811,46 @@ type OAuthTokenResponse struct { // OAuthTokenResponseTokenType defines model for OAuthTokenResponse.TokenType. type OAuthTokenResponseTokenType string +// OrganizationProjectClaimResponse defines model for OrganizationProjectClaimResponse. +type OrganizationProjectClaimResponse struct { + CreatedAt string `json:"created_at"` + CreatedBy openapi_types.UUID `json:"created_by"` + ExpiresAt string `json:"expires_at"` + Preview struct { + Errors []struct { + Key string `json:"key"` + Message string `json:"message"` + } `json:"errors"` + Info []struct { + Key string `json:"key"` + Message string `json:"message"` + } `json:"info"` + MembersExceedingFreeProjectLimit []struct { + Limit float32 `json:"limit"` + Name string `json:"name"` + } `json:"members_exceeding_free_project_limit"` + SourceSubscriptionPlan OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan `json:"source_subscription_plan"` + TargetOrganizationEligible nullable.Nullable[bool] `json:"target_organization_eligible"` + TargetOrganizationHasFreeProjectSlots nullable.Nullable[bool] `json:"target_organization_has_free_project_slots"` + TargetSubscriptionPlan nullable.Nullable[OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan] `json:"target_subscription_plan"` + Valid bool `json:"valid"` + Warnings []struct { + Key string `json:"key"` + Message string `json:"message"` + } `json:"warnings"` + } `json:"preview"` + Project struct { + Name string `json:"name"` + Ref string `json:"ref"` + } `json:"project"` +} + +// OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan defines model for OrganizationProjectClaimResponse.Preview.SourceSubscriptionPlan. +type OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan string + +// OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan defines model for OrganizationProjectClaimResponse.Preview.TargetSubscriptionPlan. +type OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan string + // OrganizationResponseV1 defines model for OrganizationResponseV1. type OrganizationResponseV1 struct { Id string `json:"id"` @@ -1796,6 +1903,14 @@ type PostgrestConfigWithJWTSecretResponse struct { MaxRows int `json:"max_rows"` } +// ProjectClaimTokenResponse defines model for ProjectClaimTokenResponse. +type ProjectClaimTokenResponse struct { + CreatedAt string `json:"created_at"` + CreatedBy openapi_types.UUID `json:"created_by"` + ExpiresAt string `json:"expires_at"` + TokenAlias string `json:"token_alias"` +} + // ProjectUpgradeEligibilityResponse defines model for ProjectUpgradeEligibilityResponse. type ProjectUpgradeEligibilityResponse struct { CurrentAppVersion string `json:"current_app_version"` @@ -2429,6 +2544,14 @@ type V1BackupsResponse struct { // V1BackupsResponseBackupsStatus defines model for V1BackupsResponse.Backups.Status. type V1BackupsResponseBackupsStatus string +// V1CreateFunctionBody defines model for V1CreateFunctionBody. +type V1CreateFunctionBody struct { + Body string `json:"body"` + Name string `json:"name"` + Slug string `json:"slug"` + VerifyJwt *bool `json:"verify_jwt,omitempty"` +} + // V1CreateMigrationBody defines model for V1CreateMigrationBody. type V1CreateMigrationBody struct { Name *string `json:"name,omitempty"` @@ -2822,10 +2945,13 @@ type V1UpdateAFunctionParams struct { // V1GetServicesHealthParams defines parameters for V1GetServicesHealth. type V1GetServicesHealthParams struct { - Services []interface{} `form:"services" json:"services"` - TimeoutMs *int `form:"timeout_ms,omitempty" json:"timeout_ms,omitempty"` + Services []V1GetServicesHealthParamsServices `form:"services" json:"services"` + TimeoutMs *int `form:"timeout_ms,omitempty" json:"timeout_ms,omitempty"` } +// V1GetServicesHealthParamsServices defines parameters for V1GetServicesHealth. +type V1GetServicesHealthParamsServices string + // V1BulkDeleteSecretsJSONBody defines parameters for V1BulkDeleteSecrets. type V1BulkDeleteSecretsJSONBody = []string @@ -2930,6 +3056,9 @@ type V1ApplyAMigrationJSONRequestBody = V1CreateMigrationBody // V1RunAQueryJSONRequestBody defines body for V1RunAQuery for application/json ContentType. type V1RunAQueryJSONRequestBody = V1RunQueryBody +// V1CreateAFunctionJSONRequestBody defines body for V1CreateAFunction for application/json ContentType. +type V1CreateAFunctionJSONRequestBody = V1CreateFunctionBody + // V1BulkUpdateFunctionsJSONRequestBody defines body for V1BulkUpdateFunctions for application/json ContentType. type V1BulkUpdateFunctionsJSONRequestBody = BulkUpdateFunctionBody diff --git a/pkg/config/auth.go b/pkg/config/auth.go index f8c431309..50194af1b 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -32,22 +32,22 @@ func (r *PasswordRequirements) UnmarshalText(text []byte) error { func (r PasswordRequirements) ToChar() v1API.UpdateAuthConfigBodyPasswordRequiredCharacters { switch r { case LettersDigits: - return v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + return v1API.UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 case LowerUpperLettersDigits: - return v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891 + return v1API.UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891 case LowerUpperLettersDigitsSymbols: - return v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567892 + return v1API.UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567892 } - return v1API.Empty + return v1API.UpdateAuthConfigBodyPasswordRequiredCharactersEmpty } func NewPasswordRequirement(c v1API.UpdateAuthConfigBodyPasswordRequiredCharacters) PasswordRequirements { switch c { - case v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789: + case v1API.UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789: return LettersDigits - case v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891: + case v1API.UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567891: return LowerUpperLettersDigits - case v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567892: + case v1API.UpdateAuthConfigBodyPasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567892: return LowerUpperLettersDigitsSymbols } return NoRequirements @@ -738,33 +738,33 @@ func (s sms) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { // Api only overrides configs of enabled providers switch { case s.Twilio.Enabled: - body.SmsProvider = nullable.NewNullableWithValue(v1API.Twilio) + body.SmsProvider = nullable.NewNullableWithValue(v1API.UpdateAuthConfigBodySmsProviderTwilio) if len(s.Twilio.AuthToken.SHA256) > 0 { body.SmsTwilioAuthToken = nullable.NewNullableWithValue(s.Twilio.AuthToken.Value) } body.SmsTwilioAccountSid = nullable.NewNullableWithValue(s.Twilio.AccountSid) body.SmsTwilioMessageServiceSid = nullable.NewNullableWithValue(s.Twilio.MessageServiceSid) case s.TwilioVerify.Enabled: - body.SmsProvider = nullable.NewNullableWithValue(v1API.TwilioVerify) + body.SmsProvider = nullable.NewNullableWithValue(v1API.UpdateAuthConfigBodySmsProviderTwilioVerify) if len(s.TwilioVerify.AuthToken.SHA256) > 0 { body.SmsTwilioVerifyAuthToken = nullable.NewNullableWithValue(s.TwilioVerify.AuthToken.Value) } body.SmsTwilioVerifyAccountSid = nullable.NewNullableWithValue(s.TwilioVerify.AccountSid) body.SmsTwilioVerifyMessageServiceSid = nullable.NewNullableWithValue(s.TwilioVerify.MessageServiceSid) case s.Messagebird.Enabled: - body.SmsProvider = nullable.NewNullableWithValue(v1API.Messagebird) + body.SmsProvider = nullable.NewNullableWithValue(v1API.UpdateAuthConfigBodySmsProviderMessagebird) if len(s.Messagebird.AccessKey.SHA256) > 0 { body.SmsMessagebirdAccessKey = nullable.NewNullableWithValue(s.Messagebird.AccessKey.Value) } body.SmsMessagebirdOriginator = nullable.NewNullableWithValue(s.Messagebird.Originator) case s.Textlocal.Enabled: - body.SmsProvider = nullable.NewNullableWithValue(v1API.Textlocal) + body.SmsProvider = nullable.NewNullableWithValue(v1API.UpdateAuthConfigBodySmsProviderTextlocal) if len(s.Textlocal.ApiKey.SHA256) > 0 { body.SmsTextlocalApiKey = nullable.NewNullableWithValue(s.Textlocal.ApiKey.Value) } body.SmsTextlocalSender = nullable.NewNullableWithValue(s.Textlocal.Sender) case s.Vonage.Enabled: - body.SmsProvider = nullable.NewNullableWithValue(v1API.Vonage) + body.SmsProvider = nullable.NewNullableWithValue(v1API.UpdateAuthConfigBodySmsProviderVonage) if len(s.Vonage.ApiSecret.SHA256) > 0 { body.SmsVonageApiSecret = nullable.NewNullableWithValue(s.Vonage.ApiSecret.Value) } diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index 09bf1fea7..1bab29847 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -60,7 +60,7 @@ func TestAuthDiff(t *testing.T) { DisableSignup: nullable.NewNullableWithValue(false), ExternalAnonymousUsersEnabled: nullable.NewNullableWithValue(true), PasswordMinLength: nullable.NewNullableWithValue(6), - PasswordRequiredCharacters: nullable.NewNullableWithValue(string(v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)), + PasswordRequiredCharacters: nullable.NewNullableWithValue(v1API.AuthConfigResponsePasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789), }) // Check error assert.NoError(t, err) @@ -90,7 +90,7 @@ func TestAuthDiff(t *testing.T) { DisableSignup: nullable.NewNullableWithValue(false), ExternalAnonymousUsersEnabled: nullable.NewNullableWithValue(true), PasswordMinLength: nullable.NewNullableWithValue(8), - PasswordRequiredCharacters: nullable.NewNullableWithValue(string(v1API.AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)), + PasswordRequiredCharacters: nullable.NewNullableWithValue(v1API.AuthConfigResponsePasswordRequiredCharactersAbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789), }) // Check error assert.NoError(t, err) @@ -111,7 +111,7 @@ func TestAuthDiff(t *testing.T) { DisableSignup: nullable.NewNullableWithValue(true), ExternalAnonymousUsersEnabled: nullable.NewNullableWithValue(false), PasswordMinLength: nullable.NewNullableWithValue(0), - PasswordRequiredCharacters: nullable.NewNullableWithValue(""), + PasswordRequiredCharacters: nullable.NewNullableWithValue(v1API.AuthConfigResponsePasswordRequiredCharactersEmpty), }) // Check error assert.NoError(t, err) @@ -133,7 +133,7 @@ func TestCaptchaDiff(t *testing.T) { // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ SecurityCaptchaEnabled: nullable.NewNullableWithValue(true), - SecurityCaptchaProvider: nullable.NewNullableWithValue("hcaptcha"), + SecurityCaptchaProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSecurityCaptchaProviderHcaptcha), SecurityCaptchaSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error @@ -154,7 +154,7 @@ func TestCaptchaDiff(t *testing.T) { // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ SecurityCaptchaEnabled: nullable.NewNullableWithValue(true), - SecurityCaptchaProvider: nullable.NewNullableWithValue("hcaptcha"), + SecurityCaptchaProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSecurityCaptchaProviderHcaptcha), SecurityCaptchaSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error @@ -175,7 +175,7 @@ func TestCaptchaDiff(t *testing.T) { // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ SecurityCaptchaEnabled: nullable.NewNullableWithValue(false), - SecurityCaptchaProvider: nullable.NewNullableWithValue("hcaptcha"), + SecurityCaptchaProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSecurityCaptchaProviderHcaptcha), SecurityCaptchaSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error @@ -202,7 +202,7 @@ func TestCaptchaDiff(t *testing.T) { // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ SecurityCaptchaEnabled: nullable.NewNullableWithValue(true), - SecurityCaptchaProvider: nullable.NewNullableWithValue("hcaptcha"), + SecurityCaptchaProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSecurityCaptchaProviderHcaptcha), SecurityCaptchaSecret: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), }) // Check error @@ -759,10 +759,10 @@ func TestSmsDiff(t *testing.T) { SmsMaxFrequency: nullable.NewNullableWithValue(60), SmsOtpExp: nullable.NewNullableWithValue(3600), SmsOtpLength: 6, - SmsProvider: nullable.NewNullableWithValue("twilio"), + SmsProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSmsProviderTwilio), SmsTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), SmsTestOtp: nullable.NewNullableWithValue("123=456"), - SmsTestOtpValidUntil: nullable.NewNullableWithValue("2050-01-01T01:00:00Z"), + SmsTestOtpValidUntil: nullable.NewNullableWithValue(time.Date(2050, 1, 1, 1, 0, 0, 0, time.UTC)), SmsTwilioAccountSid: nullable.NewNullableWithValue("test-account"), SmsTwilioAuthToken: nullable.NewNullableWithValue("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), SmsTwilioContentSid: nullable.NewNullableWithValue("test-content"), @@ -793,10 +793,10 @@ func TestSmsDiff(t *testing.T) { SmsMaxFrequency: nullable.NewNullableWithValue(60), SmsOtpExp: nullable.NewNullableWithValue(3600), SmsOtpLength: 6, - SmsProvider: nullable.NewNullableWithValue("twilio"), + SmsProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSmsProviderTwilio), SmsTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), SmsTestOtp: nullable.NewNullableWithValue("123=456,456=123"), - SmsTestOtpValidUntil: nullable.NewNullableWithValue("2050-01-01T01:00:00Z"), + SmsTestOtpValidUntil: nullable.NewNullableWithValue(time.Date(2050, 1, 1, 1, 0, 0, 0, time.UTC)), SmsTwilioAccountSid: nullable.NewNullableWithValue("test-account"), SmsTwilioAuthToken: nullable.NewNullableWithValue("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), SmsTwilioContentSid: nullable.NewNullableWithValue("test-content"), @@ -831,7 +831,7 @@ func TestSmsDiff(t *testing.T) { SmsMaxFrequency: nullable.NewNullableWithValue(0), SmsOtpExp: nullable.NewNullableWithValue(3600), SmsOtpLength: 6, - SmsProvider: nullable.NewNullableWithValue("twilio"), + SmsProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSmsProviderTwilio), SmsTemplate: nullable.NewNullableWithValue(""), SmsTwilioAccountSid: nullable.NewNullableWithValue("test-account"), SmsTwilioAuthToken: nullable.NewNullableWithValue("c84443bc59b92caef8ec8500ff443584793756749523811eb333af2bbc74fc88"), @@ -861,8 +861,8 @@ func TestSmsDiff(t *testing.T) { SmsOtpLength: 6, SmsTemplate: nullable.NewNullableWithValue("Your code is {{ .Code }}"), SmsTestOtp: nullable.NewNullableWithValue("123=456"), - SmsTestOtpValidUntil: nullable.NewNullableWithValue("2050-01-01T01:00:00Z"), - SmsProvider: nullable.NewNullableWithValue("messagebird"), + SmsTestOtpValidUntil: nullable.NewNullableWithValue(time.Date(2050, 1, 1, 1, 0, 0, 0, time.UTC)), + SmsProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSmsProviderMessagebird), SmsMessagebirdAccessKey: nullable.NewNullableWithValue("test-messagebird-key"), SmsMessagebirdOriginator: nullable.NewNullableWithValue("test-messagebird-originator"), }) @@ -879,7 +879,7 @@ func TestSmsDiff(t *testing.T) { // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ ExternalPhoneEnabled: nullable.NewNullableWithValue(false), - SmsProvider: nullable.NewNullableWithValue("twilio"), + SmsProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSmsProviderTwilio), }) // Check error assert.NoError(t, err) @@ -892,7 +892,7 @@ func TestSmsDiff(t *testing.T) { // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ ExternalPhoneEnabled: nullable.NewNullableWithValue(false), - SmsProvider: nullable.NewNullableWithValue("messagebird"), + SmsProvider: nullable.NewNullableWithValue(v1API.AuthConfigResponseSmsProviderMessagebird), SmsMessagebirdAccessKey: nullable.NewNullableWithValue(""), }) // Check error From f4cb6fb101432e9008f0f1d9494bbccd8bc1388b Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Tue, 3 Jun 2025 11:00:48 +0800 Subject: [PATCH 164/359] chore: update job permissions --- .github/workflows/fast-forward.yml | 3 +++ .github/workflows/mirror.yml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/fast-forward.yml b/.github/workflows/fast-forward.yml index efeb443f2..c4e78c241 100644 --- a/.github/workflows/fast-forward.yml +++ b/.github/workflows/fast-forward.yml @@ -27,6 +27,9 @@ jobs: publish: needs: - approved + permissions: + contents: write + packages: write # Call workflow explicitly because events from actions cannot trigger more actions uses: ./.github/workflows/release.yml secrets: inherit diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 126949ac0..d4054b3b3 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -49,6 +49,10 @@ jobs: publish: needs: - setup + permissions: + contents: read + packages: write + id-token: write if: ${{ needs.setup.outputs.tags != needs.setup.outputs.curr }} strategy: matrix: From 33895c19c6f963a1f214d031f4fbf9a30ad3bec7 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Tue, 3 Jun 2025 11:23:41 +0800 Subject: [PATCH 165/359] fix: remove unnecessary dependency --- pkg/config/templates/Dockerfile | 2 +- pkg/function/batch_test.go | 16 ++++++++++------ pkg/go.mod | 25 +++---------------------- pkg/storage/objects_test.go | 4 ++-- 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5241beb0d..f1458637e 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -13,7 +13,7 @@ FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue FROM supabase/realtime:v2.36.7 AS realtime FROM supabase/storage-api:v1.23.0 AS storage -FROM supabase/logflare:1.14.2 AS logflare +FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ FROM supabase/migra:3.0.1663481299 AS migra diff --git a/pkg/function/batch_test.go b/pkg/function/batch_test.go index 94ed6e62f..cc6437ec3 100644 --- a/pkg/function/batch_test.go +++ b/pkg/function/batch_test.go @@ -10,7 +10,6 @@ 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/pkg/api" "github.com/supabase/cli/pkg/config" ) @@ -74,7 +73,8 @@ func TestUpsertFunctions(t *testing.T) { }) // Check error assert.NoError(t, err) - assert.Empty(t, apitest.ListUnmatchedRequests()) + assert.Empty(t, gock.Pending()) + assert.Empty(t, gock.GetUnmatchedRequests()) }) t.Run("handles concurrent deploy", func(t *testing.T) { @@ -98,7 +98,8 @@ func TestUpsertFunctions(t *testing.T) { }) // Check error assert.NoError(t, err) - assert.Empty(t, apitest.ListUnmatchedRequests()) + assert.Empty(t, gock.Pending()) + assert.Empty(t, gock.GetUnmatchedRequests()) }) t.Run("retries on network failure", func(t *testing.T) { @@ -117,7 +118,8 @@ func TestUpsertFunctions(t *testing.T) { err := client.UpsertFunctions(context.Background(), nil) // Check error assert.ErrorContains(t, err, "unexpected list functions status 400:") - assert.Empty(t, apitest.ListUnmatchedRequests()) + assert.Empty(t, gock.Pending()) + assert.Empty(t, gock.GetUnmatchedRequests()) }) t.Run("retries on create failure", func(t *testing.T) { @@ -143,7 +145,8 @@ func TestUpsertFunctions(t *testing.T) { }) // Check error assert.NoError(t, err) - assert.Empty(t, apitest.ListUnmatchedRequests()) + assert.Empty(t, gock.Pending()) + assert.Empty(t, gock.GetUnmatchedRequests()) }) t.Run("retries on update failure", func(t *testing.T) { @@ -169,6 +172,7 @@ func TestUpsertFunctions(t *testing.T) { }) // Check error assert.NoError(t, err) - assert.Empty(t, apitest.ListUnmatchedRequests()) + assert.Empty(t, gock.Pending()) + assert.Empty(t, gock.GetUnmatchedRequests()) }) } diff --git a/pkg/go.mod b/pkg/go.mod index 9aad68632..6fb1fec23 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -24,57 +24,38 @@ require ( github.com/spf13/afero v1.14.0 github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 - github.com/supabase/cli v1.226.5 github.com/tidwall/jsonc v0.3.2 golang.org/x/mod v0.24.0 google.golang.org/grpc v1.72.2 ) require ( - github.com/Microsoft/go-winio v0.6.2 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect - github.com/containerd/errdefs v1.0.0 // indirect - github.com/containerd/errdefs/pkg v0.3.0 // indirect - github.com/containerd/log v0.1.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect - github.com/distribution/reference v0.6.0 // indirect - github.com/docker/docker v28.2.2+incompatible // indirect - github.com/docker/go-connections v0.5.0 // indirect github.com/ethereum/go-ethereum v1.15.8 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect - github.com/go-logr/logr v1.4.2 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/moby/docker-image-spec v1.3.1 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.1 // indirect + github.com/lib/pq v1.10.9 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/cast v1.7.1 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect - go.opentelemetry.io/otel v1.36.0 // indirect - go.opentelemetry.io/otel/metric v1.36.0 // indirect - go.opentelemetry.io/otel/trace v1.36.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.9.0 // indirect golang.org/x/crypto v0.37.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.24.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.5.2 // indirect ) diff --git a/pkg/storage/objects_test.go b/pkg/storage/objects_test.go index a2e132a9b..423cc765c 100644 --- a/pkg/storage/objects_test.go +++ b/pkg/storage/objects_test.go @@ -9,7 +9,6 @@ import ( "github.com/h2non/gock" "github.com/stretchr/testify/assert" - "github.com/supabase/cli/internal/testing/apitest" "github.com/supabase/cli/pkg/fetcher" ) @@ -86,7 +85,8 @@ func TestParseFileOptionsContentTypeDetection(t *testing.T) { err := mockApi.UploadObject(context.Background(), tt.filename, tt.filename, fsys, tt.opts...) // Assert results assert.NoError(t, err) - assert.Empty(t, apitest.ListUnmatchedRequests()) + assert.Empty(t, gock.Pending()) + assert.Empty(t, gock.GetUnmatchedRequests()) }) } } From 5d24bdf89e1973b21e51fcbb34c7556f153d6e0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 04:25:48 +0000 Subject: [PATCH 166/359] chore(deps): bump supabase/realtime from v2.36.7 to v2.36.8 in /pkg/config/templates (#3649) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.7 to v2.36.8. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index f1458637e..a39b922f8 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue -FROM supabase/realtime:v2.36.7 AS realtime +FROM supabase/realtime:v2.36.8 AS realtime FROM supabase/storage-api:v1.23.0 AS storage FROM supabase/logflare:1.12.0 AS logflare # Append to JobImages when adding new dependencies below From 535b14cf12b66ae9dec2c032b2fbf7b7b14a2324 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 04:30:59 +0000 Subject: [PATCH 167/359] chore(deps): bump supabase/logflare from 1.12.0 to 1.14.2 in /pkg/config/templates (#3650) chore(deps): bump supabase/logflare in /pkg/config/templates Bumps supabase/logflare from 1.12.0 to 1.14.2. --- updated-dependencies: - dependency-name: supabase/logflare dependency-version: 1.14.2 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index a39b922f8..24b87d8b9 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -13,7 +13,7 @@ FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue FROM supabase/realtime:v2.36.8 AS realtime FROM supabase/storage-api:v1.23.0 AS storage -FROM supabase/logflare:1.12.0 AS logflare +FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ FROM supabase/migra:3.0.1663481299 AS migra From 74d0ab80c9acf190be75ea69042e0df75befbac8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 04:27:39 +0000 Subject: [PATCH 168/359] chore(deps): bump supabase/postgres from 17.4.1.038 to 17.4.1.039 in /pkg/config/templates (#3651) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.038 to 17.4.1.039. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.039 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 24b87d8b9..161527924 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.038 AS pg +FROM supabase/postgres:17.4.1.039 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 2aadf58e447595c61270a91290a20408860fb89b Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 4 Jun 2025 17:16:00 +0800 Subject: [PATCH 169/359] feat: implement physical backup commands (#3648) * feat: implement physical backup commands * chore: support pretty print * chore: bump api spec --- cmd/backups.go | 46 +++++++++++ internal/backups/list/list.go | 69 ++++++++++++++++ internal/backups/restore/restore.go | 24 ++++++ internal/projects/list/list.go | 9 +-- internal/utils/render.go | 7 ++ pkg/api/client.gen.go | 120 ++++++++++++++++++++++++++++ pkg/api/types.gen.go | 5 ++ 7 files changed, 272 insertions(+), 8 deletions(-) create mode 100644 cmd/backups.go create mode 100644 internal/backups/list/list.go create mode 100644 internal/backups/restore/restore.go diff --git a/cmd/backups.go b/cmd/backups.go new file mode 100644 index 000000000..10f74a22d --- /dev/null +++ b/cmd/backups.go @@ -0,0 +1,46 @@ +package cmd + +import ( + "github.com/spf13/cobra" + "github.com/supabase/cli/internal/backups/list" + "github.com/supabase/cli/internal/backups/restore" + "github.com/supabase/cli/internal/utils/flags" +) + +var ( + backupsCmd = &cobra.Command{ + GroupID: groupManagementAPI, + Use: "backups", + Short: "Manage Supabase physical backups", + } + + backupListCmd = &cobra.Command{ + Use: "list", + Short: "Lists available physical backups", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + return list.Run(cmd.Context()) + }, + } + + timestamp int64 + + backupRestoreCmd = &cobra.Command{ + Use: "restore", + Short: "Restore to a specific timestamp using PITR", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + return restore.Run(cmd.Context(), timestamp) + }, + } +) + +func init() { + backupFlags := backupsCmd.PersistentFlags() + backupFlags.StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.") + backupsCmd.AddCommand(backupListCmd) + restoreFlags := backupRestoreCmd.Flags() + restoreFlags.Int64VarP(×tamp, "timestamp", "t", 0, "The recovery time target in seconds since epoch.") + backupsCmd.AddCommand(backupRestoreCmd) + rootCmd.AddCommand(backupsCmd) +} diff --git a/internal/backups/list/list.go b/internal/backups/list/list.go new file mode 100644 index 000000000..bcff285ff --- /dev/null +++ b/internal/backups/list/list.go @@ -0,0 +1,69 @@ +package list + +import ( + "context" + "fmt" + "os" + + "github.com/go-errors/errors" + "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/pkg/cast" +) + +func Run(ctx context.Context) error { + resp, err := utils.GetSupabase().V1ListAllBackupsWithResponse(ctx, flags.ProjectRef) + if err != nil { + return errors.Errorf("failed to list physical backups: %w", err) + } else if resp.JSON200 == nil { + return errors.Errorf("unexpected list backup status %d: %s", resp.StatusCode(), string(resp.Body)) + } + switch utils.OutputFormat.Value { + case utils.OutputPretty: + if len(resp.JSON200.Backups) > 0 { + return listLogicalBackups(*resp.JSON200) + } + table := `REGION|WALG|PITR|EARLIEST TIMESTAMP|LATEST TIMESTAMP +|-|-|-|-|-| +` + table += fmt.Sprintf( + "|`%s`|`%t`|`%t`|`%d`|`%d`|\n", + utils.FormatRegion(resp.JSON200.Region), + resp.JSON200.WalgEnabled, + resp.JSON200.PitrEnabled, + cast.Val(resp.JSON200.PhysicalBackupData.EarliestPhysicalBackupDateUnix, 0), + cast.Val(resp.JSON200.PhysicalBackupData.LatestPhysicalBackupDateUnix, 0), + ) + return list.RenderTable(table) + case utils.OutputEnv: + return errors.Errorf("--output env flag is not supported") + } + return utils.EncodeOutput(utils.OutputFormat.Value, os.Stdout, *resp.JSON200) +} + +const ( + BACKUP_LOGICAL = "LOGICAL" + BACKUP_PHYSICAL = "PHYSICAL" +) + +func listLogicalBackups(resp api.V1BackupsResponse) error { + table := `REGION|BACKUP TYPE|STATUS|CREATED AT (UTC) +|-|-|-|-| +` + for _, backup := range resp.Backups { + backupType := BACKUP_LOGICAL + if backup.IsPhysicalBackup { + backupType = BACKUP_PHYSICAL + } + table += fmt.Sprintf( + "|`%s`|`%s`|`%s`|`%s`|\n", + utils.FormatRegion(resp.Region), + backupType, + backup.Status, + utils.FormatTimestamp(backup.InsertedAt), + ) + } + return list.RenderTable(table) +} diff --git a/internal/backups/restore/restore.go b/internal/backups/restore/restore.go new file mode 100644 index 000000000..8118f1bcd --- /dev/null +++ b/internal/backups/restore/restore.go @@ -0,0 +1,24 @@ +package restore + +import ( + "context" + "fmt" + "net/http" + + "github.com/go-errors/errors" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" +) + +func Run(ctx context.Context, timestamp int64) error { + body := api.V1RestorePitrBody{RecoveryTimeTargetUnix: timestamp} + resp, err := utils.GetSupabase().V1RestorePitrBackupWithResponse(ctx, flags.ProjectRef, body) + if err != nil { + return errors.Errorf("failed to restore backup: %w", err) + } else if resp.StatusCode() != http.StatusCreated { + return errors.Errorf("unexpected restore backup status %d: %s", resp.StatusCode(), string(resp.Body)) + } + fmt.Println("Started PITR restore:", flags.ProjectRef) + return nil +} diff --git a/internal/projects/list/list.go b/internal/projects/list/list.go index babded41d..da788de68 100644 --- a/internal/projects/list/list.go +++ b/internal/projects/list/list.go @@ -53,7 +53,7 @@ func Run(ctx context.Context, fsys afero.Fs) error { project.OrganizationId, project.Id, strings.ReplaceAll(project.Name, "|", "\\|"), - formatRegion(project.Region), + utils.FormatRegion(project.Region), utils.FormatTimestamp(project.CreatedAt), ) } @@ -77,10 +77,3 @@ func formatBullet(value bool) string { } return " " } - -func formatRegion(region string) string { - if readable, ok := utils.RegionMap[region]; ok { - return readable - } - return region -} diff --git a/internal/utils/render.go b/internal/utils/render.go index 2d99f368a..247b9c7f6 100644 --- a/internal/utils/render.go +++ b/internal/utils/render.go @@ -26,3 +26,10 @@ func parse(layout, value string) string { } return t.UTC().Format(layoutHuman) } + +func FormatRegion(region string) string { + if readable, ok := RegionMap[region]; ok { + return readable + } + return region +} diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index 50cd731ea..d21c89a14 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -101,6 +101,9 @@ type ClientInterface interface { V1UpdateABranchConfig(ctx context.Context, branchId openapi_types.UUID, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1DiffABranch request + V1DiffABranch(ctx context.Context, branchId openapi_types.UUID, params *V1DiffABranchParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1MergeABranchWithBody request with any body V1MergeABranchWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -564,6 +567,18 @@ func (c *Client) V1UpdateABranchConfig(ctx context.Context, branchId openapi_typ return c.Client.Do(req) } +func (c *Client) V1DiffABranch(ctx context.Context, branchId openapi_types.UUID, params *V1DiffABranchParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1DiffABranchRequest(c.Server, branchId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1MergeABranchWithBody(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1MergeABranchRequestWithBody(c.Server, branchId, contentType, body) if err != nil { @@ -2491,6 +2506,62 @@ func NewV1UpdateABranchConfigRequestWithBody(server string, branchId openapi_typ return req, nil } +// NewV1DiffABranchRequest generates requests for V1DiffABranch +func NewV1DiffABranchRequest(server string, branchId openapi_types.UUID, params *V1DiffABranchParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "branch_id", runtime.ParamLocationPath, branchId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/branches/%s/diff", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.IncludedSchemas != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "included_schemas", runtime.ParamLocationQuery, *params.IncludedSchemas); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1MergeABranchRequest calls the generic V1MergeABranch builder with application/json body func NewV1MergeABranchRequest(server string, branchId openapi_types.UUID, body V1MergeABranchJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -7661,6 +7732,9 @@ type ClientWithResponsesInterface interface { V1UpdateABranchConfigWithResponse(ctx context.Context, branchId openapi_types.UUID, body V1UpdateABranchConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateABranchConfigResponse, error) + // V1DiffABranchWithResponse request + V1DiffABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, params *V1DiffABranchParams, reqEditors ...RequestEditorFn) (*V1DiffABranchResponse, error) + // V1MergeABranchWithBodyWithResponse request with any body V1MergeABranchWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1MergeABranchResponse, error) @@ -8142,6 +8216,27 @@ func (r V1UpdateABranchConfigResponse) StatusCode() int { return 0 } +type V1DiffABranchResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1DiffABranchResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1DiffABranchResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1MergeABranchResponse struct { Body []byte HTTPResponse *http.Response @@ -10617,6 +10712,15 @@ func (c *ClientWithResponses) V1UpdateABranchConfigWithResponse(ctx context.Cont return ParseV1UpdateABranchConfigResponse(rsp) } +// V1DiffABranchWithResponse request returning *V1DiffABranchResponse +func (c *ClientWithResponses) V1DiffABranchWithResponse(ctx context.Context, branchId openapi_types.UUID, params *V1DiffABranchParams, reqEditors ...RequestEditorFn) (*V1DiffABranchResponse, error) { + rsp, err := c.V1DiffABranch(ctx, branchId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1DiffABranchResponse(rsp) +} + // V1MergeABranchWithBodyWithResponse request with arbitrary body returning *V1MergeABranchResponse func (c *ClientWithResponses) V1MergeABranchWithBodyWithResponse(ctx context.Context, branchId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1MergeABranchResponse, error) { rsp, err := c.V1MergeABranchWithBody(ctx, branchId, contentType, body, reqEditors...) @@ -12015,6 +12119,22 @@ func ParseV1UpdateABranchConfigResponse(rsp *http.Response) (*V1UpdateABranchCon return response, nil } +// ParseV1DiffABranchResponse parses an HTTP response from a V1DiffABranchWithResponse call +func ParseV1DiffABranchResponse(rsp *http.Response) (*V1DiffABranchResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1DiffABranchResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseV1MergeABranchResponse parses an HTTP response from a V1MergeABranchWithResponse call func ParseV1MergeABranchResponse(rsp *http.Response) (*V1MergeABranchResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 5d6a77197..c89e7af85 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -2838,6 +2838,11 @@ type VanitySubdomainConfigResponse struct { // VanitySubdomainConfigResponseStatus defines model for VanitySubdomainConfigResponse.Status. type VanitySubdomainConfigResponseStatus string +// V1DiffABranchParams defines parameters for V1DiffABranch. +type V1DiffABranchParams struct { + IncludedSchemas *string `form:"included_schemas,omitempty" json:"included_schemas,omitempty"` +} + // V1AuthorizeUserParams defines parameters for V1AuthorizeUser. type V1AuthorizeUserParams struct { ClientId openapi_types.UUID `form:"client_id" json:"client_id"` From 070e55885be349e7e74174aee40d1f3aff9aec41 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 4 Jun 2025 18:27:49 +0800 Subject: [PATCH 170/359] feat: alias migration down command as reset (#3635) * feat: alias migration down command as reset * chore: support last n versions for db reset --- cmd/db.go | 4 +- cmd/migration.go | 19 +++++++ internal/db/reset/reset.go | 14 ++++- internal/db/reset/reset_test.go | 10 ++-- internal/migration/down/down.go | 33 ++++++++++++ internal/migration/down/down_test.go | 76 ++++++++++++++++++++++++++++ 6 files changed, 149 insertions(+), 7 deletions(-) create mode 100644 internal/migration/down/down.go create mode 100644 internal/migration/down/down_test.go diff --git a/cmd/db.go b/cmd/db.go index 948f77beb..8beec27ee 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -195,7 +195,7 @@ var ( if noSeed { utils.Config.Db.Seed.Enabled = false } - return reset.Run(cmd.Context(), migrationVersion, flags.DbConfig, afero.NewOsFs()) + return reset.Run(cmd.Context(), migrationVersion, nLastVersion, flags.DbConfig, afero.NewOsFs()) }, } @@ -319,6 +319,8 @@ func init() { resetFlags.BoolVar(&noSeed, "no-seed", false, "Skip running the seed script after reset.") dbResetCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local") resetFlags.StringVar(&migrationVersion, "version", "", "Reset up to the specified version.") + resetFlags.UintVar(&nLastVersion, "last", 0, "Reset up to the last n migration versions.") + dbResetCmd.MarkFlagsMutuallyExclusive("version", "last") dbCmd.AddCommand(dbResetCmd) // Build lint command lintFlags := dbLintCmd.Flags() diff --git a/cmd/migration.go b/cmd/migration.go index 30b7716ac..fc92e40d2 100644 --- a/cmd/migration.go +++ b/cmd/migration.go @@ -8,6 +8,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/supabase/cli/internal/migration/down" "github.com/supabase/cli/internal/migration/fetch" "github.com/supabase/cli/internal/migration/list" "github.com/supabase/cli/internal/migration/new" @@ -90,6 +91,17 @@ var ( }, } + nLastVersion uint + + migrationDownCmd = &cobra.Command{ + Use: "down", + Short: "Resets applied migrations up to the last n versions", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + return down.Run(cmd.Context(), nLastVersion, flags.DbConfig, afero.NewOsFs()) + }, + } + migrationFetchCmd = &cobra.Command{ Use: "fetch", Short: "Fetch migration files from history table", @@ -141,6 +153,13 @@ func init() { upFlags.Bool("local", true, "Applies pending migrations to the local database.") migrationUpCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local") migrationCmd.AddCommand(migrationUpCmd) + downFlags := migrationDownCmd.Flags() + downFlags.UintVar(&nLastVersion, "last", 1, "Reset up to the last n migration versions.") + downFlags.String("db-url", "", "Resets applied migrations on the database specified by the connection string (must be percent-encoded).") + downFlags.Bool("linked", false, "Resets applied migrations on the linked project.") + downFlags.Bool("local", true, "Resets applied migrations on the local database.") + migrationDownCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local") + migrationCmd.AddCommand(migrationDownCmd) // Build up command fetchFlags := migrationFetchCmd.Flags() fetchFlags.String("db-url", "", "Fetches migrations from the database specified by the connection string (must be percent-encoded).") diff --git a/internal/db/reset/reset.go b/internal/db/reset/reset.go index 3455ffbc0..5613b64bc 100644 --- a/internal/db/reset/reset.go +++ b/internal/db/reset/reset.go @@ -23,6 +23,7 @@ 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" @@ -30,7 +31,7 @@ import ( "github.com/supabase/cli/pkg/vault" ) -func Run(ctx context.Context, version string, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { +func Run(ctx context.Context, version string, last uint, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { if len(version) > 0 { if _, err := strconv.Atoi(version); err != nil { return errors.New(repair.ErrInvalidVersion) @@ -38,6 +39,17 @@ func Run(ctx context.Context, version string, config pgconn.Config, fsys afero.F if _, err := repair.GetMigrationFile(version, fsys); err != nil { return err } + } else if last > 0 { + localMigrations, err := list.LoadLocalVersions(fsys) + if err != nil { + return err + } + if total := uint(len(localMigrations)); last < total { + version = localMigrations[total-last-1] + } else { + // Negative skips all migrations + version = "-" + } } if !utils.IsLocalDatabase(config) { msg := "Do you want to reset the remote database?" diff --git a/internal/db/reset/reset_test.go b/internal/db/reset/reset_test.go index bb87bd912..b331ff341 100644 --- a/internal/db/reset/reset_test.go +++ b/internal/db/reset/reset_test.go @@ -96,7 +96,7 @@ func TestResetCommand(t *testing.T) { Reply(http.StatusOK). JSON([]storage.BucketResponse{}) // Run test - err := Run(context.Background(), "", dbConfig, fsys, conn.Intercept) + err := Run(context.Background(), "", 0, dbConfig, fsys, conn.Intercept) // Check error assert.NoError(t, err) assert.Empty(t, apitest.ListUnmatchedRequests()) @@ -106,7 +106,7 @@ func TestResetCommand(t *testing.T) { // Setup in-memory fs fsys := afero.NewMemMapFs() // Run test - err := Run(context.Background(), "", pgconn.Config{Host: "db.supabase.co"}, fsys) + err := Run(context.Background(), "", 0, pgconn.Config{Host: "db.supabase.co"}, fsys) // Check error assert.ErrorIs(t, err, context.Canceled) }) @@ -116,7 +116,7 @@ func TestResetCommand(t *testing.T) { // Setup in-memory fs fsys := afero.NewMemMapFs() // Run test - err := Run(context.Background(), "", pgconn.Config{Host: "db.supabase.co"}, fsys) + err := Run(context.Background(), "", 0, pgconn.Config{Host: "db.supabase.co"}, fsys) // Check error assert.ErrorContains(t, err, "invalid port (outside range)") }) @@ -131,7 +131,7 @@ func TestResetCommand(t *testing.T) { Get("/v" + utils.Docker.ClientVersion() + "/containers"). Reply(http.StatusNotFound) // Run test - err := Run(context.Background(), "", dbConfig, fsys) + err := Run(context.Background(), "", 0, dbConfig, fsys) // Check error assert.ErrorIs(t, err, utils.ErrNotRunning) assert.Empty(t, apitest.ListUnmatchedRequests()) @@ -153,7 +153,7 @@ func TestResetCommand(t *testing.T) { Delete("/v" + utils.Docker.ClientVersion() + "/containers/" + utils.DbId). ReplyError(errors.New("network error")) // Run test - err := Run(context.Background(), "", dbConfig, fsys) + err := Run(context.Background(), "", 0, dbConfig, fsys) // Check error assert.ErrorContains(t, err, "network error") assert.Empty(t, apitest.ListUnmatchedRequests()) diff --git a/internal/migration/down/down.go b/internal/migration/down/down.go new file mode 100644 index 000000000..300bb1b65 --- /dev/null +++ b/internal/migration/down/down.go @@ -0,0 +1,33 @@ +package down + +import ( + "context" + "fmt" + + "github.com/go-errors/errors" + "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/pkg/migration" +) + +func Run(ctx context.Context, last uint, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { + conn, err := utils.ConnectByConfig(ctx, config, options...) + if err != nil { + return err + } + defer conn.Close(context.Background()) + remoteMigrations, err := migration.ListRemoteMigrations(ctx, conn) + if err != nil { + return err + } + total := uint(len(remoteMigrations)) + if total <= last { + utils.CmdSuggestion = fmt.Sprintf("Try %s if you want to revert all migrations.", utils.Aqua("supabase db reset")) + return errors.Errorf("--last must be smaller than total applied migrations: %d", total) + } + version := remoteMigrations[total-last-1] + return reset.Run(ctx, version, 0, config, fsys) +} diff --git a/internal/migration/down/down_test.go b/internal/migration/down/down_test.go new file mode 100644 index 000000000..b5dfe9bf0 --- /dev/null +++ b/internal/migration/down/down_test.go @@ -0,0 +1,76 @@ +package down + +import ( + "context" + "os" + "path/filepath" + "testing" + + "github.com/jackc/pgconn" + "github.com/spf13/afero" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/pgtest" +) + +var dbConfig = pgconn.Config{ + Host: "127.0.0.1", + Port: 5432, + User: "admin", + Password: "password", + Database: "postgres", +} + +func TestMigrationsDown(t *testing.T) { + t.Run("resets last n migrations", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.NewMemMapFs() + files := []string{ + filepath.Join(utils.MigrationsDir, "20221201000000_test.sql"), + filepath.Join(utils.MigrationsDir, "20221201000001_test.sql"), + filepath.Join(utils.MigrationsDir, "20221201000002_test.sql"), + } + for _, path := range files { + require.NoError(t, afero.WriteFile(fsys, path, []byte(""), 0644)) + } + // Setup mock postgres + conn := pgtest.NewConn() + defer conn.Close(t) + conn.Query(migration.LIST_MIGRATION_VERSION). + Reply("SELECT 2", []interface{}{"20221201000000"}, []interface{}{"20221201000001"}) + // Run test + err := Run(context.Background(), 1, dbConfig, fsys, conn.Intercept) + // Check error + assert.ErrorIs(t, err, context.Canceled) + }) + + t.Run("throws error on out of range", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.NewMemMapFs() + // Setup mock postgres + conn := pgtest.NewConn() + defer conn.Close(t) + conn.Query(migration.LIST_MIGRATION_VERSION). + Reply("SELECT 2", []interface{}{"20221201000000"}, []interface{}{"20221201000001"}) + // Run test + err := Run(context.Background(), 2, dbConfig, fsys, conn.Intercept) + // Check error + assert.ErrorContains(t, err, "--last must be smaller than total applied migrations: 2") + }) + + t.Run("throws error on missing version", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.NewMemMapFs() + // Setup mock postgres + conn := pgtest.NewConn() + defer conn.Close(t) + conn.Query(migration.LIST_MIGRATION_VERSION). + Reply("SELECT 2", []interface{}{"20221201000000"}, []interface{}{"20221201000001"}) + // Run test + err := Run(context.Background(), 1, dbConfig, fsys, conn.Intercept) + // Check error + assert.ErrorIs(t, err, os.ErrNotExist) + }) +} From 18241d8aba24255fd83caf2a04767bda6c4b3baa Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 4 Jun 2025 22:53:03 +0800 Subject: [PATCH 171/359] fix: update default postgres major version to 17 (#3652) --- pkg/config/templates/config.toml | 2 +- pkg/config/testdata/config.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index c8aa68ad1..b1dfdfe69 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -28,7 +28,7 @@ port = 54322 shadow_port = 54320 # The database major version to use. This has to be the same as your remote database's. Run `SHOW # server_version;` on the remote database to check. -major_version = 15 +major_version = 17 [db.pooler] enabled = false diff --git a/pkg/config/testdata/config.toml b/pkg/config/testdata/config.toml index 98ad26ecf..6f1d814c7 100644 --- a/pkg/config/testdata/config.toml +++ b/pkg/config/testdata/config.toml @@ -28,7 +28,7 @@ port = 54322 shadow_port = 54320 # The database major version to use. This has to be the same as your remote database's. Run `SHOW # server_version;` on the remote database to check. -major_version = 15 +major_version = 17 [db.migrations] # Specifies an ordered list of schema files that describe your database. From 4c57b1184269fa0e8b89947d6db267f273e77154 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 4 Jun 2025 23:28:22 +0800 Subject: [PATCH 172/359] fix: migrate down using sql reset (#3655) * fix: migrate down using sql reset * chore: update unit tests --- internal/db/reset/reset.go | 22 +++---- internal/db/reset/reset_test.go | 90 ---------------------------- internal/migration/down/down.go | 35 ++++++++++- internal/migration/down/down_test.go | 79 ++++++++++++++++++++++-- 4 files changed, 116 insertions(+), 110 deletions(-) diff --git a/internal/db/reset/reset.go b/internal/db/reset/reset.go index 5613b64bc..fd5b7e711 100644 --- a/internal/db/reset/reset.go +++ b/internal/db/reset/reset.go @@ -23,12 +23,12 @@ 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/down" "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/pkg/migration" - "github.com/supabase/cli/pkg/vault" ) func Run(ctx context.Context, version string, last uint, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { @@ -52,12 +52,6 @@ func Run(ctx context.Context, version string, last uint, config pgconn.Config, f } } if !utils.IsLocalDatabase(config) { - msg := "Do you want to reset the remote database?" - if shouldReset, err := utils.NewConsole().PromptYesNo(ctx, msg, false); err != nil { - return err - } else if !shouldReset { - return errors.New(context.Canceled) - } return resetRemote(ctx, version, config, fsys, options...) } // Config file is loaded before parsing --linked or --local flags @@ -245,19 +239,19 @@ func listServicesToRestart() []string { } func resetRemote(ctx context.Context, version string, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { + msg := "Do you want to reset the remote database?" + if shouldReset, err := utils.NewConsole().PromptYesNo(ctx, msg, false); err != nil { + return err + } else if !shouldReset { + return errors.New(context.Canceled) + } fmt.Fprintln(os.Stderr, "Resetting remote database"+toLogMessage(version)) conn, err := utils.ConnectByConfigStream(ctx, config, io.Discard, options...) if err != nil { return err } defer conn.Close(context.Background()) - if err := migration.DropUserSchemas(ctx, conn); err != nil { - return err - } - if err := vault.UpsertVaultSecrets(ctx, utils.Config.Db.Vault, conn); err != nil { - return err - } - return apply.MigrateAndSeed(ctx, version, conn, fsys) + return down.ResetAll(ctx, version, conn, fsys) } func LikeEscapeSchema(schemas []string) (result []string) { diff --git a/internal/db/reset/reset_test.go b/internal/db/reset/reset_test.go index b331ff341..23454d070 100644 --- a/internal/db/reset/reset_test.go +++ b/internal/db/reset/reset_test.go @@ -5,7 +5,6 @@ import ( "errors" "io" "net/http" - "path/filepath" "testing" "time" @@ -20,9 +19,7 @@ import ( "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" ) @@ -406,90 +403,3 @@ func TestRestartDatabase(t *testing.T) { assert.Empty(t, apitest.ListUnmatchedRequests()) }) } - -var escapedSchemas = append(migration.ManagedSchemas, "extensions", "public") - -func TestResetRemote(t *testing.T) { - dbConfig := pgconn.Config{ - Host: "db.supabase.co", - Port: 5432, - User: "admin", - Password: "password", - Database: "postgres", - } - - t.Run("resets remote database", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - path := filepath.Join(utils.MigrationsDir, "0_schema.sql") - require.NoError(t, afero.WriteFile(fsys, path, nil, 0644)) - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(migration.ListSchemas, escapedSchemas). - Reply("SELECT 1", []interface{}{"private"}). - Query("DROP SCHEMA IF EXISTS private CASCADE"). - Reply("DROP SCHEMA"). - Query(migration.DropObjects). - Reply("INSERT 0") - helper.MockMigrationHistory(conn). - Query(migration.INSERT_MIGRATION_VERSION, "0", "schema", nil). - Reply("INSERT 0 1") - // Run test - err := resetRemote(context.Background(), "", dbConfig, fsys, conn.Intercept) - // Check error - assert.NoError(t, err) - }) - - t.Run("resets remote database with seed config disabled", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - path := filepath.Join(utils.MigrationsDir, "0_schema.sql") - require.NoError(t, afero.WriteFile(fsys, path, nil, 0644)) - seedPath := filepath.Join(utils.SupabaseDirPath, "seed.sql") - // Will raise an error when seeding - require.NoError(t, afero.WriteFile(fsys, seedPath, []byte("INSERT INTO test_table;"), 0644)) - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(migration.ListSchemas, escapedSchemas). - Reply("SELECT 1", []interface{}{"private"}). - Query("DROP SCHEMA IF EXISTS private CASCADE"). - Reply("DROP SCHEMA"). - Query(migration.DropObjects). - Reply("INSERT 0") - helper.MockMigrationHistory(conn). - Query(migration.INSERT_MIGRATION_VERSION, "0", "schema", nil). - Reply("INSERT 0 1") - utils.Config.Db.Seed.Enabled = false - // Run test - err := resetRemote(context.Background(), "", dbConfig, fsys, conn.Intercept) - // No error should be raised since we're skipping the seed - assert.NoError(t, err) - }) - - t.Run("throws error on connect failure", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Run test - err := resetRemote(context.Background(), "", pgconn.Config{}, fsys) - // Check error - assert.ErrorContains(t, err, "invalid port (outside range)") - }) - - t.Run("throws error on drop schema failure", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(migration.ListSchemas, escapedSchemas). - Reply("SELECT 0"). - Query(migration.DropObjects). - ReplyError(pgerrcode.InsufficientPrivilege, "permission denied for relation supabase_migrations") - // Run test - err := resetRemote(context.Background(), "", dbConfig, fsys, conn.Intercept) - // Check error - assert.ErrorContains(t, err, "ERROR: permission denied for relation supabase_migrations (SQLSTATE 42501)") - }) -} diff --git a/internal/migration/down/down.go b/internal/migration/down/down.go index 300bb1b65..35a9fa7e8 100644 --- a/internal/migration/down/down.go +++ b/internal/migration/down/down.go @@ -3,17 +3,22 @@ package down import ( "context" "fmt" + "os" "github.com/go-errors/errors" "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/apply" "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/pkg/migration" + "github.com/supabase/cli/pkg/vault" ) func Run(ctx context.Context, last uint, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { + if last == 0 { + return errors.Errorf("--last must be greater than 0") + } conn, err := utils.ConnectByConfig(ctx, config, options...) if err != nil { return err @@ -28,6 +33,32 @@ func Run(ctx context.Context, last uint, config pgconn.Config, fsys afero.Fs, op utils.CmdSuggestion = fmt.Sprintf("Try %s if you want to revert all migrations.", utils.Aqua("supabase db reset")) return errors.Errorf("--last must be smaller than total applied migrations: %d", total) } + msg := confirmResetAll(remoteMigrations[total-last:]) + if shouldReset, err := utils.NewConsole().PromptYesNo(ctx, msg, false); err != nil { + return err + } else if !shouldReset { + return errors.New(context.Canceled) + } version := remoteMigrations[total-last-1] - return reset.Run(ctx, version, 0, config, fsys) + fmt.Fprintln(os.Stderr, "Resetting database to version:", version) + return ResetAll(ctx, version, conn, fsys) +} + +func ResetAll(ctx context.Context, version string, conn *pgx.Conn, fsys afero.Fs) error { + if err := migration.DropUserSchemas(ctx, conn); err != nil { + return err + } + if err := vault.UpsertVaultSecrets(ctx, utils.Config.Db.Vault, conn); err != nil { + return err + } + return apply.MigrateAndSeed(ctx, version, conn, fsys) +} + +func confirmResetAll(pending []string) string { + msg := fmt.Sprintln("Do you want to revert the following migrations?") + for _, v := range pending { + msg += fmt.Sprintf(" • %s\n", utils.Bold(v)) + } + msg += fmt.Sprintf("%s you will lose all data in this database.", utils.Yellow("WARNING:")) + return msg } diff --git a/internal/migration/down/down_test.go b/internal/migration/down/down_test.go index b5dfe9bf0..e8d08b806 100644 --- a/internal/migration/down/down_test.go +++ b/internal/migration/down/down_test.go @@ -2,14 +2,15 @@ package down import ( "context" - "os" "path/filepath" "testing" "github.com/jackc/pgconn" + "github.com/jackc/pgerrcode" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "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" @@ -60,17 +61,87 @@ func TestMigrationsDown(t *testing.T) { assert.ErrorContains(t, err, "--last must be smaller than total applied migrations: 2") }) - t.Run("throws error on missing version", func(t *testing.T) { + t.Run("throws error on insufficient privilege", func(t *testing.T) { // Setup in-memory fs fsys := afero.NewMemMapFs() // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) conn.Query(migration.LIST_MIGRATION_VERSION). - Reply("SELECT 2", []interface{}{"20221201000000"}, []interface{}{"20221201000001"}) + ReplyError(pgerrcode.InsufficientPrivilege, "permission denied for relation supabase_migrations") // Run test err := Run(context.Background(), 1, dbConfig, fsys, conn.Intercept) // Check error - assert.ErrorIs(t, err, os.ErrNotExist) + assert.ErrorContains(t, err, "ERROR: permission denied for relation supabase_migrations (SQLSTATE 42501)") + }) +} + +var escapedSchemas = append(migration.ManagedSchemas, "extensions", "public") + +func TestResetRemote(t *testing.T) { + t.Run("resets remote database", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.NewMemMapFs() + path := filepath.Join(utils.MigrationsDir, "0_schema.sql") + require.NoError(t, afero.WriteFile(fsys, path, nil, 0644)) + // Setup mock postgres + conn := pgtest.NewConn() + defer conn.Close(t) + conn.Query(migration.ListSchemas, escapedSchemas). + Reply("SELECT 1", []interface{}{"private"}). + Query("DROP SCHEMA IF EXISTS private CASCADE"). + Reply("DROP SCHEMA"). + Query(migration.DropObjects). + Reply("INSERT 0") + helper.MockMigrationHistory(conn). + Query(migration.INSERT_MIGRATION_VERSION, "0", "schema", nil). + Reply("INSERT 0 1") + // Run test + err := ResetAll(context.Background(), "", conn.MockClient(t), fsys) + // Check error + assert.NoError(t, err) + }) + + t.Run("resets remote database with seed config disabled", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.NewMemMapFs() + path := filepath.Join(utils.MigrationsDir, "0_schema.sql") + require.NoError(t, afero.WriteFile(fsys, path, nil, 0644)) + seedPath := filepath.Join(utils.SupabaseDirPath, "seed.sql") + // Will raise an error when seeding + require.NoError(t, afero.WriteFile(fsys, seedPath, []byte("INSERT INTO test_table;"), 0644)) + // Setup mock postgres + conn := pgtest.NewConn() + defer conn.Close(t) + conn.Query(migration.ListSchemas, escapedSchemas). + Reply("SELECT 1", []interface{}{"private"}). + Query("DROP SCHEMA IF EXISTS private CASCADE"). + Reply("DROP SCHEMA"). + Query(migration.DropObjects). + Reply("INSERT 0") + helper.MockMigrationHistory(conn). + Query(migration.INSERT_MIGRATION_VERSION, "0", "schema", nil). + Reply("INSERT 0 1") + utils.Config.Db.Seed.Enabled = false + // Run test + err := ResetAll(context.Background(), "", conn.MockClient(t), fsys) + // No error should be raised since we're skipping the seed + assert.NoError(t, err) + }) + + t.Run("throws error on drop schema failure", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.NewMemMapFs() + // Setup mock postgres + conn := pgtest.NewConn() + defer conn.Close(t) + conn.Query(migration.ListSchemas, escapedSchemas). + Reply("SELECT 0"). + Query(migration.DropObjects). + ReplyError(pgerrcode.InsufficientPrivilege, "permission denied for relation supabase_migrations") + // Run test + err := ResetAll(context.Background(), "", conn.MockClient(t), fsys) + // Check error + assert.ErrorContains(t, err, "ERROR: permission denied for relation supabase_migrations (SQLSTATE 42501)") }) } From d98ce7de0202f18195a4818fed57217cc87f5a2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 04:50:48 +0000 Subject: [PATCH 173/359] chore(deps): bump github.com/containers/common from 0.63.0 to 0.63.1 (#3658) Bumps [github.com/containers/common](https://github.com/containers/common) from 0.63.0 to 0.63.1. - [Release notes](https://github.com/containers/common/releases) - [Commits](https://github.com/containers/common/compare/v0.63.0...v0.63.1) --- updated-dependencies: - dependency-name: github.com/containers/common dependency-version: 0.63.1 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 7edb9539d..950de552a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 github.com/containerd/errdefs v1.0.0 - github.com/containers/common v0.63.0 + github.com/containers/common v0.63.1 github.com/docker/cli v28.2.2+incompatible github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 diff --git a/go.sum b/go.sum index 1388a0c3e..13279fbf8 100644 --- a/go.sum +++ b/go.sum @@ -199,8 +199,8 @@ github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151X github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/containers/common v0.63.0 h1:ox6vgUYX5TSvt4W+bE36sYBVz/aXMAfRGVAgvknSjBg= -github.com/containers/common v0.63.0/go.mod h1:+3GCotSqNdIqM3sPs152VvW7m5+Mg8Kk+PExT3G9hZw= +github.com/containers/common v0.63.1 h1:6g02gbW34PaRVH4Heb2Pk11x0SdbQ+8AfeKKeQGqYBE= +github.com/containers/common v0.63.1/go.mod h1:+3GCotSqNdIqM3sPs152VvW7m5+Mg8Kk+PExT3G9hZw= github.com/containers/storage v1.58.0 h1:Q7SyyCCjqgT3wYNgRNIL8o/wUS92heIj2/cc8Sewvcc= github.com/containers/storage v1.58.0/go.mod h1:w7Jl6oG+OpeLGLzlLyOZPkmUso40kjpzgrHUk5tyBlo= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= From af3ccab95651f8514c7ec8bf504cd262145159d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 04:57:05 +0000 Subject: [PATCH 174/359] chore(deps): bump github.com/go-git/go-git/v5 from 5.16.0 to 5.16.1 (#3657) Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.16.0 to 5.16.1. - [Release notes](https://github.com/go-git/go-git/releases) - [Commits](https://github.com/go-git/go-git/compare/v5.16.0...v5.16.1) --- updated-dependencies: - dependency-name: github.com/go-git/go-git/v5 dependency-version: 5.16.1 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 950de552a..16b2787c3 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/getsentry/sentry-go v0.33.0 github.com/go-errors/errors v1.5.1 - github.com/go-git/go-git/v5 v5.16.0 + github.com/go-git/go-git/v5 v5.16.1 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golangci/golangci-lint/v2 v2.1.6 github.com/google/go-github/v62 v62.0.0 diff --git a/go.sum b/go.sum index 13279fbf8..79dab0417 100644 --- a/go.sum +++ b/go.sum @@ -312,8 +312,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.16.0 h1:k3kuOEpkc0DeY7xlL6NaaNg39xdgQbtH5mwCafHO9AQ= -github.com/go-git/go-git/v5 v5.16.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= +github.com/go-git/go-git/v5 v5.16.1 h1:TuxMBWNL7R05tXsUGi0kh1vi4tq0WfXNLlIrAkXG1k8= +github.com/go-git/go-git/v5 v5.16.1/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 631d8b4b69a22ce7c16ea82389a2189d996ceff1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 05:13:55 +0000 Subject: [PATCH 175/359] chore(deps): bump supabase/postgres from 17.4.1.039 to 17.4.1.040 in /pkg/config/templates (#3659) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.039 to 17.4.1.040. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.040 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 161527924..ce286fad8 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.039 AS pg +FROM supabase/postgres:17.4.1.040 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From bcc849829a45ac3ce1dda3d10149a173836c6e45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 08:25:44 +0000 Subject: [PATCH 176/359] chore(deps): bump supabase/realtime from v2.36.8 to v2.36.9 in /pkg/config/templates (#3660) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.8 to v2.36.9. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index ce286fad8..a436c2c0f 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue -FROM supabase/realtime:v2.36.8 AS realtime +FROM supabase/realtime:v2.36.9 AS realtime FROM supabase/storage-api:v1.23.0 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From b8f86390a8a1665d93c96117cf253781f0fc542a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 08:31:04 +0000 Subject: [PATCH 177/359] chore(deps): bump supabase/storage-api from v1.23.0 to v1.24.1 in /pkg/config/templates (#3661) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.23.0 to v1.24.1. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.24.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index a436c2c0f..1def04c92 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue FROM supabase/realtime:v2.36.9 AS realtime -FROM supabase/storage-api:v1.23.0 AS storage +FROM supabase/storage-api:v1.24.1 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From a47f9fab07f7724ee1e1bea5baaa7faba2b83ae1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 16:32:48 +0800 Subject: [PATCH 178/359] chore(deps): bump supabase/studio from 2025.06.02-sha-8f2993d to 2025.06.05-sha-671aea0 in /pkg/config/templates (#3662) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.06.02-sha-8f2993d to 2025.06.05-sha-671aea0. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.06.05-sha-671aea0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 1def04c92..696c6f412 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.3 AS pgmeta -FROM supabase/studio:2025.06.02-sha-8f2993d AS studio +FROM supabase/studio:2025.06.05-sha-671aea0 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 865f304d5cf2ffd703c305ab3b0ba68c2550597e Mon Sep 17 00:00:00 2001 From: Ziinc Date: Thu, 5 Jun 2025 16:33:10 +0800 Subject: [PATCH 179/359] fix: adjust api key handling for logflare, studio, and vecor (#3653) Co-authored-by: Han Qiao --- internal/start/start.go | 4 ++-- internal/start/templates/vector.yaml | 28 +++++++++++++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/internal/start/start.go b/internal/start/start.go index da619fe13..122080c58 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -176,7 +176,7 @@ func run(p utils.Program, ctx context.Context, fsys afero.Fs, excludedContainers "LOGFLARE_MIN_CLUSTER_SIZE=1", "LOGFLARE_SINGLE_TENANT=true", "LOGFLARE_SUPABASE_MODE=true", - "LOGFLARE_API_KEY=" + utils.Config.Analytics.ApiKey, + "LOGFLARE_PRIVATE_ACCESS_TOKEN=" + utils.Config.Analytics.ApiKey, "LOGFLARE_LOG_LEVEL=warn", "LOGFLARE_NODE_HOST=127.0.0.1", "LOGFLARE_FEATURE_FLAG_OVERRIDE='multibackend=true'", @@ -986,7 +986,7 @@ EOF "AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value, "SUPABASE_ANON_KEY=" + utils.Config.Auth.AnonKey.Value, "SUPABASE_SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value, - "LOGFLARE_API_KEY=" + utils.Config.Analytics.ApiKey, + "LOGFLARE_PRIVATE_ACCESS_TOKEN=" + utils.Config.Analytics.ApiKey, "OPENAI_API_KEY=" + utils.Config.Studio.OpenaiApiKey.Value, fmt.Sprintf("LOGFLARE_URL=http://%v:4000", utils.LogflareId), fmt.Sprintf("NEXT_PUBLIC_ENABLE_LOGS=%v", utils.Config.Analytics.Enabled), diff --git a/internal/start/templates/vector.yaml b/internal/start/templates/vector.yaml index 4c29864c0..1b9e5f57c 100644 --- a/internal/start/templates/vector.yaml +++ b/internal/start/templates/vector.yaml @@ -165,7 +165,9 @@ sinks: method: "post" request: retry_max_duration_secs: 10 - uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=gotrue.logs.prod&api_key={{ .ApiKey }}" + headers: + x-api-key: "{{ .ApiKey }}" + uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=gotrue.logs.prod" logflare_realtime: type: "http" inputs: @@ -175,7 +177,9 @@ sinks: method: "post" request: retry_max_duration_secs: 10 - uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=realtime.logs.prod&api_key={{ .ApiKey }}" + headers: + x-api-key: "{{ .ApiKey }}" + uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=realtime.logs.prod" logflare_rest: type: "http" inputs: @@ -185,7 +189,9 @@ sinks: method: "post" request: retry_max_duration_secs: 10 - uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=postgREST.logs.prod&api_key={{ .ApiKey }}" + headers: + x-api-key: "{{ .ApiKey }}" + uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=postgREST.logs.prod" logflare_db: type: "http" inputs: @@ -195,7 +201,9 @@ sinks: method: "post" request: retry_max_duration_secs: 10 - uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=postgres.logs&api_key={{ .ApiKey }}" + headers: + x-api-key: "{{ .ApiKey }}" + uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=postgres.logs" logflare_functions: type: "http" inputs: @@ -205,7 +213,9 @@ sinks: method: "post" request: retry_max_duration_secs: 10 - uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=deno-relay-logs&api_key={{ .ApiKey }}" + headers: + x-api-key: "{{ .ApiKey }}" + uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=deno-relay-logs" logflare_storage: type: "http" inputs: @@ -215,7 +225,9 @@ sinks: method: "post" request: retry_max_duration_secs: 10 - uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=storage.logs.prod.2&api_key={{ .ApiKey }}" + headers: + x-api-key: "{{ .ApiKey }}" + uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=storage.logs.prod.2" logflare_kong: type: "http" inputs: @@ -226,4 +238,6 @@ sinks: method: "post" request: retry_max_duration_secs: 10 - uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=cloudflare.logs.prod&api_key={{ .ApiKey }}" + headers: + x-api-key: "{{ .ApiKey }}" + uri: "http://{{ .LogflareId }}:4000/api/logs?source_name=cloudflare.logs.prod" From 4ccaea3579a2ee96039a86f3cc317fd16f8ecdaa Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 6 Jun 2025 22:16:34 +0800 Subject: [PATCH 180/359] fix: move db dump to public pkg (#3673) * fix: move db dump to public pkg * chore: rename column insert option * chore: bump api spec --- cmd/db.go | 9 +- internal/db/dump/dump.go | 164 +++----------- internal/db/dump/dump_test.go | 11 +- internal/db/pull/pull.go | 5 +- internal/migration/squash/squash.go | 8 +- internal/utils/misc.go | 66 +----- pkg/api/client.gen.go | 150 +++++++++++++ pkg/api/types.gen.go | 16 ++ pkg/go.sum | 307 +++++++++++++++++++++++++++ pkg/migration/dump.go | 224 +++++++++++++++++++ pkg/migration/scripts/dump_data.sh | 33 +++ pkg/migration/scripts/dump_role.sh | 34 +++ pkg/migration/scripts/dump_schema.sh | 53 +++++ 13 files changed, 873 insertions(+), 207 deletions(-) create mode 100644 pkg/go.sum create mode 100644 pkg/migration/dump.go create mode 100755 pkg/migration/scripts/dump_data.sh create mode 100755 pkg/migration/scripts/dump_role.sh create mode 100755 pkg/migration/scripts/dump_schema.sh diff --git a/cmd/db.go b/cmd/db.go index 8beec27ee..02e3e97b6 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -23,6 +23,7 @@ import ( "github.com/supabase/cli/internal/db/test" "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/migration" ) var ( @@ -120,7 +121,13 @@ var ( } }, RunE: func(cmd *cobra.Command, args []string) error { - return dump.Run(cmd.Context(), file, flags.DbConfig, schema, excludeTable, dataOnly, roleOnly, keepComments, useCopy, dryRun, afero.NewOsFs()) + opts := []migration.DumpOptionFunc{ + migration.WithSchema(schema...), + migration.WithoutTable(excludeTable...), + migration.WithComments(keepComments), + migration.WithColumnInsert(!useCopy), + } + return dump.Run(cmd.Context(), file, flags.DbConfig, dataOnly, roleOnly, dryRun, afero.NewOsFs(), opts...) }, PostRun: func(cmd *cobra.Command, args []string) { if len(file) > 0 { diff --git a/internal/db/dump/dump.go b/internal/db/dump/dump.go index d9cd2af7c..7b40ddccc 100644 --- a/internal/db/dump/dump.go +++ b/internal/db/dump/dump.go @@ -14,33 +14,23 @@ import ( "github.com/jackc/pgconn" "github.com/spf13/afero" "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) -var ( - //go:embed templates/dump_schema.sh - dumpSchemaScript string - //go:embed templates/dump_data.sh - dumpDataScript string - //go:embed templates/dump_role.sh - dumpRoleScript string -) - -func Run(ctx context.Context, path string, config pgconn.Config, schema, excludeTable []string, dataOnly, roleOnly, keepComments, useCopy, dryRun bool, fsys afero.Fs) error { +func Run(ctx context.Context, path string, config pgconn.Config, dataOnly, roleOnly, dryRun bool, fsys afero.Fs, opts ...migration.DumpOptionFunc) error { // Initialize output stream - var outStream afero.File - if len(path) > 0 { + outStream := (io.Writer)(os.Stdout) + exec := DockerExec + if dryRun { + fmt.Fprintln(os.Stderr, "DRY RUN: *only* printing the pg_dump script to console.") + exec = noExec + } else if len(path) > 0 { f, err := fsys.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { return errors.Errorf("failed to open dump file: %w", err) } defer f.Close() outStream = f - } else { - outStream = os.Stdout - } - // Load the requested script - if dryRun { - fmt.Fprintln(os.Stderr, "DRY RUN: *only* printing the pg_dump script to console.") } db := "remote" if utils.IsLocalDatabase(config) { @@ -48,132 +38,42 @@ func Run(ctx context.Context, path string, config pgconn.Config, schema, exclude } if dataOnly { fmt.Fprintf(os.Stderr, "Dumping data from %s database...\n", db) - return dumpData(ctx, config, schema, excludeTable, useCopy, dryRun, outStream) + return migration.DumpData(ctx, config, outStream, exec, opts...) } else if roleOnly { fmt.Fprintf(os.Stderr, "Dumping roles from %s database...\n", db) - return dumpRole(ctx, config, keepComments, dryRun, outStream) + return migration.DumpRole(ctx, config, outStream, exec, opts...) } fmt.Fprintf(os.Stderr, "Dumping schemas from %s database...\n", db) - return DumpSchema(ctx, config, schema, keepComments, dryRun, outStream) + return migration.DumpSchema(ctx, config, outStream, exec, opts...) } -func DumpSchema(ctx context.Context, config pgconn.Config, schema []string, keepComments, dryRun bool, stdout io.Writer) error { - var env []string - if len(schema) > 0 { - // Must append flag because empty string results in error - env = append(env, "EXTRA_FLAGS=--schema="+strings.Join(schema, "|")) - } else { - env = append(env, "EXCLUDED_SCHEMAS="+strings.Join(utils.InternalSchemas, "|")) - } - if !keepComments { - env = append(env, "EXTRA_SED=/^--/d") - } - return dump(ctx, config, dumpSchemaScript, env, dryRun, stdout) -} - -func dumpData(ctx context.Context, config pgconn.Config, schema, excludeTable []string, useCopy, dryRun bool, stdout io.Writer) error { - // We want to dump user data in auth, storage, etc. for migrating to new project - excludedSchemas := []string{ - "information_schema", - "pg_*", // Wildcard pattern follows pg_dump - // Owned by extensions - // "cron", - "graphql", - "graphql_public", - // "net", - // "pgmq", - "pgsodium", - "pgsodium_masks", - "pgtle", - "repack", - "tiger", - "tiger_data", - "timescaledb_*", - "_timescaledb_*", - "topology", - "vault", - // Managed by Supabase - // "auth", - "extensions", - "pgbouncer", - "realtime", - // "storage", - // "supabase_functions", - "supabase_migrations", - // TODO: Remove in a few version in favor of _supabase internal db - "_analytics", - "_realtime", - "_supavisor", - } - var env []string - if len(schema) > 0 { - env = append(env, "INCLUDED_SCHEMAS="+strings.Join(schema, "|")) - } else { - env = append(env, "INCLUDED_SCHEMAS=*", "EXCLUDED_SCHEMAS="+strings.Join(excludedSchemas, "|")) - } - var extraFlags []string - if !useCopy { - extraFlags = append(extraFlags, "--column-inserts", "--rows-per-insert 100000") - } - for _, table := range excludeTable { - escaped := quoteUpperCase(table) - // Use separate flags to avoid error: too many dotted names - extraFlags = append(extraFlags, "--exclude-table "+escaped) - } - if len(extraFlags) > 0 { - env = append(env, "EXTRA_FLAGS="+strings.Join(extraFlags, " ")) - } - return dump(ctx, config, dumpDataScript, env, dryRun, stdout) -} - -func quoteUpperCase(table string) string { - escaped := strings.ReplaceAll(table, ".", `"."`) - return fmt.Sprintf(`"%s"`, escaped) -} - -func dumpRole(ctx context.Context, config pgconn.Config, keepComments, dryRun bool, stdout io.Writer) error { - env := []string{} - if !keepComments { - env = append(env, "EXTRA_SED=/^--/d") +func noExec(ctx context.Context, script string, env []string, w io.Writer) error { + envMap := make(map[string]string, len(env)) + for _, e := range env { + index := strings.IndexByte(e, '=') + if index < 0 { + continue + } + envMap[e[:index]] = e[index+1:] } - return dump(ctx, config, dumpRoleScript, env, dryRun, stdout) + expanded := os.Expand(script, func(key string) string { + // Bash variable expansion is unsupported: + // https://github.com/golang/go/issues/47187 + parts := strings.Split(key, ":") + value := envMap[parts[0]] + // Escape double quotes in env vars + return strings.ReplaceAll(value, `"`, `\"`) + }) + fmt.Fprintln(w, expanded) + return nil } -func dump(ctx context.Context, config pgconn.Config, script string, env []string, dryRun bool, stdout io.Writer) error { - allEnvs := append(env, - "PGHOST="+config.Host, - fmt.Sprintf("PGPORT=%d", config.Port), - "PGUSER="+config.User, - "PGPASSWORD="+config.Password, - "PGDATABASE="+config.Database, - "RESERVED_ROLES="+strings.Join(utils.ReservedRoles, "|"), - "ALLOWED_CONFIGS="+strings.Join(utils.AllowedConfigs, "|"), - ) - if dryRun { - envMap := make(map[string]string, len(allEnvs)) - for _, e := range allEnvs { - index := strings.IndexByte(e, '=') - if index < 0 { - continue - } - envMap[e[:index]] = e[index+1:] - } - expanded := os.Expand(script, func(key string) string { - // Bash variable expansion is unsupported: - // https://github.com/golang/go/issues/47187 - parts := strings.Split(key, ":") - value := envMap[parts[0]] - // Escape double quotes in env vars - return strings.ReplaceAll(value, `"`, `\"`) - }) - fmt.Println(expanded) - return nil - } +func DockerExec(ctx context.Context, script string, env []string, w io.Writer) error { return utils.DockerRunOnceWithConfig( ctx, container.Config{ Image: utils.Config.Db.Image, - Env: allEnvs, + Env: env, Cmd: []string{"bash", "-c", script, "--"}, }, container.HostConfig{ @@ -181,7 +81,7 @@ func dump(ctx context.Context, config pgconn.Config, script string, env []string }, network.NetworkingConfig{}, "", - stdout, + w, os.Stderr, ) } diff --git a/internal/db/dump/dump_test.go b/internal/db/dump/dump_test.go index e8e4b2d1a..bfdccb128 100644 --- a/internal/db/dump/dump_test.go +++ b/internal/db/dump/dump_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/supabase/cli/internal/testing/apitest" "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/pkg/migration" ) var dbConfig = pgconn.Config{ @@ -22,7 +23,7 @@ var dbConfig = pgconn.Config{ Database: "postgres", } -func TestPullCommand(t *testing.T) { +func TestDumpCommand(t *testing.T) { imageUrl := utils.GetRegistryImageUrl(utils.Config.Db.Image) const containerId = "test-container" @@ -35,7 +36,7 @@ func TestPullCommand(t *testing.T) { apitest.MockDockerStart(utils.Docker, imageUrl, containerId) require.NoError(t, apitest.MockDockerLogs(utils.Docker, containerId, "hello world")) // Run test - err := Run(context.Background(), "schema.sql", dbConfig, nil, nil, false, false, false, false, false, fsys) + err := Run(context.Background(), "schema.sql", dbConfig, false, false, false, fsys) // Check error assert.NoError(t, err) assert.Empty(t, apitest.ListUnmatchedRequests()) @@ -54,7 +55,7 @@ func TestPullCommand(t *testing.T) { apitest.MockDockerStart(utils.Docker, imageUrl, containerId) require.NoError(t, apitest.MockDockerLogs(utils.Docker, containerId, "hello world\n")) // Run test - err := Run(context.Background(), "", dbConfig, []string{"public"}, nil, false, false, false, false, false, fsys) + err := Run(context.Background(), "", dbConfig, false, false, false, fsys, migration.WithSchema("public")) // Check error assert.NoError(t, err) assert.Empty(t, apitest.ListUnmatchedRequests()) @@ -70,7 +71,7 @@ func TestPullCommand(t *testing.T) { Get("/v" + utils.Docker.ClientVersion() + "/images"). Reply(http.StatusServiceUnavailable) // Run test - err := Run(context.Background(), "", dbConfig, nil, nil, false, false, false, false, false, fsys) + err := Run(context.Background(), "", dbConfig, false, false, false, fsys) // Check error assert.ErrorContains(t, err, "request returned 503 Service Unavailable for API route and version") assert.Empty(t, apitest.ListUnmatchedRequests()) @@ -85,7 +86,7 @@ func TestPullCommand(t *testing.T) { apitest.MockDockerStart(utils.Docker, imageUrl, containerId) require.NoError(t, apitest.MockDockerLogs(utils.Docker, containerId, "hello world\n")) // Run test - err := Run(context.Background(), "schema.sql", dbConfig, nil, nil, false, false, false, false, false, fsys) + err := Run(context.Background(), "schema.sql", dbConfig, false, false, false, fsys) // Check error assert.ErrorContains(t, err, "operation not permitted") assert.Empty(t, apitest.ListUnmatchedRequests()) diff --git a/internal/db/pull/pull.go b/internal/db/pull/pull.go index 3f99f972f..9c302e61b 100644 --- a/internal/db/pull/pull.go +++ b/internal/db/pull/pull.go @@ -6,6 +6,7 @@ import ( "fmt" "math" "os" + "path/filepath" "strconv" "github.com/go-errors/errors" @@ -89,7 +90,7 @@ func run(p utils.Program, ctx context.Context, schema []string, path string, con func dumpRemoteSchema(p utils.Program, ctx context.Context, path string, config pgconn.Config, fsys afero.Fs) error { // Special case if this is the first migration p.Send(utils.StatusMsg("Dumping schema from remote database...")) - if err := utils.MkdirIfNotExistFS(fsys, utils.MigrationsDir); err != nil { + if err := utils.MkdirIfNotExistFS(fsys, filepath.Dir(path)); err != nil { return err } f, err := fsys.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) @@ -97,7 +98,7 @@ func dumpRemoteSchema(p utils.Program, ctx context.Context, path string, config return errors.Errorf("failed to open dump file: %w", err) } defer f.Close() - return dump.DumpSchema(ctx, config, nil, false, false, f) + return migration.DumpSchema(ctx, config, f, dump.DockerExec) } func diffRemoteSchema(p utils.Program, ctx context.Context, schema []string, path string, config pgconn.Config, fsys afero.Fs) error { diff --git a/internal/migration/squash/squash.go b/internal/migration/squash/squash.go index 22f3278de..1ba5c55a9 100644 --- a/internal/migration/squash/squash.go +++ b/internal/migration/squash/squash.go @@ -96,7 +96,7 @@ func squashMigrations(ctx context.Context, migrations []string, fsys afero.Fs, o return err } // Assuming entities in managed schemas are not altered, we can simply diff the dumps before and after migrations. - schemas := []string{"auth", "storage"} + opt := migration.WithSchema("auth", "storage") config := pgconn.Config{ Host: utils.Config.Hostname, Port: utils.Config.Db.ShadowPort, @@ -105,14 +105,14 @@ func squashMigrations(ctx context.Context, migrations []string, fsys afero.Fs, o Database: "postgres", } var before, after bytes.Buffer - if err := dump.DumpSchema(ctx, config, schemas, false, false, &before); err != nil { + if err := migration.DumpSchema(ctx, config, &before, dump.DockerExec, opt); err != nil { return err } // 2. Migrate to target version if err := migration.ApplyMigrations(ctx, migrations, conn, afero.NewIOFS(fsys)); err != nil { return err } - if err := dump.DumpSchema(ctx, config, schemas, false, false, &after); err != nil { + if err := migration.DumpSchema(ctx, config, &after, dump.DockerExec, opt); err != nil { return err } // 3. Dump migrated schema @@ -122,7 +122,7 @@ func squashMigrations(ctx context.Context, migrations []string, fsys afero.Fs, o return errors.Errorf("failed to open migration file: %w", err) } defer f.Close() - if err := dump.DumpSchema(ctx, config, nil, false, false, f); err != nil { + if err := migration.DumpSchema(ctx, config, f, dump.DockerExec); err != nil { return err } // 4. Append managed schema diffs diff --git a/internal/utils/misc.go b/internal/utils/misc.go index 4d58b81c8..98705668c 100644 --- a/internal/utils/misc.go +++ b/internal/utils/misc.go @@ -16,6 +16,7 @@ import ( "github.com/go-git/go-git/v5" "github.com/spf13/afero" "github.com/spf13/viper" + "github.com/supabase/cli/pkg/migration" ) // Assigned using `-ldflags` https://stackoverflow.com/q/11354518 @@ -53,69 +54,8 @@ var ( ImageNamePattern = regexp.MustCompile(`\/(.*):`) // These schemas are ignored from db diff and db dump - PgSchemas = []string{ - "information_schema", - "pg_*", // Wildcard pattern follows pg_dump - } - // Initialised by postgres image and owned by postgres role - InternalSchemas = append([]string{ - "_analytics", - "_realtime", - "_supavisor", - "auth", - "extensions", - "pgbouncer", - "realtime", - "storage", - "supabase_functions", - "supabase_migrations", - // Owned by extensions - "cron", - "dbdev", - "graphql", - "graphql_public", - "net", - "pgmq", - "pgsodium", - "pgsodium_masks", - "pgtle", - "repack", - "tiger", - "tiger_data", - "timescaledb_*", - "_timescaledb_*", - "topology", - "vault", - }, PgSchemas...) - ReservedRoles = []string{ - "anon", - "authenticated", - "authenticator", - "dashboard_user", - "pgbouncer", - "postgres", - "service_role", - "supabase_admin", - "supabase_auth_admin", - "supabase_functions_admin", - "supabase_read_only_user", - "supabase_realtime_admin", - "supabase_replication_admin", - "supabase_storage_admin", - // Managed by extensions - "pgsodium_keyholder", - "pgsodium_keyiduser", - "pgsodium_keymaker", - "pgtle_admin", - } - AllowedConfigs = []string{ - // Ref: https://github.com/supabase/postgres/blob/develop/ansible/files/postgresql_config/supautils.conf.j2#L10 - "pgaudit.*", - "pgrst.*", - "session_replication_role", - "statement_timeout", - "track_io_timing", - } + PgSchemas = migration.InternalSchemas[:2] + InternalSchemas = migration.InternalSchemas SupabaseDirPath = "supabase" ConfigPath = filepath.Join(SupabaseDirPath, "config.toml") diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index d21c89a14..d8b6f6178 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -354,6 +354,11 @@ type ClientInterface interface { V1ApplyAMigration(ctx context.Context, ref string, params *V1ApplyAMigrationParams, body V1ApplyAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1UpsertAMigrationWithBody request with any body + V1UpsertAMigrationWithBody(ctx context.Context, ref string, params *V1UpsertAMigrationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1UpsertAMigration(ctx context.Context, ref string, params *V1UpsertAMigrationParams, body V1UpsertAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1RunAQueryWithBody request with any body V1RunAQueryWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1671,6 +1676,30 @@ func (c *Client) V1ApplyAMigration(ctx context.Context, ref string, params *V1Ap return c.Client.Do(req) } +func (c *Client) V1UpsertAMigrationWithBody(ctx context.Context, ref string, params *V1UpsertAMigrationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpsertAMigrationRequestWithBody(c.Server, ref, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1UpsertAMigration(ctx context.Context, ref string, params *V1UpsertAMigrationParams, body V1UpsertAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpsertAMigrationRequest(c.Server, ref, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1RunAQueryWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1RunAQueryRequestWithBody(c.Server, ref, contentType, body) if err != nil { @@ -5545,6 +5574,68 @@ func NewV1ApplyAMigrationRequestWithBody(server string, ref string, params *V1Ap return req, nil } +// NewV1UpsertAMigrationRequest calls the generic V1UpsertAMigration builder with application/json body +func NewV1UpsertAMigrationRequest(server string, ref string, params *V1UpsertAMigrationParams, body V1UpsertAMigrationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpsertAMigrationRequestWithBody(server, ref, params, "application/json", bodyReader) +} + +// NewV1UpsertAMigrationRequestWithBody generates requests for V1UpsertAMigration with any type of body +func NewV1UpsertAMigrationRequestWithBody(server string, ref string, params *V1UpsertAMigrationParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/database/migrations", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params != nil { + + if params.IdempotencyKey != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "Idempotency-Key", runtime.ParamLocationHeader, *params.IdempotencyKey) + if err != nil { + return nil, err + } + + req.Header.Set("Idempotency-Key", headerParam0) + } + + } + + return req, nil +} + // NewV1RunAQueryRequest calls the generic V1RunAQuery builder with application/json body func NewV1RunAQueryRequest(server string, ref string, body V1RunAQueryJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -7985,6 +8076,11 @@ type ClientWithResponsesInterface interface { V1ApplyAMigrationWithResponse(ctx context.Context, ref string, params *V1ApplyAMigrationParams, body V1ApplyAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*V1ApplyAMigrationResponse, error) + // V1UpsertAMigrationWithBodyWithResponse request with any body + V1UpsertAMigrationWithBodyWithResponse(ctx context.Context, ref string, params *V1UpsertAMigrationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpsertAMigrationResponse, error) + + V1UpsertAMigrationWithResponse(ctx context.Context, ref string, params *V1UpsertAMigrationParams, body V1UpsertAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpsertAMigrationResponse, error) + // V1RunAQueryWithBodyWithResponse request with any body V1RunAQueryWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RunAQueryResponse, error) @@ -9722,6 +9818,27 @@ func (r V1ApplyAMigrationResponse) StatusCode() int { return 0 } +type V1UpsertAMigrationResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1UpsertAMigrationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1UpsertAMigrationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1RunAQueryResponse struct { Body []byte HTTPResponse *http.Response @@ -11517,6 +11634,23 @@ func (c *ClientWithResponses) V1ApplyAMigrationWithResponse(ctx context.Context, return ParseV1ApplyAMigrationResponse(rsp) } +// V1UpsertAMigrationWithBodyWithResponse request with arbitrary body returning *V1UpsertAMigrationResponse +func (c *ClientWithResponses) V1UpsertAMigrationWithBodyWithResponse(ctx context.Context, ref string, params *V1UpsertAMigrationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpsertAMigrationResponse, error) { + rsp, err := c.V1UpsertAMigrationWithBody(ctx, ref, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpsertAMigrationResponse(rsp) +} + +func (c *ClientWithResponses) V1UpsertAMigrationWithResponse(ctx context.Context, ref string, params *V1UpsertAMigrationParams, body V1UpsertAMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpsertAMigrationResponse, error) { + rsp, err := c.V1UpsertAMigration(ctx, ref, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpsertAMigrationResponse(rsp) +} + // V1RunAQueryWithBodyWithResponse request with arbitrary body returning *V1RunAQueryResponse func (c *ClientWithResponses) V1RunAQueryWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RunAQueryResponse, error) { rsp, err := c.V1RunAQueryWithBody(ctx, ref, contentType, body, reqEditors...) @@ -13793,6 +13927,22 @@ func ParseV1ApplyAMigrationResponse(rsp *http.Response) (*V1ApplyAMigrationRespo return response, nil } +// ParseV1UpsertAMigrationResponse parses an HTTP response from a V1UpsertAMigrationWithResponse call +func ParseV1UpsertAMigrationResponse(rsp *http.Response) (*V1UpsertAMigrationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1UpsertAMigrationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseV1RunAQueryResponse parses an HTTP response from a V1RunAQueryWithResponse call func ParseV1RunAQueryResponse(rsp *http.Response) (*V1RunAQueryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index c89e7af85..882b109b5 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -705,6 +705,7 @@ const ( V1CreateProjectBodyDesiredInstanceSizeN48xlargeOptimizedMemory V1CreateProjectBodyDesiredInstanceSize = "48xlarge_optimized_memory" V1CreateProjectBodyDesiredInstanceSizeN4xlarge V1CreateProjectBodyDesiredInstanceSize = "4xlarge" V1CreateProjectBodyDesiredInstanceSizeN8xlarge V1CreateProjectBodyDesiredInstanceSize = "8xlarge" + V1CreateProjectBodyDesiredInstanceSizeNano V1CreateProjectBodyDesiredInstanceSize = "nano" V1CreateProjectBodyDesiredInstanceSizePico V1CreateProjectBodyDesiredInstanceSize = "pico" V1CreateProjectBodyDesiredInstanceSizeSmall V1CreateProjectBodyDesiredInstanceSize = "small" V1CreateProjectBodyDesiredInstanceSizeXlarge V1CreateProjectBodyDesiredInstanceSize = "xlarge" @@ -2824,6 +2825,12 @@ type V1UpdatePostgrestConfigBody struct { MaxRows *int `json:"max_rows,omitempty"` } +// V1UpsertMigrationBody defines model for V1UpsertMigrationBody. +type V1UpsertMigrationBody struct { + Name *string `json:"name,omitempty"` + Query string `json:"query"` +} + // VanitySubdomainBody defines model for VanitySubdomainBody. type VanitySubdomainBody struct { VanitySubdomain string `json:"vanity_subdomain"` @@ -2912,6 +2919,12 @@ type V1ApplyAMigrationParams struct { IdempotencyKey *string `json:"Idempotency-Key,omitempty"` } +// V1UpsertAMigrationParams defines parameters for V1UpsertAMigration. +type V1UpsertAMigrationParams struct { + // IdempotencyKey A unique key to ensure the same migration is tracked only once. + IdempotencyKey *string `json:"Idempotency-Key,omitempty"` +} + // V1CreateAFunctionParams defines parameters for V1CreateAFunction. type V1CreateAFunctionParams struct { Slug *string `form:"slug,omitempty" json:"slug,omitempty"` @@ -3058,6 +3071,9 @@ type V1RestorePitrBackupJSONRequestBody = V1RestorePitrBody // V1ApplyAMigrationJSONRequestBody defines body for V1ApplyAMigration for application/json ContentType. type V1ApplyAMigrationJSONRequestBody = V1CreateMigrationBody +// V1UpsertAMigrationJSONRequestBody defines body for V1UpsertAMigration for application/json ContentType. +type V1UpsertAMigrationJSONRequestBody = V1UpsertMigrationBody + // V1RunAQueryJSONRequestBody defines body for V1RunAQuery for application/json ContentType. type V1RunAQueryJSONRequestBody = V1RunQueryBody diff --git a/pkg/go.sum b/pkg/go.sum new file mode 100644 index 000000000..1291aaa0b --- /dev/null +++ b/pkg/go.sum @@ -0,0 +1,307 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= +github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= +github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/ecies/go/v2 v2.0.11 h1:xYhtMdLiqNi02oLirFmLyNbVXw6250h3WM6zJryQdiM= +github.com/ecies/go/v2 v2.0.11/go.mod h1:LPRzoefP0Tam+1uesQOq3Gtb6M2OwlFUnXBTtBAKfDQ= +github.com/ethereum/go-ethereum v1.15.8 h1:H6NilvRXFVoHiXZ3zkuTqKW5XcxjLZniV5UjxJt1GJU= +github.com/ethereum/go-ethereum v1.15.8/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= +github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= +github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/h2non/gock v1.2.0 h1:K6ol8rfrRkUOefooBC8elXoaNGYkpp7y2qcxGG6BzUE= +github.com/h2non/gock v1.2.0/go.mod h1:tNhoxHYW2W42cYkYb1WqzdbYIieALC99kpYr7rH/BQk= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w= +github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM= +github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 h1:Dj0L5fhJ9F82ZJyVOmBx6msDp/kfd1t9GRfny/mfJA0= +github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag= +github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.14.4 h1:fKuNiCumbKTAIxQwXfB/nsrnkEI6bPJrrSiMKgbJ2j8= +github.com/jackc/pgtype v1.14.4/go.mod h1:aKeozOde08iifGosdJpz9MBZonJOUJxqNpPBcMJTlVA= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.18.2/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= +github.com/jackc/pgx/v4 v4.18.3 h1:dE2/TrEsGX3RBprb3qryqSV9Y60iZN1C6i8IrmW9/BA= +github.com/jackc/pgx/v4 v4.18.3/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +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/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs= +github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY= +github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= +github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA= +github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= +github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/tidwall/jsonc v0.3.2 h1:ZTKrmejRlAJYdn0kcaFqRAKlxxFIC21pYq8vLa4p2Wc= +github.com/tidwall/jsonc v0.3.2/go.mod h1:dw+3CIxqHi+t8eFSpzzMlcVYxKp08UP5CD8/uSFCyJE= +github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= +github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +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= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8= +google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/pkg/migration/dump.go b/pkg/migration/dump.go new file mode 100644 index 000000000..66d3f7486 --- /dev/null +++ b/pkg/migration/dump.go @@ -0,0 +1,224 @@ +package migration + +import ( + "context" + _ "embed" + "fmt" + "io" + "strings" + + "github.com/jackc/pgconn" +) + +var ( + //go:embed scripts/dump_schema.sh + dumpSchemaScript string + //go:embed scripts/dump_data.sh + dumpDataScript string + //go:embed scripts/dump_role.sh + dumpRoleScript string + + InternalSchemas = []string{ + "information_schema", + "pg_*", // Wildcard pattern follows pg_dump + // Initialised by supabase/postgres image and owned by postgres role + "_analytics", + "_realtime", + "_supavisor", + "auth", + "extensions", + "pgbouncer", + "realtime", + "storage", + "supabase_functions", + "supabase_migrations", + // Owned by extensions + "cron", + "dbdev", + "graphql", + "graphql_public", + "net", + "pgmq", + "pgsodium", + "pgsodium_masks", + "pgtle", + "repack", + "tiger", + "tiger_data", + "timescaledb_*", + "_timescaledb_*", + "topology", + "vault", + } + // Data dump includes auth, storage, etc. for migrating to new project + excludedSchemas = []string{ + "information_schema", + "pg_*", // Wildcard pattern follows pg_dump + // Owned by extensions + // "cron", + "graphql", + "graphql_public", + // "net", + // "pgmq", + "pgsodium", + "pgsodium_masks", + "pgtle", + "repack", + "tiger", + "tiger_data", + "timescaledb_*", + "_timescaledb_*", + "topology", + "vault", + // Managed by Supabase + // "auth", + "extensions", + "pgbouncer", + "realtime", + // "storage", + // "supabase_functions", + "supabase_migrations", + // TODO: Remove in a few version in favor of _supabase internal db + "_analytics", + "_realtime", + "_supavisor", + } + reservedRoles = []string{ + "anon", + "authenticated", + "authenticator", + "dashboard_user", + "pgbouncer", + "postgres", + "service_role", + "supabase_admin", + "supabase_auth_admin", + "supabase_functions_admin", + "supabase_read_only_user", + "supabase_realtime_admin", + "supabase_replication_admin", + "supabase_storage_admin", + // Managed by extensions + "pgsodium_keyholder", + "pgsodium_keyiduser", + "pgsodium_keymaker", + "pgtle_admin", + } + allowedConfigs = []string{ + // Ref: https://github.com/supabase/postgres/blob/develop/ansible/files/postgresql_config/supautils.conf.j2#L10 + "pgaudit.*", + "pgrst.*", + "session_replication_role", + "statement_timeout", + "track_io_timing", + } +) + +type pgDumpOption struct { + schema []string + keepComments bool + excludeTable []string + columnInsert bool +} + +type DumpOptionFunc func(*pgDumpOption) + +func WithSchema(schema ...string) DumpOptionFunc { + return func(pdo *pgDumpOption) { + pdo.schema = schema + } +} + +func WithComments(keep bool) DumpOptionFunc { + return func(pdo *pgDumpOption) { + pdo.keepComments = keep + } +} + +func WithColumnInsert(use bool) DumpOptionFunc { + return func(pdo *pgDumpOption) { + pdo.columnInsert = use + } +} + +func WithoutTable(table ...string) DumpOptionFunc { + return func(pdo *pgDumpOption) { + pdo.excludeTable = table + } +} + +func toEnv(config pgconn.Config) []string { + return []string{ + "PGHOST=" + config.Host, + fmt.Sprintf("PGPORT=%d", config.Port), + "PGUSER=" + config.User, + "PGPASSWORD=" + config.Password, + "PGDATABASE=" + config.Database, + } +} + +type ExecFunc func(context.Context, string, []string, io.Writer) error + +func DumpSchema(ctx context.Context, config pgconn.Config, w io.Writer, exec ExecFunc, opts ...DumpOptionFunc) error { + var opt pgDumpOption + for _, apply := range opts { + apply(&opt) + } + env := toEnv(config) + if len(opt.schema) > 0 { + // Must append flag because empty string results in error + env = append(env, "EXTRA_FLAGS=--schema="+strings.Join(opt.schema, "|")) + } else { + env = append(env, "EXCLUDED_SCHEMAS="+strings.Join(InternalSchemas, "|")) + } + if !opt.keepComments { + env = append(env, "EXTRA_SED=/^--/d") + } + return exec(ctx, dumpSchemaScript, env, w) +} + +func DumpData(ctx context.Context, config pgconn.Config, w io.Writer, exec ExecFunc, opts ...DumpOptionFunc) error { + var opt pgDumpOption + for _, apply := range opts { + apply(&opt) + } + env := toEnv(config) + if len(opt.schema) > 0 { + env = append(env, "INCLUDED_SCHEMAS="+strings.Join(opt.schema, "|")) + } else { + env = append(env, "INCLUDED_SCHEMAS=*", "EXCLUDED_SCHEMAS="+strings.Join(excludedSchemas, "|")) + } + var extraFlags []string + if opt.columnInsert { + extraFlags = append(extraFlags, "--column-inserts", "--rows-per-insert 100000") + } + for _, table := range opt.excludeTable { + escaped := quoteUpperCase(table) + // Use separate flags to avoid error: too many dotted names + extraFlags = append(extraFlags, "--exclude-table "+escaped) + } + if len(extraFlags) > 0 { + env = append(env, "EXTRA_FLAGS="+strings.Join(extraFlags, " ")) + } + return exec(ctx, dumpDataScript, env, w) +} + +func quoteUpperCase(table string) string { + escaped := strings.ReplaceAll(table, ".", `"."`) + return fmt.Sprintf(`"%s"`, escaped) +} + +func DumpRole(ctx context.Context, config pgconn.Config, w io.Writer, exec ExecFunc, opts ...DumpOptionFunc) error { + var opt pgDumpOption + for _, apply := range opts { + apply(&opt) + } + env := append(toEnv(config), + "RESERVED_ROLES="+strings.Join(reservedRoles, "|"), + "ALLOWED_CONFIGS="+strings.Join(allowedConfigs, "|"), + ) + if !opt.keepComments { + env = append(env, "EXTRA_SED=/^--/d") + } + return exec(ctx, dumpRoleScript, env, w) +} diff --git a/pkg/migration/scripts/dump_data.sh b/pkg/migration/scripts/dump_data.sh new file mode 100755 index 000000000..764766510 --- /dev/null +++ b/pkg/migration/scripts/dump_data.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail + +export PGHOST="$PGHOST" +export PGPORT="$PGPORT" +export PGUSER="$PGUSER" +export PGPASSWORD="$PGPASSWORD" +export PGDATABASE="$PGDATABASE" + +# Disable triggers so that data dump can be restored exactly as it is +echo "SET session_replication_role = replica; +" + +# Explanation of pg_dump flags: +# +# --exclude-schema omit data from internal schemas as they are maintained by platform +# --exclude-table omit data from migration history tables as they are managed by platform +# --column-inserts only column insert syntax is supported, ie. no copy from stdin +# --schema '*' include all other schemas by default +# +# Never delete SQL comments because multiline records may begin with them. +pg_dump \ + --data-only \ + --quote-all-identifier \ + --exclude-schema "${EXCLUDED_SCHEMAS:-}" \ + --exclude-table "auth.schema_migrations" \ + --exclude-table "storage.migrations" \ + --exclude-table "supabase_functions.migrations" \ + --schema "$INCLUDED_SCHEMAS" \ + ${EXTRA_FLAGS:-} + +# Reset session config generated by pg_dump +echo "RESET ALL;" diff --git a/pkg/migration/scripts/dump_role.sh b/pkg/migration/scripts/dump_role.sh new file mode 100755 index 000000000..e5c157ba3 --- /dev/null +++ b/pkg/migration/scripts/dump_role.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail + +export PGHOST="$PGHOST" +export PGPORT="$PGPORT" +export PGUSER="$PGUSER" +export PGPASSWORD="$PGPASSWORD" +export PGDATABASE="$PGDATABASE" + +# Explanation of pg_dumpall flags: +# +# --roles-only only include create, alter, and grant role statements +# +# Explanation of sed substitutions: +# +# - do not create or alter reserved roles as they are blocked by supautils +# - explicitly allow altering safe attributes, ie. statement_timeout, pgrst.* +# - discard role attributes that require superuser, ie. nosuperuser, noreplication +# - do not alter membership grants by supabase_admin role +pg_dumpall \ + --roles-only \ + --quote-all-identifier \ + --no-role-passwords \ + --no-comments \ +| sed -E "s/^CREATE ROLE \"($RESERVED_ROLES)\"/-- &/" \ +| sed -E "s/^ALTER ROLE \"($RESERVED_ROLES)\"/-- &/" \ +| sed -E "s/ (NOSUPERUSER|NOREPLICATION)//g" \ +| sed -E "s/^-- (.* SET \"($ALLOWED_CONFIGS)\" .*)/\1/" \ +| sed -E "s/GRANT \".*\" TO \"($RESERVED_ROLES)\"/-- &/" \ +| sed -E "${EXTRA_SED:-}" \ +| uniq + +# Reset session config generated by pg_dump +echo "RESET ALL;" diff --git a/pkg/migration/scripts/dump_schema.sh b/pkg/migration/scripts/dump_schema.sh new file mode 100755 index 000000000..71aae4828 --- /dev/null +++ b/pkg/migration/scripts/dump_schema.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +set -euo pipefail + +export PGHOST="$PGHOST" +export PGPORT="$PGPORT" +export PGUSER="$PGUSER" +export PGPASSWORD="$PGPASSWORD" +export PGDATABASE="$PGDATABASE" + +# Explanation of pg_dump flags: +# +# --schema-only omit data like migration history, pgsodium key, etc. +# --exclude-schema omit internal schemas as they are maintained by platform +# +# Explanation of sed substitutions: +# +# - do not alter superuser role "supabase_admin" +# - do not alter foreign data wrappers owner +# - do not include ACL changes on internal schemas +# - do not include RLS policies on cron extension schema +# - do not include event triggers +# - do not create pgtle schema and extension comments +# - do not create publication "supabase_realtime" +pg_dump \ + --schema-only \ + --quote-all-identifier \ + --exclude-schema "${EXCLUDED_SCHEMAS:-}" \ + ${EXTRA_FLAGS:-} \ +| sed -E 's/^CREATE SCHEMA "/CREATE SCHEMA IF NOT EXISTS "/' \ +| sed -E 's/^CREATE TABLE "/CREATE TABLE IF NOT EXISTS "/' \ +| sed -E 's/^CREATE SEQUENCE "/CREATE SEQUENCE IF NOT EXISTS "/' \ +| sed -E 's/^CREATE VIEW "/CREATE OR REPLACE VIEW "/' \ +| sed -E 's/^CREATE FUNCTION "/CREATE OR REPLACE FUNCTION "/' \ +| sed -E 's/^CREATE TRIGGER "/CREATE OR REPLACE TRIGGER "/' \ +| sed -E 's/^CREATE PUBLICATION "supabase_realtime/-- &/' \ +| sed -E 's/^CREATE EVENT TRIGGER /-- &/' \ +| sed -E 's/^ WHEN TAG IN /-- &/' \ +| sed -E 's/^ EXECUTE FUNCTION /-- &/' \ +| sed -E 's/^ALTER EVENT TRIGGER /-- &/' \ +| sed -E 's/^ALTER PUBLICATION "supabase_realtime_/-- &/' \ +| sed -E 's/^ALTER FOREIGN DATA WRAPPER (.+) OWNER TO /-- &/' \ +| sed -E 's/^ALTER DEFAULT PRIVILEGES FOR ROLE "supabase_admin"/-- &/' \ +| sed -E "s/^GRANT (.+) ON (.+) \"(${EXCLUDED_SCHEMAS:-})\"/-- &/" \ +| sed -E "s/^REVOKE (.+) ON (.+) \"(${EXCLUDED_SCHEMAS:-})\"/-- &/" \ +| sed -E 's/^(CREATE EXTENSION IF NOT EXISTS "pg_tle").+/\1;/' \ +| sed -E 's/^(CREATE EXTENSION IF NOT EXISTS "pgsodium").+/\1;/' \ +| sed -E 's/^COMMENT ON EXTENSION (.+)/-- &/' \ +| sed -E 's/^CREATE POLICY "cron_job_/-- &/' \ +| sed -E 's/^ALTER TABLE "cron"/-- &/' \ +| sed -E "${EXTRA_SED:-}" + +# Reset session config generated by pg_dump +echo "RESET ALL;" From 245b45189ef1e56929fca510a1f0d3bf7d1c512c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:12:52 +0000 Subject: [PATCH 181/359] chore(deps): bump supabase/storage-api from v1.24.1 to v1.24.4 in /pkg/config/templates (#3681) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.24.1 to v1.24.4. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.24.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 696c6f412..c56975eee 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue FROM supabase/realtime:v2.36.9 AS realtime -FROM supabase/storage-api:v1.24.1 AS storage +FROM supabase/storage-api:v1.24.4 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From f29958207f1ea15d8fb59766061131f50324b769 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:18:13 +0000 Subject: [PATCH 182/359] chore(deps): bump supabase/realtime from v2.36.9 to v2.36.11 in /pkg/config/templates (#3670) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.9 to v2.36.11. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index c56975eee..2a39bb258 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.174.0 AS gotrue -FROM supabase/realtime:v2.36.9 AS realtime +FROM supabase/realtime:v2.36.11 AS realtime FROM supabase/storage-api:v1.24.4 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 300cdf9a8c6e686ca51b7eb7a87534a26e9fc8f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:23:30 +0000 Subject: [PATCH 183/359] chore(deps): bump supabase/postgres from 17.4.1.040 to 17.4.1.042 in /pkg/config/templates (#3682) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.040 to 17.4.1.042. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.042 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 2a39bb258..7006a3165 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.040 AS pg +FROM supabase/postgres:17.4.1.042 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 06bc4eb633a6a21d98dd4c379b276e15abbe4d44 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 9 Jun 2025 19:06:49 +0800 Subject: [PATCH 184/359] fix: allow skipping migrations so it can be managed by ORM (#3683) * chore: remove unused scripts * fix: allow skipping migrations so it can be managed by ORM --- internal/db/dump/templates/dump_data.sh | 33 -------------- internal/db/dump/templates/dump_role.sh | 34 --------------- internal/db/dump/templates/dump_schema.sh | 53 ----------------------- internal/db/push/push.go | 6 ++- internal/migration/apply/apply.go | 15 +++++-- internal/utils/misc.go | 2 +- pkg/config/config.go | 3 ++ pkg/config/db.go | 1 + pkg/config/templates/config.toml | 2 + pkg/config/testdata/config.toml | 2 + 10 files changed, 24 insertions(+), 127 deletions(-) delete mode 100755 internal/db/dump/templates/dump_data.sh delete mode 100755 internal/db/dump/templates/dump_role.sh delete mode 100755 internal/db/dump/templates/dump_schema.sh diff --git a/internal/db/dump/templates/dump_data.sh b/internal/db/dump/templates/dump_data.sh deleted file mode 100755 index 764766510..000000000 --- a/internal/db/dump/templates/dump_data.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -export PGHOST="$PGHOST" -export PGPORT="$PGPORT" -export PGUSER="$PGUSER" -export PGPASSWORD="$PGPASSWORD" -export PGDATABASE="$PGDATABASE" - -# Disable triggers so that data dump can be restored exactly as it is -echo "SET session_replication_role = replica; -" - -# Explanation of pg_dump flags: -# -# --exclude-schema omit data from internal schemas as they are maintained by platform -# --exclude-table omit data from migration history tables as they are managed by platform -# --column-inserts only column insert syntax is supported, ie. no copy from stdin -# --schema '*' include all other schemas by default -# -# Never delete SQL comments because multiline records may begin with them. -pg_dump \ - --data-only \ - --quote-all-identifier \ - --exclude-schema "${EXCLUDED_SCHEMAS:-}" \ - --exclude-table "auth.schema_migrations" \ - --exclude-table "storage.migrations" \ - --exclude-table "supabase_functions.migrations" \ - --schema "$INCLUDED_SCHEMAS" \ - ${EXTRA_FLAGS:-} - -# Reset session config generated by pg_dump -echo "RESET ALL;" diff --git a/internal/db/dump/templates/dump_role.sh b/internal/db/dump/templates/dump_role.sh deleted file mode 100755 index e5c157ba3..000000000 --- a/internal/db/dump/templates/dump_role.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -export PGHOST="$PGHOST" -export PGPORT="$PGPORT" -export PGUSER="$PGUSER" -export PGPASSWORD="$PGPASSWORD" -export PGDATABASE="$PGDATABASE" - -# Explanation of pg_dumpall flags: -# -# --roles-only only include create, alter, and grant role statements -# -# Explanation of sed substitutions: -# -# - do not create or alter reserved roles as they are blocked by supautils -# - explicitly allow altering safe attributes, ie. statement_timeout, pgrst.* -# - discard role attributes that require superuser, ie. nosuperuser, noreplication -# - do not alter membership grants by supabase_admin role -pg_dumpall \ - --roles-only \ - --quote-all-identifier \ - --no-role-passwords \ - --no-comments \ -| sed -E "s/^CREATE ROLE \"($RESERVED_ROLES)\"/-- &/" \ -| sed -E "s/^ALTER ROLE \"($RESERVED_ROLES)\"/-- &/" \ -| sed -E "s/ (NOSUPERUSER|NOREPLICATION)//g" \ -| sed -E "s/^-- (.* SET \"($ALLOWED_CONFIGS)\" .*)/\1/" \ -| sed -E "s/GRANT \".*\" TO \"($RESERVED_ROLES)\"/-- &/" \ -| sed -E "${EXTRA_SED:-}" \ -| uniq - -# Reset session config generated by pg_dump -echo "RESET ALL;" diff --git a/internal/db/dump/templates/dump_schema.sh b/internal/db/dump/templates/dump_schema.sh deleted file mode 100755 index 71aae4828..000000000 --- a/internal/db/dump/templates/dump_schema.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -export PGHOST="$PGHOST" -export PGPORT="$PGPORT" -export PGUSER="$PGUSER" -export PGPASSWORD="$PGPASSWORD" -export PGDATABASE="$PGDATABASE" - -# Explanation of pg_dump flags: -# -# --schema-only omit data like migration history, pgsodium key, etc. -# --exclude-schema omit internal schemas as they are maintained by platform -# -# Explanation of sed substitutions: -# -# - do not alter superuser role "supabase_admin" -# - do not alter foreign data wrappers owner -# - do not include ACL changes on internal schemas -# - do not include RLS policies on cron extension schema -# - do not include event triggers -# - do not create pgtle schema and extension comments -# - do not create publication "supabase_realtime" -pg_dump \ - --schema-only \ - --quote-all-identifier \ - --exclude-schema "${EXCLUDED_SCHEMAS:-}" \ - ${EXTRA_FLAGS:-} \ -| sed -E 's/^CREATE SCHEMA "/CREATE SCHEMA IF NOT EXISTS "/' \ -| sed -E 's/^CREATE TABLE "/CREATE TABLE IF NOT EXISTS "/' \ -| sed -E 's/^CREATE SEQUENCE "/CREATE SEQUENCE IF NOT EXISTS "/' \ -| sed -E 's/^CREATE VIEW "/CREATE OR REPLACE VIEW "/' \ -| sed -E 's/^CREATE FUNCTION "/CREATE OR REPLACE FUNCTION "/' \ -| sed -E 's/^CREATE TRIGGER "/CREATE OR REPLACE TRIGGER "/' \ -| sed -E 's/^CREATE PUBLICATION "supabase_realtime/-- &/' \ -| sed -E 's/^CREATE EVENT TRIGGER /-- &/' \ -| sed -E 's/^ WHEN TAG IN /-- &/' \ -| sed -E 's/^ EXECUTE FUNCTION /-- &/' \ -| sed -E 's/^ALTER EVENT TRIGGER /-- &/' \ -| sed -E 's/^ALTER PUBLICATION "supabase_realtime_/-- &/' \ -| sed -E 's/^ALTER FOREIGN DATA WRAPPER (.+) OWNER TO /-- &/' \ -| sed -E 's/^ALTER DEFAULT PRIVILEGES FOR ROLE "supabase_admin"/-- &/' \ -| sed -E "s/^GRANT (.+) ON (.+) \"(${EXCLUDED_SCHEMAS:-})\"/-- &/" \ -| sed -E "s/^REVOKE (.+) ON (.+) \"(${EXCLUDED_SCHEMAS:-})\"/-- &/" \ -| sed -E 's/^(CREATE EXTENSION IF NOT EXISTS "pg_tle").+/\1;/' \ -| sed -E 's/^(CREATE EXTENSION IF NOT EXISTS "pgsodium").+/\1;/' \ -| sed -E 's/^COMMENT ON EXTENSION (.+)/-- &/' \ -| sed -E 's/^CREATE POLICY "cron_job_/-- &/' \ -| sed -E 's/^ALTER TABLE "cron"/-- &/' \ -| sed -E "${EXTRA_SED:-}" - -# Reset session config generated by pg_dump -echo "RESET ALL;" diff --git a/internal/db/push/push.go b/internal/db/push/push.go index 4a1fdf6df..6960702d1 100644 --- a/internal/db/push/push.go +++ b/internal/db/push/push.go @@ -26,8 +26,10 @@ func Run(ctx context.Context, dryRun, ignoreVersionMismatch bool, includeRoles, return err } defer conn.Close(context.Background()) - pending, err := up.GetPendingMigrations(ctx, ignoreVersionMismatch, conn, fsys) - if err != nil { + var pending []string + if !utils.Config.Db.Migrations.Enabled { + fmt.Fprintln(os.Stderr, "Skipping migrations because it is disabled in config.toml for project:", flags.ProjectRef) + } else if pending, err = up.GetPendingMigrations(ctx, ignoreVersionMismatch, conn, fsys); err != nil { return err } var seeds []migration.SeedFile diff --git a/internal/migration/apply/apply.go b/internal/migration/apply/apply.go index 224b342f7..f9c517ace 100644 --- a/internal/migration/apply/apply.go +++ b/internal/migration/apply/apply.go @@ -11,14 +11,21 @@ import ( ) func MigrateAndSeed(ctx context.Context, version string, conn *pgx.Conn, fsys afero.Fs) error { - migrations, err := list.LoadPartialMigrations(version, fsys) - if err != nil { + if err := applyMigrationFiles(ctx, version, conn, fsys); err != nil { return err } - if err := migration.ApplyMigrations(ctx, migrations, conn, afero.NewIOFS(fsys)); err != nil { + return applySeedFiles(ctx, conn, fsys) +} + +func applyMigrationFiles(ctx context.Context, version string, conn *pgx.Conn, fsys afero.Fs) error { + if !utils.Config.Db.Migrations.Enabled { + return nil + } + migrations, err := list.LoadPartialMigrations(version, fsys) + if err != nil { return err } - return applySeedFiles(ctx, conn, fsys) + return migration.ApplyMigrations(ctx, migrations, conn, afero.NewIOFS(fsys)) } func applySeedFiles(ctx context.Context, conn *pgx.Conn, fsys afero.Fs) error { diff --git a/internal/utils/misc.go b/internal/utils/misc.go index 98705668c..46a9d3d12 100644 --- a/internal/utils/misc.go +++ b/internal/utils/misc.go @@ -90,7 +90,7 @@ var ( func GetCurrentTimestamp() string { // Magic number: https://stackoverflow.com/q/45160822. - return time.Now().UTC().Format("20060102150405") + return time.Now().UTC().Format(layoutVersion) } func GetCurrentBranchFS(fsys afero.Fs) (string, error) { diff --git a/pkg/config/config.go b/pkg/config/config.go index 04142d783..49dee97d6 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -344,6 +344,9 @@ func NewConfig(editors ...ConfigEditor) config { EncryptionKey: "12345678901234567890123456789032", SecretKeyBase: "EAx3IQ/wRG1v47ZD4NE4/9RzBI8Jmil3x0yhcW4V2NHBP6c2iPIzwjofi2Ep4HIG", }, + Migrations: migrations{ + Enabled: true, + }, Seed: seed{ Enabled: true, SqlPaths: []string{"seed.sql"}, diff --git a/pkg/config/db.go b/pkg/config/db.go index bdbc4da5d..0f216a23f 100644 --- a/pkg/config/db.go +++ b/pkg/config/db.go @@ -82,6 +82,7 @@ type ( } migrations struct { + Enabled bool `toml:"enabled"` SchemaPaths Glob `toml:"schema_paths"` } diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index b1dfdfe69..d72ae5045 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -46,6 +46,8 @@ max_client_conn = 100 # secret_key = "env(SECRET_VALUE)" [db.migrations] +# If disabled, migrations will be skipped during a db push or reset. +enabled = true # Specifies an ordered list of schema files that describe your database. # Supports glob patterns relative to supabase directory: "./schemas/*.sql" schema_paths = [] diff --git a/pkg/config/testdata/config.toml b/pkg/config/testdata/config.toml index 6f1d814c7..ed0d508fc 100644 --- a/pkg/config/testdata/config.toml +++ b/pkg/config/testdata/config.toml @@ -31,6 +31,8 @@ shadow_port = 54320 major_version = 17 [db.migrations] +# If disabled, migrations will be skipped during a db push or reset. +enabled = true # Specifies an ordered list of schema files that describe your database. # Supports glob patterns relative to supabase directory: "./schemas/*.sql" schema_paths = ["./schemas/*.sql"] From fe74c488624440acd6fc20606a9d7c77211bf84a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 11:19:25 +0000 Subject: [PATCH 185/359] chore(deps): bump google.golang.org/grpc from 1.72.2 to 1.73.0 in /pkg (#3666) * chore(deps): bump google.golang.org/grpc from 1.72.2 to 1.73.0 in /pkg Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.72.2 to 1.73.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.72.2...v1.73.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.73.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: run go mod tidy * chore: run go mod tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han Co-authored-by: Han Qiao --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- pkg/go.mod | 3 +-- pkg/go.sum | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 16b2787c3..77891cd1b 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( golang.org/x/mod v0.24.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.32.0 - google.golang.org/grpc v1.72.2 + google.golang.org/grpc v1.73.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/gotestsum v1.12.2 ) @@ -318,8 +318,8 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect go.opentelemetry.io/otel/metric v1.36.0 // indirect - go.opentelemetry.io/otel/sdk v1.34.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect + go.opentelemetry.io/otel/sdk v1.35.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect go.opentelemetry.io/otel/trace v1.36.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.uber.org/atomic v1.9.0 // indirect @@ -333,8 +333,8 @@ require ( golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.24.0 // indirect golang.org/x/tools v0.32.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 79dab0417..2a1334d73 100644 --- a/go.sum +++ b/go.sum @@ -1048,10 +1048,10 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 h1:BEj3S go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0/go.mod h1:9cKLGBDzI/F3NoHLQGm4ZrYdIHsvGt6ej6hUowxY0J4= go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= -go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= -go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= -go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= -go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= +go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= +go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= +go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= @@ -1444,10 +1444,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-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950= -google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:iK2jbkWL86DXjEx0qiHcRE9dE4/Ahua5k6V8OWFb//c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= +google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= +google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= 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= @@ -1461,8 +1461,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.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8= -google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= +google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= 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= diff --git a/pkg/go.mod b/pkg/go.mod index 6fb1fec23..fd3c0f96f 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -26,7 +26,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/tidwall/jsonc v0.3.2 golang.org/x/mod v0.24.0 - google.golang.org/grpc v1.72.2 + google.golang.org/grpc v1.73.0 ) require ( @@ -35,7 +35,6 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/ethereum/go-ethereum v1.15.8 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect - github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect diff --git a/pkg/go.sum b/pkg/go.sum index 1291aaa0b..04f39dd94 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -292,8 +292,8 @@ golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8= -google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= +google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From efdf14a05fea14a81a21135cf9b9dffdfc92330d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 23:34:17 +0800 Subject: [PATCH 186/359] chore(deps): bump golang.org/x/mod from 0.24.0 to 0.25.0 in /pkg (#3665) * chore(deps): bump golang.org/x/mod from 0.24.0 to 0.25.0 in /pkg Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.24.0 to 0.25.0. - [Commits](https://github.com/golang/mod/compare/v0.24.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-version: 0.25.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: run go mod tidy --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao Co-authored-by: Qiao Han --- go.mod | 2 +- go.sum | 4 ++-- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 77891cd1b..ff372d29b 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/withfig/autocomplete-tools/packages/cobra v1.2.0 github.com/zalando/go-keyring v0.2.6 go.opentelemetry.io/otel v1.36.0 - golang.org/x/mod v0.24.0 + golang.org/x/mod v0.25.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.32.0 google.golang.org/grpc v1.73.0 diff --git a/go.sum b/go.sum index 2a1334d73..c7bc0d074 100644 --- a/go.sum +++ b/go.sum @@ -1144,8 +1144,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/pkg/go.mod b/pkg/go.mod index fd3c0f96f..0340f3cba 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -25,7 +25,7 @@ require ( github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 github.com/tidwall/jsonc v0.3.2 - golang.org/x/mod v0.24.0 + golang.org/x/mod v0.25.0 google.golang.org/grpc v1.73.0 ) diff --git a/pkg/go.sum b/pkg/go.sum index 04f39dd94..c25f97883 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -226,8 +226,8 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= From bbe2f91c8e55c7878f5a2c6ad66fa500f27e4826 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 23:34:52 +0800 Subject: [PATCH 187/359] chore(deps): bump golang.org/x/mod from 0.24.0 to 0.25.0 (#3667) Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.24.0 to 0.25.0. - [Commits](https://github.com/golang/mod/compare/v0.24.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-version: 0.25.0 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> From 7280a4611a2186bf1a6244efa427f220ea42ec99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 23:35:56 +0800 Subject: [PATCH 188/359] chore(deps): bump supabase/gotrue from v2.174.0 to v2.175.0 in /pkg/config/templates (#3672) chore(deps): bump supabase/gotrue in /pkg/config/templates Bumps supabase/gotrue from v2.174.0 to v2.175.0. --- updated-dependencies: - dependency-name: supabase/gotrue dependency-version: v2.175.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 7006a3165..071b619bb 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -10,7 +10,7 @@ FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor -FROM supabase/gotrue:v2.174.0 AS gotrue +FROM supabase/gotrue:v2.175.0 AS gotrue FROM supabase/realtime:v2.36.11 AS realtime FROM supabase/storage-api:v1.24.4 AS storage FROM supabase/logflare:1.14.2 AS logflare From 389f73332e67f8c35789d545c73adac7779503fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 04:30:49 +0000 Subject: [PATCH 189/359] chore(deps): bump supabase/storage-api from v1.24.4 to v1.24.6 in /pkg/config/templates (#3692) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.24.4 to v1.24.6. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.24.6 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 071b619bb..08e51cb31 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.175.0 AS gotrue FROM supabase/realtime:v2.36.11 AS realtime -FROM supabase/storage-api:v1.24.4 AS storage +FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 30bf461a0410ff7750f1580cbe0ad89bc5ee5989 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 04:36:06 +0000 Subject: [PATCH 190/359] chore(deps): bump supabase/studio from 2025.06.05-sha-671aea0 to 2025.06.09-sha-4c1349f in /pkg/config/templates (#3691) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.06.05-sha-671aea0 to 2025.06.09-sha-4c1349f. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.06.09-sha-4c1349f dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 08e51cb31..0b25eefa2 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.3 AS pgmeta -FROM supabase/studio:2025.06.05-sha-671aea0 AS studio +FROM supabase/studio:2025.06.09-sha-4c1349f AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 7e3a6aa52c7d565519a3e53bae632ab97842e2a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 04:41:26 +0000 Subject: [PATCH 191/359] chore(deps): bump supabase/realtime from v2.36.11 to v2.36.14 in /pkg/config/templates (#3690) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.11 to v2.36.14. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.14 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 0b25eefa2..0685560af 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.175.0 AS gotrue -FROM supabase/realtime:v2.36.11 AS realtime +FROM supabase/realtime:v2.36.14 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 25cc47635449d21fa67a3ec7783ad781e7dfe6e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 04:58:29 +0000 Subject: [PATCH 192/359] chore(deps): bump github.com/slack-go/slack from 0.17.0 to 0.17.1 (#3693) Bumps [github.com/slack-go/slack](https://github.com/slack-go/slack) from 0.17.0 to 0.17.1. - [Release notes](https://github.com/slack-go/slack/releases) - [Changelog](https://github.com/slack-go/slack/blob/master/history.go) - [Commits](https://github.com/slack-go/slack/compare/v0.17.0...v0.17.1) --- updated-dependencies: - dependency-name: github.com/slack-go/slack dependency-version: 0.17.1 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 ff372d29b..9f9f3ed68 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/joho/godotenv v1.5.1 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 - github.com/slack-go/slack v0.17.0 + github.com/slack-go/slack v0.17.1 github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 diff --git a/go.sum b/go.sum index c7bc0d074..361587ead 100644 --- a/go.sum +++ b/go.sum @@ -895,8 +895,8 @@ github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+W github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= -github.com/slack-go/slack v0.17.0 h1:Vqd4GGIcwwgEu80GBs3cXoPPho5bkDGSFnuZbSG0NhA= -github.com/slack-go/slack v0.17.0/go.mod h1:X+UqOufi3LYQHDnMG1vxf0J8asC6+WllXrVrhl8/Prk= +github.com/slack-go/slack v0.17.1 h1:x0Mnc6biHBea5vfxLR+x4JFl/Rm3eIo0iS3xDZenX+o= +github.com/slack-go/slack v0.17.1/go.mod h1:X+UqOufi3LYQHDnMG1vxf0J8asC6+WllXrVrhl8/Prk= github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= From f4f46cb928df9b11edaec705ba90318649e6e51d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 05:04:43 +0000 Subject: [PATCH 193/359] chore(deps): bump github.com/go-git/go-git/v5 from 5.16.1 to 5.16.2 (#3694) Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.16.1 to 5.16.2. - [Release notes](https://github.com/go-git/go-git/releases) - [Commits](https://github.com/go-git/go-git/compare/v5.16.1...v5.16.2) --- updated-dependencies: - dependency-name: github.com/go-git/go-git/v5 dependency-version: 5.16.2 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 9f9f3ed68..236ba65ea 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/getsentry/sentry-go v0.33.0 github.com/go-errors/errors v1.5.1 - github.com/go-git/go-git/v5 v5.16.1 + github.com/go-git/go-git/v5 v5.16.2 github.com/go-xmlfmt/xmlfmt v1.1.3 github.com/golangci/golangci-lint/v2 v2.1.6 github.com/google/go-github/v62 v62.0.0 diff --git a/go.sum b/go.sum index 361587ead..522289a4b 100644 --- a/go.sum +++ b/go.sum @@ -312,8 +312,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.16.1 h1:TuxMBWNL7R05tXsUGi0kh1vi4tq0WfXNLlIrAkXG1k8= -github.com/go-git/go-git/v5 v5.16.1/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= +github.com/go-git/go-git/v5 v5.16.2 h1:fT6ZIOjE5iEnkzKyxTHK1W4HGAsPhqEqiSAssSO77hM= +github.com/go-git/go-git/v5 v5.16.2/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= From 55e2c4590c072019b569e9e2c04e8a536d320250 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 10 Jun 2025 14:24:59 +0800 Subject: [PATCH 194/359] fix: expose pointer to config struct (#3685) --- pkg/config/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 49dee97d6..c6edda1b7 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -317,10 +317,12 @@ func (c *baseConfig) Clone() baseConfig { return copy } -type ConfigEditor func(*config) +type Config *config + +type ConfigEditor func(Config) func WithHostname(hostname string) ConfigEditor { - return func(c *config) { + return func(c Config) { c.Hostname = hostname } } From f86152ee3d89b218540ccecf1ca32e1f797770b4 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 11 Jun 2025 16:13:41 +0800 Subject: [PATCH 195/359] fix: fallback to deploy with api when docker not found (#3699) * fix: fallback to deploy with api when docker not found * chore: update api spec * chore: update unit tests --- internal/functions/deploy/deploy.go | 6 +- internal/functions/deploy/deploy_test.go | 21 + internal/utils/docker.go | 5 + pkg/api/client.gen.go | 537 ----------------------- pkg/api/types.gen.go | 73 --- 5 files changed, 31 insertions(+), 611 deletions(-) diff --git a/internal/functions/deploy/deploy.go b/internal/functions/deploy/deploy.go index a3dba3e18..470a54304 100644 --- a/internal/functions/deploy/deploy.go +++ b/internal/functions/deploy/deploy.go @@ -51,7 +51,11 @@ func Run(ctx context.Context, slugs []string, useDocker bool, noVerifyJWT *bool, } opt := function.WithMaxJobs(maxJobs) if useDocker { - opt = function.WithBundler(NewDockerBundler(fsys)) + if utils.IsDockerRunning(ctx) { + opt = function.WithBundler(NewDockerBundler(fsys)) + } else { + fmt.Fprintln(os.Stderr, utils.Yellow("WARNING:"), "Docker is not running") + } } api := function.NewEdgeRuntimeAPI(flags.ProjectRef, *utils.GetSupabase(), opt) if err := api.Deploy(ctx, functionConfig, afero.NewIOFS(fsys)); errors.Is(err, function.ErrNoDeploy) { diff --git a/internal/functions/deploy/deploy_test.go b/internal/functions/deploy/deploy_test.go index 6b59dd3cf..9f0fb79db 100644 --- a/internal/functions/deploy/deploy_test.go +++ b/internal/functions/deploy/deploy_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "net/http" + "net/url" "os" "path/filepath" "testing" @@ -26,6 +27,11 @@ func TestDeployCommand(t *testing.T) { const containerId = "test-container" imageUrl := utils.GetRegistryImageUrl(utils.Config.EdgeRuntime.Image) + parsed, err := url.Parse(utils.Docker.DaemonHost()) + require.NoError(t, err) + parsed.Scheme = "http:" + dockerHost := parsed.String() + t.Run("deploys multiple functions", func(t *testing.T) { functions := []string{slug, slug + "-2"} // Setup in-memory fs @@ -39,6 +45,9 @@ func TestDeployCommand(t *testing.T) { require.NoError(t, err) // Setup mock api defer gock.OffAll() + gock.New(dockerHost). + Head("/_ping"). + Reply(http.StatusOK) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/functions"). Reply(http.StatusOK). @@ -99,6 +108,9 @@ import_map = "./import_map.json" require.NoError(t, err) // Setup mock api defer gock.OffAll() + gock.New(dockerHost). + Head("/_ping"). + Reply(http.StatusOK) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/functions"). Reply(http.StatusOK). @@ -151,6 +163,9 @@ import_map = "./import_map.json" require.NoError(t, err) // Setup mock api defer gock.OffAll() + gock.New(dockerHost). + Head("/_ping"). + Reply(http.StatusOK) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/functions"). Reply(http.StatusOK). @@ -214,6 +229,9 @@ verify_jwt = false require.NoError(t, err) // Setup mock api defer gock.OffAll() + gock.New(dockerHost). + Head("/_ping"). + Reply(http.StatusOK) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/functions"). Reply(http.StatusOK). @@ -257,6 +275,9 @@ verify_jwt = false require.NoError(t, err) // Setup mock api defer gock.OffAll() + gock.New(dockerHost). + Head("/_ping"). + Reply(http.StatusOK) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/functions"). Reply(http.StatusOK). diff --git a/internal/utils/docker.go b/internal/utils/docker.go index 1ee1da7ef..374182a3e 100644 --- a/internal/utils/docker.go +++ b/internal/utils/docker.go @@ -460,6 +460,11 @@ func DockerExecOnceWithStream(ctx context.Context, containerId, workdir string, return err } +func IsDockerRunning(ctx context.Context) bool { + _, err := Docker.Ping(ctx) + return !client.IsErrConnectionFailed(err) +} + var portErrorPattern = regexp.MustCompile("Bind for (.*) failed: port is already allocated") func parsePortBindError(err error) string { diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index d8b6f6178..d85be527a 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -146,12 +146,6 @@ type ClientInterface interface { // V1ListOrganizationMembers request V1ListOrganizationMembers(ctx context.Context, slug string, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1GetOrganizationProjectClaim request - V1GetOrganizationProjectClaim(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // V1ClaimProjectForOrganization request - V1ClaimProjectForOrganization(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1ListAllProjects request V1ListAllProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -222,15 +216,6 @@ type ClientInterface interface { V1CreateABranch(ctx context.Context, ref string, body V1CreateABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1DeleteProjectClaimToken request - V1DeleteProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // V1GetProjectClaimToken request - V1GetProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // V1CreateProjectClaimToken request - V1CreateProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // V1GetAuthServiceConfig request V1GetAuthServiceConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -776,30 +761,6 @@ func (c *Client) V1ListOrganizationMembers(ctx context.Context, slug string, req return c.Client.Do(req) } -func (c *Client) V1GetOrganizationProjectClaim(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1GetOrganizationProjectClaimRequest(c.Server, slug, token) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) V1ClaimProjectForOrganization(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1ClaimProjectForOrganizationRequest(c.Server, slug, token) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - func (c *Client) V1ListAllProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1ListAllProjectsRequest(c.Server) if err != nil { @@ -1100,42 +1061,6 @@ func (c *Client) V1CreateABranch(ctx context.Context, ref string, body V1CreateA return c.Client.Do(req) } -func (c *Client) V1DeleteProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1DeleteProjectClaimTokenRequest(c.Server, ref) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) V1GetProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1GetProjectClaimTokenRequest(c.Server, ref) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) V1CreateProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewV1CreateProjectClaimTokenRequest(c.Server, ref) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - func (c *Client) V1GetAuthServiceConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1GetAuthServiceConfigRequest(c.Server, ref) if err != nil { @@ -3096,88 +3021,6 @@ func NewV1ListOrganizationMembersRequest(server string, slug string) (*http.Requ return req, nil } -// NewV1GetOrganizationProjectClaimRequest generates requests for V1GetOrganizationProjectClaim -func NewV1GetOrganizationProjectClaimRequest(server string, slug string, token string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "slug", runtime.ParamLocationPath, slug) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "token", runtime.ParamLocationPath, token) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v1/organizations/%s/project-claim/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewV1ClaimProjectForOrganizationRequest generates requests for V1ClaimProjectForOrganization -func NewV1ClaimProjectForOrganizationRequest(server string, slug string, token string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "slug", runtime.ParamLocationPath, slug) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "token", runtime.ParamLocationPath, token) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v1/organizations/%s/project-claim/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - // NewV1ListAllProjectsRequest generates requests for V1ListAllProjects func NewV1ListAllProjectsRequest(server string) (*http.Request, error) { var err error @@ -4123,108 +3966,6 @@ func NewV1CreateABranchRequestWithBody(server string, ref string, contentType st return req, nil } -// NewV1DeleteProjectClaimTokenRequest generates requests for V1DeleteProjectClaimToken -func NewV1DeleteProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewV1GetProjectClaimTokenRequest generates requests for V1GetProjectClaimToken -func NewV1GetProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewV1CreateProjectClaimTokenRequest generates requests for V1CreateProjectClaimToken -func NewV1CreateProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - // NewV1GetAuthServiceConfigRequest generates requests for V1GetAuthServiceConfig func NewV1GetAuthServiceConfigRequest(server string, ref string) (*http.Request, error) { var err error @@ -7868,12 +7609,6 @@ type ClientWithResponsesInterface interface { // V1ListOrganizationMembersWithResponse request V1ListOrganizationMembersWithResponse(ctx context.Context, slug string, reqEditors ...RequestEditorFn) (*V1ListOrganizationMembersResponse, error) - // V1GetOrganizationProjectClaimWithResponse request - V1GetOrganizationProjectClaimWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1GetOrganizationProjectClaimResponse, error) - - // V1ClaimProjectForOrganizationWithResponse request - V1ClaimProjectForOrganizationWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1ClaimProjectForOrganizationResponse, error) - // V1ListAllProjectsWithResponse request V1ListAllProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*V1ListAllProjectsResponse, error) @@ -7944,15 +7679,6 @@ type ClientWithResponsesInterface interface { V1CreateABranchWithResponse(ctx context.Context, ref string, body V1CreateABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateABranchResponse, error) - // V1DeleteProjectClaimTokenWithResponse request - V1DeleteProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeleteProjectClaimTokenResponse, error) - - // V1GetProjectClaimTokenWithResponse request - V1GetProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectClaimTokenResponse, error) - - // V1CreateProjectClaimTokenWithResponse request - V1CreateProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CreateProjectClaimTokenResponse, error) - // V1GetAuthServiceConfigWithResponse request V1GetAuthServiceConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetAuthServiceConfigResponse, error) @@ -8551,49 +8277,6 @@ func (r V1ListOrganizationMembersResponse) StatusCode() int { return 0 } -type V1GetOrganizationProjectClaimResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *OrganizationProjectClaimResponse -} - -// Status returns HTTPResponse.Status -func (r V1GetOrganizationProjectClaimResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r V1GetOrganizationProjectClaimResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type V1ClaimProjectForOrganizationResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r V1ClaimProjectForOrganizationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r V1ClaimProjectForOrganizationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - type V1ListAllProjectsResponse struct { Body []byte HTTPResponse *http.Response @@ -9031,71 +8714,6 @@ func (r V1CreateABranchResponse) StatusCode() int { return 0 } -type V1DeleteProjectClaimTokenResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r V1DeleteProjectClaimTokenResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r V1DeleteProjectClaimTokenResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type V1GetProjectClaimTokenResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ProjectClaimTokenResponse -} - -// Status returns HTTPResponse.Status -func (r V1GetProjectClaimTokenResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r V1GetProjectClaimTokenResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type V1CreateProjectClaimTokenResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CreateProjectClaimTokenResponse -} - -// Status returns HTTPResponse.Status -func (r V1CreateProjectClaimTokenResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r V1CreateProjectClaimTokenResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - type V1GetAuthServiceConfigResponse struct { Body []byte HTTPResponse *http.Response @@ -10976,24 +10594,6 @@ func (c *ClientWithResponses) V1ListOrganizationMembersWithResponse(ctx context. return ParseV1ListOrganizationMembersResponse(rsp) } -// V1GetOrganizationProjectClaimWithResponse request returning *V1GetOrganizationProjectClaimResponse -func (c *ClientWithResponses) V1GetOrganizationProjectClaimWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1GetOrganizationProjectClaimResponse, error) { - rsp, err := c.V1GetOrganizationProjectClaim(ctx, slug, token, reqEditors...) - if err != nil { - return nil, err - } - return ParseV1GetOrganizationProjectClaimResponse(rsp) -} - -// V1ClaimProjectForOrganizationWithResponse request returning *V1ClaimProjectForOrganizationResponse -func (c *ClientWithResponses) V1ClaimProjectForOrganizationWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1ClaimProjectForOrganizationResponse, error) { - rsp, err := c.V1ClaimProjectForOrganization(ctx, slug, token, reqEditors...) - if err != nil { - return nil, err - } - return ParseV1ClaimProjectForOrganizationResponse(rsp) -} - // V1ListAllProjectsWithResponse request returning *V1ListAllProjectsResponse func (c *ClientWithResponses) V1ListAllProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*V1ListAllProjectsResponse, error) { rsp, err := c.V1ListAllProjects(ctx, reqEditors...) @@ -11214,33 +10814,6 @@ func (c *ClientWithResponses) V1CreateABranchWithResponse(ctx context.Context, r return ParseV1CreateABranchResponse(rsp) } -// V1DeleteProjectClaimTokenWithResponse request returning *V1DeleteProjectClaimTokenResponse -func (c *ClientWithResponses) V1DeleteProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeleteProjectClaimTokenResponse, error) { - rsp, err := c.V1DeleteProjectClaimToken(ctx, ref, reqEditors...) - if err != nil { - return nil, err - } - return ParseV1DeleteProjectClaimTokenResponse(rsp) -} - -// V1GetProjectClaimTokenWithResponse request returning *V1GetProjectClaimTokenResponse -func (c *ClientWithResponses) V1GetProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectClaimTokenResponse, error) { - rsp, err := c.V1GetProjectClaimToken(ctx, ref, reqEditors...) - if err != nil { - return nil, err - } - return ParseV1GetProjectClaimTokenResponse(rsp) -} - -// V1CreateProjectClaimTokenWithResponse request returning *V1CreateProjectClaimTokenResponse -func (c *ClientWithResponses) V1CreateProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CreateProjectClaimTokenResponse, error) { - rsp, err := c.V1CreateProjectClaimToken(ctx, ref, reqEditors...) - if err != nil { - return nil, err - } - return ParseV1CreateProjectClaimTokenResponse(rsp) -} - // V1GetAuthServiceConfigWithResponse request returning *V1GetAuthServiceConfigResponse func (c *ClientWithResponses) V1GetAuthServiceConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetAuthServiceConfigResponse, error) { rsp, err := c.V1GetAuthServiceConfig(ctx, ref, reqEditors...) @@ -12509,48 +12082,6 @@ func ParseV1ListOrganizationMembersResponse(rsp *http.Response) (*V1ListOrganiza return response, nil } -// ParseV1GetOrganizationProjectClaimResponse parses an HTTP response from a V1GetOrganizationProjectClaimWithResponse call -func ParseV1GetOrganizationProjectClaimResponse(rsp *http.Response) (*V1GetOrganizationProjectClaimResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &V1GetOrganizationProjectClaimResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest OrganizationProjectClaimResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseV1ClaimProjectForOrganizationResponse parses an HTTP response from a V1ClaimProjectForOrganizationWithResponse call -func ParseV1ClaimProjectForOrganizationResponse(rsp *http.Response) (*V1ClaimProjectForOrganizationResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &V1ClaimProjectForOrganizationResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - // ParseV1ListAllProjectsResponse parses an HTTP response from a V1ListAllProjectsWithResponse call func ParseV1ListAllProjectsResponse(rsp *http.Response) (*V1ListAllProjectsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -13041,74 +12572,6 @@ func ParseV1CreateABranchResponse(rsp *http.Response) (*V1CreateABranchResponse, return response, nil } -// ParseV1DeleteProjectClaimTokenResponse parses an HTTP response from a V1DeleteProjectClaimTokenWithResponse call -func ParseV1DeleteProjectClaimTokenResponse(rsp *http.Response) (*V1DeleteProjectClaimTokenResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &V1DeleteProjectClaimTokenResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseV1GetProjectClaimTokenResponse parses an HTTP response from a V1GetProjectClaimTokenWithResponse call -func ParseV1GetProjectClaimTokenResponse(rsp *http.Response) (*V1GetProjectClaimTokenResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &V1GetProjectClaimTokenResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ProjectClaimTokenResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseV1CreateProjectClaimTokenResponse parses an HTTP response from a V1CreateProjectClaimTokenWithResponse call -func ParseV1CreateProjectClaimTokenResponse(rsp *http.Response) (*V1CreateProjectClaimTokenResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &V1CreateProjectClaimTokenResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CreateProjectClaimTokenResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - // ParseV1GetAuthServiceConfigResponse parses an HTTP response from a V1GetAuthServiceConfigWithResponse call func ParseV1GetAuthServiceConfigResponse(rsp *http.Response) (*V1GetAuthServiceConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 882b109b5..a303bf27e 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -462,22 +462,6 @@ const ( Bearer OAuthTokenResponseTokenType = "Bearer" ) -// Defines values for OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan. -const ( - OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanEnterprise OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "enterprise" - OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanFree OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "free" - OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanPro OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "pro" - OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanTeam OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "team" -) - -// Defines values for OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan. -const ( - OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanEnterprise OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "enterprise" - OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanFree OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "free" - OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanPro OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "pro" - OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanTeam OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "team" -) - // Defines values for PostgresConfigResponseSessionReplicationRole. const ( PostgresConfigResponseSessionReplicationRoleLocal PostgresConfigResponseSessionReplicationRole = "local" @@ -1347,15 +1331,6 @@ type CreateOrganizationV1 struct { Name string `json:"name"` } -// CreateProjectClaimTokenResponse defines model for CreateProjectClaimTokenResponse. -type CreateProjectClaimTokenResponse struct { - CreatedAt string `json:"created_at"` - CreatedBy openapi_types.UUID `json:"created_by"` - ExpiresAt string `json:"expires_at"` - Token string `json:"token"` - TokenAlias string `json:"token_alias"` -} - // CreateProviderBody defines model for CreateProviderBody. type CreateProviderBody struct { AttributeMapping *struct { @@ -1812,46 +1787,6 @@ type OAuthTokenResponse struct { // OAuthTokenResponseTokenType defines model for OAuthTokenResponse.TokenType. type OAuthTokenResponseTokenType string -// OrganizationProjectClaimResponse defines model for OrganizationProjectClaimResponse. -type OrganizationProjectClaimResponse struct { - CreatedAt string `json:"created_at"` - CreatedBy openapi_types.UUID `json:"created_by"` - ExpiresAt string `json:"expires_at"` - Preview struct { - Errors []struct { - Key string `json:"key"` - Message string `json:"message"` - } `json:"errors"` - Info []struct { - Key string `json:"key"` - Message string `json:"message"` - } `json:"info"` - MembersExceedingFreeProjectLimit []struct { - Limit float32 `json:"limit"` - Name string `json:"name"` - } `json:"members_exceeding_free_project_limit"` - SourceSubscriptionPlan OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan `json:"source_subscription_plan"` - TargetOrganizationEligible nullable.Nullable[bool] `json:"target_organization_eligible"` - TargetOrganizationHasFreeProjectSlots nullable.Nullable[bool] `json:"target_organization_has_free_project_slots"` - TargetSubscriptionPlan nullable.Nullable[OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan] `json:"target_subscription_plan"` - Valid bool `json:"valid"` - Warnings []struct { - Key string `json:"key"` - Message string `json:"message"` - } `json:"warnings"` - } `json:"preview"` - Project struct { - Name string `json:"name"` - Ref string `json:"ref"` - } `json:"project"` -} - -// OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan defines model for OrganizationProjectClaimResponse.Preview.SourceSubscriptionPlan. -type OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan string - -// OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan defines model for OrganizationProjectClaimResponse.Preview.TargetSubscriptionPlan. -type OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan string - // OrganizationResponseV1 defines model for OrganizationResponseV1. type OrganizationResponseV1 struct { Id string `json:"id"` @@ -1904,14 +1839,6 @@ type PostgrestConfigWithJWTSecretResponse struct { MaxRows int `json:"max_rows"` } -// ProjectClaimTokenResponse defines model for ProjectClaimTokenResponse. -type ProjectClaimTokenResponse struct { - CreatedAt string `json:"created_at"` - CreatedBy openapi_types.UUID `json:"created_by"` - ExpiresAt string `json:"expires_at"` - TokenAlias string `json:"token_alias"` -} - // ProjectUpgradeEligibilityResponse defines model for ProjectUpgradeEligibilityResponse. type ProjectUpgradeEligibilityResponse struct { CurrentAppVersion string `json:"current_app_version"` From 06aaa3fcfe95a35d56228fdf17f8e125fd1a83fb Mon Sep 17 00:00:00 2001 From: Andrew Valleteau Date: Wed, 11 Jun 2025 11:22:54 +0200 Subject: [PATCH 196/359] chore(ci): add api-sync codegen automation workflow (#3701) --- .github/workflows/api-sync.yml | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/api-sync.yml diff --git a/.github/workflows/api-sync.yml b/.github/workflows/api-sync.yml new file mode 100644 index 000000000..4079ec7a4 --- /dev/null +++ b/.github/workflows/api-sync.yml @@ -0,0 +1,53 @@ +name: API Sync + +on: + repository_dispatch: + types: [api-sync] + workflow_dispatch: # allow manual triggering + +# Add explicit permissions +permissions: + contents: write + pull-requests: write + +jobs: + sync: + name: Sync API Types + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Run codegen + run: go generate + + - name: Check for changes + id: check + run: | + if git diff --ignore-space-at-eol --exit-code --quiet pkg; then + echo "No changes detected" + echo "has_changes=false" >> $GITHUB_OUTPUT + else + echo "Changes detected" + echo "has_changes=true" >> $GITHUB_OUTPUT + fi + + - name: Create Pull Request + if: steps.check.outputs.has_changes == 'true' + uses: peter-evans/create-pull-request@v5 + with: + commit-message: "chore: sync API types from infrastructure" + title: "chore: sync API types from infrastructure" + body: | + This PR was automatically created to sync API types from the infrastructure repository. + + Changes were detected in the generated API code after syncing with the latest spec from infrastructure. + branch: sync/api-types + base: develop + labels: | + automated pr + api-sync From 2fc65cd09f475ae048f8e98ae4409ff5f112788b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:15:38 +0000 Subject: [PATCH 197/359] chore(deps): bump supabase/realtime from v2.36.14 to v2.36.16 in /pkg/config/templates (#3698) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.14 to v2.36.16. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.16 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 0685560af..375db70b0 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor FROM supabase/gotrue:v2.175.0 AS gotrue -FROM supabase/realtime:v2.36.14 AS realtime +FROM supabase/realtime:v2.36.16 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From b3bee3dd5689a195a1784a318df2f63813981f9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:20:40 +0000 Subject: [PATCH 198/359] chore(deps): bump supabase/gotrue from v2.175.0 to v2.176.0 in /pkg/config/templates (#3697) chore(deps): bump supabase/gotrue in /pkg/config/templates Bumps supabase/gotrue from v2.175.0 to v2.176.0. --- updated-dependencies: - dependency-name: supabase/gotrue dependency-version: v2.176.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 375db70b0..f2ab476d1 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -10,7 +10,7 @@ FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.1 AS supavisor -FROM supabase/gotrue:v2.175.0 AS gotrue +FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.36.16 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare From f2b5f76a9dc2273b51cac897187102bc95973999 Mon Sep 17 00:00:00 2001 From: Andrew Valleteau Date: Thu, 12 Jun 2025 11:32:25 +0200 Subject: [PATCH 199/359] chore(ci): use PAT for generated PR (#3712) Otherwise additional workflows (CI/tests) won't be started over the generated PR and will be kept pending --- .github/workflows/api-sync.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/api-sync.yml b/.github/workflows/api-sync.yml index 4079ec7a4..327dc8e21 100644 --- a/.github/workflows/api-sync.yml +++ b/.github/workflows/api-sync.yml @@ -40,6 +40,7 @@ jobs: if: steps.check.outputs.has_changes == 'true' uses: peter-evans/create-pull-request@v5 with: + token: ${{ secrets.GH_PAT }} commit-message: "chore: sync API types from infrastructure" title: "chore: sync API types from infrastructure" body: | From 0cf9350f6409958d420221232e58421acb3afdda Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Thu, 12 Jun 2025 11:37:36 +0200 Subject: [PATCH 200/359] chore: sync API types from infrastructure (#3713) Co-authored-by: avallete --- pkg/api/types.gen.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index a303bf27e..121c51c2e 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -735,7 +735,9 @@ const ( // Defines values for V1OrganizationSlugResponseOptInTags. const ( - AISQLGENERATOROPTIN V1OrganizationSlugResponseOptInTags = "AI_SQL_GENERATOR_OPT_IN" + AIDATAGENERATOROPTIN V1OrganizationSlugResponseOptInTags = "AI_DATA_GENERATOR_OPT_IN" + AILOGGENERATOROPTIN V1OrganizationSlugResponseOptInTags = "AI_LOG_GENERATOR_OPT_IN" + AISQLGENERATOROPTIN V1OrganizationSlugResponseOptInTags = "AI_SQL_GENERATOR_OPT_IN" ) // Defines values for V1OrganizationSlugResponsePlan. @@ -1081,6 +1083,9 @@ type AuthConfigResponse struct { ExternalZoomClientId nullable.Nullable[string] `json:"external_zoom_client_id"` ExternalZoomEnabled nullable.Nullable[bool] `json:"external_zoom_enabled"` ExternalZoomSecret nullable.Nullable[string] `json:"external_zoom_secret"` + HookBeforeUserCreatedEnabled nullable.Nullable[bool] `json:"hook_before_user_created_enabled"` + HookBeforeUserCreatedSecrets nullable.Nullable[string] `json:"hook_before_user_created_secrets"` + HookBeforeUserCreatedUri nullable.Nullable[string] `json:"hook_before_user_created_uri"` HookCustomAccessTokenEnabled nullable.Nullable[bool] `json:"hook_custom_access_token_enabled"` HookCustomAccessTokenSecrets nullable.Nullable[string] `json:"hook_custom_access_token_secrets"` HookCustomAccessTokenUri nullable.Nullable[string] `json:"hook_custom_access_token_uri"` @@ -2164,6 +2169,9 @@ type UpdateAuthConfigBody struct { ExternalZoomClientId nullable.Nullable[string] `json:"external_zoom_client_id,omitempty"` ExternalZoomEnabled nullable.Nullable[bool] `json:"external_zoom_enabled,omitempty"` ExternalZoomSecret nullable.Nullable[string] `json:"external_zoom_secret,omitempty"` + HookBeforeUserCreatedEnabled nullable.Nullable[bool] `json:"hook_before_user_created_enabled,omitempty"` + HookBeforeUserCreatedSecrets nullable.Nullable[string] `json:"hook_before_user_created_secrets,omitempty"` + HookBeforeUserCreatedUri nullable.Nullable[string] `json:"hook_before_user_created_uri,omitempty"` HookCustomAccessTokenEnabled nullable.Nullable[bool] `json:"hook_custom_access_token_enabled,omitempty"` HookCustomAccessTokenSecrets nullable.Nullable[string] `json:"hook_custom_access_token_secrets,omitempty"` HookCustomAccessTokenUri nullable.Nullable[string] `json:"hook_custom_access_token_uri,omitempty"` From 8d89df7d89b8cda434368cb9b8cf5fca1ff54fb2 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 12 Jun 2025 18:32:27 +0800 Subject: [PATCH 201/359] fix: download compressed function from local api (#3709) * fix: download compressed function from local api * chore: bump api spec --- internal/functions/download/download.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/internal/functions/download/download.go b/internal/functions/download/download.go index ca99c1bcf..d37d4a54e 100644 --- a/internal/functions/download/download.go +++ b/internal/functions/download/download.go @@ -10,11 +10,14 @@ import ( "os/exec" "path" "path/filepath" + "strings" + "github.com/andybalholm/brotli" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" "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/flags" "github.com/supabase/cli/pkg/api" @@ -121,11 +124,13 @@ func Run(ctx context.Context, slug string, projectRef string, useLegacyBundle bo if err != nil { return err } - defer func() { - if err := fsys.Remove(eszipPath); err != nil { - fmt.Fprintln(os.Stderr, err) - } - }() + if !viper.GetBool("DEBUG") { + defer func() { + if err := fsys.Remove(eszipPath); err != nil { + fmt.Fprintln(os.Stderr, err) + } + }() + } // Extract eszip to functions directory err = extractOne(ctx, slug, eszipPath) if err != nil { @@ -148,12 +153,16 @@ func downloadOne(ctx context.Context, slug, projectRef string, fsys afero.Fs) (s } return "", errors.Errorf("Error status %d: %s", resp.StatusCode, string(body)) } + r := io.Reader(resp.Body) + if strings.EqualFold(resp.Header.Get("Content-Encoding"), "br") { + r = brotli.NewReader(resp.Body) + } // Create temp file to store downloaded eszip eszipPath := filepath.Join(utils.TempDir, fmt.Sprintf("output_%s.eszip", slug)) if err := utils.MkdirIfNotExistFS(fsys, utils.TempDir); err != nil { return "", err } - if err := afero.WriteReader(fsys, eszipPath, resp.Body); err != nil { + if err := afero.WriteReader(fsys, eszipPath, r); err != nil { return "", errors.Errorf("failed to download file: %w", err) } return eszipPath, nil From ea556bdb77c4edc0445c27a1c1983bd255753de9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 04:37:51 +0000 Subject: [PATCH 202/359] chore(deps): bump supabase/supavisor from 2.5.1 to 2.5.2 in /pkg/config/templates (#3714) chore(deps): bump supabase/supavisor in /pkg/config/templates Bumps supabase/supavisor from 2.5.1 to 2.5.2. --- updated-dependencies: - dependency-name: supabase/supavisor dependency-version: 2.5.2 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index f2ab476d1..174b4a568 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -9,7 +9,7 @@ FROM supabase/studio:2025.06.09-sha-4c1349f AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector -FROM supabase/supavisor:2.5.1 AS supavisor +FROM supabase/supavisor:2.5.2 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.36.16 AS realtime FROM supabase/storage-api:v1.24.6 AS storage From b9c5f3203f3a15b1aa2f317e95e8fbb45f5518b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 04:44:58 +0000 Subject: [PATCH 203/359] chore(deps): bump supabase/realtime from v2.36.16 to v2.36.18 in /pkg/config/templates (#3715) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.16 to v2.36.18. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.18 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 174b4a568..4182a40b5 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.2 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.36.16 AS realtime +FROM supabase/realtime:v2.36.18 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 2e617fe3ed580550f4c258900e67ba74d0666772 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 04:50:02 +0000 Subject: [PATCH 204/359] chore(deps): bump supabase/postgres from 17.4.1.042 to 17.4.1.043 in /pkg/config/templates (#3707) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.042 to 17.4.1.043. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.043 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 4182a40b5..3c1231ae3 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.042 AS pg +FROM supabase/postgres:17.4.1.043 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From ddbb18c10ca3be1f24acc9b8101ed09c2f810563 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:04:40 +0800 Subject: [PATCH 205/359] chore(deps): bump peter-evans/create-pull-request from 5 to 7 (#3708) * chore(deps): bump peter-evans/create-pull-request from 5 to 7 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * chore: bump api spec --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao Co-authored-by: Qiao Han --- .github/workflows/api-sync.yml | 2 +- pkg/api/client.gen.go | 268 +++++++++++++++++++++++++++++++++ pkg/api/types.gen.go | 15 ++ 3 files changed, 284 insertions(+), 1 deletion(-) diff --git a/.github/workflows/api-sync.yml b/.github/workflows/api-sync.yml index 327dc8e21..8193d927a 100644 --- a/.github/workflows/api-sync.yml +++ b/.github/workflows/api-sync.yml @@ -38,7 +38,7 @@ jobs: - name: Create Pull Request if: steps.check.outputs.has_changes == 'true' - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.GH_PAT }} commit-message: "chore: sync API types from infrastructure" diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index d85be527a..b5659e914 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -183,6 +183,12 @@ type ClientInterface interface { CreateApiKey(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // CheckLegacyApiKeys request + CheckLegacyApiKeys(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateLegacyApiKeys request + UpdateLegacyApiKeys(ctx context.Context, ref string, params *UpdateLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteApiKey request DeleteApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -917,6 +923,30 @@ func (c *Client) CreateApiKey(ctx context.Context, ref string, params *CreateApi return c.Client.Do(req) } +func (c *Client) CheckLegacyApiKeys(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCheckLegacyApiKeysRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateLegacyApiKeys(ctx context.Context, ref string, params *UpdateLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateLegacyApiKeysRequest(c.Server, ref, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) DeleteApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteApiKeyRequest(c.Server, ref, id, params) if err != nil { @@ -3527,6 +3557,92 @@ func NewCreateApiKeyRequestWithBody(server string, ref string, params *CreateApi return req, nil } +// NewCheckLegacyApiKeysRequest generates requests for CheckLegacyApiKeys +func NewCheckLegacyApiKeysRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/api-keys/legacy", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateLegacyApiKeysRequest generates requests for UpdateLegacyApiKeys +func NewUpdateLegacyApiKeysRequest(server string, ref string, params *UpdateLegacyApiKeysParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/api-keys/legacy", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "enabled", runtime.ParamLocationQuery, params.Enabled); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PUT", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewDeleteApiKeyRequest generates requests for DeleteApiKey func NewDeleteApiKeyRequest(server string, ref string, id openapi_types.UUID, params *DeleteApiKeyParams) (*http.Request, error) { var err error @@ -3579,6 +3695,38 @@ func NewDeleteApiKeyRequest(server string, ref string, id openapi_types.UUID, pa } + if params.WasCompromised != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "was_compromised", runtime.ParamLocationQuery, *params.WasCompromised); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Reason != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "reason", runtime.ParamLocationQuery, *params.Reason); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } @@ -7646,6 +7794,12 @@ type ClientWithResponsesInterface interface { CreateApiKeyWithResponse(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) + // CheckLegacyApiKeysWithResponse request + CheckLegacyApiKeysWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*CheckLegacyApiKeysResponse, error) + + // UpdateLegacyApiKeysWithResponse request + UpdateLegacyApiKeysWithResponse(ctx context.Context, ref string, params *UpdateLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*UpdateLegacyApiKeysResponse, error) + // DeleteApiKeyWithResponse request DeleteApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) @@ -8519,6 +8673,50 @@ func (r CreateApiKeyResponse) StatusCode() int { return 0 } +type CheckLegacyApiKeysResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LegacyApiKeysResponse +} + +// Status returns HTTPResponse.Status +func (r CheckLegacyApiKeysResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CheckLegacyApiKeysResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateLegacyApiKeysResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LegacyApiKeysResponse +} + +// Status returns HTTPResponse.Status +func (r UpdateLegacyApiKeysResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateLegacyApiKeysResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type DeleteApiKeyResponse struct { Body []byte HTTPResponse *http.Response @@ -10709,6 +10907,24 @@ func (c *ClientWithResponses) CreateApiKeyWithResponse(ctx context.Context, ref return ParseCreateApiKeyResponse(rsp) } +// CheckLegacyApiKeysWithResponse request returning *CheckLegacyApiKeysResponse +func (c *ClientWithResponses) CheckLegacyApiKeysWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*CheckLegacyApiKeysResponse, error) { + rsp, err := c.CheckLegacyApiKeys(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseCheckLegacyApiKeysResponse(rsp) +} + +// UpdateLegacyApiKeysWithResponse request returning *UpdateLegacyApiKeysResponse +func (c *ClientWithResponses) UpdateLegacyApiKeysWithResponse(ctx context.Context, ref string, params *UpdateLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*UpdateLegacyApiKeysResponse, error) { + rsp, err := c.UpdateLegacyApiKeys(ctx, ref, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateLegacyApiKeysResponse(rsp) +} + // DeleteApiKeyWithResponse request returning *DeleteApiKeyResponse func (c *ClientWithResponses) DeleteApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) { rsp, err := c.DeleteApiKey(ctx, ref, id, params, reqEditors...) @@ -12368,6 +12584,58 @@ func ParseCreateApiKeyResponse(rsp *http.Response) (*CreateApiKeyResponse, error return response, nil } +// ParseCheckLegacyApiKeysResponse parses an HTTP response from a CheckLegacyApiKeysWithResponse call +func ParseCheckLegacyApiKeysResponse(rsp *http.Response) (*CheckLegacyApiKeysResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CheckLegacyApiKeysResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LegacyApiKeysResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseUpdateLegacyApiKeysResponse parses an HTTP response from a UpdateLegacyApiKeysWithResponse call +func ParseUpdateLegacyApiKeysResponse(rsp *http.Response) (*UpdateLegacyApiKeysResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateLegacyApiKeysResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LegacyApiKeysResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseDeleteApiKeyResponse parses an HTTP response from a DeleteApiKeyWithResponse call func ParseDeleteApiKeyResponse(rsp *http.Response) (*DeleteApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 121c51c2e..50148b79f 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1581,6 +1581,11 @@ type GetProviderResponse struct { UpdatedAt *string `json:"updated_at,omitempty"` } +// LegacyApiKeysResponse defines model for LegacyApiKeysResponse. +type LegacyApiKeysResponse struct { + Enabled bool `json:"enabled"` +} + // ListProjectAddonsResponse defines model for ListProjectAddonsResponse. type ListProjectAddonsResponse struct { AvailableAddons []struct { @@ -2830,10 +2835,20 @@ type CreateApiKeyParams struct { Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } +// UpdateLegacyApiKeysParams defines parameters for UpdateLegacyApiKeys. +type UpdateLegacyApiKeysParams struct { + // Enabled Boolean string, true or false + Enabled bool `form:"enabled" json:"enabled"` +} + // DeleteApiKeyParams defines parameters for DeleteApiKey. type DeleteApiKeyParams struct { // Reveal Boolean string, true or false Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` + + // WasCompromised Boolean string, true or false + WasCompromised *bool `form:"was_compromised,omitempty" json:"was_compromised,omitempty"` + Reason *string `form:"reason,omitempty" json:"reason,omitempty"` } // GetApiKeyParams defines parameters for GetApiKey. From 0c3e9cf70fea38a7c68f56ca05c183924854ecff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 05:25:36 +0000 Subject: [PATCH 206/359] chore(deps): bump supabase/studio from 2025.06.09-sha-4c1349f to 2025.06.16-sha-c4316c3 in /pkg/config/templates (#3722) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.06.09-sha-4c1349f to 2025.06.16-sha-c4316c3. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.06.16-sha-c4316c3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 3c1231ae3..0cab55e94 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.3 AS pgmeta -FROM supabase/studio:2025.06.09-sha-4c1349f AS studio +FROM supabase/studio:2025.06.16-sha-c4316c3 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From c74541e54af713c9e4a8f4375ee53e03b8447b8a Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 17 Jun 2025 10:16:52 +0800 Subject: [PATCH 207/359] fix: separate last version flag for reset command (#3724) --- cmd/db.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/db.go b/cmd/db.go index 02e3e97b6..08906fd5f 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -193,7 +193,8 @@ var ( }, } - noSeed bool + noSeed bool + lastVersion uint dbResetCmd = &cobra.Command{ Use: "reset", @@ -202,7 +203,7 @@ var ( if noSeed { utils.Config.Db.Seed.Enabled = false } - return reset.Run(cmd.Context(), migrationVersion, nLastVersion, flags.DbConfig, afero.NewOsFs()) + return reset.Run(cmd.Context(), migrationVersion, lastVersion, flags.DbConfig, afero.NewOsFs()) }, } @@ -326,7 +327,7 @@ func init() { resetFlags.BoolVar(&noSeed, "no-seed", false, "Skip running the seed script after reset.") dbResetCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local") resetFlags.StringVar(&migrationVersion, "version", "", "Reset up to the specified version.") - resetFlags.UintVar(&nLastVersion, "last", 0, "Reset up to the last n migration versions.") + resetFlags.UintVar(&lastVersion, "last", 0, "Reset up to the last n migration versions.") dbResetCmd.MarkFlagsMutuallyExclusive("version", "last") dbCmd.AddCommand(dbResetCmd) // Build lint command From e454cde99207dc0506f6037b53e27ebbff235bde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 05:01:55 +0000 Subject: [PATCH 208/359] chore(deps): bump supabase/realtime from v2.36.18 to v2.36.20 in /pkg/config/templates (#3725) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.18 to v2.36.20. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.36.20 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 0cab55e94..e8073571c 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.2 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.36.18 AS realtime +FROM supabase/realtime:v2.36.20 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 17739310a6b8309570972c3dabcdd7b703978a61 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 18 Jun 2025 11:36:00 +0800 Subject: [PATCH 209/359] feat: hot reload eszip bundle when function source changes (#3710) * fix: file watcher skeleton for serving functions * chore: add debounce file watcher * chore: remove unnecessary log * chore: impose default watch limit * chore: add watcher tests and main.ts (#3717) * chore: add watcher tests and main.ts * chore: add serve tests * chore: fix lints * chore: remove sleep in tests * chore: simulate fs event when possible * chore: avoid flaky tests * chore: undo debounce test --------- Co-authored-by: Qiao Han * chore: simplify event ignore logic * chore: add streamer unit tests * chore: simplify streamer test * chore: update serve tests * chore: update unit tests * chore: update watcher tests --------- Co-authored-by: Andrew Valleteau --- internal/functions/serve/serve.go | 56 +++- internal/functions/serve/serve_test.go | 79 +++++- internal/functions/serve/streamer.go | 47 ++++ internal/functions/serve/streamer_test.go | 91 ++++++ internal/functions/serve/templates/main.ts | 34 ++- internal/functions/serve/testdata/config.toml | 8 + internal/functions/serve/watcher.go | 165 +++++++++++ internal/functions/serve/watcher_test.go | 264 ++++++++++++++++++ internal/testing/apitest/docker.go | 15 +- internal/utils/container_output.go | 35 --- internal/utils/container_output_test.go | 37 --- internal/utils/docker.go | 25 +- 12 files changed, 754 insertions(+), 102 deletions(-) create mode 100644 internal/functions/serve/streamer.go create mode 100644 internal/functions/serve/streamer_test.go create mode 100644 internal/functions/serve/testdata/config.toml create mode 100644 internal/functions/serve/watcher.go create mode 100644 internal/functions/serve/watcher_test.go diff --git a/internal/functions/serve/serve.go b/internal/functions/serve/serve.go index 9fba48a76..9819a181d 100644 --- a/internal/functions/serve/serve.go +++ b/internal/functions/serve/serve.go @@ -10,7 +10,9 @@ import ( "strconv" "strings" + "github.com/docker/cli/cli/compose/loader" "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/network" "github.com/docker/go-connections/nat" "github.com/go-errors/errors" @@ -46,6 +48,7 @@ func (mode InspectMode) toFlag() string { type RuntimeOption struct { InspectMode *InspectMode InspectMain bool + fileWatcher *debounceFileWatcher } func (i *RuntimeOption) toArgs() []string { @@ -68,6 +71,36 @@ const ( var mainFuncEmbed string func Run(ctx context.Context, envFilePath string, noVerifyJWT *bool, importMapPath string, runtimeOption RuntimeOption, fsys afero.Fs) error { + watcher, err := NewDebounceFileWatcher() + if err != nil { + return err + } + go watcher.Start() + defer watcher.Close() + // TODO: refactor this to edge runtime service + runtimeOption.fileWatcher = watcher + if err := restartEdgeRuntime(ctx, envFilePath, noVerifyJWT, importMapPath, runtimeOption, fsys); err != nil { + return err + } + streamer := NewLogStreamer(ctx) + go streamer.Start(utils.EdgeRuntimeId) + defer streamer.Close() + for { + select { + case <-ctx.Done(): + fmt.Println("Stopped serving " + utils.Bold(utils.FunctionsDir)) + return ctx.Err() + case <-watcher.RestartCh: + if err := restartEdgeRuntime(ctx, envFilePath, noVerifyJWT, importMapPath, runtimeOption, fsys); err != nil { + return err + } + case err := <-streamer.ErrCh: + return err + } + } +} + +func restartEdgeRuntime(ctx context.Context, envFilePath string, noVerifyJWT *bool, importMapPath string, runtimeOption RuntimeOption, fsys afero.Fs) error { // 1. Sanity checks. if err := flags.LoadConfig(fsys); err != nil { return err @@ -84,14 +117,7 @@ func Run(ctx context.Context, envFilePath string, noVerifyJWT *bool, importMapPa dbUrl := fmt.Sprintf("postgresql://postgres:postgres@%s:5432/postgres", utils.DbAliases[0]) // 3. Serve and log to console fmt.Fprintln(os.Stderr, "Setting up Edge Functions runtime...") - if err := ServeFunctions(ctx, envFilePath, noVerifyJWT, importMapPath, dbUrl, runtimeOption, fsys); err != nil { - return err - } - if err := utils.DockerStreamLogs(ctx, utils.EdgeRuntimeId, os.Stdout, os.Stderr); err != nil { - return err - } - fmt.Println("Stopped serving " + utils.Bold(utils.FunctionsDir)) - return nil + return ServeFunctions(ctx, envFilePath, noVerifyJWT, importMapPath, dbUrl, runtimeOption, fsys) } func ServeFunctions(ctx context.Context, envFilePath string, noVerifyJWT *bool, importMapPath string, dbUrl string, runtimeOption RuntimeOption, fsys afero.Fs) error { @@ -131,6 +157,19 @@ func ServeFunctions(ctx context.Context, envFilePath string, noVerifyJWT *bool, if err != nil { return err } + if watcher := runtimeOption.fileWatcher; watcher != nil { + var watchPaths []string + for _, b := range binds { + if spec, err := loader.ParseVolume(b); err != nil { + return errors.Errorf("failed to parse docker volume: %w", err) + } else if spec.Type == string(mount.TypeBind) { + watchPaths = append(watchPaths, spec.Source) + } + } + if err := watcher.SetWatchPaths(watchPaths, fsys); err != nil { + return err + } + } env = append(env, "SUPABASE_INTERNAL_FUNCTIONS_CONFIG="+functionsConfigString) // 3. Parse entrypoint script cmd := append([]string{ @@ -215,6 +254,7 @@ func populatePerFunctionConfigs(cwd, importMapPath string, noVerifyJWT *bool, fs for slug, fc := range functionsConfig { if !fc.Enabled { fmt.Fprintln(os.Stderr, "Skipped serving Function:", slug) + delete(functionsConfig, slug) continue } modules, err := deploy.GetBindMounts(cwd, utils.FunctionsDir, "", fc.Entrypoint, fc.ImportMap, fsys) diff --git a/internal/functions/serve/serve_test.go b/internal/functions/serve/serve_test.go index 7dbd75377..7b0bb17fa 100644 --- a/internal/functions/serve/serve_test.go +++ b/internal/functions/serve/serve_test.go @@ -2,9 +2,10 @@ package serve import ( "context" + "embed" "net/http" - "os" "path/filepath" + "strings" "testing" "github.com/docker/docker/api/types/container" @@ -17,13 +18,20 @@ import ( "github.com/supabase/cli/pkg/cast" ) +var ( + //go:embed testdata/config.toml + testConfig []byte + //go:embed testdata/* + testdata embed.FS +) + func TestServeCommand(t *testing.T) { t.Run("serves all functions", func(t *testing.T) { // Setup in-memory fs fsys := afero.NewMemMapFs() - require.NoError(t, utils.InitConfig(utils.InitParams{ProjectId: "test"}, fsys)) + require.NoError(t, afero.WriteFile(fsys, utils.ConfigPath, testConfig, 0644)) require.NoError(t, afero.WriteFile(fsys, utils.FallbackEnvFilePath, []byte{}, 0644)) - require.NoError(t, afero.WriteFile(fsys, utils.FallbackImportMapPath, []byte{}, 0644)) + require.NoError(t, afero.WriteFile(fsys, utils.FallbackImportMapPath, []byte("{}"), 0644)) // Setup mock docker require.NoError(t, apitest.MockDocker(utils.Docker)) defer gock.OffAll() @@ -36,11 +44,11 @@ func TestServeCommand(t *testing.T) { Delete("/v" + utils.Docker.ClientVersion() + "/containers/" + containerId). Reply(http.StatusOK) apitest.MockDockerStart(utils.Docker, utils.GetRegistryImageUrl(utils.Config.EdgeRuntime.Image), containerId) - require.NoError(t, apitest.MockDockerLogs(utils.Docker, containerId, "success")) - // Run test + require.NoError(t, apitest.MockDockerLogsStream(utils.Docker, containerId, 1, strings.NewReader("failed"))) + // Run test with timeout context err := Run(context.Background(), "", nil, "", RuntimeOption{}, fsys) // Check error - assert.NoError(t, err) + assert.ErrorContains(t, err, "error running container: exit 1") assert.Empty(t, apitest.ListUnmatchedRequests()) }) @@ -88,7 +96,6 @@ func TestServeCommand(t *testing.T) { }) t.Run("throws error on missing import map", func(t *testing.T) { - utils.CurrentDirAbs = "/" // Setup in-memory fs fsys := afero.NewMemMapFs() require.NoError(t, utils.InitConfig(utils.InitParams{ProjectId: "test"}, fsys)) @@ -105,6 +112,62 @@ func TestServeCommand(t *testing.T) { // Run test err := Run(context.Background(), ".env", cast.Ptr(true), "import_map.json", RuntimeOption{}, fsys) // Check error - assert.ErrorIs(t, err, os.ErrNotExist) + assert.ErrorContains(t, err, "failed to resolve relative path:") + }) +} + +func TestServeFunctions(t *testing.T) { + require.NoError(t, utils.Config.Load("testdata/config.toml", testdata)) + utils.UpdateDockerIds() + + t.Run("runs inspect mode", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.FromIOFS{FS: testdata} + // Setup mock docker + require.NoError(t, apitest.MockDocker(utils.Docker)) + defer gock.OffAll() + apitest.MockDockerStart(utils.Docker, utils.GetRegistryImageUrl(utils.Config.EdgeRuntime.Image), utils.EdgeRuntimeId) + // Run test + err := ServeFunctions(context.Background(), "", nil, "", "", RuntimeOption{ + InspectMode: cast.Ptr(InspectModeRun), + InspectMain: true, + }, fsys) + // Check error + assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("parses env file", func(t *testing.T) { + envPath := "/project/.env" + // Setup in-memory fs + fsys := afero.NewMemMapFs() + require.NoError(t, utils.WriteFile(envPath, []byte(` + DATABASE_URL=postgresql://localhost:5432/test + API_KEY=secret123 + DEBUG=true + `), fsys)) + // Run test + env, err := parseEnvFile(envPath, fsys) + // Check error + assert.NoError(t, err) + assert.ElementsMatch(t, []string{ + "DATABASE_URL=postgresql://localhost:5432/test", + "API_KEY=secret123", + "DEBUG=true", + }, env) + }) + + t.Run("parses function config", func(t *testing.T) { + // Setup in-memory fs + fsys := afero.FromIOFS{FS: testdata} + // Run test + binds, configString, err := populatePerFunctionConfigs("/", "", nil, fsys) + // Check error + assert.NoError(t, err) + assert.ElementsMatch(t, []string{ + "supabase_edge_runtime_test:/root/.cache/deno:rw", + "/supabase/functions/:/supabase/functions/:ro", + }, binds) + assert.Equal(t, `{"hello":{"verifyJWT":true,"entrypointPath":"testdata/functions/hello/index.ts","staticFiles":["testdata/image.png"]}}`, configString) }) } diff --git a/internal/functions/serve/streamer.go b/internal/functions/serve/streamer.go new file mode 100644 index 000000000..09d4171d5 --- /dev/null +++ b/internal/functions/serve/streamer.go @@ -0,0 +1,47 @@ +package serve + +import ( + "context" + "os" + "time" + + "github.com/cenkalti/backoff/v4" + "github.com/containerd/errdefs" + "github.com/docker/docker/api/types/container" + "github.com/go-errors/errors" + "github.com/supabase/cli/internal/utils" +) + +type logStreamer struct { + ctx context.Context + Close context.CancelFunc + ErrCh chan error +} + +func NewLogStreamer(ctx context.Context) logStreamer { + cancelCtx, cancel := context.WithCancel(ctx) + return logStreamer{ + ctx: cancelCtx, + Close: cancel, + ErrCh: make(chan error, 1), + } +} + +// Used by unit tests +var retryInterval = time.Millisecond * 400 + +func (s *logStreamer) Start(containerID string) { + // Retry indefinitely until stream is closed + policy := backoff.WithContext(backoff.NewConstantBackOff(retryInterval), s.ctx) + fetch := func() error { + if err := utils.DockerStreamLogs(s.ctx, containerID, os.Stdout, os.Stderr, func(lo *container.LogsOptions) { + lo.Timestamps = true + }); errdefs.IsNotFound(err) || errdefs.IsConflict(err) || errors.Is(err, utils.ErrContainerKilled) { + return err + } else if err != nil { + return &backoff.PermanentError{Err: err} + } + return errors.Errorf("container exited gracefully: %s", containerID) + } + s.ErrCh <- backoff.Retry(fetch, policy) +} diff --git a/internal/functions/serve/streamer_test.go b/internal/functions/serve/streamer_test.go new file mode 100644 index 000000000..23116860e --- /dev/null +++ b/internal/functions/serve/streamer_test.go @@ -0,0 +1,91 @@ +package serve + +import ( + "context" + "net/http" + "strings" + "testing" + "time" + + "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" +) + +func TestLogStreamer(t *testing.T) { + containerID := "test-container" + retryInterval = 0 + + t.Run("streams logs from container", func(t *testing.T) { + // Setup mock docker + require.NoError(t, apitest.MockDocker(utils.Docker)) + defer gock.OffAll() + require.NoError(t, apitest.MockDockerLogsStream(utils.Docker, containerID, 1, strings.NewReader(""))) + // Run test + streamer := NewLogStreamer(context.Background()) + streamer.Start(containerID) + // Check error + select { + case err := <-streamer.ErrCh: + assert.ErrorContains(t, err, "error running container: exit 1") + case <-time.After(2 * time.Second): + assert.Fail(t, "missing error signal from closing") + } + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("retries on container exit", func(t *testing.T) { + // Setup mock docker + require.NoError(t, apitest.MockDocker(utils.Docker)) + defer gock.OffAll() + require.NoError(t, apitest.MockDockerLogsStream(utils.Docker, containerID, 0, strings.NewReader(""))) + require.NoError(t, apitest.MockDockerLogsStream(utils.Docker, containerID, 137, strings.NewReader(""))) + require.NoError(t, apitest.MockDockerLogsStream(utils.Docker, containerID, 1, strings.NewReader(""))) + // Run test + streamer := NewLogStreamer(context.Background()) + streamer.Start(containerID) + // Check error + select { + case err := <-streamer.ErrCh: + assert.ErrorContains(t, err, "error running container: exit 1") + case <-time.After(2 * time.Second): + assert.Fail(t, "missing error signal from closing") + } + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("retries on missing container", func(t *testing.T) { + // Setup mock docker + require.NoError(t, apitest.MockDocker(utils.Docker)) + defer gock.OffAll() + gock.New(utils.Docker.DaemonHost()). + Get("/v" + utils.Docker.ClientVersion() + "/containers/" + containerID + "/logs"). + Reply(http.StatusNotFound). + BodyString("No such container") + gock.New(utils.Docker.DaemonHost()). + Get("/v" + utils.Docker.ClientVersion() + "/containers/" + containerID + "/logs"). + Reply(http.StatusConflict). + BodyString("can not get logs from container which is dead or marked for removal") + gock.New(utils.Docker.DaemonHost()). + Get("/v" + utils.Docker.ClientVersion() + "/containers/" + containerID + "/logs"). + Reply(http.StatusOK) + gock.New(utils.Docker.DaemonHost()). + Get("/v" + utils.Docker.ClientVersion() + "/containers/" + containerID + "/json"). + Reply(http.StatusNotFound). + BodyString("No such object") + require.NoError(t, apitest.MockDockerLogsStream(utils.Docker, containerID, 1, strings.NewReader(""))) + // Run test + streamer := NewLogStreamer(context.Background()) + streamer.Start(containerID) + // Check error + select { + case err := <-streamer.ErrCh: + assert.ErrorContains(t, err, "error running container: exit 1") + case <-time.After(2 * time.Second): + assert.Fail(t, "missing error signal from closing") + } + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) +} diff --git a/internal/functions/serve/templates/main.ts b/internal/functions/serve/templates/main.ts index 534409a98..568c547f8 100644 --- a/internal/functions/serve/templates/main.ts +++ b/internal/functions/serve/templates/main.ts @@ -48,6 +48,7 @@ const DENO_SB_ERROR_MAP = new Map([ SB_SPECIFIC_ERROR_CODE.WorkerLimit, ], ]); +const GENERIC_FUNCTION_SERVE_MESSAGE = `Serving functions on http://127.0.0.1:${HOST_PORT}/functions/v1/` interface FunctionConfig { entrypointPath: string; @@ -228,9 +229,36 @@ Deno.serve({ }, onListen: () => { - console.log( - `Serving functions on http://127.0.0.1:${HOST_PORT}/functions/v1/\nUsing ${Deno.version.deno}`, - ); + try { + const functionsConfigString = Deno.env.get( + "SUPABASE_INTERNAL_FUNCTIONS_CONFIG" + ); + if (functionsConfigString) { + const MAX_FUNCTIONS_URL_EXAMPLES = 5 + const functionsConfig = JSON.parse(functionsConfigString) as Record< + string, + unknown + >; + const functionNames = Object.keys(functionsConfig); + const exampleFunctions = functionNames.slice(0, MAX_FUNCTIONS_URL_EXAMPLES); + const functionsUrls = exampleFunctions.map( + (fname) => ` - http://127.0.0.1:${HOST_PORT}/functions/v1/${fname}` + ); + const functionsExamplesMessages = functionNames.length > 0 + // Show some functions urls examples + ? `\n${functionsUrls.join(`\n`)}${functionNames.length > MAX_FUNCTIONS_URL_EXAMPLES + // If we have more than 10 functions to serve, then show examples for first 10 + // and a count for the remaining ones + ? `\n... and ${functionNames.length - MAX_FUNCTIONS_URL_EXAMPLES} more functions` + : ''}` + : '' + console.log(`${GENERIC_FUNCTION_SERVE_MESSAGE}${functionsExamplesMessages}\nUsing ${Deno.version.deno}`); + } + } catch (e) { + console.log( + `${GENERIC_FUNCTION_SERVE_MESSAGE}\nUsing ${Deno.version.deno}` + ); + } }, onError: e => { diff --git a/internal/functions/serve/testdata/config.toml b/internal/functions/serve/testdata/config.toml new file mode 100644 index 000000000..28ea9a510 --- /dev/null +++ b/internal/functions/serve/testdata/config.toml @@ -0,0 +1,8 @@ +project_id = "test" + +[functions.hello] +static_files = ["image.png"] + +[functions.world] +enabled = false +verify_jwt = false diff --git a/internal/functions/serve/watcher.go b/internal/functions/serve/watcher.go new file mode 100644 index 000000000..6e75a104b --- /dev/null +++ b/internal/functions/serve/watcher.go @@ -0,0 +1,165 @@ +package serve + +import ( + "fmt" + "io/fs" + "os" + "path/filepath" + "slices" + "strings" + "time" + + "github.com/fsnotify/fsnotify" + "github.com/go-errors/errors" + "github.com/spf13/afero" + "github.com/spf13/viper" + "github.com/supabase/cli/internal/utils" +) + +const ( + // Debounce duration for file changes + debounceDuration = 500 * time.Millisecond + restartEvents = fsnotify.Write | fsnotify.Create | fsnotify.Remove | fsnotify.Rename + maxFileLimit = 1000 +) + +var ( + errTooManyFiles = errors.New("too many files") + + // Directories to ignore. + ignoredDirNames = []string{ + ".git", + "node_modules", + ".vscode", + ".idea", + ".DS_Store", + "vendor", + } + + // Patterns for ignoring file events. + ignoredFilePatterns = []struct { + Prefix string // File basename prefix + Suffix string // File basename suffix + ExactMatch bool // File basename exact match + }{ + {Suffix: "~"}, // Common backup files (e.g., emacs, gedit) + {Prefix: ".", Suffix: ".swp"}, // Vim swap files + {Prefix: ".", Suffix: ".swx"}, // Vim swap files (extended) + {Prefix: "___"}, // Deno temp files often start with this + {Suffix: ".tmp"}, // Generic temp files + {Prefix: ".#"}, // Emacs lock files + } +) + +// isIgnoredFileEvent checks if a file event should be ignored based on predefined patterns. +func isIgnoredFileEvent(event fsnotify.Event) bool { + if !event.Has(restartEvents) { + return true + } + baseName := filepath.Base(event.Name) + for _, p := range ignoredFilePatterns { + if strings.HasPrefix(baseName, p.Prefix) && strings.HasSuffix(baseName, p.Suffix) { + // An exact match means all characters match both prefix and suffix + if p.ExactMatch && len(baseName) > len(p.Prefix)+len(p.Suffix) { + continue + } + return true + } + } + return false +} + +type debounceFileWatcher struct { + watcher *fsnotify.Watcher + restartTimer *time.Timer + RestartCh <-chan time.Time + ErrCh <-chan error +} + +func NewDebounceFileWatcher() (*debounceFileWatcher, error) { + restartTimer := time.NewTimer(debounceDuration) + if !restartTimer.Stop() { + return nil, errors.New("failed to initialise timer") + } + watcher, err := fsnotify.NewWatcher() + if err != nil { + return nil, errors.Errorf("failed to create file watcher: %w", err) + } + return &debounceFileWatcher{ + watcher: watcher, + ErrCh: watcher.Errors, + restartTimer: restartTimer, + RestartCh: restartTimer.C, + }, nil +} + +func (w *debounceFileWatcher) Start() { + for { + event, ok := <-w.watcher.Events + if !isIgnoredFileEvent(event) { + fmt.Fprintf(os.Stderr, "File change detected: %s (%s)\n", event.Name, event.Op.String()) + // Fire immediately when timer is inactive, without blocking this thread + if active := w.restartTimer.Reset(0); active { + w.restartTimer.Reset(debounceDuration) + } + } + // Ensure the last event is fired before channel close + if !ok { + return + } + fmt.Fprintf(utils.GetDebugLogger(), "Ignoring file event: %s (%s)\n", event.Name, event.Op.String()) + } +} + +func (w *debounceFileWatcher) SetWatchPaths(watchPaths []string, fsys afero.Fs) error { + watchLimit := viper.GetUint("FUNCTIONS_WATCH_LIMIT") + if watchLimit == 0 { + watchLimit = maxFileLimit + } + shouldWatchDirs := make(map[string]struct{}) + for _, hostPath := range watchPaths { + // Ignore non-existent paths and symlink directories + if err := afero.Walk(fsys, hostPath, func(path string, info fs.FileInfo, err error) error { + if errors.Is(err, os.ErrNotExist) || slices.Contains(ignoredDirNames, filepath.Base(path)) { + return nil + } else if err != nil { + return errors.Errorf("failed to walk path: %w", err) + } + if info.IsDir() { + shouldWatchDirs[path] = struct{}{} + } else if path == hostPath { + shouldWatchDirs[filepath.Dir(path)] = struct{}{} + } + if uint(len(shouldWatchDirs)) >= watchLimit { + return errors.Errorf("file watcher stopped at %s: %w", path, errTooManyFiles) + } + return nil + }); errors.Is(err, errTooManyFiles) { + fmt.Fprintf(os.Stderr, "%s\nYou can increase this limit by setting SUPABASE_FUNCTIONS_WATCH_LIMIT=%d", err.Error(), watchLimit<<2) + } else if err != nil { + return err + } + } + // Add directories to watch, ignoring duplicates + for hostPath := range shouldWatchDirs { + if err := w.watcher.Add(hostPath); err != nil { + return errors.Errorf("failed to watch directory: %w", err) + } + fmt.Fprintln(utils.GetDebugLogger(), "Added directory from watcher:", hostPath) + } + // Remove directories that are no longer needed + for _, hostPath := range w.watcher.WatchList() { + if _, ok := shouldWatchDirs[hostPath]; !ok { + if err := w.watcher.Remove(hostPath); err != nil { + return errors.Errorf("failed to remove watch directory: %w", err) + } + fmt.Fprintln(utils.GetDebugLogger(), "Removed directory from watcher:", hostPath) + } + } + return nil +} + +func (r *debounceFileWatcher) Close() error { + // Don't stop the timer to allow debounced events to fire + return r.watcher.Close() +} diff --git a/internal/functions/serve/watcher_test.go b/internal/functions/serve/watcher_test.go new file mode 100644 index 000000000..cde1dc078 --- /dev/null +++ b/internal/functions/serve/watcher_test.go @@ -0,0 +1,264 @@ +package serve + +import ( + "context" + "os" + "path/filepath" + "testing" + "time" + + "github.com/fsnotify/fsnotify" + "github.com/spf13/afero" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// Integration test setup for watcher functionality +type WatcherIntegrationSetup struct { + T *testing.T + Context context.Context + Cancel context.CancelFunc + TempDir string +} + +func NewWatcherIntegrationSetup(t *testing.T) *WatcherIntegrationSetup { + ctx, cancel := context.WithCancel(context.Background()) + tempDir := t.TempDir() + + setup := &WatcherIntegrationSetup{ + T: t, + Context: ctx, + Cancel: cancel, + TempDir: tempDir, + } + + return setup +} + +func (s *WatcherIntegrationSetup) Cleanup() { + s.Cancel() +} + +// SetupFunctionsDirectory creates a functions directory with test functions +func (s *WatcherIntegrationSetup) SetupFunctionsDirectory() string { + functionsDir := filepath.Join(s.TempDir, "supabase", "functions") + require.NoError(s.T, os.MkdirAll(functionsDir, 0755)) + + // Set up test functions + s.createFunction("hello", `export default () => new Response("Hello World")`) + s.createFunction("protected", `export default () => new Response("Protected")`) + + return functionsDir +} + +func (s *WatcherIntegrationSetup) SetupSupabaseDirectory() string { + supabaseDir := filepath.Join(s.TempDir, "supabase") + require.NoError(s.T, os.MkdirAll(supabaseDir, 0755)) + + return supabaseDir +} + +func (s *WatcherIntegrationSetup) createFunction(name, content string) { + funcDir := filepath.Join(s.TempDir, "supabase", "functions", name) + require.NoError(s.T, os.MkdirAll(funcDir, 0755)) + require.NoError(s.T, os.WriteFile(filepath.Join(funcDir, "index.ts"), []byte(content), 0600)) +} + +// CreateFileWatcher creates and configures a debounce file watcher for testing +func (s *WatcherIntegrationSetup) CreateFileWatcher() (*debounceFileWatcher, error) { + watcher, err := NewDebounceFileWatcher() + if err != nil { + return nil, err + } + + // Set up watch paths to include our test directory + fsys := afero.NewOsFs() + watchPaths := []string{s.TempDir} + + if err := watcher.SetWatchPaths(watchPaths, fsys); err != nil { + watcher.Close() + return nil, err + } + + return watcher, nil +} + +func TestFileWatcher(t *testing.T) { + t.Run("detects TypeScript function changes and triggers restart", func(t *testing.T) { + setup := NewWatcherIntegrationSetup(t) + defer setup.Cleanup() + + functionsDir := setup.SetupFunctionsDirectory() + watcher, err := setup.CreateFileWatcher() + require.NoError(t, err) + + // Modify a function file in background + go func() { + defer watcher.Close() + funcFile := filepath.Join(functionsDir, "hello", "index.ts") + newContent := `export default () => new Response("Hello Modified World")` + require.NoError(t, os.WriteFile(funcFile, []byte(newContent), 0600)) + // https://github.com/fsnotify/fsnotify/blob/main/fsnotify_test.go#L181 + time.Sleep(50 * time.Millisecond) + }() + + // Run watcher on main thread to avoid sleeping + watcher.Start() + + // Wait for restart signal + select { + case ts, ok := <-watcher.RestartCh: + assert.NotZero(t, ts, "file change should trigger restart") + assert.True(t, ok, "timer channel should be closed") + case <-time.After(2 * time.Second): + assert.Fail(t, "missing restart signal after modifying TypeScript file") + } + }) + + t.Run("ignores editor temporary files", func(t *testing.T) { + watcher, err := NewDebounceFileWatcher() + require.NoError(t, err) + + // Create various temporary/editor files that should be ignored + go func() { + defer watcher.Close() + tempFiles := []string{ + filepath.Join("/tmp", "test.txt~"), // Backup file + filepath.Join("/tmp", ".test.swp"), // Vim swap + filepath.Join("/tmp", ".#test.ts"), // Emacs lock + filepath.Join("/tmp", "test.tmp"), // Temp file + filepath.Join("/tmp", "___deno_temp___"), // Deno temp + } + for _, tempFile := range tempFiles { + // Fire events directly since we only care about ignore files + watcher.watcher.Events <- fsnotify.Event{ + Name: tempFile, + Op: fsnotify.Create, + } + } + }() + + // Run watcher on main thread to avoid sleeping + watcher.Start() + + // Wait multiple times for out of order events + for range 3 { + select { + case <-watcher.RestartCh: + assert.Fail(t, "should not receive any restart signals from ignored files") + case err := <-watcher.ErrCh: + assert.NoError(t, err) + } + } + }) + + t.Run("detects config file changes and triggers restart", func(t *testing.T) { + setup := NewWatcherIntegrationSetup(t) + defer setup.Cleanup() + + supabaseDir := setup.SetupSupabaseDirectory() + watcher, err := setup.CreateFileWatcher() + require.NoError(t, err) + + // Create and modify a config.toml file + go func() { + defer watcher.Close() + configFile := filepath.Join(supabaseDir, "config.toml") + require.NoError(t, os.WriteFile(configFile, []byte(` + [functions.hello] + enabled = true + verify_jwt = false + `), 0600)) + // https://github.com/fsnotify/fsnotify/blob/main/fsnotify_test.go#L181 + time.Sleep(50 * time.Millisecond) + }() + + // Run watcher on main thread to avoid sleeping + watcher.Start() + + // Wait for restart signal + select { + case ts, ok := <-watcher.RestartCh: + assert.NotZero(t, ts, "config change should trigger restart") + assert.True(t, ok, "timer channel should be closed") + case <-time.After(2 * time.Second): + assert.Fail(t, "missing restart signal after modifying config file") + } + }) + + t.Run("debounces rapid file changes", func(t *testing.T) { + watcher, err := NewDebounceFileWatcher() + require.NoError(t, err) + + // Make rapid changes to a file + go func() { + defer watcher.Close() + for range 5 { + watcher.watcher.Events <- fsnotify.Event{ + Name: filepath.Join("/tmp", "index.ts"), + Op: fsnotify.Write, + } + } + }() + + // Run watcher on main thread to avoid sleeping + watcher.Start() + + // Wait for debounce duration + select { + case ts, ok := <-watcher.RestartCh: + assert.NotZero(t, ts) + assert.True(t, ok) + case <-time.After(debounceDuration): + assert.Fail(t, "missing restart signal after rapid file changes") + } + select { + case <-watcher.RestartCh: + assert.Fail(t, "should only get one restart signal due to debouncing") + case ts, ok := <-time.After(debounceDuration): + assert.NotZero(t, ts) + assert.True(t, ok) + } + }) + + t.Run("watches multiple directories", func(t *testing.T) { + setup := NewWatcherIntegrationSetup(t) + defer setup.Cleanup() + + // Create multiple directories with functions + functionsDir := setup.SetupFunctionsDirectory() + libDir := filepath.Join(setup.TempDir, "lib") + require.NoError(t, os.MkdirAll(libDir, 0755)) + + // Create a utility file in lib directory + utilFile := filepath.Join(libDir, "utils.ts") + require.NoError(t, os.WriteFile(utilFile, []byte(`export function util() { return "utility"; }`), 0600)) + + watcher, err := NewDebounceFileWatcher() + require.NoError(t, err) + + go func() { + defer watcher.Close() + // Set up watch paths to include both directories + fsys := afero.NewOsFs() + watchPaths := []string{functionsDir, libDir} + require.NoError(t, watcher.SetWatchPaths(watchPaths, fsys)) + // Modify file in lib directory + require.NoError(t, os.WriteFile(utilFile, []byte(`export function util() { return "modified utility"; }`), 0600)) + // https://github.com/fsnotify/fsnotify/blob/main/fsnotify_test.go#L181 + time.Sleep(50 * time.Millisecond) + }() + + // Run watcher on main thread to avoid sleeping + watcher.Start() + + // Wait for restart signal + select { + case ts, ok := <-watcher.RestartCh: + assert.NotZero(t, ts, "change in watched lib directory should trigger restart") + assert.True(t, ok, "timer channel should be closed") + case <-time.After(2 * time.Second): + assert.Fail(t, "missing restart signal after modifying file in watched lib directory") + } + }) +} diff --git a/internal/testing/apitest/docker.go b/internal/testing/apitest/docker.go index 17a14355d..9b9020c04 100644 --- a/internal/testing/apitest/docker.go +++ b/internal/testing/apitest/docker.go @@ -3,7 +3,9 @@ package apitest import ( "bytes" "fmt" + "io" "net/http" + "strings" "github.com/docker/docker/api" "github.com/docker/docker/api/types/container" @@ -84,9 +86,17 @@ func MockDockerStop(docker *client.Client) { // Ref: internal/utils/docker.go::DockerRunOnce func setupDockerLogs(docker *client.Client, containerID, stdout string, exitCode int) error { + err := MockDockerLogsStream(docker, containerID, exitCode, strings.NewReader(stdout)) + gock.New(docker.DaemonHost()). + Delete("/v" + docker.ClientVersion() + "/containers/" + containerID). + Reply(http.StatusOK) + return err +} + +func MockDockerLogsStream(docker *client.Client, containerID string, exitCode int, r io.Reader) error { var body bytes.Buffer writer := stdcopy.NewStdWriter(&body, stdcopy.Stdout) - _, err := writer.Write([]byte(stdout)) + _, err := io.Copy(writer, r) gock.New(docker.DaemonHost()). Get("/v"+docker.ClientVersion()+"/containers/"+containerID+"/logs"). Reply(http.StatusOK). @@ -99,9 +109,6 @@ func setupDockerLogs(docker *client.Client, containerID, stdout string, exitCode State: &container.State{ ExitCode: exitCode, }}}) - gock.New(docker.DaemonHost()). - Delete("/v" + docker.ClientVersion() + "/containers/" + containerID). - Reply(http.StatusOK) return err } diff --git a/internal/utils/container_output.go b/internal/utils/container_output.go index 8f417afd1..ccbbab033 100644 --- a/internal/utils/container_output.go +++ b/internal/utils/container_output.go @@ -12,8 +12,6 @@ import ( "strings" "github.com/docker/docker/pkg/jsonmessage" - "github.com/docker/docker/pkg/stdcopy" - "github.com/go-errors/errors" ) func ProcessPullOutput(out io.ReadCloser, p Program) error { @@ -205,36 +203,3 @@ func ProcessDiffOutput(diffBytes []byte) ([]byte, error) { } return []byte(diffHeader + "\n\n" + strings.Join(filteredDiffDdls, "\n\n") + "\n"), nil } - -func ProcessPsqlOutput(out io.Reader, p Program) error { - r, w := io.Pipe() - doneCh := make(chan struct{}, 1) - - go func() { - scanner := bufio.NewScanner(r) - - for scanner.Scan() { - select { - case <-doneCh: - return - default: - } - - line := scanner.Text() - p.Send(PsqlMsg(&line)) - } - }() - - var errBuf bytes.Buffer - if _, err := stdcopy.StdCopy(w, &errBuf, out); err != nil { - return err - } - if errBuf.Len() > 0 { - return errors.New("Error running SQL: " + errBuf.String()) - } - - doneCh <- struct{}{} - p.Send(PsqlMsg(nil)) - - return nil -} diff --git a/internal/utils/container_output_test.go b/internal/utils/container_output_test.go index cf3e529bb..325084618 100644 --- a/internal/utils/container_output_test.go +++ b/internal/utils/container_output_test.go @@ -1,7 +1,6 @@ package utils import ( - "bytes" "encoding/json" "io" "sync" @@ -9,7 +8,6 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/docker/docker/pkg/jsonmessage" - "github.com/docker/docker/pkg/stdcopy" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -65,41 +63,6 @@ func TestProcessDiffOutput(t *testing.T) { }) } -func TestProcessPsqlOutput(t *testing.T) { - t.Run("processes psql output", func(t *testing.T) { - var buf bytes.Buffer - writer := stdcopy.NewStdWriter(&buf, stdcopy.Stdout) - _, err := writer.Write([]byte("test output\n")) - require.NoError(t, err) - - var lastLine *string - p := NewMockProgram(func(msg tea.Msg) { - if m, ok := msg.(PsqlMsg); ok { - lastLine = m - } - }) - - err = ProcessPsqlOutput(&buf, p) - - assert.NoError(t, err) - assert.Nil(t, lastLine) - }) - - t.Run("handles stderr output", func(t *testing.T) { - var buf bytes.Buffer - writer := stdcopy.NewStdWriter(&buf, stdcopy.Stderr) - _, err := writer.Write([]byte("error message\n")) - require.NoError(t, err) - - p := NewMockProgram(nil) - - err = ProcessPsqlOutput(&buf, p) - - assert.Error(t, err) - assert.Contains(t, err.Error(), "error message") - }) -} - func TestProcessPullOutput(t *testing.T) { t.Run("processes docker pull messages", func(t *testing.T) { messages := []jsonmessage.JSONMessage{ diff --git a/internal/utils/docker.go b/internal/utils/docker.go index 374182a3e..7e908649e 100644 --- a/internal/utils/docker.go +++ b/internal/utils/docker.go @@ -376,13 +376,19 @@ func DockerRunOnceWithConfig(ctx context.Context, config container.Config, hostC return DockerStreamLogs(ctx, container, stdout, stderr) } -func DockerStreamLogs(ctx context.Context, containerId string, stdout, stderr io.Writer) error { - // Stream logs - logs, err := Docker.ContainerLogs(ctx, containerId, container.LogsOptions{ +var ErrContainerKilled = errors.New("exit 137") + +func DockerStreamLogs(ctx context.Context, containerId string, stdout, stderr io.Writer, opts ...func(*container.LogsOptions)) error { + logsOptions := container.LogsOptions{ ShowStdout: true, ShowStderr: true, Follow: true, - }) + } + for _, apply := range opts { + apply(&logsOptions) + } + // Stream logs + logs, err := Docker.ContainerLogs(ctx, containerId, logsOptions) if err != nil { return errors.Errorf("failed to read docker logs: %w", err) } @@ -395,10 +401,15 @@ func DockerStreamLogs(ctx context.Context, containerId string, stdout, stderr io if err != nil { return errors.Errorf("failed to inspect docker container: %w", err) } - if resp.State.ExitCode > 0 { - return errors.Errorf("error running container: exit %d", resp.State.ExitCode) + switch resp.State.ExitCode { + case 0: + return nil + case 137: + err = ErrContainerKilled + default: + err = errors.Errorf("exit %d", resp.State.ExitCode) } - return nil + return errors.Errorf("error running container: %w", err) } func DockerStreamLogsOnce(ctx context.Context, containerId string, stdout, stderr io.Writer) error { From e1d608256a2c89cc9a8beeda901d23f078807f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=83=A5=EB=83=90=EC=B1=A0?= Date: Wed, 18 Jun 2025 12:46:31 +0900 Subject: [PATCH 210/359] fix: bump edge-runtime to 1.68.0-develop.18 (#3727) --- 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 ad0c71d2d..b9d03e3e3 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -12,7 +12,7 @@ const ( pg13 = "supabase/postgres:13.3.0" pg14 = "supabase/postgres:14.1.0.89" pg15 = "supabase/postgres:15.8.1.085" - deno2 = "supabase/edge-runtime:v1.68.0-develop.14" + deno2 = "supabase/edge-runtime:v1.68.0-develop.18" ) type images struct { From 0f1e20f8cc2ff51c626626f66187c116ff176d7e Mon Sep 17 00:00:00 2001 From: Chris Gwilliams <517923+encima@users.noreply.github.com> Date: Wed, 18 Jun 2025 09:17:42 +0300 Subject: [PATCH 211/359] feat: add CSVQ support for rule parsing (#3595) * add simple rules for parsing report output added csvq driver and normalised column names across queries combine report queries to creats rollup for tables, indexes, roles and db overall * chore: use deprecated command field * chore: add missing deprecated commands * chore: use a single toml library * fix: exclude internal schemas from db stats * chore: update unit tests * fix: load default rules in report command * chore: add deprecated command * chore: make report database configurable * feat: load inspect rules from config file --------- Co-authored-by: Qiao Han Co-authored-by: Han Qiao --- cmd/inspect.go | 229 ++++++++++-------- go.mod | 5 + go.sum | 10 + internal/inspect/bloat/bloat.go | 13 +- internal/inspect/bloat/bloat.sql | 41 ++-- internal/inspect/bloat/bloat_test.go | 9 +- internal/inspect/cache/cache.go | 57 ----- internal/inspect/cache/cache.sql | 9 - internal/inspect/cache/cache_test.go | 52 ---- internal/inspect/db_stats/db_stats.go | 52 ++++ internal/inspect/db_stats/db_stats.sql | 27 +++ .../db_stats_test.go} | 15 +- internal/inspect/index_sizes/index_sizes.sql | 9 - .../index_stats.go} | 20 +- internal/inspect/index_stats/index_stats.sql | 49 ++++ .../index_stats_test.go} | 23 +- internal/inspect/index_usage/index_usage.sql | 17 -- internal/inspect/locks/locks.go | 10 +- internal/inspect/locks/locks.sql | 4 +- internal/inspect/locks/locks_test.go | 2 +- internal/inspect/report.go | 78 ++++-- internal/inspect/report_test.go | 81 ++----- .../inspect/role_configs/role_configs.sql | 5 - .../inspect/role_configs/role_configs_test.go | 38 --- .../role_connections/role_connections.go | 62 ----- .../role_stats.go} | 18 +- .../role_stats.sql} | 10 +- .../role_stats_test.go} | 7 +- internal/inspect/seq_scans/seq_scans.go | 46 ---- internal/inspect/seq_scans/seq_scans.sql | 6 - internal/inspect/seq_scans/seq_scans_test.go | 40 --- .../table_index_sizes/table_index_sizes.go | 46 ---- .../table_index_sizes/table_index_sizes.sql | 8 - .../table_index_sizes_test.go | 40 --- .../table_record_counts.go | 47 ---- .../table_record_counts.sql | 7 - .../table_record_counts_test.go | 41 ---- internal/inspect/table_sizes/table_sizes.go | 47 ---- internal/inspect/table_sizes/table_sizes.sql | 9 - .../inspect/table_sizes/table_sizes_test.go | 41 ---- .../table_stats.go} | 23 +- internal/inspect/table_stats/table_stats.sql | 27 +++ .../table_stats_test.go} | 24 +- internal/inspect/templates/rules.toml | 43 ++++ .../total_index_size/total_index_size.go | 45 ---- .../total_index_size/total_index_size.sql | 6 - .../total_table_sizes/total_table_sizes.go | 47 ---- .../total_table_sizes/total_table_sizes.sql | 9 - .../total_table_sizes_test.go | 41 ---- .../inspect/unused_indexes/unused_indexes.go | 4 +- .../inspect/unused_indexes/unused_indexes.sql | 2 +- .../unused_indexes/unused_indexes_test.go | 2 +- internal/inspect/vacuum_stats/vacuum_stats.go | 7 +- .../inspect/vacuum_stats/vacuum_stats.sql | 3 +- .../inspect/vacuum_stats/vacuum_stats_test.go | 3 +- pkg/config/config.go | 12 + 56 files changed, 558 insertions(+), 1070 deletions(-) delete mode 100644 internal/inspect/cache/cache.go delete mode 100644 internal/inspect/cache/cache.sql delete mode 100644 internal/inspect/cache/cache_test.go create mode 100644 internal/inspect/db_stats/db_stats.go create mode 100644 internal/inspect/db_stats/db_stats.sql rename internal/inspect/{total_index_size/total_index_size_test.go => db_stats/db_stats_test.go} (63%) delete mode 100644 internal/inspect/index_sizes/index_sizes.sql rename internal/inspect/{index_sizes/index_sizes.go => index_stats/index_stats.go} (64%) create mode 100644 internal/inspect/index_stats/index_stats.sql rename internal/inspect/{index_sizes/index_sizes_test.go => index_stats/index_stats_test.go} (63%) delete mode 100644 internal/inspect/index_usage/index_usage.sql delete mode 100644 internal/inspect/role_configs/role_configs.sql delete mode 100644 internal/inspect/role_configs/role_configs_test.go delete mode 100644 internal/inspect/role_connections/role_connections.go rename internal/inspect/{role_configs/role_configs.go => role_stats/role_stats.go} (64%) rename internal/inspect/{role_connections/role_connections.sql => role_stats/role_stats.sql} (64%) rename internal/inspect/{role_connections/role_connections_test.go => role_stats/role_stats_test.go} (84%) delete mode 100644 internal/inspect/seq_scans/seq_scans.go delete mode 100644 internal/inspect/seq_scans/seq_scans.sql delete mode 100644 internal/inspect/seq_scans/seq_scans_test.go delete mode 100644 internal/inspect/table_index_sizes/table_index_sizes.go delete mode 100644 internal/inspect/table_index_sizes/table_index_sizes.sql delete mode 100644 internal/inspect/table_index_sizes/table_index_sizes_test.go delete mode 100644 internal/inspect/table_record_counts/table_record_counts.go delete mode 100644 internal/inspect/table_record_counts/table_record_counts.sql delete mode 100644 internal/inspect/table_record_counts/table_record_counts_test.go delete mode 100644 internal/inspect/table_sizes/table_sizes.go delete mode 100644 internal/inspect/table_sizes/table_sizes.sql delete mode 100644 internal/inspect/table_sizes/table_sizes_test.go rename internal/inspect/{index_usage/index_usage.go => table_stats/table_stats.go} (60%) create mode 100644 internal/inspect/table_stats/table_stats.sql rename internal/inspect/{index_usage/index_usage_test.go => table_stats/table_stats_test.go} (59%) create mode 100644 internal/inspect/templates/rules.toml delete mode 100644 internal/inspect/total_index_size/total_index_size.go delete mode 100644 internal/inspect/total_index_size/total_index_size.sql delete mode 100644 internal/inspect/total_table_sizes/total_table_sizes.go delete mode 100644 internal/inspect/total_table_sizes/total_table_sizes.sql delete mode 100644 internal/inspect/total_table_sizes/total_table_sizes_test.go diff --git a/cmd/inspect.go b/cmd/inspect.go index 2b55c3876..24c3ff465 100644 --- a/cmd/inspect.go +++ b/cmd/inspect.go @@ -1,37 +1,25 @@ package cmd import ( - "fmt" "os" "os/signal" - "path/filepath" "github.com/spf13/afero" "github.com/spf13/cobra" + "github.com/supabase/cli/internal/inspect" "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/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/db_stats" + "github.com/supabase/cli/internal/inspect/index_stats" "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/role_stats" + "github.com/supabase/cli/internal/inspect/table_stats" "github.com/supabase/cli/internal/inspect/vacuum_stats" + "github.com/supabase/cli/internal/utils/flags" ) var ( @@ -51,11 +39,11 @@ var ( }, } - inspectCacheHitCmd = &cobra.Command{ - Use: "cache-hit", - Short: "Show cache hit rates for tables and indices", + inspectDBStatsCmd = &cobra.Command{ + Use: "db-stats", + Short: "Show stats such as cache hit rates, total sizes, and WAL size", RunE: func(cmd *cobra.Command, args []string) error { - return cache.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return db_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } @@ -67,14 +55,6 @@ var ( }, } - inspectIndexUsageCmd = &cobra.Command{ - Use: "index-usage", - Short: "Show information about the efficiency of indexes", - RunE: func(cmd *cobra.Command, args []string) error { - return index_usage.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) - }, - } - inspectLocksCmd = &cobra.Command{ Use: "locks", Short: "Show queries which have taken out an exclusive lock on a relation", @@ -107,107 +87,159 @@ var ( }, } - inspectTotalIndexSizeCmd = &cobra.Command{ - Use: "total-index-size", - Short: "Show total size of all indexes", + inspectIndexStatsCmd = &cobra.Command{ + Use: "index-stats", + Short: "Show combined index size, usage percent, scan counts, and unused status", RunE: func(cmd *cobra.Command, args []string) error { - return total_index_size.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return index_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectIndexSizesCmd = &cobra.Command{ - Use: "index-sizes", - Short: "Show index sizes of individual indexes", + inspectLongRunningQueriesCmd = &cobra.Command{ + Use: "long-running-queries", + Short: "Show currently running queries running for longer than 5 minutes", RunE: func(cmd *cobra.Command, args []string) error { - return index_sizes.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return long_running_queries.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectTableSizesCmd = &cobra.Command{ - Use: "table-sizes", - Short: "Show table sizes of individual tables without their index sizes", + inspectBloatCmd = &cobra.Command{ + Use: "bloat", + Short: "Estimates space allocated to a relation that is full of dead tuples", RunE: func(cmd *cobra.Command, args []string) error { - return table_sizes.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return bloat.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectTableIndexSizesCmd = &cobra.Command{ - Use: "table-index-sizes", - Short: "Show index sizes of individual tables", + inspectRoleStatsCmd = &cobra.Command{ + Use: "role-stats", + Short: "Show information about roles on the database", RunE: func(cmd *cobra.Command, args []string) error { - return table_index_sizes.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return role_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectTotalTableSizesCmd = &cobra.Command{ - Use: "total-table-sizes", - Short: "Show total table sizes, including table index sizes", + inspectVacuumStatsCmd = &cobra.Command{ + Use: "vacuum-stats", + Short: "Show statistics related to vacuum operations per table", RunE: func(cmd *cobra.Command, args []string) error { - return total_table_sizes.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return vacuum_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectUnusedIndexesCmd = &cobra.Command{ - Use: "unused-indexes", - Short: "Show indexes with low usage", + inspectTableStatsCmd = &cobra.Command{ + Use: "table-stats", + Short: "Show combined table size, index size, and estimated row count", RunE: func(cmd *cobra.Command, args []string) error { - return unused_indexes.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return table_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectSeqScansCmd = &cobra.Command{ - Use: "seq-scans", - Short: "Show number of sequential scans recorded against all tables", + inspectCacheHitCmd = &cobra.Command{ + Deprecated: `use "db-stats" instead.`, + Use: "cache-hit", + Short: "Show cache hit rates for tables and indices", RunE: func(cmd *cobra.Command, args []string) error { - return seq_scans.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return db_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectLongRunningQueriesCmd = &cobra.Command{ - Use: "long-running-queries", - Short: "Show currently running queries running for longer than 5 minutes", + inspectIndexUsageCmd = &cobra.Command{ + Deprecated: `use "index-stats" instead.`, + Use: "index-usage", + Short: "Show information about the efficiency of indexes", RunE: func(cmd *cobra.Command, args []string) error { - return long_running_queries.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return index_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectTableRecordCountsCmd = &cobra.Command{ - Use: "table-record-counts", - Short: "Show estimated number of rows per table", + inspectTotalIndexSizeCmd = &cobra.Command{ + Deprecated: `use "index-stats" instead.`, + Use: "total-index-size", + Short: "Show total size of all indexes", RunE: func(cmd *cobra.Command, args []string) error { - return table_record_counts.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return index_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectBloatCmd = &cobra.Command{ - Use: "bloat", - Short: "Estimates space allocated to a relation that is full of dead tuples", + inspectIndexSizesCmd = &cobra.Command{ + Deprecated: `use "index-stats" instead.`, + Use: "index-sizes", + Short: "Show index sizes of individual indexes", RunE: func(cmd *cobra.Command, args []string) error { - return bloat.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return index_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } - inspectVacuumStatsCmd = &cobra.Command{ - Use: "vacuum-stats", - Short: "Show statistics related to vacuum operations per table", + inspectTableSizesCmd = &cobra.Command{ + Deprecated: `use "table-stats" instead.`, + Use: "table-sizes", + Short: "Show table sizes of individual tables without their index sizes", RunE: func(cmd *cobra.Command, args []string) error { - return vacuum_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return table_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + }, + } + + inspectTableIndexSizesCmd = &cobra.Command{ + Deprecated: `use "table-stats" instead.`, + Use: "table-index-sizes", + Short: "Show index sizes of individual tables", + RunE: func(cmd *cobra.Command, args []string) error { + return table_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + }, + } + + inspectTotalTableSizesCmd = &cobra.Command{ + Deprecated: `use "table-stats" instead.`, + Use: "total-table-sizes", + Short: "Show total table sizes, including table index sizes", + RunE: func(cmd *cobra.Command, args []string) error { + return table_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + }, + } + + inspectUnusedIndexesCmd = &cobra.Command{ + Deprecated: `use "index-stats" instead.`, + Use: "unused-indexes", + Short: "Show indexes with low usage", + RunE: func(cmd *cobra.Command, args []string) error { + return index_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + }, + } + + inspectTableRecordCountsCmd = &cobra.Command{ + Deprecated: `use "table-stats" instead.`, + Use: "table-record-counts", + Short: "Show estimated number of rows per table", + RunE: func(cmd *cobra.Command, args []string) error { + return index_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + }, + } + + inspectSeqScansCmd = &cobra.Command{ + Deprecated: `use "index-stats" instead.`, + Use: "seq-scans", + Short: "Show number of sequential scans recorded against all tables", + RunE: func(cmd *cobra.Command, args []string) error { + return index_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } inspectRoleConfigsCmd = &cobra.Command{ - Use: "role-configs", - Short: "Show configuration settings for database roles when they have been modified", + Deprecated: `use "role-stats" instead.`, + Use: "role-configs", + Short: "Show configuration settings for database roles when they have been modified", RunE: func(cmd *cobra.Command, args []string) error { - return role_configs.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return role_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } inspectRoleConnectionsCmd = &cobra.Command{ - Use: "role-connections", - Short: "Show number of active connections for all database roles", + Deprecated: `use "role-stats" instead.`, + Use: "role-connections", + Short: "Show number of active connections for all database roles", RunE: func(cmd *cobra.Command, args []string) error { - return role_connections.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) + return role_stats.Run(cmd.Context(), flags.DbConfig, afero.NewOsFs()) }, } @@ -217,17 +249,7 @@ var ( Use: "report", Short: "Generate a CSV output for all inspect commands", RunE: func(cmd *cobra.Command, args []string) error { - ctx := cmd.Context() - if len(outputDir) == 0 { - defaultPath := filepath.Join(utils.CurrentDirAbs, "report") - title := fmt.Sprintf("Enter a directory to save output files (or leave blank to use %s): ", utils.Bold(defaultPath)) - if dir, err := utils.NewConsole().PromptText(ctx, title); err != nil { - return err - } else if len(dir) == 0 { - outputDir = defaultPath - } - } - return inspect.Report(ctx, outputDir, flags.DbConfig, afero.NewOsFs()) + return inspect.Report(cmd.Context(), outputDir, flags.DbConfig, afero.NewOsFs()) }, } ) @@ -238,28 +260,33 @@ func init() { inspectFlags.Bool("linked", true, "Inspect the linked project.") inspectFlags.Bool("local", false, "Inspect the local database.") inspectCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local") - inspectDBCmd.AddCommand(inspectCacheHitCmd) inspectDBCmd.AddCommand(inspectReplicationSlotsCmd) - inspectDBCmd.AddCommand(inspectIndexUsageCmd) + inspectDBCmd.AddCommand(inspectIndexStatsCmd) inspectDBCmd.AddCommand(inspectLocksCmd) inspectDBCmd.AddCommand(inspectBlockingCmd) inspectDBCmd.AddCommand(inspectOutliersCmd) inspectDBCmd.AddCommand(inspectCallsCmd) + inspectDBCmd.AddCommand(inspectLongRunningQueriesCmd) + inspectDBCmd.AddCommand(inspectBloatCmd) + inspectDBCmd.AddCommand(inspectVacuumStatsCmd) + inspectDBCmd.AddCommand(inspectTableStatsCmd) + inspectDBCmd.AddCommand(inspectRoleStatsCmd) + inspectDBCmd.AddCommand(inspectDBStatsCmd) + // DEPRECATED + inspectDBCmd.AddCommand(inspectCacheHitCmd) + inspectDBCmd.AddCommand(inspectIndexUsageCmd) + inspectDBCmd.AddCommand(inspectSeqScansCmd) + inspectDBCmd.AddCommand(inspectUnusedIndexesCmd) + inspectDBCmd.AddCommand(inspectTotalTableSizesCmd) + inspectDBCmd.AddCommand(inspectTableIndexSizesCmd) inspectDBCmd.AddCommand(inspectTotalIndexSizeCmd) inspectDBCmd.AddCommand(inspectIndexSizesCmd) inspectDBCmd.AddCommand(inspectTableSizesCmd) - inspectDBCmd.AddCommand(inspectTableIndexSizesCmd) - inspectDBCmd.AddCommand(inspectTotalTableSizesCmd) - inspectDBCmd.AddCommand(inspectUnusedIndexesCmd) - inspectDBCmd.AddCommand(inspectSeqScansCmd) - inspectDBCmd.AddCommand(inspectLongRunningQueriesCmd) inspectDBCmd.AddCommand(inspectTableRecordCountsCmd) - inspectDBCmd.AddCommand(inspectBloatCmd) - inspectDBCmd.AddCommand(inspectVacuumStatsCmd) inspectDBCmd.AddCommand(inspectRoleConfigsCmd) inspectDBCmd.AddCommand(inspectRoleConnectionsCmd) inspectCmd.AddCommand(inspectDBCmd) - reportCmd.Flags().StringVar(&outputDir, "output-dir", "", "Path to save CSV files in") + reportCmd.Flags().StringVar(&outputDir, "output-dir", ".", "Path to save CSV files in") inspectCmd.AddCommand(reportCmd) rootCmd.AddCommand(inspectCmd) } diff --git a/go.mod b/go.mod index 236ba65ea..25165cd30 100644 --- a/go.mod +++ b/go.mod @@ -29,6 +29,7 @@ require ( github.com/jackc/pgproto3/v2 v2.3.3 github.com/jackc/pgx/v4 v4.18.3 github.com/joho/godotenv v1.5.1 + github.com/mithrandie/csvq-driver v1.7.0 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 github.com/slack-go/slack v0.17.1 @@ -223,6 +224,10 @@ require ( github.com/microcosm-cc/bluemonday v1.0.27 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect + github.com/mithrandie/csvq v1.18.1 // indirect + github.com/mithrandie/go-file/v2 v2.1.0 // indirect + github.com/mithrandie/go-text v1.6.0 // indirect + github.com/mithrandie/ternary v1.1.1 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/sys/atomicwriter v0.1.0 // indirect github.com/moby/sys/sequential v0.6.0 // indirect diff --git a/go.sum b/go.sum index 522289a4b..40b6ea8ee 100644 --- a/go.sum +++ b/go.sum @@ -696,6 +696,16 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mithrandie/csvq v1.18.1 h1:f7NB2scbb7xx2ffPduJ2VtZ85RpWXfvanYskAkGlCBU= +github.com/mithrandie/csvq v1.18.1/go.mod h1:MRJj7AtcXfk7jhNGxLuJGP3LORmh4lpiPWxQ7VyCRn8= +github.com/mithrandie/csvq-driver v1.7.0 h1:ejiavXNWwTPMyr3fJFnhcqd1L1cYudA0foQy9cZrqhw= +github.com/mithrandie/csvq-driver v1.7.0/go.mod h1:HcN3xL9UCJnBYA/AIQOOB/KlyfXAiYr5yxDmiwrGk5o= +github.com/mithrandie/go-file/v2 v2.1.0 h1:XA5Tl+73GXMDvgwSE3Sg0uC5FkLr3hnXs8SpUas0hyg= +github.com/mithrandie/go-file/v2 v2.1.0/go.mod h1:9YtTF3Xo59GqC1Pxw6KyGVcM/qubAMlxVsqI/u9r++c= +github.com/mithrandie/go-text v1.6.0 h1:8gOXTMPbMY8DJbKMTv8kHhADcJlDWXqS/YQH4SyWO6s= +github.com/mithrandie/go-text v1.6.0/go.mod h1:xCgj1xiNbI/d4xA9sLVvXkjh5B2tNx2ZT2/3rpmh8to= +github.com/mithrandie/ternary v1.1.1 h1:k/joD6UGVYxHixYmSR8EGgDFNONBMqyD373xT4QRdC4= +github.com/mithrandie/ternary v1.1.1/go.mod h1:0D9Ba3+09K2TdSZO7/bFCC0GjSXetCvYuYq0u8FY/1g= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= diff --git a/internal/inspect/bloat/bloat.go b/internal/inspect/bloat/bloat.go index 6a97e41c8..a339cd205 100644 --- a/internal/inspect/bloat/bloat.go +++ b/internal/inspect/bloat/bloat.go @@ -19,11 +19,10 @@ import ( var BloatQuery string type Result struct { - Type string - Schemaname string - Object_name string - Bloat string - Waste string + Type string + Name string + Bloat string + Waste string } func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { @@ -41,9 +40,9 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu return err } - table := "|Type|Schema name|Object name|Bloat|Waste\n|-|-|-|-|-|\n" + table := "|Type|Name|Bloat|Waste\n|-|-|-|-|\n" for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|`%s`|`%s`|`%s`|\n", r.Type, r.Schemaname, r.Object_name, r.Bloat, r.Waste) + table += fmt.Sprintf("|`%s`|`%s`|`%s`|`%s`|\n", r.Type, r.Name, r.Bloat, r.Waste) } return list.RenderTable(table) } diff --git a/internal/inspect/bloat/bloat.sql b/internal/inspect/bloat/bloat.sql index 25917d874..06e4234f0 100644 --- a/internal/inspect/bloat/bloat.sql +++ b/internal/inspect/bloat/bloat.sql @@ -25,7 +25,8 @@ WITH constants AS ( (CASE WHEN datahdr%ma=0 THEN ma ELSE datahdr%ma END))+nullhdr2+4))/(bs-20::float)) AS otta FROM bloat_info JOIN pg_class cc ON cc.relname = bloat_info.tablename - JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = bloat_info.schemaname AND nn.nspname <> 'information_schema' + JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = bloat_info.schemaname + WHERE NOT nn.nspname LIKE ANY($1) ), index_bloat AS ( SELECT schemaname, tablename, bs, @@ -33,29 +34,25 @@ WITH constants AS ( COALESCE(CEIL((c2.reltuples*(datahdr-12))/(bs-20::float)),0) AS iotta -- very rough approximation, assumes all cols FROM bloat_info JOIN pg_class cc ON cc.relname = bloat_info.tablename - JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = bloat_info.schemaname AND nn.nspname <> 'information_schema' + JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = bloat_info.schemaname JOIN pg_index i ON indrelid = cc.oid JOIN pg_class c2 ON c2.oid = i.indexrelid -) -SELECT - type, schemaname, object_name, bloat, pg_size_pretty(raw_waste) as waste -FROM -(SELECT - 'table' as type, - schemaname, - tablename as object_name, - ROUND(CASE WHEN otta=0 THEN 0.0 ELSE table_bloat.relpages/otta::numeric END,1) AS bloat, - CASE WHEN relpages < otta THEN '0' ELSE (bs*(table_bloat.relpages-otta)::bigint)::bigint END AS raw_waste -FROM - table_bloat + WHERE NOT nn.nspname LIKE ANY($1) +), bloat_summary AS ( + SELECT + 'table' as type, + FORMAT('%I.%I', schemaname, tablename) AS name, + ROUND(CASE WHEN otta=0 THEN 0.0 ELSE table_bloat.relpages/otta::numeric END,1) AS bloat, + CASE WHEN relpages < otta THEN '0' ELSE (bs*(table_bloat.relpages-otta)::bigint)::bigint END AS raw_waste + FROM table_bloat UNION -SELECT - 'index' as type, - schemaname, - tablename || '::' || iname as object_name, - ROUND(CASE WHEN iotta=0 OR ipages=0 THEN 0.0 ELSE ipages/iotta::numeric END,1) AS bloat, + SELECT + 'index' as type, + FORMAT('%I.%I::%I', schemaname, tablename, iname) AS name, + ROUND(CASE WHEN iotta=0 OR ipages=0 THEN 0.0 ELSE ipages/iotta::numeric END,1) AS bloat, CASE WHEN ipages < iotta THEN '0' ELSE (bs*(ipages-iotta))::bigint END AS raw_waste -FROM - index_bloat) bloat_summary -WHERE NOT schemaname LIKE ANY($1) + FROM index_bloat +) +SELECT type, name, bloat, pg_size_pretty(raw_waste) as waste +FROM bloat_summary ORDER BY raw_waste DESC, bloat DESC diff --git a/internal/inspect/bloat/bloat_test.go b/internal/inspect/bloat/bloat_test.go index 8646565ce..d172e4220 100644 --- a/internal/inspect/bloat/bloat_test.go +++ b/internal/inspect/bloat/bloat_test.go @@ -29,11 +29,10 @@ func TestBloat(t *testing.T) { defer conn.Close(t) conn.Query(BloatQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). Reply("SELECT 1", Result{ - Type: "index hit rate", - Schemaname: "public", - Object_name: "table", - Bloat: "0.9", - Waste: "0.1", + Type: "index hit rate", + Name: "public.table", + Bloat: "0.9", + Waste: "0.1", }) // Run test err := Run(context.Background(), dbConfig, fsys, conn.Intercept) diff --git a/internal/inspect/cache/cache.go b/internal/inspect/cache/cache.go deleted file mode 100644 index 2b7ad5f25..000000000 --- a/internal/inspect/cache/cache.go +++ /dev/null @@ -1,57 +0,0 @@ -package cache - -import ( - "context" - _ "embed" - "fmt" - - "github.com/go-errors/errors" - "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" -) - -//go:embed cache.sql -var CacheQuery string - -type Result struct { - Name string - Ratio float64 -} - -func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - // Ref: https://github.com/heroku/heroku-pg-extras/blob/main/commands/cache_hit.js#L7 - conn, err := utils.ConnectByConfig(ctx, config, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, CacheQuery) - if err != nil { - return errors.Errorf("failed to query rows: %w", err) - } - result, err := pgxv5.CollectRows[Result](rows) - if err != nil { - return err - } - // TODO: implement a markdown table marshaller - table := "|Name|Ratio|OK?|Explanation|\n|-|-|-|-|\n" - for _, r := range result { - ok := "Yup!" - if r.Ratio < 0.94 { - ok = "Maybe not..." - } - var explanation string - switch r.Name { - case "index hit rate": - explanation = "This is the ratio of index hits to index scans. If this ratio is low, it means that the database is not using indexes effectively. Check the `index-usage` command for more info." - case "table hit rate": - explanation = "This is the ratio of table hits to table scans. If this ratio is low, it means that your queries are not finding the data effectively. Check your query performance and it might be worth increasing your compute." - } - table += fmt.Sprintf("|`%s`|`%.6f`|`%s`|`%s`|\n", r.Name, r.Ratio, ok, explanation) - } - return list.RenderTable(table) -} diff --git a/internal/inspect/cache/cache.sql b/internal/inspect/cache/cache.sql deleted file mode 100644 index fc14b288c..000000000 --- a/internal/inspect/cache/cache.sql +++ /dev/null @@ -1,9 +0,0 @@ -SELECT - 'index hit rate' AS name, - (sum(idx_blks_hit)) / nullif(sum(idx_blks_hit + idx_blks_read),0) AS ratio -FROM pg_statio_user_indexes -UNION ALL -SELECT - 'table hit rate' AS name, - sum(heap_blks_hit) / nullif(sum(heap_blks_hit) + sum(heap_blks_read),0) AS ratio -FROM pg_statio_user_tables diff --git a/internal/inspect/cache/cache_test.go b/internal/inspect/cache/cache_test.go deleted file mode 100644 index 28fa1cb73..000000000 --- a/internal/inspect/cache/cache_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package cache - -import ( - "context" - "testing" - - "github.com/jackc/pgconn" - "github.com/spf13/afero" - "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" -) - -var dbConfig = pgconn.Config{ - Host: "127.0.0.1", - Port: 5432, - User: "admin", - Password: "password", - Database: "postgres", -} - -func TestCacheCommand(t *testing.T) { - t.Run("inspects cache hit rate", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(CacheQuery). - Reply("SELECT 1", Result{ - Name: "index hit rate", - Ratio: 0.9, - }) - // Run test - err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error - assert.NoError(t, err) - }) - - t.Run("throws error on empty result", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(CacheQuery). - Reply("SELECT 1", []interface{}{}) - // Run test - err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error - assert.ErrorContains(t, err, "cannot find field Name in returned row") - }) -} diff --git a/internal/inspect/db_stats/db_stats.go b/internal/inspect/db_stats/db_stats.go new file mode 100644 index 000000000..e9ca43f7e --- /dev/null +++ b/internal/inspect/db_stats/db_stats.go @@ -0,0 +1,52 @@ +package db_stats + +import ( + "context" + _ "embed" + "fmt" + + "github.com/go-errors/errors" + "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" +) + +//go:embed db_stats.sql +var DBStatsQuery string + +type Result struct { + Database_size string + Total_index_size string + Total_table_size string + Total_toast_size string + Time_since_stats_reset string + Index_hit_rate string + Table_hit_rate string + WAL_size string +} + +func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { + conn, err := utils.ConnectByConfig(ctx, config, options...) + if err != nil { + return err + } + defer conn.Close(context.Background()) + rows, err := conn.Query(ctx, DBStatsQuery, reset.LikeEscapeSchema(utils.InternalSchemas), config.Database) + if err != nil { + return errors.Errorf("failed to query rows: %w", err) + } + result, err := pgxv5.CollectRows[Result](rows) + if err != nil { + return err + } + + table := "|Name|Database Size|Total Index Size|Total Table Size|Total Toast Size|Time Since Stats Reset|Index Hit Rate|Table Hit Rate|WAL Size|\n|-|-|-|-|-|-|-|-|-|\n" + for _, r := range result { + table += fmt.Sprintf("|`%s`|`%s`|`%s`|`%s`|`%s`|`%s`|`%s`|`%s`|`%s`|\n", config.Database, r.Database_size, r.Total_index_size, r.Total_table_size, r.Total_toast_size, r.Time_since_stats_reset, r.Index_hit_rate, r.Table_hit_rate, r.WAL_size) + } + return list.RenderTable(table) +} diff --git a/internal/inspect/db_stats/db_stats.sql b/internal/inspect/db_stats/db_stats.sql new file mode 100644 index 000000000..d7fc02f98 --- /dev/null +++ b/internal/inspect/db_stats/db_stats.sql @@ -0,0 +1,27 @@ +WITH total_objects AS ( + SELECT c.relkind, pg_size_pretty(SUM(pg_relation_size(c.oid))) AS size + FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE c.relkind IN ('i', 'r', 't') AND NOT n.nspname LIKE ANY($1) + GROUP BY c.relkind +), cache_hit AS ( + SELECT + 'i' AS relkind, + ROUND(SUM(idx_blks_hit)::numeric / nullif(SUM(idx_blks_hit + idx_blks_read), 0), 2) AS ratio + FROM pg_statio_user_indexes + WHERE NOT schemaname LIKE ANY($1) + UNION + SELECT + 't' AS relkind, + ROUND(SUM(heap_blks_hit)::numeric / nullif(SUM(heap_blks_hit + heap_blks_read), 0), 2) AS ratio + FROM pg_statio_user_tables + WHERE NOT schemaname LIKE ANY($1) +) +SELECT + pg_size_pretty(pg_database_size($2)) AS database_size, + (SELECT size FROM total_objects WHERE relkind = 'i') AS total_index_size, + (SELECT size FROM total_objects WHERE relkind = 'r') AS total_table_size, + (SELECT size FROM total_objects WHERE relkind = 't') AS total_toast_size, + (SELECT (now() - stats_reset)::text FROM pg_stat_statements_info) AS time_since_stats_reset, + (SELECT COALESCE(ratio::text, 'N/A') FROM cache_hit WHERE relkind = 'i') AS index_hit_rate, + (SELECT COALESCE(ratio::text, 'N/A') FROM cache_hit WHERE relkind = 't') AS table_hit_rate, + (SELECT pg_size_pretty(SUM(size)) FROM pg_ls_waldir()) AS wal_size diff --git a/internal/inspect/total_index_size/total_index_size_test.go b/internal/inspect/db_stats/db_stats_test.go similarity index 63% rename from internal/inspect/total_index_size/total_index_size_test.go rename to internal/inspect/db_stats/db_stats_test.go index 8eb0e0aa9..46b22efc8 100644 --- a/internal/inspect/total_index_size/total_index_size_test.go +++ b/internal/inspect/db_stats/db_stats_test.go @@ -1,4 +1,4 @@ -package total_index_size +package db_stats import ( "context" @@ -20,16 +20,23 @@ var dbConfig = pgconn.Config{ Database: "postgres", } -func TestTotalIndexSizeCommand(t *testing.T) { +func TestDBStatsCommand(t *testing.T) { t.Run("inspects size of all indexes", func(t *testing.T) { // Setup in-memory fs fsys := afero.NewMemMapFs() // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(TotalIndexSizeQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). + conn.Query(DBStatsQuery, reset.LikeEscapeSchema(utils.InternalSchemas), dbConfig.Database). Reply("SELECT 1", Result{ - Size: "8GB", + Database_size: "8GB", + Total_index_size: "8GB", + Total_table_size: "8GB", + Total_toast_size: "8GB", + Time_since_stats_reset: "8GB", + Index_hit_rate: "0.89", + Table_hit_rate: "0.98", + WAL_size: "8GB", }) // Run test err := Run(context.Background(), dbConfig, fsys, conn.Intercept) diff --git a/internal/inspect/index_sizes/index_sizes.sql b/internal/inspect/index_sizes/index_sizes.sql deleted file mode 100644 index 25b6f96d5..000000000 --- a/internal/inspect/index_sizes/index_sizes.sql +++ /dev/null @@ -1,9 +0,0 @@ -SELECT - n.nspname || '.' || c.relname AS name, - pg_size_pretty(sum(c.relpages::bigint*8192)::bigint) AS size -FROM pg_class c -LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace) -WHERE NOT n.nspname LIKE ANY($1) -AND c.relkind = 'i' -GROUP BY n.nspname, c.relname -ORDER BY sum(c.relpages) DESC diff --git a/internal/inspect/index_sizes/index_sizes.go b/internal/inspect/index_stats/index_stats.go similarity index 64% rename from internal/inspect/index_sizes/index_sizes.go rename to internal/inspect/index_stats/index_stats.go index 2cfc06e8d..8f781c688 100644 --- a/internal/inspect/index_sizes/index_sizes.go +++ b/internal/inspect/index_stats/index_stats.go @@ -1,4 +1,4 @@ -package index_sizes +package index_stats import ( "context" @@ -15,12 +15,16 @@ import ( "github.com/supabase/cli/pkg/pgxv5" ) -//go:embed index_sizes.sql -var IndexSizesQuery string +//go:embed index_stats.sql +var IndexStatsQuery string type Result struct { - Name string - Size string + Name string + Size string + Percent_used string + Index_scans int64 + Seq_scans int64 + Unused bool } func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { @@ -29,7 +33,7 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu return err } defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, IndexSizesQuery, reset.LikeEscapeSchema(utils.InternalSchemas)) + rows, err := conn.Query(ctx, IndexStatsQuery, reset.LikeEscapeSchema(utils.InternalSchemas)) if err != nil { return errors.Errorf("failed to query rows: %w", err) } @@ -38,9 +42,9 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu return err } - table := "|Name|size|\n|-|-|\n" + table := "|Name|Size|Percent used|Index scans|Seq scans|Unused|\n|-|-|-|-|-|-|\n" for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|\n", r.Name, r.Size) + table += fmt.Sprintf("|`%s`|`%s`|`%s`|`%d`|`%d`|`%t`|\n", r.Name, r.Size, r.Percent_used, r.Index_scans, r.Seq_scans, r.Unused) } return list.RenderTable(table) } diff --git a/internal/inspect/index_stats/index_stats.sql b/internal/inspect/index_stats/index_stats.sql new file mode 100644 index 000000000..c8d33e95d --- /dev/null +++ b/internal/inspect/index_stats/index_stats.sql @@ -0,0 +1,49 @@ +-- Combined index statistics: size, usage percent, seq scans, and mark unused +WITH idx_sizes AS ( + SELECT + i.indexrelid AS oid, + FORMAT('%I.%I', n.nspname, c.relname) AS name, + pg_relation_size(i.indexrelid) AS index_size_bytes + FROM pg_stat_user_indexes ui + JOIN pg_index i ON ui.indexrelid = i.indexrelid + JOIN pg_class c ON ui.indexrelid = c.oid + JOIN pg_namespace n ON c.relnamespace = n.oid + WHERE NOT n.nspname LIKE ANY($1) +), +idx_usage AS ( + SELECT + indexrelid AS oid, + idx_scan::bigint AS idx_scans + FROM pg_stat_user_indexes ui + WHERE NOT schemaname LIKE ANY($1) +), +seq_usage AS ( + SELECT + relid AS oid, + seq_scan::bigint AS seq_scans + FROM pg_stat_user_tables + WHERE NOT schemaname LIKE ANY($1) +), +usage_pct AS ( + SELECT + u.oid, + CASE + WHEN u.idx_scans IS NULL OR u.idx_scans = 0 THEN 0 + WHEN s.seq_scans IS NULL THEN 100 + ELSE ROUND(100.0 * u.idx_scans / (s.seq_scans + u.idx_scans), 1) + END AS percent_used + FROM idx_usage u + LEFT JOIN seq_usage s ON s.oid = u.oid +) +SELECT + s.name, + pg_size_pretty(s.index_size_bytes) AS size, + COALESCE(up.percent_used, 0)::text || '%' AS percent_used, + COALESCE(u.idx_scans, 0) AS index_scans, + COALESCE(sq.seq_scans, 0) AS seq_scans, + CASE WHEN COALESCE(u.idx_scans, 0) = 0 THEN true ELSE false END AS unused +FROM idx_sizes s +LEFT JOIN idx_usage u ON u.oid = s.oid +LEFT JOIN seq_usage sq ON sq.oid = s.oid +LEFT JOIN usage_pct up ON up.oid = s.oid +ORDER BY s.index_size_bytes DESC diff --git a/internal/inspect/index_sizes/index_sizes_test.go b/internal/inspect/index_stats/index_stats_test.go similarity index 63% rename from internal/inspect/index_sizes/index_sizes_test.go rename to internal/inspect/index_stats/index_stats_test.go index 9071c5710..abc3cd654 100644 --- a/internal/inspect/index_sizes/index_sizes_test.go +++ b/internal/inspect/index_stats/index_stats_test.go @@ -1,4 +1,4 @@ -package index_sizes +package index_stats import ( "context" @@ -20,21 +20,24 @@ var dbConfig = pgconn.Config{ Database: "postgres", } -func TestIndexSizes(t *testing.T) { - t.Run("inspects index sizes", func(t *testing.T) { - // Setup in-memory fs +func TestIndexStatsCommand(t *testing.T) { + t.Run("inspects index stats", func(t *testing.T) { fsys := afero.NewMemMapFs() - // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(IndexSizesQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). + + // Mock index stats + conn.Query(IndexStatsQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). Reply("SELECT 1", Result{ - Name: "test_table_idx", - Size: "100GB", + Name: "public.test_idx", + Size: "1GB", + Percent_used: "50%", + Index_scans: 5, + Seq_scans: 5, + Unused: false, }) - // Run test + err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error assert.NoError(t, err) }) } diff --git a/internal/inspect/index_usage/index_usage.sql b/internal/inspect/index_usage/index_usage.sql deleted file mode 100644 index fa83e97db..000000000 --- a/internal/inspect/index_usage/index_usage.sql +++ /dev/null @@ -1,17 +0,0 @@ -SELECT - schemaname || '.' || relname AS name, - CASE - WHEN idx_scan IS NULL THEN 'Insufficient data' - WHEN idx_scan = 0 THEN 'Insufficient data' - ELSE ROUND(100.0 * idx_scan / (seq_scan + idx_scan), 1) || '%' - END percent_of_times_index_used, - n_live_tup rows_in_table -FROM pg_stat_user_tables -WHERE NOT schemaname LIKE ANY($1) -ORDER BY - CASE - WHEN idx_scan is null then 1 - WHEN idx_scan = 0 then 1 - ELSE 0 - END, - n_live_tup DESC diff --git a/internal/inspect/locks/locks.go b/internal/inspect/locks/locks.go index 0b2db71c6..be5c34d3a 100644 --- a/internal/inspect/locks/locks.go +++ b/internal/inspect/locks/locks.go @@ -23,7 +23,7 @@ type Result struct { Relname string Transactionid string Granted bool - Query string + Stmt string Age string } @@ -42,16 +42,16 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu return err } - table := "|pid|relname|transaction id|granted|query|age|\n|-|-|-|-|-|-|\n" + table := "|pid|relname|transaction id|granted|stmt|age|\n|-|-|-|-|-|-|\n" for _, r := range result { // remove whitespace from query re := regexp.MustCompile(`\s+|\r+|\n+|\t+|\v`) - query := re.ReplaceAllString(r.Query, " ") + stmt := re.ReplaceAllString(r.Stmt, " ") // escape pipes in query re = regexp.MustCompile(`\|`) - query = re.ReplaceAllString(query, `\|`) - table += fmt.Sprintf("|`%d`|`%s`|`%s`|`%t`|%s|`%s`|\n", r.Pid, r.Relname, r.Transactionid, r.Granted, query, r.Age) + stmt = re.ReplaceAllString(stmt, `\|`) + table += fmt.Sprintf("|`%d`|`%s`|`%s`|`%t`|%s|`%s`|\n", r.Pid, r.Relname, r.Transactionid, r.Granted, stmt, r.Age) } return list.RenderTable(table) } diff --git a/internal/inspect/locks/locks.sql b/internal/inspect/locks/locks.sql index e140f4786..9369057b5 100644 --- a/internal/inspect/locks/locks.sql +++ b/internal/inspect/locks/locks.sql @@ -1,9 +1,9 @@ SELECT pg_stat_activity.pid, COALESCE(pg_class.relname, 'null') AS relname, - COALESCE(pg_locks.transactionid, 'null') AS transactionid, + COALESCE(pg_locks.transactionid::text, 'null') AS transactionid, pg_locks.granted, - pg_stat_activity.query, + pg_stat_activity.query AS stmt, age(now(), pg_stat_activity.query_start)::text AS age FROM pg_stat_activity, pg_locks LEFT OUTER JOIN pg_class ON (pg_locks.relation = pg_class.oid) WHERE pg_stat_activity.query <> '' diff --git a/internal/inspect/locks/locks_test.go b/internal/inspect/locks/locks_test.go index e4c55c6bd..0964ad122 100644 --- a/internal/inspect/locks/locks_test.go +++ b/internal/inspect/locks/locks_test.go @@ -31,7 +31,7 @@ func TestLocksCommand(t *testing.T) { Relname: "rel", Transactionid: "9301", Granted: true, - Query: "select 1", + Stmt: "select 1", Age: "300ms", }) // Run test diff --git a/internal/inspect/report.go b/internal/inspect/report.go index de721d954..e69e792b1 100644 --- a/internal/inspect/report.go +++ b/internal/inspect/report.go @@ -2,6 +2,7 @@ package inspect import ( "context" + "database/sql" "embed" "fmt" "io/fs" @@ -10,20 +11,26 @@ import ( "strings" "time" + "github.com/BurntSushi/toml" "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" + _ "github.com/mithrandie/csvq-driver" "github.com/spf13/afero" "github.com/supabase/cli/internal/db/reset" + "github.com/supabase/cli/internal/migration/list" "github.com/supabase/cli/internal/utils" ) //go:embed **/*.sql var queries embed.FS -func Report(ctx context.Context, out string, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - date := time.Now().Format("2006-01-02") - if err := utils.MkdirIfNotExistFS(fsys, out); err != nil { +func Report(ctx context.Context, outDir string, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { + outDir = filepath.Join(outDir, time.Now().Format("2006-01-02")) + if !filepath.IsAbs(outDir) { + outDir = filepath.Join(utils.CurrentDirAbs, outDir) + } + if err := utils.MkdirIfNotExistFS(fsys, outDir); err != nil { return err } conn, err := utils.ConnectByConfig(ctx, config, options...) @@ -44,19 +51,18 @@ func Report(ctx context.Context, out string, config pgconn.Config, fsys afero.Fs return errors.Errorf("failed to read query: %w", err) } name := strings.Split(d.Name(), ".")[0] - outPath := filepath.Join(out, fmt.Sprintf("%s_%s.csv", name, date)) - return copyToCSV(ctx, string(query), outPath, conn.PgConn(), fsys) + outPath := filepath.Join(outDir, fmt.Sprintf("%s.csv", name)) + return copyToCSV(ctx, string(query), config.Database, outPath, conn.PgConn(), fsys) }); err != nil { return err } - if !filepath.IsAbs(out) { - out, _ = filepath.Abs(out) - } - fmt.Fprintln(os.Stderr, "Reports saved to "+utils.Bold(out)) - return nil + fmt.Fprintln(os.Stderr, "Reports saved to "+utils.Bold(outDir)) + return printSummary(ctx, outDir) } -func copyToCSV(ctx context.Context, query, outPath string, conn *pgconn.PgConn, fsys afero.Fs) error { +var ignoreSchemas = fmt.Sprintf("'{%s}'::text[]", strings.Join(reset.LikeEscapeSchema(utils.InternalSchemas), ",")) + +func copyToCSV(ctx context.Context, query, database, outPath string, conn *pgconn.PgConn, fsys afero.Fs) error { // Create output file f, err := fsys.OpenFile(outPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { @@ -64,16 +70,56 @@ func copyToCSV(ctx context.Context, query, outPath string, conn *pgconn.PgConn, } defer f.Close() // Execute query - csvQuery := wrapQuery(query) + csvQuery := wrapQuery(query, ignoreSchemas, fmt.Sprintf("'%s'", database)) if _, err = conn.CopyTo(ctx, f, csvQuery); err != nil { return errors.Errorf("failed to copy output: %w", err) } return nil } -var ignoreSchemas = fmt.Sprintf("'{%s}'::text[]", strings.Join(reset.LikeEscapeSchema(utils.InternalSchemas), ",")) +func wrapQuery(query string, args ...string) string { + for i, v := range args { + query = strings.ReplaceAll(query, fmt.Sprintf("$%d", i+1), v) + } + return fmt.Sprintf("COPY (%s) TO STDOUT WITH CSV HEADER", query) +} + +//go:embed templates/rules.toml +var rulesConfig embed.FS -func wrapQuery(query string) string { - fullQuery := strings.ReplaceAll(query, "$1", ignoreSchemas) - return fmt.Sprintf("COPY (%s) TO STDOUT WITH CSV HEADER", fullQuery) +func printSummary(ctx context.Context, outDir string) error { + if len(utils.Config.Experimental.Inspect.Rules) == 0 { + fmt.Fprintln(os.Stderr, "Loading default rules...") + if _, err := toml.DecodeFS(rulesConfig, "templates/rules.toml", &utils.Config.Experimental.Inspect); err != nil { + return errors.Errorf("failed load default rules: %w", err) + } + } + // Open csvq database rooted at the output directory + db, err := sql.Open("csvq", outDir) + if err != nil { + return err + } + defer db.Close() + // Build report summary table + table := "RULE|STATUS|MATCHES\n|-|-|-|\n" + for _, r := range utils.Config.Experimental.Inspect.Rules { + row := db.QueryRowContext(ctx, r.Query) + // find matching rule + var status string + var match sql.NullString + if err := row.Scan(&match); errors.Is(err, sql.ErrNoRows) { + status = r.Pass + } else if err != nil { + status = err.Error() + } else if !match.Valid || match.String == "" { + status = r.Pass + } else { + status = r.Fail + } + if !match.Valid { + match.String = "-" + } + table += fmt.Sprintf("|`%s`|`%s`|`%s`|\n", r.Name, status, match.String) + } + return list.RenderTable(table) } diff --git a/internal/inspect/report_test.go b/internal/inspect/report_test.go index 6b4220451..dd0b61d09 100644 --- a/internal/inspect/report_test.go +++ b/internal/inspect/report_test.go @@ -3,31 +3,13 @@ package inspect import ( "context" "fmt" + "io/fs" "testing" "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/stretchr/testify/require" "github.com/supabase/cli/pkg/pgtest" ) @@ -41,58 +23,25 @@ var dbConfig = pgconn.Config{ func TestReportCommand(t *testing.T) { t.Run("runs all queries", func(t *testing.T) { - // Setup in-memory fs fsys := afero.NewMemMapFs() // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(wrapQuery(bloat.BloatQuery)). - Reply("COPY 0"). - Query(wrapQuery(blocking.BlockingQuery)). - Reply("COPY 0"). - Query(wrapQuery(cache.CacheQuery)). - Reply("COPY 0"). - Query(wrapQuery(calls.CallsQuery)). - Reply("COPY 0"). - Query(wrapQuery(index_sizes.IndexSizesQuery)). - Reply("COPY 0"). - Query(wrapQuery(index_usage.IndexUsageQuery)). - Reply("COPY 0"). - Query(wrapQuery(locks.LocksQuery)). - Reply("COPY 0"). - Query(wrapQuery(long_running_queries.LongRunningQueriesQuery)). - Reply("COPY 0"). - Query(wrapQuery(outliers.OutliersQuery)). - Reply("COPY 0"). - Query(wrapQuery(replication_slots.ReplicationSlotsQuery)). - Reply("COPY 0"). - Query(wrapQuery(role_configs.RoleConfigsQuery)). - Reply("COPY 0"). - Query(wrapQuery(role_connections.RoleConnectionsQuery)). - Reply("COPY 0"). - Query(wrapQuery(seq_scans.SeqScansQuery)). - Reply("COPY 0"). - Query(wrapQuery(table_index_sizes.TableIndexSizesQuery)). - Reply("COPY 0"). - Query(wrapQuery(table_record_counts.TableRecordCountsQuery)). - Reply("COPY 0"). - Query(wrapQuery(table_sizes.TableSizesQuery)). - Reply("COPY 0"). - Query(wrapQuery(total_index_size.TotalIndexSizeQuery)). - Reply("COPY 0"). - Query(wrapQuery(total_table_sizes.TotalTableSizesQuery)). - Reply("COPY 0"). - Query(wrapQuery(unused_indexes.UnusedIndexesQuery)). - Reply("COPY 0"). - Query(wrapQuery(vacuum_stats.VacuumStatsQuery)). - Reply("COPY 0") + // Iterate over all embedded SQL files + sqlPaths, err := fs.Glob(queries, "*/*.sql") + require.NoError(t, err) + for _, fp := range sqlPaths { + data, err := queries.ReadFile(fp) + require.NoError(t, err) + sql := wrapQuery(string(data), ignoreSchemas, fmt.Sprintf("'%s'", dbConfig.Database)) + conn.Query(sql).Reply("COPY 0") + } // Run test - err := Report(context.Background(), ".", dbConfig, fsys, conn.Intercept) - // Check error + err = Report(context.Background(), ".", dbConfig, fsys, conn.Intercept) assert.NoError(t, err) - matches, err := afero.Glob(fsys, "*.csv") + matches, err := afero.Glob(fsys, "*/*.csv") assert.NoError(t, err) - assert.Len(t, matches, 20) + assert.Len(t, matches, len(sqlPaths)) }) } @@ -107,7 +56,7 @@ func TestWrapQuery(t *testing.T) { t.Run("replaces placeholder value", func(t *testing.T) { assert.Equal(t, fmt.Sprintf("COPY (SELECT 'a' LIKE ANY(%s)) TO STDOUT WITH CSV HEADER", ignoreSchemas), - wrapQuery("SELECT 'a' LIKE ANY($1)"), + wrapQuery("SELECT 'a' LIKE ANY($1)", ignoreSchemas), ) }) } diff --git a/internal/inspect/role_configs/role_configs.sql b/internal/inspect/role_configs/role_configs.sql deleted file mode 100644 index fd7f964d0..000000000 --- a/internal/inspect/role_configs/role_configs.sql +++ /dev/null @@ -1,5 +0,0 @@ -select - rolname as role_name, - array_to_string(rolconfig, ',', '*') as custom_config -from - pg_roles where rolconfig is not null diff --git a/internal/inspect/role_configs/role_configs_test.go b/internal/inspect/role_configs/role_configs_test.go deleted file mode 100644 index 554a12526..000000000 --- a/internal/inspect/role_configs/role_configs_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package role_configs - -import ( - "context" - "testing" - - "github.com/jackc/pgconn" - "github.com/spf13/afero" - "github.com/stretchr/testify/assert" - "github.com/supabase/cli/pkg/pgtest" -) - -var dbConfig = pgconn.Config{ - Host: "127.0.0.1", - Port: 5432, - User: "admin", - Password: "password", - Database: "postgres", -} - -func TestRoleCommand(t *testing.T) { - t.Run("inspects role connections", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(RoleConfigsQuery). - Reply("SELECT 1", Result{ - Role_name: "postgres", - Custom_config: "statement_timeout=3s", - }) - // Run test - err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error - assert.NoError(t, err) - }) -} diff --git a/internal/inspect/role_connections/role_connections.go b/internal/inspect/role_connections/role_connections.go deleted file mode 100644 index 5b0a56539..000000000 --- a/internal/inspect/role_connections/role_connections.go +++ /dev/null @@ -1,62 +0,0 @@ -package role_connections - -import ( - "context" - _ "embed" - "fmt" - - "github.com/go-errors/errors" - "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" -) - -//go:embed role_connections.sql -var RoleConnectionsQuery string - -type Result struct { - Rolname string - Active_connections int - Connection_limit int -} - -func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - conn, err := utils.ConnectByConfig(ctx, config, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, RoleConnectionsQuery) - if err != nil { - return errors.Errorf("failed to query rows: %w", err) - } - result, err := pgxv5.CollectRows[Result](rows) - if err != nil { - return err - } - - table := "|Role Name|Active connction|\n|-|-|\n" - sum := 0 - for _, r := range result { - table += fmt.Sprintf("|`%s`|`%d`|\n", r.Rolname, r.Active_connections) - sum += r.Active_connections - } - - if err := list.RenderTable(table); err != nil { - return err - } - - if len(result) > 0 { - fmt.Printf("\nActive connections %d/%d\n\n", sum, result[0].Connection_limit) - } - - if matches := utils.ProjectHostPattern.FindStringSubmatch(config.Host); len(matches) == 4 { - fmt.Println("Go to the dashboard for more here:") - fmt.Printf("https://app.supabase.com/project/%s/database/roles\n", matches[2]) - } - - return nil -} diff --git a/internal/inspect/role_configs/role_configs.go b/internal/inspect/role_stats/role_stats.go similarity index 64% rename from internal/inspect/role_configs/role_configs.go rename to internal/inspect/role_stats/role_stats.go index f4fb79382..ee5e724f2 100644 --- a/internal/inspect/role_configs/role_configs.go +++ b/internal/inspect/role_stats/role_stats.go @@ -1,4 +1,4 @@ -package role_configs +package role_stats import ( "context" @@ -14,12 +14,14 @@ import ( "github.com/supabase/cli/pkg/pgxv5" ) -//go:embed role_configs.sql -var RoleConfigsQuery string +//go:embed role_stats.sql +var RoleStatsQuery string type Result struct { - Role_name string - Custom_config string + Role_name string + Active_connections int + Connection_limit int + Custom_config string } func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { @@ -28,7 +30,7 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu return err } defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, RoleConfigsQuery) + rows, err := conn.Query(ctx, RoleStatsQuery) if err != nil { return errors.Errorf("failed to query rows: %w", err) } @@ -37,9 +39,9 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu return err } - table := "|Role name|Custom config|\n|-|-|\n" + table := "|Role name|Active connections|Connection limit|Custom config|\n|-|-|-|-|\n" for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|\n", r.Role_name, r.Custom_config) + table += fmt.Sprintf("|`%s`|`%d`|`%d`|`%s`|\n", r.Role_name, r.Active_connections, r.Connection_limit, r.Custom_config) } return list.RenderTable(table) diff --git a/internal/inspect/role_connections/role_connections.sql b/internal/inspect/role_stats/role_stats.sql similarity index 64% rename from internal/inspect/role_connections/role_connections.sql rename to internal/inspect/role_stats/role_stats.sql index 40b103669..92f32c9e5 100644 --- a/internal/inspect/role_connections/role_connections.sql +++ b/internal/inspect/role_stats/role_stats.sql @@ -1,5 +1,5 @@ SELECT - rolname, + rolname as role_name, ( SELECT count(*) @@ -11,6 +11,8 @@ SELECT CASE WHEN rolconnlimit = -1 THEN current_setting('max_connections')::int8 ELSE rolconnlimit - END AS connection_limit -FROM pg_roles -ORDER BY 2 DESC + END AS connection_limit, + array_to_string(rolconfig, ',', '*') as custom_config +FROM + pg_roles +ORDER BY 1 DESC diff --git a/internal/inspect/role_connections/role_connections_test.go b/internal/inspect/role_stats/role_stats_test.go similarity index 84% rename from internal/inspect/role_connections/role_connections_test.go rename to internal/inspect/role_stats/role_stats_test.go index 32ecab768..0539c594f 100644 --- a/internal/inspect/role_connections/role_connections_test.go +++ b/internal/inspect/role_stats/role_stats_test.go @@ -1,4 +1,4 @@ -package role_connections +package role_stats import ( "context" @@ -25,9 +25,10 @@ func TestRoleCommand(t *testing.T) { // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(RoleConnectionsQuery). + conn.Query(RoleStatsQuery). Reply("SELECT 1", Result{ - Rolname: "postgres", + Role_name: "postgres", + Custom_config: "statement_timeout=3s", Active_connections: 1, Connection_limit: 10, }) diff --git a/internal/inspect/seq_scans/seq_scans.go b/internal/inspect/seq_scans/seq_scans.go deleted file mode 100644 index 6b52538ee..000000000 --- a/internal/inspect/seq_scans/seq_scans.go +++ /dev/null @@ -1,46 +0,0 @@ -package seq_scans - -import ( - "context" - _ "embed" - "fmt" - - "github.com/go-errors/errors" - "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" -) - -//go:embed seq_scans.sql -var SeqScansQuery string - -type Result struct { - Name string - Count int64 -} - -func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - conn, err := utils.ConnectByConfig(ctx, config, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, SeqScansQuery, reset.LikeEscapeSchema(utils.InternalSchemas)) - if err != nil { - return errors.Errorf("failed to query rows: %w", err) - } - result, err := pgxv5.CollectRows[Result](rows) - if err != nil { - return err - } - - table := "|Name|Count|\n|-|-|\n" - for _, r := range result { - table += fmt.Sprintf("|`%s`|`%d`|\n", r.Name, r.Count) - } - return list.RenderTable(table) -} diff --git a/internal/inspect/seq_scans/seq_scans.sql b/internal/inspect/seq_scans/seq_scans.sql deleted file mode 100644 index c8edfc8e3..000000000 --- a/internal/inspect/seq_scans/seq_scans.sql +++ /dev/null @@ -1,6 +0,0 @@ -SELECT - schemaname || '.' || relname AS name, - seq_scan as count -FROM pg_stat_user_tables -WHERE NOT schemaname LIKE ANY($1) -ORDER BY seq_scan DESC diff --git a/internal/inspect/seq_scans/seq_scans_test.go b/internal/inspect/seq_scans/seq_scans_test.go deleted file mode 100644 index 3db6caee5..000000000 --- a/internal/inspect/seq_scans/seq_scans_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package seq_scans - -import ( - "context" - "testing" - - "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" -) - -var dbConfig = pgconn.Config{ - Host: "127.0.0.1", - Port: 5432, - User: "admin", - Password: "password", - Database: "postgres", -} - -func TestSequentialScansCommand(t *testing.T) { - t.Run("inspects sequential scans", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(SeqScansQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). - Reply("SELECT 1", Result{ - Name: "test_table", - Count: 99999, - }) - // Run test - err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error - assert.NoError(t, err) - }) -} diff --git a/internal/inspect/table_index_sizes/table_index_sizes.go b/internal/inspect/table_index_sizes/table_index_sizes.go deleted file mode 100644 index e61f23361..000000000 --- a/internal/inspect/table_index_sizes/table_index_sizes.go +++ /dev/null @@ -1,46 +0,0 @@ -package table_index_sizes - -import ( - "context" - _ "embed" - "fmt" - - "github.com/go-errors/errors" - "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" -) - -//go:embed table_index_sizes.sql -var TableIndexSizesQuery string - -type Result struct { - Table string - Index_size string -} - -func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - conn, err := utils.ConnectByConfig(ctx, config, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, TableIndexSizesQuery, reset.LikeEscapeSchema(utils.InternalSchemas)) - if err != nil { - return errors.Errorf("failed to query rows: %w", err) - } - result, err := pgxv5.CollectRows[Result](rows) - if err != nil { - return err - } - - table := "|Table|Index size|\n|-|-|\n" - for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|\n", r.Table, r.Index_size) - } - return list.RenderTable(table) -} diff --git a/internal/inspect/table_index_sizes/table_index_sizes.sql b/internal/inspect/table_index_sizes/table_index_sizes.sql deleted file mode 100644 index 0c9bc6bfc..000000000 --- a/internal/inspect/table_index_sizes/table_index_sizes.sql +++ /dev/null @@ -1,8 +0,0 @@ -SELECT - n.nspname || '.' || c.relname AS table, - pg_size_pretty(pg_indexes_size(c.oid)) AS index_size -FROM pg_class c -LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace) -WHERE NOT n.nspname LIKE ANY($1) -AND c.relkind = 'r' -ORDER BY pg_indexes_size(c.oid) DESC diff --git a/internal/inspect/table_index_sizes/table_index_sizes_test.go b/internal/inspect/table_index_sizes/table_index_sizes_test.go deleted file mode 100644 index 20ad80fc9..000000000 --- a/internal/inspect/table_index_sizes/table_index_sizes_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package table_index_sizes - -import ( - "context" - "testing" - - "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" -) - -var dbConfig = pgconn.Config{ - Host: "127.0.0.1", - Port: 5432, - User: "admin", - Password: "password", - Database: "postgres", -} - -func TestTableIndexSizesCommand(t *testing.T) { - t.Run("inspects table index sizes", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(TableIndexSizesQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). - Reply("SELECT 1", Result{ - Table: "public.test_table", - Index_size: "3GB", - }) - // Run test - err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error - assert.NoError(t, err) - }) -} diff --git a/internal/inspect/table_record_counts/table_record_counts.go b/internal/inspect/table_record_counts/table_record_counts.go deleted file mode 100644 index e0b394374..000000000 --- a/internal/inspect/table_record_counts/table_record_counts.go +++ /dev/null @@ -1,47 +0,0 @@ -package table_record_counts - -import ( - "context" - _ "embed" - "fmt" - - "github.com/go-errors/errors" - "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" -) - -//go:embed table_record_counts.sql -var TableRecordCountsQuery string - -type Result struct { - Schema string - Name string - Estimated_count int64 -} - -func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - conn, err := utils.ConnectByConfig(ctx, config, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, TableRecordCountsQuery, reset.LikeEscapeSchema(utils.PgSchemas)) - if err != nil { - return errors.Errorf("failed to query rows: %w", err) - } - result, err := pgxv5.CollectRows[Result](rows) - if err != nil { - return err - } - - table := "Schema|Table|Estimated count|\n|-|-|-|\n" - for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|`%d`|\n", r.Schema, r.Name, r.Estimated_count) - } - return list.RenderTable(table) -} diff --git a/internal/inspect/table_record_counts/table_record_counts.sql b/internal/inspect/table_record_counts/table_record_counts.sql deleted file mode 100644 index 1b24f04a4..000000000 --- a/internal/inspect/table_record_counts/table_record_counts.sql +++ /dev/null @@ -1,7 +0,0 @@ -SELECT - schemaname AS schema, - relname AS name, - n_live_tup AS estimated_count -FROM pg_stat_user_tables -WHERE NOT schemaname LIKE ANY($1) -ORDER BY n_live_tup DESC diff --git a/internal/inspect/table_record_counts/table_record_counts_test.go b/internal/inspect/table_record_counts/table_record_counts_test.go deleted file mode 100644 index a03714d97..000000000 --- a/internal/inspect/table_record_counts/table_record_counts_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package table_record_counts - -import ( - "context" - "testing" - - "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" -) - -var dbConfig = pgconn.Config{ - Host: "127.0.0.1", - Port: 5432, - User: "admin", - Password: "password", - Database: "postgres", -} - -func TestTableRecordCountsCommand(t *testing.T) { - t.Run("inspects table record counts", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(TableRecordCountsQuery, reset.LikeEscapeSchema(utils.PgSchemas)). - Reply("SELECT 1", Result{ - Schema: "public", - Name: "test_table", - Estimated_count: 100, - }) - // Run test - err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error - assert.NoError(t, err) - }) -} diff --git a/internal/inspect/table_sizes/table_sizes.go b/internal/inspect/table_sizes/table_sizes.go deleted file mode 100644 index 7741f0119..000000000 --- a/internal/inspect/table_sizes/table_sizes.go +++ /dev/null @@ -1,47 +0,0 @@ -package table_sizes - -import ( - "context" - _ "embed" - "fmt" - - "github.com/go-errors/errors" - "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" -) - -//go:embed table_sizes.sql -var TableSizesQuery string - -type Result struct { - Schema string - Name string - Size string -} - -func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - conn, err := utils.ConnectByConfig(ctx, config, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, TableSizesQuery, reset.LikeEscapeSchema(utils.PgSchemas)) - if err != nil { - return errors.Errorf("failed to query rows: %w", err) - } - result, err := pgxv5.CollectRows[Result](rows) - if err != nil { - return err - } - - table := "Schema|Table|size|\n|-|-|-|\n" - for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|`%s`|\n", r.Schema, r.Name, r.Size) - } - return list.RenderTable(table) -} diff --git a/internal/inspect/table_sizes/table_sizes.sql b/internal/inspect/table_sizes/table_sizes.sql deleted file mode 100644 index 2c8fb3064..000000000 --- a/internal/inspect/table_sizes/table_sizes.sql +++ /dev/null @@ -1,9 +0,0 @@ -SELECT - n.nspname AS schema, - c.relname AS name, - pg_size_pretty(pg_table_size(c.oid)) AS size -FROM pg_class c -LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace) -WHERE NOT n.nspname LIKE ANY($1) -AND c.relkind = 'r' -ORDER BY pg_table_size(c.oid) DESC diff --git a/internal/inspect/table_sizes/table_sizes_test.go b/internal/inspect/table_sizes/table_sizes_test.go deleted file mode 100644 index 5cc6426ad..000000000 --- a/internal/inspect/table_sizes/table_sizes_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package table_sizes - -import ( - "context" - "testing" - - "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" -) - -var dbConfig = pgconn.Config{ - Host: "127.0.0.1", - Port: 5432, - User: "admin", - Password: "password", - Database: "postgres", -} - -func TestTableSizesCommand(t *testing.T) { - t.Run("inspects table sizes", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(TableSizesQuery, reset.LikeEscapeSchema(utils.PgSchemas)). - Reply("SELECT 1", Result{ - Schema: "schema", - Name: "test_table", - Size: "3GB", - }) - // Run test - err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error - assert.NoError(t, err) - }) -} diff --git a/internal/inspect/index_usage/index_usage.go b/internal/inspect/table_stats/table_stats.go similarity index 60% rename from internal/inspect/index_usage/index_usage.go rename to internal/inspect/table_stats/table_stats.go index cd8875f79..afc3b193b 100644 --- a/internal/inspect/index_usage/index_usage.go +++ b/internal/inspect/table_stats/table_stats.go @@ -1,4 +1,4 @@ -package index_usage +package table_stats import ( "context" @@ -15,13 +15,16 @@ import ( "github.com/supabase/cli/pkg/pgxv5" ) -//go:embed index_usage.sql -var IndexUsageQuery string +//go:embed table_stats.sql +var TableStatsQuery string type Result struct { - Name string - Percent_of_times_index_used string - Rows_in_table int64 + Name string + Table_size string + Index_size string + Total_size string + Estimated_row_count int64 + Seq_scans int64 } func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { @@ -30,7 +33,7 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu return err } defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, IndexUsageQuery, reset.LikeEscapeSchema(utils.InternalSchemas)) + rows, err := conn.Query(ctx, TableStatsQuery, reset.LikeEscapeSchema(utils.InternalSchemas)) if err != nil { return errors.Errorf("failed to query rows: %w", err) } @@ -38,10 +41,10 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu if err != nil { return err } - // TODO: implement a markdown table marshaller - table := "|Table name|Percentage of times index used|Rows in table|\n|-|-|-|\n" + + table := "|Name|Table size|Index size|Total size|Estimated row count|Seq scans|\n|-|-|-|-|-|-|\n" for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|`%d`|\n", r.Name, r.Percent_of_times_index_used, r.Rows_in_table) + table += fmt.Sprintf("|`%s`|`%s`|`%s`|`%s`|`%d`|`%d`|\n", r.Name, r.Table_size, r.Index_size, r.Total_size, r.Estimated_row_count, r.Seq_scans) } return list.RenderTable(table) } diff --git a/internal/inspect/table_stats/table_stats.sql b/internal/inspect/table_stats/table_stats.sql new file mode 100644 index 000000000..bcc22b29d --- /dev/null +++ b/internal/inspect/table_stats/table_stats.sql @@ -0,0 +1,27 @@ +SELECT + ts.name, + pg_size_pretty(ts.table_size_bytes) AS table_size, + pg_size_pretty(ts.index_size_bytes) AS index_size, + pg_size_pretty(ts.total_size_bytes) AS total_size, + COALESCE(rc.estimated_row_count, 0) AS estimated_row_count, + COALESCE(rc.seq_scans, 0) AS seq_scans +FROM ( + SELECT + FORMAT('%I.%I', n.nspname, c.relname) AS name, + pg_table_size(c.oid) AS table_size_bytes, + pg_indexes_size(c.oid) AS index_size_bytes, + pg_total_relation_size(c.oid) AS total_size_bytes + FROM pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE NOT n.nspname LIKE ANY($1) + AND c.relkind = 'r' +) ts +LEFT JOIN ( + SELECT + FORMAT('%I.%I', schemaname, relname) AS name, + n_live_tup AS estimated_row_count, + seq_scan AS seq_scans + FROM pg_stat_user_tables + WHERE NOT schemaname LIKE ANY($1) +) rc ON rc.name = ts.name +ORDER BY ts.total_size_bytes DESC diff --git a/internal/inspect/index_usage/index_usage_test.go b/internal/inspect/table_stats/table_stats_test.go similarity index 59% rename from internal/inspect/index_usage/index_usage_test.go rename to internal/inspect/table_stats/table_stats_test.go index 5b735bb60..087641029 100644 --- a/internal/inspect/index_usage/index_usage_test.go +++ b/internal/inspect/table_stats/table_stats_test.go @@ -1,4 +1,4 @@ -package index_usage +package table_stats import ( "context" @@ -20,22 +20,24 @@ var dbConfig = pgconn.Config{ Database: "postgres", } -func TestIndexUsage(t *testing.T) { - t.Run("inspects index usage", func(t *testing.T) { - // Setup in-memory fs +func TestTableStatsCommand(t *testing.T) { + t.Run("inspects table stats", func(t *testing.T) { fsys := afero.NewMemMapFs() - // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(IndexUsageQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). + + // Mock table sizes and index sizes + conn.Query(TableStatsQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). Reply("SELECT 1", Result{ - Name: "test_table_idx", - Percent_of_times_index_used: "0.9", - Rows_in_table: 300, + Name: "public.test_table", + Table_size: "3GB", + Index_size: "1GB", + Total_size: "4GB", + Estimated_row_count: 100, + Seq_scans: 1, }) - // Run test + err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error assert.NoError(t, err) }) } diff --git a/internal/inspect/templates/rules.toml b/internal/inspect/templates/rules.toml new file mode 100644 index 000000000..2597ee720 --- /dev/null +++ b/internal/inspect/templates/rules.toml @@ -0,0 +1,43 @@ +# Rules to validate CSV report files + +[[rules]] +query = "SELECT LISTAGG(stmt, ',') AS match FROM `locks.csv` WHERE age > '00:02:00'" +name = "No old locks" +pass = "✔" +fail = "There is at least one lock older than 2 minutes" + +[[rules]] +query = "SELECT LISTAGG(stmt, ',') AS match FROM `locks.csv` WHERE granted = 'f'" +name = "No ungranted locks" +pass = "✔" +fail = "There is at least one ungranted lock" + +[[rules]] +query = "SELECT LISTAGG(index, ',') AS match FROM `unused_indexes.csv`" +name = "No unused indexes" +pass = "✔" +fail = "There is at least one unused index" + +[[rules]] +query = "SELECT LISTAGG(name, ',') AS match FROM `db_stats.csv` WHERE index_hit_rate < 0.94 OR table_hit_rate < 0.94" +name = "Check cache hit is within acceptable bounds" +pass = "✔" +fail = "There is a cache hit ratio (table or index) below 94%" + +[[rules]] +query = "SELECT LISTAGG(t.name, ',') AS match FROM `table_stats.csv` t WHERE t.seq_scans > t.estimated_row_count * 0.1 AND t.estimated_row_count > 1000;" +name = "No large tables with sequential scans more than 10% of rows" +pass = "✔" +fail = "At least one table is showing sequential scans more than 10% of total row count" + +[[rules]] +query = "SELECT LISTAGG(s.tbl, ',') AS match FROM `vacuum_stats.csv` s WHERE s.expect_autovacuum = 'yes' and s.rowcount > 1000;" +name = "No large tables waiting on autovacuum" +pass = "✔" +fail = "At least one table is waiting on autovacuum" + +[[rules]] +query = "SELECT LISTAGG(s.name, ',') AS match FROM `vacuum_stats.csv` s WHERE s.rowcount > 0 AND (s.last_autovacuum = '' OR s.last_vacuum = '');" +name = "No tables yet to be vacuumed" +pass = "✔" +fail = "At least one table has never had autovacuum or vacuum run on it" diff --git a/internal/inspect/total_index_size/total_index_size.go b/internal/inspect/total_index_size/total_index_size.go deleted file mode 100644 index fbc66b259..000000000 --- a/internal/inspect/total_index_size/total_index_size.go +++ /dev/null @@ -1,45 +0,0 @@ -package total_index_size - -import ( - "context" - _ "embed" - "fmt" - - "github.com/go-errors/errors" - "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" -) - -//go:embed total_index_size.sql -var TotalIndexSizeQuery string - -type Result struct { - Size string -} - -func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - conn, err := utils.ConnectByConfig(ctx, config, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, TotalIndexSizeQuery, reset.LikeEscapeSchema(utils.InternalSchemas)) - if err != nil { - return errors.Errorf("failed to query rows: %w", err) - } - result, err := pgxv5.CollectRows[Result](rows) - if err != nil { - return err - } - - table := "|Size|\n|-|\n" - for _, r := range result { - table += fmt.Sprintf("|`%s`|\n", r.Size) - } - return list.RenderTable(table) -} diff --git a/internal/inspect/total_index_size/total_index_size.sql b/internal/inspect/total_index_size/total_index_size.sql deleted file mode 100644 index d1e8ab3d8..000000000 --- a/internal/inspect/total_index_size/total_index_size.sql +++ /dev/null @@ -1,6 +0,0 @@ -SELECT - pg_size_pretty(sum(c.relpages::bigint*8192)::bigint) AS size -FROM pg_class c -LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace) -WHERE NOT n.nspname LIKE ANY($1) -AND c.relkind = 'i' diff --git a/internal/inspect/total_table_sizes/total_table_sizes.go b/internal/inspect/total_table_sizes/total_table_sizes.go deleted file mode 100644 index 80b1c89a8..000000000 --- a/internal/inspect/total_table_sizes/total_table_sizes.go +++ /dev/null @@ -1,47 +0,0 @@ -package total_table_sizes - -import ( - "context" - _ "embed" - "fmt" - - "github.com/go-errors/errors" - "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" -) - -//go:embed total_table_sizes.sql -var TotalTableSizesQuery string - -type Result struct { - Schema string - Name string - Size string -} - -func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - conn, err := utils.ConnectByConfig(ctx, config, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - rows, err := conn.Query(ctx, TotalTableSizesQuery, reset.LikeEscapeSchema(utils.PgSchemas)) - if err != nil { - return errors.Errorf("failed to query rows: %w", err) - } - result, err := pgxv5.CollectRows[Result](rows) - if err != nil { - return err - } - - table := "Schema|Table|Size|\n|-|-|-|\n" - for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|`%s`|\n", r.Schema, r.Name, r.Size) - } - return list.RenderTable(table) -} diff --git a/internal/inspect/total_table_sizes/total_table_sizes.sql b/internal/inspect/total_table_sizes/total_table_sizes.sql deleted file mode 100644 index 471d0655f..000000000 --- a/internal/inspect/total_table_sizes/total_table_sizes.sql +++ /dev/null @@ -1,9 +0,0 @@ -SELECT - n.nspname AS schema, - c.relname AS name, - pg_size_pretty(pg_total_relation_size(c.oid)) AS size -FROM pg_class c -LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace) -WHERE NOT n.nspname LIKE ANY($1) -AND c.relkind = 'r' -ORDER BY pg_total_relation_size(c.oid) DESC diff --git a/internal/inspect/total_table_sizes/total_table_sizes_test.go b/internal/inspect/total_table_sizes/total_table_sizes_test.go deleted file mode 100644 index bc548af60..000000000 --- a/internal/inspect/total_table_sizes/total_table_sizes_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package total_table_sizes - -import ( - "context" - "testing" - - "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" -) - -var dbConfig = pgconn.Config{ - Host: "127.0.0.1", - Port: 5432, - User: "admin", - Password: "password", - Database: "postgres", -} - -func TestTotalTableSizesCommand(t *testing.T) { - t.Run("inspects total table sizes", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(TotalTableSizesQuery, reset.LikeEscapeSchema(utils.PgSchemas)). - Reply("SELECT 1", Result{ - Schema: "public", - Name: "test_table", - Size: "3GB", - }) - // Run test - err := Run(context.Background(), dbConfig, fsys, conn.Intercept) - // Check error - assert.NoError(t, err) - }) -} diff --git a/internal/inspect/unused_indexes/unused_indexes.go b/internal/inspect/unused_indexes/unused_indexes.go index 2a30a46d7..bfbbf523a 100644 --- a/internal/inspect/unused_indexes/unused_indexes.go +++ b/internal/inspect/unused_indexes/unused_indexes.go @@ -19,7 +19,7 @@ import ( var UnusedIndexesQuery string type Result struct { - Table string + Name string Index string Index_size string Index_scans int64 @@ -42,7 +42,7 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu table := "|Table|Index|Index Size|Index Scans\n|-|-|-|-|\n" for _, r := range result { - table += fmt.Sprintf("|`%s`|`%s`|`%s`|`%d`|\n", r.Table, r.Index, r.Index_size, r.Index_scans) + table += fmt.Sprintf("|`%s`|`%s`|`%s`|`%d`|\n", r.Name, r.Index, r.Index_size, r.Index_scans) } return list.RenderTable(table) } diff --git a/internal/inspect/unused_indexes/unused_indexes.sql b/internal/inspect/unused_indexes/unused_indexes.sql index 6e775967d..aa429b9ed 100644 --- a/internal/inspect/unused_indexes/unused_indexes.sql +++ b/internal/inspect/unused_indexes/unused_indexes.sql @@ -1,5 +1,5 @@ SELECT - schemaname || '.' || relname AS table, + FORMAT('%I.%I', schemaname, relname) AS name, indexrelname AS index, pg_size_pretty(pg_relation_size(i.indexrelid)) AS index_size, idx_scan as index_scans diff --git a/internal/inspect/unused_indexes/unused_indexes_test.go b/internal/inspect/unused_indexes/unused_indexes_test.go index ee4182094..517f88c61 100644 --- a/internal/inspect/unused_indexes/unused_indexes_test.go +++ b/internal/inspect/unused_indexes/unused_indexes_test.go @@ -29,7 +29,7 @@ func TestUnusedIndexesCommand(t *testing.T) { defer conn.Close(t) conn.Query(UnusedIndexesQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). Reply("SELECT 1", Result{ - Table: "test_table", + Name: "public.test_table", Index: "test_table_idx", Index_size: "3GB", Index_scans: 2, diff --git a/internal/inspect/vacuum_stats/vacuum_stats.go b/internal/inspect/vacuum_stats/vacuum_stats.go index dc9326d79..8b3669879 100644 --- a/internal/inspect/vacuum_stats/vacuum_stats.go +++ b/internal/inspect/vacuum_stats/vacuum_stats.go @@ -20,8 +20,7 @@ import ( var VacuumStatsQuery string type Result struct { - Schema string - Table string + Name string Last_vacuum string Last_autovacuum string Rowcount string @@ -45,10 +44,10 @@ func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...fu return err } - table := "|Schema|Table|Last Vacuum|Last Auto Vacuum|Row count|Dead row count|Expect autovacuum?\n|-|-|-|-|-|-|-|\n" + table := "|Table|Last Vacuum|Last Auto Vacuum|Row count|Dead row count|Expect autovacuum?\n|-|-|-|-|-|-|\n" for _, r := range result { rowcount := strings.Replace(r.Rowcount, "-1", "No stats", 1) - table += fmt.Sprintf("|`%s`|`%s`|%s|%s|`%s`|`%s`|`%s`|\n", r.Schema, r.Table, r.Last_vacuum, r.Last_autovacuum, rowcount, r.Dead_rowcount, r.Expect_autovacuum) + table += fmt.Sprintf("|`%s`|%s|%s|`%s`|`%s`|`%s`|\n", r.Name, r.Last_vacuum, r.Last_autovacuum, rowcount, r.Dead_rowcount, r.Expect_autovacuum) } return list.RenderTable(table) } diff --git a/internal/inspect/vacuum_stats/vacuum_stats.sql b/internal/inspect/vacuum_stats/vacuum_stats.sql index 707847497..534fa4e64 100644 --- a/internal/inspect/vacuum_stats/vacuum_stats.sql +++ b/internal/inspect/vacuum_stats/vacuum_stats.sql @@ -20,8 +20,7 @@ WITH table_opts AS ( table_opts ) SELECT - vacuum_settings.nspname AS schema, - vacuum_settings.relname AS table, + FORMAT('%I.%I', vacuum_settings.nspname, vacuum_settings.relname) AS name, coalesce(to_char(psut.last_vacuum, 'YYYY-MM-DD HH24:MI'), '') AS last_vacuum, coalesce(to_char(psut.last_autovacuum, 'YYYY-MM-DD HH24:MI'), '') AS last_autovacuum, to_char(pg_class.reltuples, '9G999G999G999') AS rowcount, diff --git a/internal/inspect/vacuum_stats/vacuum_stats_test.go b/internal/inspect/vacuum_stats/vacuum_stats_test.go index 0d3cbec10..7872567b3 100644 --- a/internal/inspect/vacuum_stats/vacuum_stats_test.go +++ b/internal/inspect/vacuum_stats/vacuum_stats_test.go @@ -29,8 +29,7 @@ func TestVacuumCommand(t *testing.T) { defer conn.Close(t) conn.Query(VacuumStatsQuery, reset.LikeEscapeSchema(utils.InternalSchemas)). Reply("SELECT 1", Result{ - Schema: "test_schema", - Table: "test_table", + Name: "test_schema.test_table", Last_vacuum: "2021-01-01 00:00:00", Last_autovacuum: "2021-01-01 00:00:00", Rowcount: "1000", diff --git a/pkg/config/config.go b/pkg/config/config.go index c6edda1b7..75bf61fcd 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -247,6 +247,17 @@ type ( Enabled bool `toml:"enabled"` } + inspect struct { + Rules []rule `toml:"rules"` + } + + rule struct { + Query string `toml:"query"` + Name string `toml:"name"` + Pass string `toml:"pass"` + Fail string `toml:"fail"` + } + experimental struct { OrioleDBVersion string `toml:"orioledb_version"` S3Host string `toml:"s3_host"` @@ -254,6 +265,7 @@ type ( S3AccessKey string `toml:"s3_access_key"` S3SecretKey string `toml:"s3_secret_key"` Webhooks *webhooks `toml:"webhooks"` + Inspect inspect `toml:"inspect"` } ) From 86b9b7dea330f66d1d20110b1367e5d883b3277d Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Wed, 18 Jun 2025 08:18:05 +0200 Subject: [PATCH 212/359] chore: sync API types from infrastructure (#3728) Co-authored-by: sweatybridge <1639722+sweatybridge@users.noreply.github.com> --- pkg/api/client.gen.go | 1422 +++++++++++++++++++++++++++++++++++++---- pkg/api/types.gen.go | 174 ++++- 2 files changed, 1466 insertions(+), 130 deletions(-) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index b5659e914..0527d078a 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -122,6 +122,9 @@ type ClientInterface interface { // V1AuthorizeUser request V1AuthorizeUser(ctx context.Context, params *V1AuthorizeUserParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1OauthAuthorizeProjectClaim request + V1OauthAuthorizeProjectClaim(ctx context.Context, params *V1OauthAuthorizeProjectClaimParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1RevokeTokenWithBody request with any body V1RevokeTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -146,6 +149,12 @@ type ClientInterface interface { // V1ListOrganizationMembers request V1ListOrganizationMembers(ctx context.Context, slug string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetOrganizationProjectClaim request + V1GetOrganizationProjectClaim(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1ClaimProjectForOrganization request + V1ClaimProjectForOrganization(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1ListAllProjects request V1ListAllProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -164,7 +173,7 @@ type ClientInterface interface { GetPerformanceAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSecurityAdvisors request - GetSecurityAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetSecurityAdvisors(ctx context.Context, ref string, params *GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetLogs request GetLogs(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -222,6 +231,15 @@ type ClientInterface interface { V1CreateABranch(ctx context.Context, ref string, body V1CreateABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1DeleteProjectClaimToken request + V1DeleteProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1GetProjectClaimToken request + V1GetProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1CreateProjectClaimToken request + V1CreateProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetAuthServiceConfig request V1GetAuthServiceConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -334,6 +352,19 @@ type ClientInterface interface { V1RestorePitrBackup(ctx context.Context, ref string, body V1RestorePitrBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetRestorePoint request + V1GetRestorePoint(ctx context.Context, ref string, params *V1GetRestorePointParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1CreateRestorePointWithBody request with any body + V1CreateRestorePointWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1CreateRestorePoint(ctx context.Context, ref string, body V1CreateRestorePointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1UndoWithBody request with any body + V1UndoWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1Undo(ctx context.Context, ref string, body V1UndoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetDatabaseMetadata request GetDatabaseMetadata(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -659,6 +690,18 @@ func (c *Client) V1AuthorizeUser(ctx context.Context, params *V1AuthorizeUserPar return c.Client.Do(req) } +func (c *Client) V1OauthAuthorizeProjectClaim(ctx context.Context, params *V1OauthAuthorizeProjectClaimParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1OauthAuthorizeProjectClaimRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1RevokeTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1RevokeTokenRequestWithBody(c.Server, contentType, body) if err != nil { @@ -767,6 +810,30 @@ func (c *Client) V1ListOrganizationMembers(ctx context.Context, slug string, req return c.Client.Do(req) } +func (c *Client) V1GetOrganizationProjectClaim(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetOrganizationProjectClaimRequest(c.Server, slug, token) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1ClaimProjectForOrganization(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ClaimProjectForOrganizationRequest(c.Server, slug, token) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1ListAllProjects(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1ListAllProjectsRequest(c.Server) if err != nil { @@ -839,8 +906,8 @@ func (c *Client) GetPerformanceAdvisors(ctx context.Context, ref string, reqEdit return c.Client.Do(req) } -func (c *Client) GetSecurityAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSecurityAdvisorsRequest(c.Server, ref) +func (c *Client) GetSecurityAdvisors(ctx context.Context, ref string, params *GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSecurityAdvisorsRequest(c.Server, ref, params) if err != nil { return nil, err } @@ -1091,6 +1158,42 @@ func (c *Client) V1CreateABranch(ctx context.Context, ref string, body V1CreateA return c.Client.Do(req) } +func (c *Client) V1DeleteProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1DeleteProjectClaimTokenRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1GetProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectClaimTokenRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1CreateProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateProjectClaimTokenRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1GetAuthServiceConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1GetAuthServiceConfigRequest(c.Server, ref) if err != nil { @@ -1583,6 +1686,66 @@ func (c *Client) V1RestorePitrBackup(ctx context.Context, ref string, body V1Res return c.Client.Do(req) } +func (c *Client) V1GetRestorePoint(ctx context.Context, ref string, params *V1GetRestorePointParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetRestorePointRequest(c.Server, ref, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1CreateRestorePointWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateRestorePointRequestWithBody(c.Server, ref, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1CreateRestorePoint(ctx context.Context, ref string, body V1CreateRestorePointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateRestorePointRequest(c.Server, ref, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1UndoWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UndoRequestWithBody(c.Server, ref, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1Undo(ctx context.Context, ref string, body V1UndoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UndoRequest(c.Server, ref, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetDatabaseMetadata(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetDatabaseMetadataRequest(c.Server, ref) if err != nil { @@ -2836,19 +2999,8 @@ func NewV1AuthorizeUserRequest(server string, params *V1AuthorizeUserParams) (*h return req, nil } -// NewV1RevokeTokenRequest calls the generic V1RevokeToken builder with application/json body -func NewV1RevokeTokenRequest(server string, body V1RevokeTokenJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewV1RevokeTokenRequestWithBody(server, "application/json", bodyReader) -} - -// NewV1RevokeTokenRequestWithBody generates requests for V1RevokeToken with any type of body -func NewV1RevokeTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1OauthAuthorizeProjectClaimRequest generates requests for V1OauthAuthorizeProjectClaim +func NewV1OauthAuthorizeProjectClaimRequest(server string, params *V1OauthAuthorizeProjectClaimParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -2856,7 +3008,7 @@ func NewV1RevokeTokenRequestWithBody(server string, contentType string, body io. return nil, err } - operationPath := fmt.Sprintf("/v1/oauth/revoke") + operationPath := fmt.Sprintf("/v1/oauth/authorize/project-claim") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2866,67 +3018,223 @@ func NewV1RevokeTokenRequestWithBody(server string, contentType string, body io. return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) + if params != nil { + queryValues := queryURL.Query() - return req, nil -} + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "project_ref", runtime.ParamLocationQuery, params.ProjectRef); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } -// NewV1ExchangeOauthTokenRequestWithFormdataBody calls the generic V1ExchangeOauthToken builder with application/x-www-form-urlencoded body -func NewV1ExchangeOauthTokenRequestWithFormdataBody(server string, body V1ExchangeOauthTokenFormdataRequestBody) (*http.Request, error) { - var bodyReader io.Reader - bodyStr, err := runtime.MarshalForm(body, nil) - if err != nil { - return nil, err - } - bodyReader = strings.NewReader(bodyStr.Encode()) - return NewV1ExchangeOauthTokenRequestWithBody(server, "application/x-www-form-urlencoded", bodyReader) -} + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "client_id", runtime.ParamLocationQuery, params.ClientId); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } -// NewV1ExchangeOauthTokenRequestWithBody generates requests for V1ExchangeOauthToken with any type of body -func NewV1ExchangeOauthTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "response_type", runtime.ParamLocationQuery, params.ResponseType); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "redirect_uri", runtime.ParamLocationQuery, params.RedirectUri); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - operationPath := fmt.Sprintf("/v1/oauth/token") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + if params.State != nil { - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "state", runtime.ParamLocationQuery, *params.State); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } + } - req.Header.Add("Content-Type", contentType) + if params.ResponseMode != nil { - return req, nil -} + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "response_mode", runtime.ParamLocationQuery, *params.ResponseMode); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } -// NewV1ListAllOrganizationsRequest generates requests for V1ListAllOrganizations -func NewV1ListAllOrganizationsRequest(server string) (*http.Request, error) { - var err error + } - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + if params.CodeChallenge != nil { - operationPath := fmt.Sprintf("/v1/organizations") - if operationPath[0] == '/' { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "code_challenge", runtime.ParamLocationQuery, *params.CodeChallenge); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CodeChallengeMethod != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "code_challenge_method", runtime.ParamLocationQuery, *params.CodeChallengeMethod); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1RevokeTokenRequest calls the generic V1RevokeToken builder with application/json body +func NewV1RevokeTokenRequest(server string, body V1RevokeTokenJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1RevokeTokenRequestWithBody(server, "application/json", bodyReader) +} + +// NewV1RevokeTokenRequestWithBody generates requests for V1RevokeToken with any type of body +func NewV1RevokeTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/oauth/revoke") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1ExchangeOauthTokenRequestWithFormdataBody calls the generic V1ExchangeOauthToken builder with application/x-www-form-urlencoded body +func NewV1ExchangeOauthTokenRequestWithFormdataBody(server string, body V1ExchangeOauthTokenFormdataRequestBody) (*http.Request, error) { + var bodyReader io.Reader + bodyStr, err := runtime.MarshalForm(body, nil) + if err != nil { + return nil, err + } + bodyReader = strings.NewReader(bodyStr.Encode()) + return NewV1ExchangeOauthTokenRequestWithBody(server, "application/x-www-form-urlencoded", bodyReader) +} + +// NewV1ExchangeOauthTokenRequestWithBody generates requests for V1ExchangeOauthToken with any type of body +func NewV1ExchangeOauthTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/oauth/token") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1ListAllOrganizationsRequest generates requests for V1ListAllOrganizations +func NewV1ListAllOrganizationsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/organizations") + if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3051,6 +3359,88 @@ func NewV1ListOrganizationMembersRequest(server string, slug string) (*http.Requ return req, nil } +// NewV1GetOrganizationProjectClaimRequest generates requests for V1GetOrganizationProjectClaim +func NewV1GetOrganizationProjectClaimRequest(server string, slug string, token string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "slug", runtime.ParamLocationPath, slug) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "token", runtime.ParamLocationPath, token) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/organizations/%s/project-claim/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1ClaimProjectForOrganizationRequest generates requests for V1ClaimProjectForOrganization +func NewV1ClaimProjectForOrganizationRequest(server string, slug string, token string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "slug", runtime.ParamLocationPath, slug) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "token", runtime.ParamLocationPath, token) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/organizations/%s/project-claim/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1ListAllProjectsRequest generates requests for V1ListAllProjects func NewV1ListAllProjectsRequest(server string) (*http.Request, error) { var err error @@ -3221,7 +3611,7 @@ func NewGetPerformanceAdvisorsRequest(server string, ref string) (*http.Request, } // NewGetSecurityAdvisorsRequest generates requests for GetSecurityAdvisors -func NewGetSecurityAdvisorsRequest(server string, ref string) (*http.Request, error) { +func NewGetSecurityAdvisorsRequest(server string, ref string, params *GetSecurityAdvisorsParams) (*http.Request, error) { var err error var pathParam0 string @@ -3246,6 +3636,28 @@ func NewGetSecurityAdvisorsRequest(server string, ref string) (*http.Request, er return nil, err } + if params != nil { + queryValues := queryURL.Query() + + if params.LintType != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "lint_type", runtime.ParamLocationQuery, *params.LintType); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -4114,6 +4526,108 @@ func NewV1CreateABranchRequestWithBody(server string, ref string, contentType st return req, nil } +// NewV1DeleteProjectClaimTokenRequest generates requests for V1DeleteProjectClaimToken +func NewV1DeleteProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1GetProjectClaimTokenRequest generates requests for V1GetProjectClaimToken +func NewV1GetProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1CreateProjectClaimTokenRequest generates requests for V1CreateProjectClaimToken +func NewV1CreateProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/claim-token", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1GetAuthServiceConfigRequest generates requests for V1GetAuthServiceConfig func NewV1GetAuthServiceConfigRequest(server string, ref string) (*http.Request, error) { var err error @@ -5119,7 +5633,122 @@ func NewV1GetHostnameConfigRequest(server string, ref string) (*http.Request, er return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1ActivateCustomHostnameRequest generates requests for V1ActivateCustomHostname +func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/activate", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1UpdateHostnameConfigRequest calls the generic V1UpdateHostnameConfig builder with application/json body +func NewV1UpdateHostnameConfigRequest(server string, ref string, body V1UpdateHostnameConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpdateHostnameConfigRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpdateHostnameConfigRequestWithBody generates requests for V1UpdateHostnameConfig with any type of body +func NewV1UpdateHostnameConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/initialize", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1VerifyDnsConfigRequest generates requests for V1VerifyDnsConfig +func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/reverify", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5129,7 +5758,7 @@ func NewV1GetHostnameConfigRequest(server string, ref string) (*http.Request, er return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } @@ -5137,8 +5766,8 @@ func NewV1GetHostnameConfigRequest(server string, ref string) (*http.Request, er return req, nil } -// NewV1ActivateCustomHostnameRequest generates requests for V1ActivateCustomHostname -func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Request, error) { +// NewV1ListAllBackupsRequest generates requests for V1ListAllBackups +func NewV1ListAllBackupsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5153,7 +5782,7 @@ func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Reques return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/activate", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/database/backups", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5163,7 +5792,7 @@ func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Reques return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -5171,19 +5800,19 @@ func NewV1ActivateCustomHostnameRequest(server string, ref string) (*http.Reques return req, nil } -// NewV1UpdateHostnameConfigRequest calls the generic V1UpdateHostnameConfig builder with application/json body -func NewV1UpdateHostnameConfigRequest(server string, ref string, body V1UpdateHostnameConfigJSONRequestBody) (*http.Request, error) { +// NewV1RestorePitrBackupRequest calls the generic V1RestorePitrBackup builder with application/json body +func NewV1RestorePitrBackupRequest(server string, ref string, body V1RestorePitrBackupJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1UpdateHostnameConfigRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1RestorePitrBackupRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1UpdateHostnameConfigRequestWithBody generates requests for V1UpdateHostnameConfig with any type of body -func NewV1UpdateHostnameConfigRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1RestorePitrBackupRequestWithBody generates requests for V1RestorePitrBackup with any type of body +func NewV1RestorePitrBackupRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5198,7 +5827,7 @@ func NewV1UpdateHostnameConfigRequestWithBody(server string, ref string, content return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/initialize", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/database/backups/restore-pitr", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5218,8 +5847,8 @@ func NewV1UpdateHostnameConfigRequestWithBody(server string, ref string, content return req, nil } -// NewV1VerifyDnsConfigRequest generates requests for V1VerifyDnsConfig -func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, error) { +// NewV1GetRestorePointRequest generates requests for V1GetRestorePoint +func NewV1GetRestorePointRequest(server string, ref string, params *V1GetRestorePointParams) (*http.Request, error) { var err error var pathParam0 string @@ -5234,7 +5863,7 @@ func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, erro return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/custom-hostname/reverify", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/database/backups/restore-point", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5244,7 +5873,29 @@ func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, erro return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + if params != nil { + queryValues := queryURL.Query() + + if params.Name != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -5252,8 +5903,19 @@ func NewV1VerifyDnsConfigRequest(server string, ref string) (*http.Request, erro return req, nil } -// NewV1ListAllBackupsRequest generates requests for V1ListAllBackups -func NewV1ListAllBackupsRequest(server string, ref string) (*http.Request, error) { +// NewV1CreateRestorePointRequest calls the generic V1CreateRestorePoint builder with application/json body +func NewV1CreateRestorePointRequest(server string, ref string, body V1CreateRestorePointJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1CreateRestorePointRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1CreateRestorePointRequestWithBody generates requests for V1CreateRestorePoint with any type of body +func NewV1CreateRestorePointRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5268,7 +5930,7 @@ func NewV1ListAllBackupsRequest(server string, ref string) (*http.Request, error return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/database/backups", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/database/backups/restore-point", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5278,27 +5940,29 @@ func NewV1ListAllBackupsRequest(server string, ref string) (*http.Request, error return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewV1RestorePitrBackupRequest calls the generic V1RestorePitrBackup builder with application/json body -func NewV1RestorePitrBackupRequest(server string, ref string, body V1RestorePitrBackupJSONRequestBody) (*http.Request, error) { +// NewV1UndoRequest calls the generic V1Undo builder with application/json body +func NewV1UndoRequest(server string, ref string, body V1UndoJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewV1RestorePitrBackupRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1UndoRequestWithBody(server, ref, "application/json", bodyReader) } -// NewV1RestorePitrBackupRequestWithBody generates requests for V1RestorePitrBackup with any type of body -func NewV1RestorePitrBackupRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UndoRequestWithBody generates requests for V1Undo with any type of body +func NewV1UndoRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5313,7 +5977,7 @@ func NewV1RestorePitrBackupRequestWithBody(server string, ref string, contentTyp return nil, err } - operationPath := fmt.Sprintf("/v1/projects/%s/database/backups/restore-pitr", pathParam0) + operationPath := fmt.Sprintf("/v1/projects/%s/database/backups/undo", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7733,6 +8397,9 @@ type ClientWithResponsesInterface interface { // V1AuthorizeUserWithResponse request V1AuthorizeUserWithResponse(ctx context.Context, params *V1AuthorizeUserParams, reqEditors ...RequestEditorFn) (*V1AuthorizeUserResponse, error) + // V1OauthAuthorizeProjectClaimWithResponse request + V1OauthAuthorizeProjectClaimWithResponse(ctx context.Context, params *V1OauthAuthorizeProjectClaimParams, reqEditors ...RequestEditorFn) (*V1OauthAuthorizeProjectClaimResponse, error) + // V1RevokeTokenWithBodyWithResponse request with any body V1RevokeTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RevokeTokenResponse, error) @@ -7757,6 +8424,12 @@ type ClientWithResponsesInterface interface { // V1ListOrganizationMembersWithResponse request V1ListOrganizationMembersWithResponse(ctx context.Context, slug string, reqEditors ...RequestEditorFn) (*V1ListOrganizationMembersResponse, error) + // V1GetOrganizationProjectClaimWithResponse request + V1GetOrganizationProjectClaimWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1GetOrganizationProjectClaimResponse, error) + + // V1ClaimProjectForOrganizationWithResponse request + V1ClaimProjectForOrganizationWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1ClaimProjectForOrganizationResponse, error) + // V1ListAllProjectsWithResponse request V1ListAllProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*V1ListAllProjectsResponse, error) @@ -7775,7 +8448,7 @@ type ClientWithResponsesInterface interface { GetPerformanceAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetPerformanceAdvisorsResponse, error) // GetSecurityAdvisorsWithResponse request - GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetSecurityAdvisorsResponse, error) + GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, params *GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*GetSecurityAdvisorsResponse, error) // GetLogsWithResponse request GetLogsWithResponse(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*GetLogsResponse, error) @@ -7833,6 +8506,15 @@ type ClientWithResponsesInterface interface { V1CreateABranchWithResponse(ctx context.Context, ref string, body V1CreateABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateABranchResponse, error) + // V1DeleteProjectClaimTokenWithResponse request + V1DeleteProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeleteProjectClaimTokenResponse, error) + + // V1GetProjectClaimTokenWithResponse request + V1GetProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectClaimTokenResponse, error) + + // V1CreateProjectClaimTokenWithResponse request + V1CreateProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CreateProjectClaimTokenResponse, error) + // V1GetAuthServiceConfigWithResponse request V1GetAuthServiceConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetAuthServiceConfigResponse, error) @@ -7945,6 +8627,19 @@ type ClientWithResponsesInterface interface { V1RestorePitrBackupWithResponse(ctx context.Context, ref string, body V1RestorePitrBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*V1RestorePitrBackupResponse, error) + // V1GetRestorePointWithResponse request + V1GetRestorePointWithResponse(ctx context.Context, ref string, params *V1GetRestorePointParams, reqEditors ...RequestEditorFn) (*V1GetRestorePointResponse, error) + + // V1CreateRestorePointWithBodyWithResponse request with any body + V1CreateRestorePointWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateRestorePointResponse, error) + + V1CreateRestorePointWithResponse(ctx context.Context, ref string, body V1CreateRestorePointJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateRestorePointResponse, error) + + // V1UndoWithBodyWithResponse request with any body + V1UndoWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UndoResponse, error) + + V1UndoWithResponse(ctx context.Context, ref string, body V1UndoJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UndoResponse, error) + // GetDatabaseMetadataWithResponse request GetDatabaseMetadataWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetDatabaseMetadataResponse, error) @@ -8300,6 +8995,27 @@ func (r V1AuthorizeUserResponse) StatusCode() int { return 0 } +type V1OauthAuthorizeProjectClaimResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1OauthAuthorizeProjectClaimResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1OauthAuthorizeProjectClaimResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1RevokeTokenResponse struct { Body []byte HTTPResponse *http.Response @@ -8431,6 +9147,49 @@ func (r V1ListOrganizationMembersResponse) StatusCode() int { return 0 } +type V1GetOrganizationProjectClaimResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OrganizationProjectClaimResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetOrganizationProjectClaimResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetOrganizationProjectClaimResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1ClaimProjectForOrganizationResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1ClaimProjectForOrganizationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1ClaimProjectForOrganizationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1ListAllProjectsResponse struct { Body []byte HTTPResponse *http.Response @@ -8912,6 +9671,71 @@ func (r V1CreateABranchResponse) StatusCode() int { return 0 } +type V1DeleteProjectClaimTokenResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1DeleteProjectClaimTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1DeleteProjectClaimTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1GetProjectClaimTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ProjectClaimTokenResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetProjectClaimTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetProjectClaimTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1CreateProjectClaimTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CreateProjectClaimTokenResponse +} + +// Status returns HTTPResponse.Status +func (r V1CreateProjectClaimTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1CreateProjectClaimTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1GetAuthServiceConfigResponse struct { Body []byte HTTPResponse *http.Response @@ -9423,7 +10247,73 @@ type V1DeleteHostnameConfigResponse struct { } // Status returns HTTPResponse.Status -func (r V1DeleteHostnameConfigResponse) Status() string { +func (r V1DeleteHostnameConfigResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1DeleteHostnameConfigResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1GetHostnameConfigResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UpdateCustomHostnameResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetHostnameConfigResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetHostnameConfigResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1ActivateCustomHostnameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *UpdateCustomHostnameResponse +} + +// Status returns HTTPResponse.Status +func (r V1ActivateCustomHostnameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1ActivateCustomHostnameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1UpdateHostnameConfigResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *UpdateCustomHostnameResponse +} + +// Status returns HTTPResponse.Status +func (r V1UpdateHostnameConfigResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9431,21 +10321,21 @@ func (r V1DeleteHostnameConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1DeleteHostnameConfigResponse) StatusCode() int { +func (r V1UpdateHostnameConfigResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1GetHostnameConfigResponse struct { +type V1VerifyDnsConfigResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *UpdateCustomHostnameResponse + JSON201 *UpdateCustomHostnameResponse } // Status returns HTTPResponse.Status -func (r V1GetHostnameConfigResponse) Status() string { +func (r V1VerifyDnsConfigResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9453,21 +10343,21 @@ func (r V1GetHostnameConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1GetHostnameConfigResponse) StatusCode() int { +func (r V1VerifyDnsConfigResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1ActivateCustomHostnameResponse struct { +type V1ListAllBackupsResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *UpdateCustomHostnameResponse + JSON200 *V1BackupsResponse } // Status returns HTTPResponse.Status -func (r V1ActivateCustomHostnameResponse) Status() string { +func (r V1ListAllBackupsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9475,21 +10365,20 @@ func (r V1ActivateCustomHostnameResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1ActivateCustomHostnameResponse) StatusCode() int { +func (r V1ListAllBackupsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1UpdateHostnameConfigResponse struct { +type V1RestorePitrBackupResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *UpdateCustomHostnameResponse } // Status returns HTTPResponse.Status -func (r V1UpdateHostnameConfigResponse) Status() string { +func (r V1RestorePitrBackupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9497,21 +10386,21 @@ func (r V1UpdateHostnameConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1UpdateHostnameConfigResponse) StatusCode() int { +func (r V1RestorePitrBackupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1VerifyDnsConfigResponse struct { +type V1GetRestorePointResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *UpdateCustomHostnameResponse + JSON200 *V1RestorePointResponse } // Status returns HTTPResponse.Status -func (r V1VerifyDnsConfigResponse) Status() string { +func (r V1GetRestorePointResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9519,21 +10408,21 @@ func (r V1VerifyDnsConfigResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1VerifyDnsConfigResponse) StatusCode() int { +func (r V1GetRestorePointResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1ListAllBackupsResponse struct { +type V1CreateRestorePointResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *V1BackupsResponse + JSON201 *V1RestorePointResponse } // Status returns HTTPResponse.Status -func (r V1ListAllBackupsResponse) Status() string { +func (r V1CreateRestorePointResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9541,20 +10430,20 @@ func (r V1ListAllBackupsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1ListAllBackupsResponse) StatusCode() int { +func (r V1CreateRestorePointResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type V1RestorePitrBackupResponse struct { +type V1UndoResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r V1RestorePitrBackupResponse) Status() string { +func (r V1UndoResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9562,7 +10451,7 @@ func (r V1RestorePitrBackupResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r V1RestorePitrBackupResponse) StatusCode() int { +func (r V1UndoResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -10714,6 +11603,15 @@ func (c *ClientWithResponses) V1AuthorizeUserWithResponse(ctx context.Context, p return ParseV1AuthorizeUserResponse(rsp) } +// V1OauthAuthorizeProjectClaimWithResponse request returning *V1OauthAuthorizeProjectClaimResponse +func (c *ClientWithResponses) V1OauthAuthorizeProjectClaimWithResponse(ctx context.Context, params *V1OauthAuthorizeProjectClaimParams, reqEditors ...RequestEditorFn) (*V1OauthAuthorizeProjectClaimResponse, error) { + rsp, err := c.V1OauthAuthorizeProjectClaim(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1OauthAuthorizeProjectClaimResponse(rsp) +} + // V1RevokeTokenWithBodyWithResponse request with arbitrary body returning *V1RevokeTokenResponse func (c *ClientWithResponses) V1RevokeTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1RevokeTokenResponse, error) { rsp, err := c.V1RevokeTokenWithBody(ctx, contentType, body, reqEditors...) @@ -10792,6 +11690,24 @@ func (c *ClientWithResponses) V1ListOrganizationMembersWithResponse(ctx context. return ParseV1ListOrganizationMembersResponse(rsp) } +// V1GetOrganizationProjectClaimWithResponse request returning *V1GetOrganizationProjectClaimResponse +func (c *ClientWithResponses) V1GetOrganizationProjectClaimWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1GetOrganizationProjectClaimResponse, error) { + rsp, err := c.V1GetOrganizationProjectClaim(ctx, slug, token, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetOrganizationProjectClaimResponse(rsp) +} + +// V1ClaimProjectForOrganizationWithResponse request returning *V1ClaimProjectForOrganizationResponse +func (c *ClientWithResponses) V1ClaimProjectForOrganizationWithResponse(ctx context.Context, slug string, token string, reqEditors ...RequestEditorFn) (*V1ClaimProjectForOrganizationResponse, error) { + rsp, err := c.V1ClaimProjectForOrganization(ctx, slug, token, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ClaimProjectForOrganizationResponse(rsp) +} + // V1ListAllProjectsWithResponse request returning *V1ListAllProjectsResponse func (c *ClientWithResponses) V1ListAllProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*V1ListAllProjectsResponse, error) { rsp, err := c.V1ListAllProjects(ctx, reqEditors...) @@ -10846,8 +11762,8 @@ func (c *ClientWithResponses) GetPerformanceAdvisorsWithResponse(ctx context.Con } // GetSecurityAdvisorsWithResponse request returning *GetSecurityAdvisorsResponse -func (c *ClientWithResponses) GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetSecurityAdvisorsResponse, error) { - rsp, err := c.GetSecurityAdvisors(ctx, ref, reqEditors...) +func (c *ClientWithResponses) GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, params *GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*GetSecurityAdvisorsResponse, error) { + rsp, err := c.GetSecurityAdvisors(ctx, ref, params, reqEditors...) if err != nil { return nil, err } @@ -11030,6 +11946,33 @@ func (c *ClientWithResponses) V1CreateABranchWithResponse(ctx context.Context, r return ParseV1CreateABranchResponse(rsp) } +// V1DeleteProjectClaimTokenWithResponse request returning *V1DeleteProjectClaimTokenResponse +func (c *ClientWithResponses) V1DeleteProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeleteProjectClaimTokenResponse, error) { + rsp, err := c.V1DeleteProjectClaimToken(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1DeleteProjectClaimTokenResponse(rsp) +} + +// V1GetProjectClaimTokenWithResponse request returning *V1GetProjectClaimTokenResponse +func (c *ClientWithResponses) V1GetProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectClaimTokenResponse, error) { + rsp, err := c.V1GetProjectClaimToken(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetProjectClaimTokenResponse(rsp) +} + +// V1CreateProjectClaimTokenWithResponse request returning *V1CreateProjectClaimTokenResponse +func (c *ClientWithResponses) V1CreateProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CreateProjectClaimTokenResponse, error) { + rsp, err := c.V1CreateProjectClaimToken(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1CreateProjectClaimTokenResponse(rsp) +} + // V1GetAuthServiceConfigWithResponse request returning *V1GetAuthServiceConfigResponse func (c *ClientWithResponses) V1GetAuthServiceConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetAuthServiceConfigResponse, error) { rsp, err := c.V1GetAuthServiceConfig(ctx, ref, reqEditors...) @@ -11388,6 +12331,49 @@ func (c *ClientWithResponses) V1RestorePitrBackupWithResponse(ctx context.Contex return ParseV1RestorePitrBackupResponse(rsp) } +// V1GetRestorePointWithResponse request returning *V1GetRestorePointResponse +func (c *ClientWithResponses) V1GetRestorePointWithResponse(ctx context.Context, ref string, params *V1GetRestorePointParams, reqEditors ...RequestEditorFn) (*V1GetRestorePointResponse, error) { + rsp, err := c.V1GetRestorePoint(ctx, ref, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetRestorePointResponse(rsp) +} + +// V1CreateRestorePointWithBodyWithResponse request with arbitrary body returning *V1CreateRestorePointResponse +func (c *ClientWithResponses) V1CreateRestorePointWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateRestorePointResponse, error) { + rsp, err := c.V1CreateRestorePointWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1CreateRestorePointResponse(rsp) +} + +func (c *ClientWithResponses) V1CreateRestorePointWithResponse(ctx context.Context, ref string, body V1CreateRestorePointJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateRestorePointResponse, error) { + rsp, err := c.V1CreateRestorePoint(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1CreateRestorePointResponse(rsp) +} + +// V1UndoWithBodyWithResponse request with arbitrary body returning *V1UndoResponse +func (c *ClientWithResponses) V1UndoWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UndoResponse, error) { + rsp, err := c.V1UndoWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UndoResponse(rsp) +} + +func (c *ClientWithResponses) V1UndoWithResponse(ctx context.Context, ref string, body V1UndoJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UndoResponse, error) { + rsp, err := c.V1Undo(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UndoResponse(rsp) +} + // GetDatabaseMetadataWithResponse request returning *GetDatabaseMetadataResponse func (c *ClientWithResponses) GetDatabaseMetadataWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetDatabaseMetadataResponse, error) { rsp, err := c.GetDatabaseMetadata(ctx, ref, reqEditors...) @@ -12152,6 +13138,22 @@ func ParseV1AuthorizeUserResponse(rsp *http.Response) (*V1AuthorizeUserResponse, return response, nil } +// ParseV1OauthAuthorizeProjectClaimResponse parses an HTTP response from a V1OauthAuthorizeProjectClaimWithResponse call +func ParseV1OauthAuthorizeProjectClaimResponse(rsp *http.Response) (*V1OauthAuthorizeProjectClaimResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1OauthAuthorizeProjectClaimResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseV1RevokeTokenResponse parses an HTTP response from a V1RevokeTokenWithResponse call func ParseV1RevokeTokenResponse(rsp *http.Response) (*V1RevokeTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -12298,6 +13300,48 @@ func ParseV1ListOrganizationMembersResponse(rsp *http.Response) (*V1ListOrganiza return response, nil } +// ParseV1GetOrganizationProjectClaimResponse parses an HTTP response from a V1GetOrganizationProjectClaimWithResponse call +func ParseV1GetOrganizationProjectClaimResponse(rsp *http.Response) (*V1GetOrganizationProjectClaimResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetOrganizationProjectClaimResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OrganizationProjectClaimResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1ClaimProjectForOrganizationResponse parses an HTTP response from a V1ClaimProjectForOrganizationWithResponse call +func ParseV1ClaimProjectForOrganizationResponse(rsp *http.Response) (*V1ClaimProjectForOrganizationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1ClaimProjectForOrganizationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseV1ListAllProjectsResponse parses an HTTP response from a V1ListAllProjectsWithResponse call func ParseV1ListAllProjectsResponse(rsp *http.Response) (*V1ListAllProjectsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -12840,6 +13884,74 @@ func ParseV1CreateABranchResponse(rsp *http.Response) (*V1CreateABranchResponse, return response, nil } +// ParseV1DeleteProjectClaimTokenResponse parses an HTTP response from a V1DeleteProjectClaimTokenWithResponse call +func ParseV1DeleteProjectClaimTokenResponse(rsp *http.Response) (*V1DeleteProjectClaimTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1DeleteProjectClaimTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseV1GetProjectClaimTokenResponse parses an HTTP response from a V1GetProjectClaimTokenWithResponse call +func ParseV1GetProjectClaimTokenResponse(rsp *http.Response) (*V1GetProjectClaimTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetProjectClaimTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ProjectClaimTokenResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1CreateProjectClaimTokenResponse parses an HTTP response from a V1CreateProjectClaimTokenWithResponse call +func ParseV1CreateProjectClaimTokenResponse(rsp *http.Response) (*V1CreateProjectClaimTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1CreateProjectClaimTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CreateProjectClaimTokenResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseV1GetAuthServiceConfigResponse parses an HTTP response from a V1GetAuthServiceConfigWithResponse call func ParseV1GetAuthServiceConfigResponse(rsp *http.Response) (*V1GetAuthServiceConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -13590,6 +14702,74 @@ func ParseV1RestorePitrBackupResponse(rsp *http.Response) (*V1RestorePitrBackupR return response, nil } +// ParseV1GetRestorePointResponse parses an HTTP response from a V1GetRestorePointWithResponse call +func ParseV1GetRestorePointResponse(rsp *http.Response) (*V1GetRestorePointResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetRestorePointResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest V1RestorePointResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1CreateRestorePointResponse parses an HTTP response from a V1CreateRestorePointWithResponse call +func ParseV1CreateRestorePointResponse(rsp *http.Response) (*V1CreateRestorePointResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1CreateRestorePointResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest V1RestorePointResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil +} + +// ParseV1UndoResponse parses an HTTP response from a V1UndoWithResponse call +func ParseV1UndoResponse(rsp *http.Response) (*V1UndoResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1UndoResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseGetDatabaseMetadataResponse parses an HTTP response from a GetDatabaseMetadataWithResponse call func ParseGetDatabaseMetadataResponse(rsp *http.Response) (*GetDatabaseMetadataResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 50148b79f..b9ec43b0b 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -462,6 +462,22 @@ const ( Bearer OAuthTokenResponseTokenType = "Bearer" ) +// Defines values for OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan. +const ( + OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanEnterprise OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "enterprise" + OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanFree OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "free" + OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanPro OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "pro" + OrganizationProjectClaimResponsePreviewSourceSubscriptionPlanTeam OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan = "team" +) + +// Defines values for OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan. +const ( + OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanEnterprise OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "enterprise" + OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanFree OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "free" + OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanPro OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "pro" + OrganizationProjectClaimResponsePreviewTargetSubscriptionPlanTeam OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan = "team" +) + // Defines values for PostgresConfigResponseSessionReplicationRole. const ( PostgresConfigResponseSessionReplicationRoleLocal PostgresConfigResponseSessionReplicationRole = "local" @@ -853,6 +869,13 @@ const ( V1ProjectWithDatabaseResponseStatusUPGRADING V1ProjectWithDatabaseResponseStatus = "UPGRADING" ) +// Defines values for V1RestorePointResponseStatus. +const ( + V1RestorePointResponseStatusAVAILABLE V1RestorePointResponseStatus = "AVAILABLE" + V1RestorePointResponseStatusPENDING V1RestorePointResponseStatus = "PENDING" + V1RestorePointResponseStatusREMOVED V1RestorePointResponseStatus = "REMOVED" +) + // Defines values for V1ServiceHealthResponseInfo0Name. const ( GoTrue V1ServiceHealthResponseInfo0Name = "GoTrue" @@ -870,9 +893,9 @@ const ( // Defines values for V1ServiceHealthResponseStatus. const ( - V1ServiceHealthResponseStatusACTIVEHEALTHY V1ServiceHealthResponseStatus = "ACTIVE_HEALTHY" - V1ServiceHealthResponseStatusCOMINGUP V1ServiceHealthResponseStatus = "COMING_UP" - V1ServiceHealthResponseStatusUNHEALTHY V1ServiceHealthResponseStatus = "UNHEALTHY" + ACTIVEHEALTHY V1ServiceHealthResponseStatus = "ACTIVE_HEALTHY" + COMINGUP V1ServiceHealthResponseStatus = "COMING_UP" + UNHEALTHY V1ServiceHealthResponseStatus = "UNHEALTHY" ) // Defines values for VanitySubdomainConfigResponseStatus. @@ -884,16 +907,35 @@ const ( // Defines values for V1AuthorizeUserParamsResponseType. const ( - Code V1AuthorizeUserParamsResponseType = "code" - IdTokenToken V1AuthorizeUserParamsResponseType = "id_token token" - Token V1AuthorizeUserParamsResponseType = "token" + V1AuthorizeUserParamsResponseTypeCode V1AuthorizeUserParamsResponseType = "code" + V1AuthorizeUserParamsResponseTypeIdTokenToken V1AuthorizeUserParamsResponseType = "id_token token" + V1AuthorizeUserParamsResponseTypeToken V1AuthorizeUserParamsResponseType = "token" ) // Defines values for V1AuthorizeUserParamsCodeChallengeMethod. const ( - Plain V1AuthorizeUserParamsCodeChallengeMethod = "plain" - S256 V1AuthorizeUserParamsCodeChallengeMethod = "S256" - Sha256 V1AuthorizeUserParamsCodeChallengeMethod = "sha256" + V1AuthorizeUserParamsCodeChallengeMethodPlain V1AuthorizeUserParamsCodeChallengeMethod = "plain" + V1AuthorizeUserParamsCodeChallengeMethodS256 V1AuthorizeUserParamsCodeChallengeMethod = "S256" + V1AuthorizeUserParamsCodeChallengeMethodSha256 V1AuthorizeUserParamsCodeChallengeMethod = "sha256" +) + +// Defines values for V1OauthAuthorizeProjectClaimParamsResponseType. +const ( + V1OauthAuthorizeProjectClaimParamsResponseTypeCode V1OauthAuthorizeProjectClaimParamsResponseType = "code" + V1OauthAuthorizeProjectClaimParamsResponseTypeIdTokenToken V1OauthAuthorizeProjectClaimParamsResponseType = "id_token token" + V1OauthAuthorizeProjectClaimParamsResponseTypeToken V1OauthAuthorizeProjectClaimParamsResponseType = "token" +) + +// Defines values for V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod. +const ( + V1OauthAuthorizeProjectClaimParamsCodeChallengeMethodPlain V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod = "plain" + V1OauthAuthorizeProjectClaimParamsCodeChallengeMethodS256 V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod = "S256" + V1OauthAuthorizeProjectClaimParamsCodeChallengeMethodSha256 V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod = "sha256" +) + +// Defines values for GetSecurityAdvisorsParamsLintType. +const ( + Sql GetSecurityAdvisorsParamsLintType = "sql" ) // Defines values for GetApiCountsParamsInterval. @@ -1336,6 +1378,15 @@ type CreateOrganizationV1 struct { Name string `json:"name"` } +// CreateProjectClaimTokenResponse defines model for CreateProjectClaimTokenResponse. +type CreateProjectClaimTokenResponse struct { + CreatedAt string `json:"created_at"` + CreatedBy openapi_types.UUID `json:"created_by"` + ExpiresAt string `json:"expires_at"` + Token string `json:"token"` + TokenAlias string `json:"token_alias"` +} + // CreateProviderBody defines model for CreateProviderBody. type CreateProviderBody struct { AttributeMapping *struct { @@ -1797,6 +1848,46 @@ type OAuthTokenResponse struct { // OAuthTokenResponseTokenType defines model for OAuthTokenResponse.TokenType. type OAuthTokenResponseTokenType string +// OrganizationProjectClaimResponse defines model for OrganizationProjectClaimResponse. +type OrganizationProjectClaimResponse struct { + CreatedAt string `json:"created_at"` + CreatedBy openapi_types.UUID `json:"created_by"` + ExpiresAt string `json:"expires_at"` + Preview struct { + Errors []struct { + Key string `json:"key"` + Message string `json:"message"` + } `json:"errors"` + Info []struct { + Key string `json:"key"` + Message string `json:"message"` + } `json:"info"` + MembersExceedingFreeProjectLimit []struct { + Limit float32 `json:"limit"` + Name string `json:"name"` + } `json:"members_exceeding_free_project_limit"` + SourceSubscriptionPlan OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan `json:"source_subscription_plan"` + TargetOrganizationEligible nullable.Nullable[bool] `json:"target_organization_eligible"` + TargetOrganizationHasFreeProjectSlots nullable.Nullable[bool] `json:"target_organization_has_free_project_slots"` + TargetSubscriptionPlan nullable.Nullable[OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan] `json:"target_subscription_plan"` + Valid bool `json:"valid"` + Warnings []struct { + Key string `json:"key"` + Message string `json:"message"` + } `json:"warnings"` + } `json:"preview"` + Project struct { + Name string `json:"name"` + Ref string `json:"ref"` + } `json:"project"` +} + +// OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan defines model for OrganizationProjectClaimResponse.Preview.SourceSubscriptionPlan. +type OrganizationProjectClaimResponsePreviewSourceSubscriptionPlan string + +// OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan defines model for OrganizationProjectClaimResponse.Preview.TargetSubscriptionPlan. +type OrganizationProjectClaimResponsePreviewTargetSubscriptionPlan string + // OrganizationResponseV1 defines model for OrganizationResponseV1. type OrganizationResponseV1 struct { Id string `json:"id"` @@ -1849,6 +1940,14 @@ type PostgrestConfigWithJWTSecretResponse struct { MaxRows int `json:"max_rows"` } +// ProjectClaimTokenResponse defines model for ProjectClaimTokenResponse. +type ProjectClaimTokenResponse struct { + CreatedAt string `json:"created_at"` + CreatedBy openapi_types.UUID `json:"created_by"` + ExpiresAt string `json:"expires_at"` + TokenAlias string `json:"token_alias"` +} + // ProjectUpgradeEligibilityResponse defines model for ProjectUpgradeEligibilityResponse. type ProjectUpgradeEligibilityResponse struct { CurrentAppVersion string `json:"current_app_version"` @@ -2697,6 +2796,20 @@ type V1RestorePitrBody struct { RecoveryTimeTargetUnix int64 `json:"recovery_time_target_unix"` } +// V1RestorePointPostBody defines model for V1RestorePointPostBody. +type V1RestorePointPostBody struct { + Name string `json:"name"` +} + +// V1RestorePointResponse defines model for V1RestorePointResponse. +type V1RestorePointResponse struct { + Name string `json:"name"` + Status V1RestorePointResponseStatus `json:"status"` +} + +// V1RestorePointResponseStatus defines model for V1RestorePointResponse.Status. +type V1RestorePointResponseStatus string + // V1RunQueryBody defines model for V1RunQueryBody. type V1RunQueryBody struct { Query string `json:"query"` @@ -2750,6 +2863,11 @@ type V1StorageBucketResponse struct { UpdatedAt string `json:"updated_at"` } +// V1UndoBody defines model for V1UndoBody. +type V1UndoBody struct { + Name string `json:"name"` +} + // V1UpdateFunctionBody defines model for V1UpdateFunctionBody. type V1UpdateFunctionBody struct { Body *string `json:"body,omitempty"` @@ -2808,6 +2926,33 @@ type V1AuthorizeUserParamsResponseType string // V1AuthorizeUserParamsCodeChallengeMethod defines parameters for V1AuthorizeUser. type V1AuthorizeUserParamsCodeChallengeMethod string +// V1OauthAuthorizeProjectClaimParams defines parameters for V1OauthAuthorizeProjectClaim. +type V1OauthAuthorizeProjectClaimParams struct { + // ProjectRef Project ref + ProjectRef string `form:"project_ref" json:"project_ref"` + ClientId openapi_types.UUID `form:"client_id" json:"client_id"` + ResponseType V1OauthAuthorizeProjectClaimParamsResponseType `form:"response_type" json:"response_type"` + RedirectUri string `form:"redirect_uri" json:"redirect_uri"` + State *string `form:"state,omitempty" json:"state,omitempty"` + ResponseMode *string `form:"response_mode,omitempty" json:"response_mode,omitempty"` + CodeChallenge *string `form:"code_challenge,omitempty" json:"code_challenge,omitempty"` + CodeChallengeMethod *V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod `form:"code_challenge_method,omitempty" json:"code_challenge_method,omitempty"` +} + +// V1OauthAuthorizeProjectClaimParamsResponseType defines parameters for V1OauthAuthorizeProjectClaim. +type V1OauthAuthorizeProjectClaimParamsResponseType string + +// V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod defines parameters for V1OauthAuthorizeProjectClaim. +type V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod string + +// GetSecurityAdvisorsParams defines parameters for GetSecurityAdvisors. +type GetSecurityAdvisorsParams struct { + LintType *GetSecurityAdvisorsParamsLintType `form:"lint_type,omitempty" json:"lint_type,omitempty"` +} + +// GetSecurityAdvisorsParamsLintType defines parameters for GetSecurityAdvisors. +type GetSecurityAdvisorsParamsLintType string + // GetLogsParams defines parameters for GetLogs. type GetLogsParams struct { Sql *string `form:"sql,omitempty" json:"sql,omitempty"` @@ -2863,6 +3008,11 @@ type UpdateApiKeyParams struct { Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } +// V1GetRestorePointParams defines parameters for V1GetRestorePoint. +type V1GetRestorePointParams struct { + Name *string `form:"name,omitempty" json:"name,omitempty"` +} + // V1ApplyAMigrationParams defines parameters for V1ApplyAMigration. type V1ApplyAMigrationParams struct { // IdempotencyKey A unique key to ensure the same migration is tracked only once. @@ -3018,6 +3168,12 @@ type V1UpdateHostnameConfigJSONRequestBody = UpdateCustomHostnameBody // V1RestorePitrBackupJSONRequestBody defines body for V1RestorePitrBackup for application/json ContentType. type V1RestorePitrBackupJSONRequestBody = V1RestorePitrBody +// V1CreateRestorePointJSONRequestBody defines body for V1CreateRestorePoint for application/json ContentType. +type V1CreateRestorePointJSONRequestBody = V1RestorePointPostBody + +// V1UndoJSONRequestBody defines body for V1Undo for application/json ContentType. +type V1UndoJSONRequestBody = V1UndoBody + // V1ApplyAMigrationJSONRequestBody defines body for V1ApplyAMigration for application/json ContentType. type V1ApplyAMigrationJSONRequestBody = V1CreateMigrationBody From 66916d4136ce2ba73bbea5145a8ec34fab4d3e97 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Wed, 18 Jun 2025 11:58:52 +0200 Subject: [PATCH 213/359] chore: sync API types from infrastructure (#3733) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/client.gen.go | 856 +++++++++++++++++++++--------------------- pkg/api/types.gen.go | 84 ++--- 2 files changed, 470 insertions(+), 470 deletions(-) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index 0527d078a..a00065344 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -169,45 +169,45 @@ type ClientInterface interface { // V1GetProject request V1GetProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetPerformanceAdvisors request - GetPerformanceAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetPerformanceAdvisors request + V1GetPerformanceAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSecurityAdvisors request - GetSecurityAdvisors(ctx context.Context, ref string, params *GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetSecurityAdvisors request + V1GetSecurityAdvisors(ctx context.Context, ref string, params *V1GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetLogs request - GetLogs(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectLogs request + V1GetProjectLogs(ctx context.Context, ref string, params *V1GetProjectLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetApiCounts request - GetApiCounts(ctx context.Context, ref string, params *GetApiCountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectUsageApiCount request + V1GetProjectUsageApiCount(ctx context.Context, ref string, params *V1GetProjectUsageApiCountParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetApiRequestsCount request - GetApiRequestsCount(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectUsageRequestCount request + V1GetProjectUsageRequestCount(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) // V1GetProjectApiKeys request V1GetProjectApiKeys(ctx context.Context, ref string, params *V1GetProjectApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateApiKeyWithBody request with any body - CreateApiKeyWithBody(ctx context.Context, ref string, params *CreateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1CreateProjectApiKeyWithBody request with any body + V1CreateProjectApiKeyWithBody(ctx context.Context, ref string, params *V1CreateProjectApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateApiKey(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + V1CreateProjectApiKey(ctx context.Context, ref string, params *V1CreateProjectApiKeyParams, body V1CreateProjectApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // CheckLegacyApiKeys request - CheckLegacyApiKeys(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectLegacyApiKeys request + V1GetProjectLegacyApiKeys(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdateLegacyApiKeys request - UpdateLegacyApiKeys(ctx context.Context, ref string, params *UpdateLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1UpdateProjectLegacyApiKeys request + V1UpdateProjectLegacyApiKeys(ctx context.Context, ref string, params *V1UpdateProjectLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteApiKey request - DeleteApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1DeleteProjectApiKey request + V1DeleteProjectApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *V1DeleteProjectApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetApiKey request - GetApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectApiKey request + V1GetProjectApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *V1GetProjectApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdateApiKeyWithBody request with any body - UpdateApiKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1UpdateProjectApiKeyWithBody request with any body + V1UpdateProjectApiKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + V1UpdateProjectApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, body V1UpdateProjectApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // V1ListProjectAddons request V1ListProjectAddons(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -248,24 +248,24 @@ type ClientInterface interface { V1UpdateAuthServiceConfig(ctx context.Context, ref string, body V1UpdateAuthServiceConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListSigningKeysForProject request - ListSigningKeysForProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectSigningKeys request + V1GetProjectSigningKeys(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateSigningKeyForProjectWithBody request with any body - CreateSigningKeyForProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1CreateProjectSigningKeyWithBody request with any body + V1CreateProjectSigningKeyWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateSigningKeyForProject(ctx context.Context, ref string, body CreateSigningKeyForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + V1CreateProjectSigningKey(ctx context.Context, ref string, body V1CreateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteSigningKey request - DeleteSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1RemoveProjectSigningKey request + V1RemoveProjectSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSigningKeyForProject request - GetSigningKeyForProject(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectSigningKey request + V1GetProjectSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) - // PatchSigningKeyWithBody request with any body - PatchSigningKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1UpdateProjectSigningKeyWithBody request with any body + V1UpdateProjectSigningKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - PatchSigningKey(ctx context.Context, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + V1UpdateProjectSigningKey(ctx context.Context, ref string, id openapi_types.UUID, body V1UpdateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // V1ListAllSsoProvider request V1ListAllSsoProvider(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -286,19 +286,19 @@ type ClientInterface interface { V1UpdateASsoProvider(ctx context.Context, ref string, providerId openapi_types.UUID, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListTPAForProject request - ListTPAForProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1ListProjectTpaIntegrations request + V1ListProjectTpaIntegrations(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateTPAForProjectWithBody request with any body - CreateTPAForProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1CreateProjectTpaIntegrationWithBody request with any body + V1CreateProjectTpaIntegrationWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateTPAForProject(ctx context.Context, ref string, body CreateTPAForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + V1CreateProjectTpaIntegration(ctx context.Context, ref string, body V1CreateProjectTpaIntegrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteTPAForProject request - DeleteTPAForProject(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1DeleteProjectTpaIntegration request + V1DeleteProjectTpaIntegration(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetTPAForProject request - GetTPAForProject(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetProjectTpaIntegration request + V1GetProjectTpaIntegration(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) // V1GetProjectPgbouncerConfig request V1GetProjectPgbouncerConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -365,8 +365,8 @@ type ClientInterface interface { V1Undo(ctx context.Context, ref string, body V1UndoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetDatabaseMetadata request - GetDatabaseMetadata(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetDatabaseMetadata request + V1GetDatabaseMetadata(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) // V1ListMigrationHistory request V1ListMigrationHistory(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -894,8 +894,8 @@ func (c *Client) V1GetProject(ctx context.Context, ref string, reqEditors ...Req return c.Client.Do(req) } -func (c *Client) GetPerformanceAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPerformanceAdvisorsRequest(c.Server, ref) +func (c *Client) V1GetPerformanceAdvisors(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetPerformanceAdvisorsRequest(c.Server, ref) if err != nil { return nil, err } @@ -906,8 +906,8 @@ func (c *Client) GetPerformanceAdvisors(ctx context.Context, ref string, reqEdit return c.Client.Do(req) } -func (c *Client) GetSecurityAdvisors(ctx context.Context, ref string, params *GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSecurityAdvisorsRequest(c.Server, ref, params) +func (c *Client) V1GetSecurityAdvisors(ctx context.Context, ref string, params *V1GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetSecurityAdvisorsRequest(c.Server, ref, params) if err != nil { return nil, err } @@ -918,8 +918,8 @@ func (c *Client) GetSecurityAdvisors(ctx context.Context, ref string, params *Ge return c.Client.Do(req) } -func (c *Client) GetLogs(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetLogsRequest(c.Server, ref, params) +func (c *Client) V1GetProjectLogs(ctx context.Context, ref string, params *V1GetProjectLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectLogsRequest(c.Server, ref, params) if err != nil { return nil, err } @@ -930,8 +930,8 @@ func (c *Client) GetLogs(ctx context.Context, ref string, params *GetLogsParams, return c.Client.Do(req) } -func (c *Client) GetApiCounts(ctx context.Context, ref string, params *GetApiCountsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetApiCountsRequest(c.Server, ref, params) +func (c *Client) V1GetProjectUsageApiCount(ctx context.Context, ref string, params *V1GetProjectUsageApiCountParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectUsageApiCountRequest(c.Server, ref, params) if err != nil { return nil, err } @@ -942,8 +942,8 @@ func (c *Client) GetApiCounts(ctx context.Context, ref string, params *GetApiCou return c.Client.Do(req) } -func (c *Client) GetApiRequestsCount(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetApiRequestsCountRequest(c.Server, ref) +func (c *Client) V1GetProjectUsageRequestCount(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectUsageRequestCountRequest(c.Server, ref) if err != nil { return nil, err } @@ -966,8 +966,8 @@ func (c *Client) V1GetProjectApiKeys(ctx context.Context, ref string, params *V1 return c.Client.Do(req) } -func (c *Client) CreateApiKeyWithBody(ctx context.Context, ref string, params *CreateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateApiKeyRequestWithBody(c.Server, ref, params, contentType, body) +func (c *Client) V1CreateProjectApiKeyWithBody(ctx context.Context, ref string, params *V1CreateProjectApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateProjectApiKeyRequestWithBody(c.Server, ref, params, contentType, body) if err != nil { return nil, err } @@ -978,8 +978,8 @@ func (c *Client) CreateApiKeyWithBody(ctx context.Context, ref string, params *C return c.Client.Do(req) } -func (c *Client) CreateApiKey(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateApiKeyRequest(c.Server, ref, params, body) +func (c *Client) V1CreateProjectApiKey(ctx context.Context, ref string, params *V1CreateProjectApiKeyParams, body V1CreateProjectApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateProjectApiKeyRequest(c.Server, ref, params, body) if err != nil { return nil, err } @@ -990,8 +990,8 @@ func (c *Client) CreateApiKey(ctx context.Context, ref string, params *CreateApi return c.Client.Do(req) } -func (c *Client) CheckLegacyApiKeys(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCheckLegacyApiKeysRequest(c.Server, ref) +func (c *Client) V1GetProjectLegacyApiKeys(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectLegacyApiKeysRequest(c.Server, ref) if err != nil { return nil, err } @@ -1002,8 +1002,8 @@ func (c *Client) CheckLegacyApiKeys(ctx context.Context, ref string, reqEditors return c.Client.Do(req) } -func (c *Client) UpdateLegacyApiKeys(ctx context.Context, ref string, params *UpdateLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateLegacyApiKeysRequest(c.Server, ref, params) +func (c *Client) V1UpdateProjectLegacyApiKeys(ctx context.Context, ref string, params *V1UpdateProjectLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateProjectLegacyApiKeysRequest(c.Server, ref, params) if err != nil { return nil, err } @@ -1014,8 +1014,8 @@ func (c *Client) UpdateLegacyApiKeys(ctx context.Context, ref string, params *Up return c.Client.Do(req) } -func (c *Client) DeleteApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteApiKeyRequest(c.Server, ref, id, params) +func (c *Client) V1DeleteProjectApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *V1DeleteProjectApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1DeleteProjectApiKeyRequest(c.Server, ref, id, params) if err != nil { return nil, err } @@ -1026,8 +1026,8 @@ func (c *Client) DeleteApiKey(ctx context.Context, ref string, id openapi_types. return c.Client.Do(req) } -func (c *Client) GetApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetApiKeyRequest(c.Server, ref, id, params) +func (c *Client) V1GetProjectApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *V1GetProjectApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectApiKeyRequest(c.Server, ref, id, params) if err != nil { return nil, err } @@ -1038,8 +1038,8 @@ func (c *Client) GetApiKey(ctx context.Context, ref string, id openapi_types.UUI return c.Client.Do(req) } -func (c *Client) UpdateApiKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateApiKeyRequestWithBody(c.Server, ref, id, params, contentType, body) +func (c *Client) V1UpdateProjectApiKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateProjectApiKeyRequestWithBody(c.Server, ref, id, params, contentType, body) if err != nil { return nil, err } @@ -1050,8 +1050,8 @@ func (c *Client) UpdateApiKeyWithBody(ctx context.Context, ref string, id openap return c.Client.Do(req) } -func (c *Client) UpdateApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateApiKeyRequest(c.Server, ref, id, params, body) +func (c *Client) V1UpdateProjectApiKey(ctx context.Context, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, body V1UpdateProjectApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateProjectApiKeyRequest(c.Server, ref, id, params, body) if err != nil { return nil, err } @@ -1230,8 +1230,8 @@ func (c *Client) V1UpdateAuthServiceConfig(ctx context.Context, ref string, body return c.Client.Do(req) } -func (c *Client) ListSigningKeysForProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListSigningKeysForProjectRequest(c.Server, ref) +func (c *Client) V1GetProjectSigningKeys(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectSigningKeysRequest(c.Server, ref) if err != nil { return nil, err } @@ -1242,8 +1242,8 @@ func (c *Client) ListSigningKeysForProject(ctx context.Context, ref string, reqE return c.Client.Do(req) } -func (c *Client) CreateSigningKeyForProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateSigningKeyForProjectRequestWithBody(c.Server, ref, contentType, body) +func (c *Client) V1CreateProjectSigningKeyWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateProjectSigningKeyRequestWithBody(c.Server, ref, contentType, body) if err != nil { return nil, err } @@ -1254,8 +1254,8 @@ func (c *Client) CreateSigningKeyForProjectWithBody(ctx context.Context, ref str return c.Client.Do(req) } -func (c *Client) CreateSigningKeyForProject(ctx context.Context, ref string, body CreateSigningKeyForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateSigningKeyForProjectRequest(c.Server, ref, body) +func (c *Client) V1CreateProjectSigningKey(ctx context.Context, ref string, body V1CreateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateProjectSigningKeyRequest(c.Server, ref, body) if err != nil { return nil, err } @@ -1266,8 +1266,8 @@ func (c *Client) CreateSigningKeyForProject(ctx context.Context, ref string, bod return c.Client.Do(req) } -func (c *Client) DeleteSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteSigningKeyRequest(c.Server, ref, id) +func (c *Client) V1RemoveProjectSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1RemoveProjectSigningKeyRequest(c.Server, ref, id) if err != nil { return nil, err } @@ -1278,8 +1278,8 @@ func (c *Client) DeleteSigningKey(ctx context.Context, ref string, id openapi_ty return c.Client.Do(req) } -func (c *Client) GetSigningKeyForProject(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSigningKeyForProjectRequest(c.Server, ref, id) +func (c *Client) V1GetProjectSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectSigningKeyRequest(c.Server, ref, id) if err != nil { return nil, err } @@ -1290,8 +1290,8 @@ func (c *Client) GetSigningKeyForProject(ctx context.Context, ref string, id ope return c.Client.Do(req) } -func (c *Client) PatchSigningKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchSigningKeyRequestWithBody(c.Server, ref, id, contentType, body) +func (c *Client) V1UpdateProjectSigningKeyWithBody(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateProjectSigningKeyRequestWithBody(c.Server, ref, id, contentType, body) if err != nil { return nil, err } @@ -1302,8 +1302,8 @@ func (c *Client) PatchSigningKeyWithBody(ctx context.Context, ref string, id ope return c.Client.Do(req) } -func (c *Client) PatchSigningKey(ctx context.Context, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPatchSigningKeyRequest(c.Server, ref, id, body) +func (c *Client) V1UpdateProjectSigningKey(ctx context.Context, ref string, id openapi_types.UUID, body V1UpdateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateProjectSigningKeyRequest(c.Server, ref, id, body) if err != nil { return nil, err } @@ -1398,8 +1398,8 @@ func (c *Client) V1UpdateASsoProvider(ctx context.Context, ref string, providerI return c.Client.Do(req) } -func (c *Client) ListTPAForProject(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListTPAForProjectRequest(c.Server, ref) +func (c *Client) V1ListProjectTpaIntegrations(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ListProjectTpaIntegrationsRequest(c.Server, ref) if err != nil { return nil, err } @@ -1410,8 +1410,8 @@ func (c *Client) ListTPAForProject(ctx context.Context, ref string, reqEditors . return c.Client.Do(req) } -func (c *Client) CreateTPAForProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateTPAForProjectRequestWithBody(c.Server, ref, contentType, body) +func (c *Client) V1CreateProjectTpaIntegrationWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateProjectTpaIntegrationRequestWithBody(c.Server, ref, contentType, body) if err != nil { return nil, err } @@ -1422,8 +1422,8 @@ func (c *Client) CreateTPAForProjectWithBody(ctx context.Context, ref string, co return c.Client.Do(req) } -func (c *Client) CreateTPAForProject(ctx context.Context, ref string, body CreateTPAForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateTPAForProjectRequest(c.Server, ref, body) +func (c *Client) V1CreateProjectTpaIntegration(ctx context.Context, ref string, body V1CreateProjectTpaIntegrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateProjectTpaIntegrationRequest(c.Server, ref, body) if err != nil { return nil, err } @@ -1434,8 +1434,8 @@ func (c *Client) CreateTPAForProject(ctx context.Context, ref string, body Creat return c.Client.Do(req) } -func (c *Client) DeleteTPAForProject(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteTPAForProjectRequest(c.Server, ref, tpaId) +func (c *Client) V1DeleteProjectTpaIntegration(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1DeleteProjectTpaIntegrationRequest(c.Server, ref, tpaId) if err != nil { return nil, err } @@ -1446,8 +1446,8 @@ func (c *Client) DeleteTPAForProject(ctx context.Context, ref string, tpaId open return c.Client.Do(req) } -func (c *Client) GetTPAForProject(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetTPAForProjectRequest(c.Server, ref, tpaId) +func (c *Client) V1GetProjectTpaIntegration(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetProjectTpaIntegrationRequest(c.Server, ref, tpaId) if err != nil { return nil, err } @@ -1746,8 +1746,8 @@ func (c *Client) V1Undo(ctx context.Context, ref string, body V1UndoJSONRequestB return c.Client.Do(req) } -func (c *Client) GetDatabaseMetadata(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDatabaseMetadataRequest(c.Server, ref) +func (c *Client) V1GetDatabaseMetadata(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetDatabaseMetadataRequest(c.Server, ref) if err != nil { return nil, err } @@ -3576,8 +3576,8 @@ func NewV1GetProjectRequest(server string, ref string) (*http.Request, error) { return req, nil } -// NewGetPerformanceAdvisorsRequest generates requests for GetPerformanceAdvisors -func NewGetPerformanceAdvisorsRequest(server string, ref string) (*http.Request, error) { +// NewV1GetPerformanceAdvisorsRequest generates requests for V1GetPerformanceAdvisors +func NewV1GetPerformanceAdvisorsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3610,8 +3610,8 @@ func NewGetPerformanceAdvisorsRequest(server string, ref string) (*http.Request, return req, nil } -// NewGetSecurityAdvisorsRequest generates requests for GetSecurityAdvisors -func NewGetSecurityAdvisorsRequest(server string, ref string, params *GetSecurityAdvisorsParams) (*http.Request, error) { +// NewV1GetSecurityAdvisorsRequest generates requests for V1GetSecurityAdvisors +func NewV1GetSecurityAdvisorsRequest(server string, ref string, params *V1GetSecurityAdvisorsParams) (*http.Request, error) { var err error var pathParam0 string @@ -3666,8 +3666,8 @@ func NewGetSecurityAdvisorsRequest(server string, ref string, params *GetSecurit return req, nil } -// NewGetLogsRequest generates requests for GetLogs -func NewGetLogsRequest(server string, ref string, params *GetLogsParams) (*http.Request, error) { +// NewV1GetProjectLogsRequest generates requests for V1GetProjectLogs +func NewV1GetProjectLogsRequest(server string, ref string, params *V1GetProjectLogsParams) (*http.Request, error) { var err error var pathParam0 string @@ -3754,8 +3754,8 @@ func NewGetLogsRequest(server string, ref string, params *GetLogsParams) (*http. return req, nil } -// NewGetApiCountsRequest generates requests for GetApiCounts -func NewGetApiCountsRequest(server string, ref string, params *GetApiCountsParams) (*http.Request, error) { +// NewV1GetProjectUsageApiCountRequest generates requests for V1GetProjectUsageApiCount +func NewV1GetProjectUsageApiCountRequest(server string, ref string, params *V1GetProjectUsageApiCountParams) (*http.Request, error) { var err error var pathParam0 string @@ -3810,8 +3810,8 @@ func NewGetApiCountsRequest(server string, ref string, params *GetApiCountsParam return req, nil } -// NewGetApiRequestsCountRequest generates requests for GetApiRequestsCount -func NewGetApiRequestsCountRequest(server string, ref string) (*http.Request, error) { +// NewV1GetProjectUsageRequestCountRequest generates requests for V1GetProjectUsageRequestCount +func NewV1GetProjectUsageRequestCountRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -3900,19 +3900,19 @@ func NewV1GetProjectApiKeysRequest(server string, ref string, params *V1GetProje return req, nil } -// NewCreateApiKeyRequest calls the generic CreateApiKey builder with application/json body -func NewCreateApiKeyRequest(server string, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody) (*http.Request, error) { +// NewV1CreateProjectApiKeyRequest calls the generic V1CreateProjectApiKey builder with application/json body +func NewV1CreateProjectApiKeyRequest(server string, ref string, params *V1CreateProjectApiKeyParams, body V1CreateProjectApiKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateApiKeyRequestWithBody(server, ref, params, "application/json", bodyReader) + return NewV1CreateProjectApiKeyRequestWithBody(server, ref, params, "application/json", bodyReader) } -// NewCreateApiKeyRequestWithBody generates requests for CreateApiKey with any type of body -func NewCreateApiKeyRequestWithBody(server string, ref string, params *CreateApiKeyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewV1CreateProjectApiKeyRequestWithBody generates requests for V1CreateProjectApiKey with any type of body +func NewV1CreateProjectApiKeyRequestWithBody(server string, ref string, params *V1CreateProjectApiKeyParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -3969,8 +3969,8 @@ func NewCreateApiKeyRequestWithBody(server string, ref string, params *CreateApi return req, nil } -// NewCheckLegacyApiKeysRequest generates requests for CheckLegacyApiKeys -func NewCheckLegacyApiKeysRequest(server string, ref string) (*http.Request, error) { +// NewV1GetProjectLegacyApiKeysRequest generates requests for V1GetProjectLegacyApiKeys +func NewV1GetProjectLegacyApiKeysRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4003,8 +4003,8 @@ func NewCheckLegacyApiKeysRequest(server string, ref string) (*http.Request, err return req, nil } -// NewUpdateLegacyApiKeysRequest generates requests for UpdateLegacyApiKeys -func NewUpdateLegacyApiKeysRequest(server string, ref string, params *UpdateLegacyApiKeysParams) (*http.Request, error) { +// NewV1UpdateProjectLegacyApiKeysRequest generates requests for V1UpdateProjectLegacyApiKeys +func NewV1UpdateProjectLegacyApiKeysRequest(server string, ref string, params *V1UpdateProjectLegacyApiKeysParams) (*http.Request, error) { var err error var pathParam0 string @@ -4055,8 +4055,8 @@ func NewUpdateLegacyApiKeysRequest(server string, ref string, params *UpdateLega return req, nil } -// NewDeleteApiKeyRequest generates requests for DeleteApiKey -func NewDeleteApiKeyRequest(server string, ref string, id openapi_types.UUID, params *DeleteApiKeyParams) (*http.Request, error) { +// NewV1DeleteProjectApiKeyRequest generates requests for V1DeleteProjectApiKey +func NewV1DeleteProjectApiKeyRequest(server string, ref string, id openapi_types.UUID, params *V1DeleteProjectApiKeyParams) (*http.Request, error) { var err error var pathParam0 string @@ -4150,8 +4150,8 @@ func NewDeleteApiKeyRequest(server string, ref string, id openapi_types.UUID, pa return req, nil } -// NewGetApiKeyRequest generates requests for GetApiKey -func NewGetApiKeyRequest(server string, ref string, id openapi_types.UUID, params *GetApiKeyParams) (*http.Request, error) { +// NewV1GetProjectApiKeyRequest generates requests for V1GetProjectApiKey +func NewV1GetProjectApiKeyRequest(server string, ref string, id openapi_types.UUID, params *V1GetProjectApiKeyParams) (*http.Request, error) { var err error var pathParam0 string @@ -4213,19 +4213,19 @@ func NewGetApiKeyRequest(server string, ref string, id openapi_types.UUID, param return req, nil } -// NewUpdateApiKeyRequest calls the generic UpdateApiKey builder with application/json body -func NewUpdateApiKeyRequest(server string, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody) (*http.Request, error) { +// NewV1UpdateProjectApiKeyRequest calls the generic V1UpdateProjectApiKey builder with application/json body +func NewV1UpdateProjectApiKeyRequest(server string, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, body V1UpdateProjectApiKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateApiKeyRequestWithBody(server, ref, id, params, "application/json", bodyReader) + return NewV1UpdateProjectApiKeyRequestWithBody(server, ref, id, params, "application/json", bodyReader) } -// NewUpdateApiKeyRequestWithBody generates requests for UpdateApiKey with any type of body -func NewUpdateApiKeyRequestWithBody(server string, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UpdateProjectApiKeyRequestWithBody generates requests for V1UpdateProjectApiKey with any type of body +func NewV1UpdateProjectApiKeyRequestWithBody(server string, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4709,8 +4709,8 @@ func NewV1UpdateAuthServiceConfigRequestWithBody(server string, ref string, cont return req, nil } -// NewListSigningKeysForProjectRequest generates requests for ListSigningKeysForProject -func NewListSigningKeysForProjectRequest(server string, ref string) (*http.Request, error) { +// NewV1GetProjectSigningKeysRequest generates requests for V1GetProjectSigningKeys +func NewV1GetProjectSigningKeysRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -4743,19 +4743,19 @@ func NewListSigningKeysForProjectRequest(server string, ref string) (*http.Reque return req, nil } -// NewCreateSigningKeyForProjectRequest calls the generic CreateSigningKeyForProject builder with application/json body -func NewCreateSigningKeyForProjectRequest(server string, ref string, body CreateSigningKeyForProjectJSONRequestBody) (*http.Request, error) { +// NewV1CreateProjectSigningKeyRequest calls the generic V1CreateProjectSigningKey builder with application/json body +func NewV1CreateProjectSigningKeyRequest(server string, ref string, body V1CreateProjectSigningKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateSigningKeyForProjectRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1CreateProjectSigningKeyRequestWithBody(server, ref, "application/json", bodyReader) } -// NewCreateSigningKeyForProjectRequestWithBody generates requests for CreateSigningKeyForProject with any type of body -func NewCreateSigningKeyForProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1CreateProjectSigningKeyRequestWithBody generates requests for V1CreateProjectSigningKey with any type of body +func NewV1CreateProjectSigningKeyRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4790,8 +4790,8 @@ func NewCreateSigningKeyForProjectRequestWithBody(server string, ref string, con return req, nil } -// NewDeleteSigningKeyRequest generates requests for DeleteSigningKey -func NewDeleteSigningKeyRequest(server string, ref string, id openapi_types.UUID) (*http.Request, error) { +// NewV1RemoveProjectSigningKeyRequest generates requests for V1RemoveProjectSigningKey +func NewV1RemoveProjectSigningKeyRequest(server string, ref string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -4831,8 +4831,8 @@ func NewDeleteSigningKeyRequest(server string, ref string, id openapi_types.UUID return req, nil } -// NewGetSigningKeyForProjectRequest generates requests for GetSigningKeyForProject -func NewGetSigningKeyForProjectRequest(server string, ref string, id openapi_types.UUID) (*http.Request, error) { +// NewV1GetProjectSigningKeyRequest generates requests for V1GetProjectSigningKey +func NewV1GetProjectSigningKeyRequest(server string, ref string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -4872,19 +4872,19 @@ func NewGetSigningKeyForProjectRequest(server string, ref string, id openapi_typ return req, nil } -// NewPatchSigningKeyRequest calls the generic PatchSigningKey builder with application/json body -func NewPatchSigningKeyRequest(server string, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody) (*http.Request, error) { +// NewV1UpdateProjectSigningKeyRequest calls the generic V1UpdateProjectSigningKey builder with application/json body +func NewV1UpdateProjectSigningKeyRequest(server string, ref string, id openapi_types.UUID, body V1UpdateProjectSigningKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPatchSigningKeyRequestWithBody(server, ref, id, "application/json", bodyReader) + return NewV1UpdateProjectSigningKeyRequestWithBody(server, ref, id, "application/json", bodyReader) } -// NewPatchSigningKeyRequestWithBody generates requests for PatchSigningKey with any type of body -func NewPatchSigningKeyRequestWithBody(server string, ref string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewV1UpdateProjectSigningKeyRequestWithBody generates requests for V1UpdateProjectSigningKey with any type of body +func NewV1UpdateProjectSigningKeyRequestWithBody(server string, ref string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5143,8 +5143,8 @@ func NewV1UpdateASsoProviderRequestWithBody(server string, ref string, providerI return req, nil } -// NewListTPAForProjectRequest generates requests for ListTPAForProject -func NewListTPAForProjectRequest(server string, ref string) (*http.Request, error) { +// NewV1ListProjectTpaIntegrationsRequest generates requests for V1ListProjectTpaIntegrations +func NewV1ListProjectTpaIntegrationsRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -5177,19 +5177,19 @@ func NewListTPAForProjectRequest(server string, ref string) (*http.Request, erro return req, nil } -// NewCreateTPAForProjectRequest calls the generic CreateTPAForProject builder with application/json body -func NewCreateTPAForProjectRequest(server string, ref string, body CreateTPAForProjectJSONRequestBody) (*http.Request, error) { +// NewV1CreateProjectTpaIntegrationRequest calls the generic V1CreateProjectTpaIntegration builder with application/json body +func NewV1CreateProjectTpaIntegrationRequest(server string, ref string, body V1CreateProjectTpaIntegrationJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateTPAForProjectRequestWithBody(server, ref, "application/json", bodyReader) + return NewV1CreateProjectTpaIntegrationRequestWithBody(server, ref, "application/json", bodyReader) } -// NewCreateTPAForProjectRequestWithBody generates requests for CreateTPAForProject with any type of body -func NewCreateTPAForProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { +// NewV1CreateProjectTpaIntegrationRequestWithBody generates requests for V1CreateProjectTpaIntegration with any type of body +func NewV1CreateProjectTpaIntegrationRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5224,8 +5224,8 @@ func NewCreateTPAForProjectRequestWithBody(server string, ref string, contentTyp return req, nil } -// NewDeleteTPAForProjectRequest generates requests for DeleteTPAForProject -func NewDeleteTPAForProjectRequest(server string, ref string, tpaId openapi_types.UUID) (*http.Request, error) { +// NewV1DeleteProjectTpaIntegrationRequest generates requests for V1DeleteProjectTpaIntegration +func NewV1DeleteProjectTpaIntegrationRequest(server string, ref string, tpaId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -5265,8 +5265,8 @@ func NewDeleteTPAForProjectRequest(server string, ref string, tpaId openapi_type return req, nil } -// NewGetTPAForProjectRequest generates requests for GetTPAForProject -func NewGetTPAForProjectRequest(server string, ref string, tpaId openapi_types.UUID) (*http.Request, error) { +// NewV1GetProjectTpaIntegrationRequest generates requests for V1GetProjectTpaIntegration +func NewV1GetProjectTpaIntegrationRequest(server string, ref string, tpaId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -5997,8 +5997,8 @@ func NewV1UndoRequestWithBody(server string, ref string, contentType string, bod return req, nil } -// NewGetDatabaseMetadataRequest generates requests for GetDatabaseMetadata -func NewGetDatabaseMetadataRequest(server string, ref string) (*http.Request, error) { +// NewV1GetDatabaseMetadataRequest generates requests for V1GetDatabaseMetadata +func NewV1GetDatabaseMetadataRequest(server string, ref string) (*http.Request, error) { var err error var pathParam0 string @@ -8444,45 +8444,45 @@ type ClientWithResponsesInterface interface { // V1GetProjectWithResponse request V1GetProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectResponse, error) - // GetPerformanceAdvisorsWithResponse request - GetPerformanceAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetPerformanceAdvisorsResponse, error) + // V1GetPerformanceAdvisorsWithResponse request + V1GetPerformanceAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPerformanceAdvisorsResponse, error) - // GetSecurityAdvisorsWithResponse request - GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, params *GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*GetSecurityAdvisorsResponse, error) + // V1GetSecurityAdvisorsWithResponse request + V1GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, params *V1GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*V1GetSecurityAdvisorsResponse, error) - // GetLogsWithResponse request - GetLogsWithResponse(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*GetLogsResponse, error) + // V1GetProjectLogsWithResponse request + V1GetProjectLogsWithResponse(ctx context.Context, ref string, params *V1GetProjectLogsParams, reqEditors ...RequestEditorFn) (*V1GetProjectLogsResponse, error) - // GetApiCountsWithResponse request - GetApiCountsWithResponse(ctx context.Context, ref string, params *GetApiCountsParams, reqEditors ...RequestEditorFn) (*GetApiCountsResponse, error) + // V1GetProjectUsageApiCountWithResponse request + V1GetProjectUsageApiCountWithResponse(ctx context.Context, ref string, params *V1GetProjectUsageApiCountParams, reqEditors ...RequestEditorFn) (*V1GetProjectUsageApiCountResponse, error) - // GetApiRequestsCountWithResponse request - GetApiRequestsCountWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetApiRequestsCountResponse, error) + // V1GetProjectUsageRequestCountWithResponse request + V1GetProjectUsageRequestCountWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectUsageRequestCountResponse, error) // V1GetProjectApiKeysWithResponse request V1GetProjectApiKeysWithResponse(ctx context.Context, ref string, params *V1GetProjectApiKeysParams, reqEditors ...RequestEditorFn) (*V1GetProjectApiKeysResponse, error) - // CreateApiKeyWithBodyWithResponse request with any body - CreateApiKeyWithBodyWithResponse(ctx context.Context, ref string, params *CreateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) + // V1CreateProjectApiKeyWithBodyWithResponse request with any body + V1CreateProjectApiKeyWithBodyWithResponse(ctx context.Context, ref string, params *V1CreateProjectApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateProjectApiKeyResponse, error) - CreateApiKeyWithResponse(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) + V1CreateProjectApiKeyWithResponse(ctx context.Context, ref string, params *V1CreateProjectApiKeyParams, body V1CreateProjectApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateProjectApiKeyResponse, error) - // CheckLegacyApiKeysWithResponse request - CheckLegacyApiKeysWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*CheckLegacyApiKeysResponse, error) + // V1GetProjectLegacyApiKeysWithResponse request + V1GetProjectLegacyApiKeysWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectLegacyApiKeysResponse, error) - // UpdateLegacyApiKeysWithResponse request - UpdateLegacyApiKeysWithResponse(ctx context.Context, ref string, params *UpdateLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*UpdateLegacyApiKeysResponse, error) + // V1UpdateProjectLegacyApiKeysWithResponse request + V1UpdateProjectLegacyApiKeysWithResponse(ctx context.Context, ref string, params *V1UpdateProjectLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*V1UpdateProjectLegacyApiKeysResponse, error) - // DeleteApiKeyWithResponse request - DeleteApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) + // V1DeleteProjectApiKeyWithResponse request + V1DeleteProjectApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *V1DeleteProjectApiKeyParams, reqEditors ...RequestEditorFn) (*V1DeleteProjectApiKeyResponse, error) - // GetApiKeyWithResponse request - GetApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*GetApiKeyResponse, error) + // V1GetProjectApiKeyWithResponse request + V1GetProjectApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *V1GetProjectApiKeyParams, reqEditors ...RequestEditorFn) (*V1GetProjectApiKeyResponse, error) - // UpdateApiKeyWithBodyWithResponse request with any body - UpdateApiKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) + // V1UpdateProjectApiKeyWithBodyWithResponse request with any body + V1UpdateProjectApiKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateProjectApiKeyResponse, error) - UpdateApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) + V1UpdateProjectApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, body V1UpdateProjectApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateProjectApiKeyResponse, error) // V1ListProjectAddonsWithResponse request V1ListProjectAddonsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListProjectAddonsResponse, error) @@ -8523,24 +8523,24 @@ type ClientWithResponsesInterface interface { V1UpdateAuthServiceConfigWithResponse(ctx context.Context, ref string, body V1UpdateAuthServiceConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateAuthServiceConfigResponse, error) - // ListSigningKeysForProjectWithResponse request - ListSigningKeysForProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListSigningKeysForProjectResponse, error) + // V1GetProjectSigningKeysWithResponse request + V1GetProjectSigningKeysWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectSigningKeysResponse, error) - // CreateSigningKeyForProjectWithBodyWithResponse request with any body - CreateSigningKeyForProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSigningKeyForProjectResponse, error) + // V1CreateProjectSigningKeyWithBodyWithResponse request with any body + V1CreateProjectSigningKeyWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateProjectSigningKeyResponse, error) - CreateSigningKeyForProjectWithResponse(ctx context.Context, ref string, body CreateSigningKeyForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSigningKeyForProjectResponse, error) + V1CreateProjectSigningKeyWithResponse(ctx context.Context, ref string, body V1CreateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateProjectSigningKeyResponse, error) - // DeleteSigningKeyWithResponse request - DeleteSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteSigningKeyResponse, error) + // V1RemoveProjectSigningKeyWithResponse request + V1RemoveProjectSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1RemoveProjectSigningKeyResponse, error) - // GetSigningKeyForProjectWithResponse request - GetSigningKeyForProjectWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetSigningKeyForProjectResponse, error) + // V1GetProjectSigningKeyWithResponse request + V1GetProjectSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetProjectSigningKeyResponse, error) - // PatchSigningKeyWithBodyWithResponse request with any body - PatchSigningKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchSigningKeyResponse, error) + // V1UpdateProjectSigningKeyWithBodyWithResponse request with any body + V1UpdateProjectSigningKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateProjectSigningKeyResponse, error) - PatchSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchSigningKeyResponse, error) + V1UpdateProjectSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, body V1UpdateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateProjectSigningKeyResponse, error) // V1ListAllSsoProviderWithResponse request V1ListAllSsoProviderWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListAllSsoProviderResponse, error) @@ -8561,19 +8561,19 @@ type ClientWithResponsesInterface interface { V1UpdateASsoProviderWithResponse(ctx context.Context, ref string, providerId openapi_types.UUID, body V1UpdateASsoProviderJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateASsoProviderResponse, error) - // ListTPAForProjectWithResponse request - ListTPAForProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListTPAForProjectResponse, error) + // V1ListProjectTpaIntegrationsWithResponse request + V1ListProjectTpaIntegrationsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListProjectTpaIntegrationsResponse, error) - // CreateTPAForProjectWithBodyWithResponse request with any body - CreateTPAForProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTPAForProjectResponse, error) + // V1CreateProjectTpaIntegrationWithBodyWithResponse request with any body + V1CreateProjectTpaIntegrationWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateProjectTpaIntegrationResponse, error) - CreateTPAForProjectWithResponse(ctx context.Context, ref string, body CreateTPAForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTPAForProjectResponse, error) + V1CreateProjectTpaIntegrationWithResponse(ctx context.Context, ref string, body V1CreateProjectTpaIntegrationJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateProjectTpaIntegrationResponse, error) - // DeleteTPAForProjectWithResponse request - DeleteTPAForProjectWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteTPAForProjectResponse, error) + // V1DeleteProjectTpaIntegrationWithResponse request + V1DeleteProjectTpaIntegrationWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1DeleteProjectTpaIntegrationResponse, error) - // GetTPAForProjectWithResponse request - GetTPAForProjectWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTPAForProjectResponse, error) + // V1GetProjectTpaIntegrationWithResponse request + V1GetProjectTpaIntegrationWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetProjectTpaIntegrationResponse, error) // V1GetProjectPgbouncerConfigWithResponse request V1GetProjectPgbouncerConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectPgbouncerConfigResponse, error) @@ -8640,8 +8640,8 @@ type ClientWithResponsesInterface interface { V1UndoWithResponse(ctx context.Context, ref string, body V1UndoJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UndoResponse, error) - // GetDatabaseMetadataWithResponse request - GetDatabaseMetadataWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetDatabaseMetadataResponse, error) + // V1GetDatabaseMetadataWithResponse request + V1GetDatabaseMetadataWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetDatabaseMetadataResponse, error) // V1ListMigrationHistoryWithResponse request V1ListMigrationHistoryWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListMigrationHistoryResponse, error) @@ -9278,14 +9278,14 @@ func (r V1GetProjectResponse) StatusCode() int { return 0 } -type GetPerformanceAdvisorsResponse struct { +type V1GetPerformanceAdvisorsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *V1ProjectAdvisorsResponse } // Status returns HTTPResponse.Status -func (r GetPerformanceAdvisorsResponse) Status() string { +func (r V1GetPerformanceAdvisorsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9293,21 +9293,21 @@ func (r GetPerformanceAdvisorsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetPerformanceAdvisorsResponse) StatusCode() int { +func (r V1GetPerformanceAdvisorsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetSecurityAdvisorsResponse struct { +type V1GetSecurityAdvisorsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *V1ProjectAdvisorsResponse } // Status returns HTTPResponse.Status -func (r GetSecurityAdvisorsResponse) Status() string { +func (r V1GetSecurityAdvisorsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9315,21 +9315,21 @@ func (r GetSecurityAdvisorsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetSecurityAdvisorsResponse) StatusCode() int { +func (r V1GetSecurityAdvisorsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetLogsResponse struct { +type V1GetProjectLogsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *AnalyticsResponse } // Status returns HTTPResponse.Status -func (r GetLogsResponse) Status() string { +func (r V1GetProjectLogsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9337,21 +9337,21 @@ func (r GetLogsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetLogsResponse) StatusCode() int { +func (r V1GetProjectLogsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetApiCountsResponse struct { +type V1GetProjectUsageApiCountResponse struct { Body []byte HTTPResponse *http.Response JSON200 *AnalyticsResponse } // Status returns HTTPResponse.Status -func (r GetApiCountsResponse) Status() string { +func (r V1GetProjectUsageApiCountResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9359,21 +9359,21 @@ func (r GetApiCountsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetApiCountsResponse) StatusCode() int { +func (r V1GetProjectUsageApiCountResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetApiRequestsCountResponse struct { +type V1GetProjectUsageRequestCountResponse struct { Body []byte HTTPResponse *http.Response JSON200 *AnalyticsResponse } // Status returns HTTPResponse.Status -func (r GetApiRequestsCountResponse) Status() string { +func (r V1GetProjectUsageRequestCountResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9381,7 +9381,7 @@ func (r GetApiRequestsCountResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetApiRequestsCountResponse) StatusCode() int { +func (r V1GetProjectUsageRequestCountResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9410,14 +9410,14 @@ func (r V1GetProjectApiKeysResponse) StatusCode() int { return 0 } -type CreateApiKeyResponse struct { +type V1CreateProjectApiKeyResponse struct { Body []byte HTTPResponse *http.Response JSON201 *ApiKeyResponse } // Status returns HTTPResponse.Status -func (r CreateApiKeyResponse) Status() string { +func (r V1CreateProjectApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9425,21 +9425,21 @@ func (r CreateApiKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateApiKeyResponse) StatusCode() int { +func (r V1CreateProjectApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CheckLegacyApiKeysResponse struct { +type V1GetProjectLegacyApiKeysResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LegacyApiKeysResponse } // Status returns HTTPResponse.Status -func (r CheckLegacyApiKeysResponse) Status() string { +func (r V1GetProjectLegacyApiKeysResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9447,21 +9447,21 @@ func (r CheckLegacyApiKeysResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CheckLegacyApiKeysResponse) StatusCode() int { +func (r V1GetProjectLegacyApiKeysResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateLegacyApiKeysResponse struct { +type V1UpdateProjectLegacyApiKeysResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LegacyApiKeysResponse } // Status returns HTTPResponse.Status -func (r UpdateLegacyApiKeysResponse) Status() string { +func (r V1UpdateProjectLegacyApiKeysResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9469,21 +9469,21 @@ func (r UpdateLegacyApiKeysResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateLegacyApiKeysResponse) StatusCode() int { +func (r V1UpdateProjectLegacyApiKeysResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteApiKeyResponse struct { +type V1DeleteProjectApiKeyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *ApiKeyResponse } // Status returns HTTPResponse.Status -func (r DeleteApiKeyResponse) Status() string { +func (r V1DeleteProjectApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9491,21 +9491,21 @@ func (r DeleteApiKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteApiKeyResponse) StatusCode() int { +func (r V1DeleteProjectApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetApiKeyResponse struct { +type V1GetProjectApiKeyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *ApiKeyResponse } // Status returns HTTPResponse.Status -func (r GetApiKeyResponse) Status() string { +func (r V1GetProjectApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9513,21 +9513,21 @@ func (r GetApiKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetApiKeyResponse) StatusCode() int { +func (r V1GetProjectApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateApiKeyResponse struct { +type V1UpdateProjectApiKeyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *ApiKeyResponse } // Status returns HTTPResponse.Status -func (r UpdateApiKeyResponse) Status() string { +func (r V1UpdateProjectApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9535,7 +9535,7 @@ func (r UpdateApiKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateApiKeyResponse) StatusCode() int { +func (r V1UpdateProjectApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9780,14 +9780,14 @@ func (r V1UpdateAuthServiceConfigResponse) StatusCode() int { return 0 } -type ListSigningKeysForProjectResponse struct { +type V1GetProjectSigningKeysResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SigningKeysResponse } // Status returns HTTPResponse.Status -func (r ListSigningKeysForProjectResponse) Status() string { +func (r V1GetProjectSigningKeysResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9795,21 +9795,21 @@ func (r ListSigningKeysForProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListSigningKeysForProjectResponse) StatusCode() int { +func (r V1GetProjectSigningKeysResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateSigningKeyForProjectResponse struct { +type V1CreateProjectSigningKeyResponse struct { Body []byte HTTPResponse *http.Response JSON201 *SigningKeyResponse } // Status returns HTTPResponse.Status -func (r CreateSigningKeyForProjectResponse) Status() string { +func (r V1CreateProjectSigningKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9817,21 +9817,21 @@ func (r CreateSigningKeyForProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateSigningKeyForProjectResponse) StatusCode() int { +func (r V1CreateProjectSigningKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteSigningKeyResponse struct { +type V1RemoveProjectSigningKeyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SigningKeyResponse } // Status returns HTTPResponse.Status -func (r DeleteSigningKeyResponse) Status() string { +func (r V1RemoveProjectSigningKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9839,21 +9839,21 @@ func (r DeleteSigningKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteSigningKeyResponse) StatusCode() int { +func (r V1RemoveProjectSigningKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetSigningKeyForProjectResponse struct { +type V1GetProjectSigningKeyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SigningKeyResponse } // Status returns HTTPResponse.Status -func (r GetSigningKeyForProjectResponse) Status() string { +func (r V1GetProjectSigningKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9861,21 +9861,21 @@ func (r GetSigningKeyForProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetSigningKeyForProjectResponse) StatusCode() int { +func (r V1GetProjectSigningKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PatchSigningKeyResponse struct { +type V1UpdateProjectSigningKeyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SigningKeyResponse } // Status returns HTTPResponse.Status -func (r PatchSigningKeyResponse) Status() string { +func (r V1UpdateProjectSigningKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9883,7 +9883,7 @@ func (r PatchSigningKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PatchSigningKeyResponse) StatusCode() int { +func (r V1UpdateProjectSigningKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -10000,14 +10000,14 @@ func (r V1UpdateASsoProviderResponse) StatusCode() int { return 0 } -type ListTPAForProjectResponse struct { +type V1ListProjectTpaIntegrationsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *[]ThirdPartyAuth } // Status returns HTTPResponse.Status -func (r ListTPAForProjectResponse) Status() string { +func (r V1ListProjectTpaIntegrationsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10015,21 +10015,21 @@ func (r ListTPAForProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListTPAForProjectResponse) StatusCode() int { +func (r V1ListProjectTpaIntegrationsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateTPAForProjectResponse struct { +type V1CreateProjectTpaIntegrationResponse struct { Body []byte HTTPResponse *http.Response JSON201 *ThirdPartyAuth } // Status returns HTTPResponse.Status -func (r CreateTPAForProjectResponse) Status() string { +func (r V1CreateProjectTpaIntegrationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10037,21 +10037,21 @@ func (r CreateTPAForProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateTPAForProjectResponse) StatusCode() int { +func (r V1CreateProjectTpaIntegrationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteTPAForProjectResponse struct { +type V1DeleteProjectTpaIntegrationResponse struct { Body []byte HTTPResponse *http.Response JSON200 *ThirdPartyAuth } // Status returns HTTPResponse.Status -func (r DeleteTPAForProjectResponse) Status() string { +func (r V1DeleteProjectTpaIntegrationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10059,21 +10059,21 @@ func (r DeleteTPAForProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteTPAForProjectResponse) StatusCode() int { +func (r V1DeleteProjectTpaIntegrationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetTPAForProjectResponse struct { +type V1GetProjectTpaIntegrationResponse struct { Body []byte HTTPResponse *http.Response JSON200 *ThirdPartyAuth } // Status returns HTTPResponse.Status -func (r GetTPAForProjectResponse) Status() string { +func (r V1GetProjectTpaIntegrationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10081,7 +10081,7 @@ func (r GetTPAForProjectResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetTPAForProjectResponse) StatusCode() int { +func (r V1GetProjectTpaIntegrationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -10458,14 +10458,14 @@ func (r V1UndoResponse) StatusCode() int { return 0 } -type GetDatabaseMetadataResponse struct { +type V1GetDatabaseMetadataResponse struct { Body []byte HTTPResponse *http.Response JSON200 *GetProjectDbMetadataResponse } // Status returns HTTPResponse.Status -func (r GetDatabaseMetadataResponse) Status() string { +func (r V1GetDatabaseMetadataResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -10473,7 +10473,7 @@ func (r GetDatabaseMetadataResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDatabaseMetadataResponse) StatusCode() int { +func (r V1GetDatabaseMetadataResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -11752,49 +11752,49 @@ func (c *ClientWithResponses) V1GetProjectWithResponse(ctx context.Context, ref return ParseV1GetProjectResponse(rsp) } -// GetPerformanceAdvisorsWithResponse request returning *GetPerformanceAdvisorsResponse -func (c *ClientWithResponses) GetPerformanceAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetPerformanceAdvisorsResponse, error) { - rsp, err := c.GetPerformanceAdvisors(ctx, ref, reqEditors...) +// V1GetPerformanceAdvisorsWithResponse request returning *V1GetPerformanceAdvisorsResponse +func (c *ClientWithResponses) V1GetPerformanceAdvisorsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetPerformanceAdvisorsResponse, error) { + rsp, err := c.V1GetPerformanceAdvisors(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseGetPerformanceAdvisorsResponse(rsp) + return ParseV1GetPerformanceAdvisorsResponse(rsp) } -// GetSecurityAdvisorsWithResponse request returning *GetSecurityAdvisorsResponse -func (c *ClientWithResponses) GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, params *GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*GetSecurityAdvisorsResponse, error) { - rsp, err := c.GetSecurityAdvisors(ctx, ref, params, reqEditors...) +// V1GetSecurityAdvisorsWithResponse request returning *V1GetSecurityAdvisorsResponse +func (c *ClientWithResponses) V1GetSecurityAdvisorsWithResponse(ctx context.Context, ref string, params *V1GetSecurityAdvisorsParams, reqEditors ...RequestEditorFn) (*V1GetSecurityAdvisorsResponse, error) { + rsp, err := c.V1GetSecurityAdvisors(ctx, ref, params, reqEditors...) if err != nil { return nil, err } - return ParseGetSecurityAdvisorsResponse(rsp) + return ParseV1GetSecurityAdvisorsResponse(rsp) } -// GetLogsWithResponse request returning *GetLogsResponse -func (c *ClientWithResponses) GetLogsWithResponse(ctx context.Context, ref string, params *GetLogsParams, reqEditors ...RequestEditorFn) (*GetLogsResponse, error) { - rsp, err := c.GetLogs(ctx, ref, params, reqEditors...) +// V1GetProjectLogsWithResponse request returning *V1GetProjectLogsResponse +func (c *ClientWithResponses) V1GetProjectLogsWithResponse(ctx context.Context, ref string, params *V1GetProjectLogsParams, reqEditors ...RequestEditorFn) (*V1GetProjectLogsResponse, error) { + rsp, err := c.V1GetProjectLogs(ctx, ref, params, reqEditors...) if err != nil { return nil, err } - return ParseGetLogsResponse(rsp) + return ParseV1GetProjectLogsResponse(rsp) } -// GetApiCountsWithResponse request returning *GetApiCountsResponse -func (c *ClientWithResponses) GetApiCountsWithResponse(ctx context.Context, ref string, params *GetApiCountsParams, reqEditors ...RequestEditorFn) (*GetApiCountsResponse, error) { - rsp, err := c.GetApiCounts(ctx, ref, params, reqEditors...) +// V1GetProjectUsageApiCountWithResponse request returning *V1GetProjectUsageApiCountResponse +func (c *ClientWithResponses) V1GetProjectUsageApiCountWithResponse(ctx context.Context, ref string, params *V1GetProjectUsageApiCountParams, reqEditors ...RequestEditorFn) (*V1GetProjectUsageApiCountResponse, error) { + rsp, err := c.V1GetProjectUsageApiCount(ctx, ref, params, reqEditors...) if err != nil { return nil, err } - return ParseGetApiCountsResponse(rsp) + return ParseV1GetProjectUsageApiCountResponse(rsp) } -// GetApiRequestsCountWithResponse request returning *GetApiRequestsCountResponse -func (c *ClientWithResponses) GetApiRequestsCountWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetApiRequestsCountResponse, error) { - rsp, err := c.GetApiRequestsCount(ctx, ref, reqEditors...) +// V1GetProjectUsageRequestCountWithResponse request returning *V1GetProjectUsageRequestCountResponse +func (c *ClientWithResponses) V1GetProjectUsageRequestCountWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectUsageRequestCountResponse, error) { + rsp, err := c.V1GetProjectUsageRequestCount(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseGetApiRequestsCountResponse(rsp) + return ParseV1GetProjectUsageRequestCountResponse(rsp) } // V1GetProjectApiKeysWithResponse request returning *V1GetProjectApiKeysResponse @@ -11806,74 +11806,74 @@ func (c *ClientWithResponses) V1GetProjectApiKeysWithResponse(ctx context.Contex return ParseV1GetProjectApiKeysResponse(rsp) } -// CreateApiKeyWithBodyWithResponse request with arbitrary body returning *CreateApiKeyResponse -func (c *ClientWithResponses) CreateApiKeyWithBodyWithResponse(ctx context.Context, ref string, params *CreateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) { - rsp, err := c.CreateApiKeyWithBody(ctx, ref, params, contentType, body, reqEditors...) +// V1CreateProjectApiKeyWithBodyWithResponse request with arbitrary body returning *V1CreateProjectApiKeyResponse +func (c *ClientWithResponses) V1CreateProjectApiKeyWithBodyWithResponse(ctx context.Context, ref string, params *V1CreateProjectApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateProjectApiKeyResponse, error) { + rsp, err := c.V1CreateProjectApiKeyWithBody(ctx, ref, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateApiKeyResponse(rsp) + return ParseV1CreateProjectApiKeyResponse(rsp) } -func (c *ClientWithResponses) CreateApiKeyWithResponse(ctx context.Context, ref string, params *CreateApiKeyParams, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) { - rsp, err := c.CreateApiKey(ctx, ref, params, body, reqEditors...) +func (c *ClientWithResponses) V1CreateProjectApiKeyWithResponse(ctx context.Context, ref string, params *V1CreateProjectApiKeyParams, body V1CreateProjectApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateProjectApiKeyResponse, error) { + rsp, err := c.V1CreateProjectApiKey(ctx, ref, params, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateApiKeyResponse(rsp) + return ParseV1CreateProjectApiKeyResponse(rsp) } -// CheckLegacyApiKeysWithResponse request returning *CheckLegacyApiKeysResponse -func (c *ClientWithResponses) CheckLegacyApiKeysWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*CheckLegacyApiKeysResponse, error) { - rsp, err := c.CheckLegacyApiKeys(ctx, ref, reqEditors...) +// V1GetProjectLegacyApiKeysWithResponse request returning *V1GetProjectLegacyApiKeysResponse +func (c *ClientWithResponses) V1GetProjectLegacyApiKeysWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectLegacyApiKeysResponse, error) { + rsp, err := c.V1GetProjectLegacyApiKeys(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseCheckLegacyApiKeysResponse(rsp) + return ParseV1GetProjectLegacyApiKeysResponse(rsp) } -// UpdateLegacyApiKeysWithResponse request returning *UpdateLegacyApiKeysResponse -func (c *ClientWithResponses) UpdateLegacyApiKeysWithResponse(ctx context.Context, ref string, params *UpdateLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*UpdateLegacyApiKeysResponse, error) { - rsp, err := c.UpdateLegacyApiKeys(ctx, ref, params, reqEditors...) +// V1UpdateProjectLegacyApiKeysWithResponse request returning *V1UpdateProjectLegacyApiKeysResponse +func (c *ClientWithResponses) V1UpdateProjectLegacyApiKeysWithResponse(ctx context.Context, ref string, params *V1UpdateProjectLegacyApiKeysParams, reqEditors ...RequestEditorFn) (*V1UpdateProjectLegacyApiKeysResponse, error) { + rsp, err := c.V1UpdateProjectLegacyApiKeys(ctx, ref, params, reqEditors...) if err != nil { return nil, err } - return ParseUpdateLegacyApiKeysResponse(rsp) + return ParseV1UpdateProjectLegacyApiKeysResponse(rsp) } -// DeleteApiKeyWithResponse request returning *DeleteApiKeyResponse -func (c *ClientWithResponses) DeleteApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) { - rsp, err := c.DeleteApiKey(ctx, ref, id, params, reqEditors...) +// V1DeleteProjectApiKeyWithResponse request returning *V1DeleteProjectApiKeyResponse +func (c *ClientWithResponses) V1DeleteProjectApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *V1DeleteProjectApiKeyParams, reqEditors ...RequestEditorFn) (*V1DeleteProjectApiKeyResponse, error) { + rsp, err := c.V1DeleteProjectApiKey(ctx, ref, id, params, reqEditors...) if err != nil { return nil, err } - return ParseDeleteApiKeyResponse(rsp) + return ParseV1DeleteProjectApiKeyResponse(rsp) } -// GetApiKeyWithResponse request returning *GetApiKeyResponse -func (c *ClientWithResponses) GetApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *GetApiKeyParams, reqEditors ...RequestEditorFn) (*GetApiKeyResponse, error) { - rsp, err := c.GetApiKey(ctx, ref, id, params, reqEditors...) +// V1GetProjectApiKeyWithResponse request returning *V1GetProjectApiKeyResponse +func (c *ClientWithResponses) V1GetProjectApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *V1GetProjectApiKeyParams, reqEditors ...RequestEditorFn) (*V1GetProjectApiKeyResponse, error) { + rsp, err := c.V1GetProjectApiKey(ctx, ref, id, params, reqEditors...) if err != nil { return nil, err } - return ParseGetApiKeyResponse(rsp) + return ParseV1GetProjectApiKeyResponse(rsp) } -// UpdateApiKeyWithBodyWithResponse request with arbitrary body returning *UpdateApiKeyResponse -func (c *ClientWithResponses) UpdateApiKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) { - rsp, err := c.UpdateApiKeyWithBody(ctx, ref, id, params, contentType, body, reqEditors...) +// V1UpdateProjectApiKeyWithBodyWithResponse request with arbitrary body returning *V1UpdateProjectApiKeyResponse +func (c *ClientWithResponses) V1UpdateProjectApiKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateProjectApiKeyResponse, error) { + rsp, err := c.V1UpdateProjectApiKeyWithBody(ctx, ref, id, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateApiKeyResponse(rsp) + return ParseV1UpdateProjectApiKeyResponse(rsp) } -func (c *ClientWithResponses) UpdateApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *UpdateApiKeyParams, body UpdateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiKeyResponse, error) { - rsp, err := c.UpdateApiKey(ctx, ref, id, params, body, reqEditors...) +func (c *ClientWithResponses) V1UpdateProjectApiKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, params *V1UpdateProjectApiKeyParams, body V1UpdateProjectApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateProjectApiKeyResponse, error) { + rsp, err := c.V1UpdateProjectApiKey(ctx, ref, id, params, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateApiKeyResponse(rsp) + return ParseV1UpdateProjectApiKeyResponse(rsp) } // V1ListProjectAddonsWithResponse request returning *V1ListProjectAddonsResponse @@ -11999,65 +11999,65 @@ func (c *ClientWithResponses) V1UpdateAuthServiceConfigWithResponse(ctx context. return ParseV1UpdateAuthServiceConfigResponse(rsp) } -// ListSigningKeysForProjectWithResponse request returning *ListSigningKeysForProjectResponse -func (c *ClientWithResponses) ListSigningKeysForProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListSigningKeysForProjectResponse, error) { - rsp, err := c.ListSigningKeysForProject(ctx, ref, reqEditors...) +// V1GetProjectSigningKeysWithResponse request returning *V1GetProjectSigningKeysResponse +func (c *ClientWithResponses) V1GetProjectSigningKeysWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetProjectSigningKeysResponse, error) { + rsp, err := c.V1GetProjectSigningKeys(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseListSigningKeysForProjectResponse(rsp) + return ParseV1GetProjectSigningKeysResponse(rsp) } -// CreateSigningKeyForProjectWithBodyWithResponse request with arbitrary body returning *CreateSigningKeyForProjectResponse -func (c *ClientWithResponses) CreateSigningKeyForProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSigningKeyForProjectResponse, error) { - rsp, err := c.CreateSigningKeyForProjectWithBody(ctx, ref, contentType, body, reqEditors...) +// V1CreateProjectSigningKeyWithBodyWithResponse request with arbitrary body returning *V1CreateProjectSigningKeyResponse +func (c *ClientWithResponses) V1CreateProjectSigningKeyWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateProjectSigningKeyResponse, error) { + rsp, err := c.V1CreateProjectSigningKeyWithBody(ctx, ref, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateSigningKeyForProjectResponse(rsp) + return ParseV1CreateProjectSigningKeyResponse(rsp) } -func (c *ClientWithResponses) CreateSigningKeyForProjectWithResponse(ctx context.Context, ref string, body CreateSigningKeyForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSigningKeyForProjectResponse, error) { - rsp, err := c.CreateSigningKeyForProject(ctx, ref, body, reqEditors...) +func (c *ClientWithResponses) V1CreateProjectSigningKeyWithResponse(ctx context.Context, ref string, body V1CreateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateProjectSigningKeyResponse, error) { + rsp, err := c.V1CreateProjectSigningKey(ctx, ref, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateSigningKeyForProjectResponse(rsp) + return ParseV1CreateProjectSigningKeyResponse(rsp) } -// DeleteSigningKeyWithResponse request returning *DeleteSigningKeyResponse -func (c *ClientWithResponses) DeleteSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteSigningKeyResponse, error) { - rsp, err := c.DeleteSigningKey(ctx, ref, id, reqEditors...) +// V1RemoveProjectSigningKeyWithResponse request returning *V1RemoveProjectSigningKeyResponse +func (c *ClientWithResponses) V1RemoveProjectSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1RemoveProjectSigningKeyResponse, error) { + rsp, err := c.V1RemoveProjectSigningKey(ctx, ref, id, reqEditors...) if err != nil { return nil, err } - return ParseDeleteSigningKeyResponse(rsp) + return ParseV1RemoveProjectSigningKeyResponse(rsp) } -// GetSigningKeyForProjectWithResponse request returning *GetSigningKeyForProjectResponse -func (c *ClientWithResponses) GetSigningKeyForProjectWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetSigningKeyForProjectResponse, error) { - rsp, err := c.GetSigningKeyForProject(ctx, ref, id, reqEditors...) +// V1GetProjectSigningKeyWithResponse request returning *V1GetProjectSigningKeyResponse +func (c *ClientWithResponses) V1GetProjectSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetProjectSigningKeyResponse, error) { + rsp, err := c.V1GetProjectSigningKey(ctx, ref, id, reqEditors...) if err != nil { return nil, err } - return ParseGetSigningKeyForProjectResponse(rsp) + return ParseV1GetProjectSigningKeyResponse(rsp) } -// PatchSigningKeyWithBodyWithResponse request with arbitrary body returning *PatchSigningKeyResponse -func (c *ClientWithResponses) PatchSigningKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchSigningKeyResponse, error) { - rsp, err := c.PatchSigningKeyWithBody(ctx, ref, id, contentType, body, reqEditors...) +// V1UpdateProjectSigningKeyWithBodyWithResponse request with arbitrary body returning *V1UpdateProjectSigningKeyResponse +func (c *ClientWithResponses) V1UpdateProjectSigningKeyWithBodyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateProjectSigningKeyResponse, error) { + rsp, err := c.V1UpdateProjectSigningKeyWithBody(ctx, ref, id, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParsePatchSigningKeyResponse(rsp) + return ParseV1UpdateProjectSigningKeyResponse(rsp) } -func (c *ClientWithResponses) PatchSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, body PatchSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchSigningKeyResponse, error) { - rsp, err := c.PatchSigningKey(ctx, ref, id, body, reqEditors...) +func (c *ClientWithResponses) V1UpdateProjectSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, body V1UpdateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateProjectSigningKeyResponse, error) { + rsp, err := c.V1UpdateProjectSigningKey(ctx, ref, id, body, reqEditors...) if err != nil { return nil, err } - return ParsePatchSigningKeyResponse(rsp) + return ParseV1UpdateProjectSigningKeyResponse(rsp) } // V1ListAllSsoProviderWithResponse request returning *V1ListAllSsoProviderResponse @@ -12121,48 +12121,48 @@ func (c *ClientWithResponses) V1UpdateASsoProviderWithResponse(ctx context.Conte return ParseV1UpdateASsoProviderResponse(rsp) } -// ListTPAForProjectWithResponse request returning *ListTPAForProjectResponse -func (c *ClientWithResponses) ListTPAForProjectWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListTPAForProjectResponse, error) { - rsp, err := c.ListTPAForProject(ctx, ref, reqEditors...) +// V1ListProjectTpaIntegrationsWithResponse request returning *V1ListProjectTpaIntegrationsResponse +func (c *ClientWithResponses) V1ListProjectTpaIntegrationsWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListProjectTpaIntegrationsResponse, error) { + rsp, err := c.V1ListProjectTpaIntegrations(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseListTPAForProjectResponse(rsp) + return ParseV1ListProjectTpaIntegrationsResponse(rsp) } -// CreateTPAForProjectWithBodyWithResponse request with arbitrary body returning *CreateTPAForProjectResponse -func (c *ClientWithResponses) CreateTPAForProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTPAForProjectResponse, error) { - rsp, err := c.CreateTPAForProjectWithBody(ctx, ref, contentType, body, reqEditors...) +// V1CreateProjectTpaIntegrationWithBodyWithResponse request with arbitrary body returning *V1CreateProjectTpaIntegrationResponse +func (c *ClientWithResponses) V1CreateProjectTpaIntegrationWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1CreateProjectTpaIntegrationResponse, error) { + rsp, err := c.V1CreateProjectTpaIntegrationWithBody(ctx, ref, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateTPAForProjectResponse(rsp) + return ParseV1CreateProjectTpaIntegrationResponse(rsp) } -func (c *ClientWithResponses) CreateTPAForProjectWithResponse(ctx context.Context, ref string, body CreateTPAForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTPAForProjectResponse, error) { - rsp, err := c.CreateTPAForProject(ctx, ref, body, reqEditors...) +func (c *ClientWithResponses) V1CreateProjectTpaIntegrationWithResponse(ctx context.Context, ref string, body V1CreateProjectTpaIntegrationJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateProjectTpaIntegrationResponse, error) { + rsp, err := c.V1CreateProjectTpaIntegration(ctx, ref, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateTPAForProjectResponse(rsp) + return ParseV1CreateProjectTpaIntegrationResponse(rsp) } -// DeleteTPAForProjectWithResponse request returning *DeleteTPAForProjectResponse -func (c *ClientWithResponses) DeleteTPAForProjectWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteTPAForProjectResponse, error) { - rsp, err := c.DeleteTPAForProject(ctx, ref, tpaId, reqEditors...) +// V1DeleteProjectTpaIntegrationWithResponse request returning *V1DeleteProjectTpaIntegrationResponse +func (c *ClientWithResponses) V1DeleteProjectTpaIntegrationWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1DeleteProjectTpaIntegrationResponse, error) { + rsp, err := c.V1DeleteProjectTpaIntegration(ctx, ref, tpaId, reqEditors...) if err != nil { return nil, err } - return ParseDeleteTPAForProjectResponse(rsp) + return ParseV1DeleteProjectTpaIntegrationResponse(rsp) } -// GetTPAForProjectWithResponse request returning *GetTPAForProjectResponse -func (c *ClientWithResponses) GetTPAForProjectWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTPAForProjectResponse, error) { - rsp, err := c.GetTPAForProject(ctx, ref, tpaId, reqEditors...) +// V1GetProjectTpaIntegrationWithResponse request returning *V1GetProjectTpaIntegrationResponse +func (c *ClientWithResponses) V1GetProjectTpaIntegrationWithResponse(ctx context.Context, ref string, tpaId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1GetProjectTpaIntegrationResponse, error) { + rsp, err := c.V1GetProjectTpaIntegration(ctx, ref, tpaId, reqEditors...) if err != nil { return nil, err } - return ParseGetTPAForProjectResponse(rsp) + return ParseV1GetProjectTpaIntegrationResponse(rsp) } // V1GetProjectPgbouncerConfigWithResponse request returning *V1GetProjectPgbouncerConfigResponse @@ -12374,13 +12374,13 @@ func (c *ClientWithResponses) V1UndoWithResponse(ctx context.Context, ref string return ParseV1UndoResponse(rsp) } -// GetDatabaseMetadataWithResponse request returning *GetDatabaseMetadataResponse -func (c *ClientWithResponses) GetDatabaseMetadataWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetDatabaseMetadataResponse, error) { - rsp, err := c.GetDatabaseMetadata(ctx, ref, reqEditors...) +// V1GetDatabaseMetadataWithResponse request returning *V1GetDatabaseMetadataResponse +func (c *ClientWithResponses) V1GetDatabaseMetadataWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetDatabaseMetadataResponse, error) { + rsp, err := c.V1GetDatabaseMetadata(ctx, ref, reqEditors...) if err != nil { return nil, err } - return ParseGetDatabaseMetadataResponse(rsp) + return ParseV1GetDatabaseMetadataResponse(rsp) } // V1ListMigrationHistoryWithResponse request returning *V1ListMigrationHistoryResponse @@ -13446,15 +13446,15 @@ func ParseV1GetProjectResponse(rsp *http.Response) (*V1GetProjectResponse, error return response, nil } -// ParseGetPerformanceAdvisorsResponse parses an HTTP response from a GetPerformanceAdvisorsWithResponse call -func ParseGetPerformanceAdvisorsResponse(rsp *http.Response) (*GetPerformanceAdvisorsResponse, error) { +// ParseV1GetPerformanceAdvisorsResponse parses an HTTP response from a V1GetPerformanceAdvisorsWithResponse call +func ParseV1GetPerformanceAdvisorsResponse(rsp *http.Response) (*V1GetPerformanceAdvisorsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetPerformanceAdvisorsResponse{ + response := &V1GetPerformanceAdvisorsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13472,15 +13472,15 @@ func ParseGetPerformanceAdvisorsResponse(rsp *http.Response) (*GetPerformanceAdv return response, nil } -// ParseGetSecurityAdvisorsResponse parses an HTTP response from a GetSecurityAdvisorsWithResponse call -func ParseGetSecurityAdvisorsResponse(rsp *http.Response) (*GetSecurityAdvisorsResponse, error) { +// ParseV1GetSecurityAdvisorsResponse parses an HTTP response from a V1GetSecurityAdvisorsWithResponse call +func ParseV1GetSecurityAdvisorsResponse(rsp *http.Response) (*V1GetSecurityAdvisorsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSecurityAdvisorsResponse{ + response := &V1GetSecurityAdvisorsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13498,15 +13498,15 @@ func ParseGetSecurityAdvisorsResponse(rsp *http.Response) (*GetSecurityAdvisorsR return response, nil } -// ParseGetLogsResponse parses an HTTP response from a GetLogsWithResponse call -func ParseGetLogsResponse(rsp *http.Response) (*GetLogsResponse, error) { +// ParseV1GetProjectLogsResponse parses an HTTP response from a V1GetProjectLogsWithResponse call +func ParseV1GetProjectLogsResponse(rsp *http.Response) (*V1GetProjectLogsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetLogsResponse{ + response := &V1GetProjectLogsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13524,15 +13524,15 @@ func ParseGetLogsResponse(rsp *http.Response) (*GetLogsResponse, error) { return response, nil } -// ParseGetApiCountsResponse parses an HTTP response from a GetApiCountsWithResponse call -func ParseGetApiCountsResponse(rsp *http.Response) (*GetApiCountsResponse, error) { +// ParseV1GetProjectUsageApiCountResponse parses an HTTP response from a V1GetProjectUsageApiCountWithResponse call +func ParseV1GetProjectUsageApiCountResponse(rsp *http.Response) (*V1GetProjectUsageApiCountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiCountsResponse{ + response := &V1GetProjectUsageApiCountResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13550,15 +13550,15 @@ func ParseGetApiCountsResponse(rsp *http.Response) (*GetApiCountsResponse, error return response, nil } -// ParseGetApiRequestsCountResponse parses an HTTP response from a GetApiRequestsCountWithResponse call -func ParseGetApiRequestsCountResponse(rsp *http.Response) (*GetApiRequestsCountResponse, error) { +// ParseV1GetProjectUsageRequestCountResponse parses an HTTP response from a V1GetProjectUsageRequestCountWithResponse call +func ParseV1GetProjectUsageRequestCountResponse(rsp *http.Response) (*V1GetProjectUsageRequestCountResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiRequestsCountResponse{ + response := &V1GetProjectUsageRequestCountResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13602,15 +13602,15 @@ func ParseV1GetProjectApiKeysResponse(rsp *http.Response) (*V1GetProjectApiKeysR return response, nil } -// ParseCreateApiKeyResponse parses an HTTP response from a CreateApiKeyWithResponse call -func ParseCreateApiKeyResponse(rsp *http.Response) (*CreateApiKeyResponse, error) { +// ParseV1CreateProjectApiKeyResponse parses an HTTP response from a V1CreateProjectApiKeyWithResponse call +func ParseV1CreateProjectApiKeyResponse(rsp *http.Response) (*V1CreateProjectApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateApiKeyResponse{ + response := &V1CreateProjectApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13628,15 +13628,15 @@ func ParseCreateApiKeyResponse(rsp *http.Response) (*CreateApiKeyResponse, error return response, nil } -// ParseCheckLegacyApiKeysResponse parses an HTTP response from a CheckLegacyApiKeysWithResponse call -func ParseCheckLegacyApiKeysResponse(rsp *http.Response) (*CheckLegacyApiKeysResponse, error) { +// ParseV1GetProjectLegacyApiKeysResponse parses an HTTP response from a V1GetProjectLegacyApiKeysWithResponse call +func ParseV1GetProjectLegacyApiKeysResponse(rsp *http.Response) (*V1GetProjectLegacyApiKeysResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CheckLegacyApiKeysResponse{ + response := &V1GetProjectLegacyApiKeysResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13654,15 +13654,15 @@ func ParseCheckLegacyApiKeysResponse(rsp *http.Response) (*CheckLegacyApiKeysRes return response, nil } -// ParseUpdateLegacyApiKeysResponse parses an HTTP response from a UpdateLegacyApiKeysWithResponse call -func ParseUpdateLegacyApiKeysResponse(rsp *http.Response) (*UpdateLegacyApiKeysResponse, error) { +// ParseV1UpdateProjectLegacyApiKeysResponse parses an HTTP response from a V1UpdateProjectLegacyApiKeysWithResponse call +func ParseV1UpdateProjectLegacyApiKeysResponse(rsp *http.Response) (*V1UpdateProjectLegacyApiKeysResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateLegacyApiKeysResponse{ + response := &V1UpdateProjectLegacyApiKeysResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13680,15 +13680,15 @@ func ParseUpdateLegacyApiKeysResponse(rsp *http.Response) (*UpdateLegacyApiKeysR return response, nil } -// ParseDeleteApiKeyResponse parses an HTTP response from a DeleteApiKeyWithResponse call -func ParseDeleteApiKeyResponse(rsp *http.Response) (*DeleteApiKeyResponse, error) { +// ParseV1DeleteProjectApiKeyResponse parses an HTTP response from a V1DeleteProjectApiKeyWithResponse call +func ParseV1DeleteProjectApiKeyResponse(rsp *http.Response) (*V1DeleteProjectApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteApiKeyResponse{ + response := &V1DeleteProjectApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13706,15 +13706,15 @@ func ParseDeleteApiKeyResponse(rsp *http.Response) (*DeleteApiKeyResponse, error return response, nil } -// ParseGetApiKeyResponse parses an HTTP response from a GetApiKeyWithResponse call -func ParseGetApiKeyResponse(rsp *http.Response) (*GetApiKeyResponse, error) { +// ParseV1GetProjectApiKeyResponse parses an HTTP response from a V1GetProjectApiKeyWithResponse call +func ParseV1GetProjectApiKeyResponse(rsp *http.Response) (*V1GetProjectApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetApiKeyResponse{ + response := &V1GetProjectApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -13732,15 +13732,15 @@ func ParseGetApiKeyResponse(rsp *http.Response) (*GetApiKeyResponse, error) { return response, nil } -// ParseUpdateApiKeyResponse parses an HTTP response from a UpdateApiKeyWithResponse call -func ParseUpdateApiKeyResponse(rsp *http.Response) (*UpdateApiKeyResponse, error) { +// ParseV1UpdateProjectApiKeyResponse parses an HTTP response from a V1UpdateProjectApiKeyWithResponse call +func ParseV1UpdateProjectApiKeyResponse(rsp *http.Response) (*V1UpdateProjectApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateApiKeyResponse{ + response := &V1UpdateProjectApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14004,15 +14004,15 @@ func ParseV1UpdateAuthServiceConfigResponse(rsp *http.Response) (*V1UpdateAuthSe return response, nil } -// ParseListSigningKeysForProjectResponse parses an HTTP response from a ListSigningKeysForProjectWithResponse call -func ParseListSigningKeysForProjectResponse(rsp *http.Response) (*ListSigningKeysForProjectResponse, error) { +// ParseV1GetProjectSigningKeysResponse parses an HTTP response from a V1GetProjectSigningKeysWithResponse call +func ParseV1GetProjectSigningKeysResponse(rsp *http.Response) (*V1GetProjectSigningKeysResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListSigningKeysForProjectResponse{ + response := &V1GetProjectSigningKeysResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14030,15 +14030,15 @@ func ParseListSigningKeysForProjectResponse(rsp *http.Response) (*ListSigningKey return response, nil } -// ParseCreateSigningKeyForProjectResponse parses an HTTP response from a CreateSigningKeyForProjectWithResponse call -func ParseCreateSigningKeyForProjectResponse(rsp *http.Response) (*CreateSigningKeyForProjectResponse, error) { +// ParseV1CreateProjectSigningKeyResponse parses an HTTP response from a V1CreateProjectSigningKeyWithResponse call +func ParseV1CreateProjectSigningKeyResponse(rsp *http.Response) (*V1CreateProjectSigningKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateSigningKeyForProjectResponse{ + response := &V1CreateProjectSigningKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14056,15 +14056,15 @@ func ParseCreateSigningKeyForProjectResponse(rsp *http.Response) (*CreateSigning return response, nil } -// ParseDeleteSigningKeyResponse parses an HTTP response from a DeleteSigningKeyWithResponse call -func ParseDeleteSigningKeyResponse(rsp *http.Response) (*DeleteSigningKeyResponse, error) { +// ParseV1RemoveProjectSigningKeyResponse parses an HTTP response from a V1RemoveProjectSigningKeyWithResponse call +func ParseV1RemoveProjectSigningKeyResponse(rsp *http.Response) (*V1RemoveProjectSigningKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteSigningKeyResponse{ + response := &V1RemoveProjectSigningKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14082,15 +14082,15 @@ func ParseDeleteSigningKeyResponse(rsp *http.Response) (*DeleteSigningKeyRespons return response, nil } -// ParseGetSigningKeyForProjectResponse parses an HTTP response from a GetSigningKeyForProjectWithResponse call -func ParseGetSigningKeyForProjectResponse(rsp *http.Response) (*GetSigningKeyForProjectResponse, error) { +// ParseV1GetProjectSigningKeyResponse parses an HTTP response from a V1GetProjectSigningKeyWithResponse call +func ParseV1GetProjectSigningKeyResponse(rsp *http.Response) (*V1GetProjectSigningKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSigningKeyForProjectResponse{ + response := &V1GetProjectSigningKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14108,15 +14108,15 @@ func ParseGetSigningKeyForProjectResponse(rsp *http.Response) (*GetSigningKeyFor return response, nil } -// ParsePatchSigningKeyResponse parses an HTTP response from a PatchSigningKeyWithResponse call -func ParsePatchSigningKeyResponse(rsp *http.Response) (*PatchSigningKeyResponse, error) { +// ParseV1UpdateProjectSigningKeyResponse parses an HTTP response from a V1UpdateProjectSigningKeyWithResponse call +func ParseV1UpdateProjectSigningKeyResponse(rsp *http.Response) (*V1UpdateProjectSigningKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PatchSigningKeyResponse{ + response := &V1UpdateProjectSigningKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14264,15 +14264,15 @@ func ParseV1UpdateASsoProviderResponse(rsp *http.Response) (*V1UpdateASsoProvide return response, nil } -// ParseListTPAForProjectResponse parses an HTTP response from a ListTPAForProjectWithResponse call -func ParseListTPAForProjectResponse(rsp *http.Response) (*ListTPAForProjectResponse, error) { +// ParseV1ListProjectTpaIntegrationsResponse parses an HTTP response from a V1ListProjectTpaIntegrationsWithResponse call +func ParseV1ListProjectTpaIntegrationsResponse(rsp *http.Response) (*V1ListProjectTpaIntegrationsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListTPAForProjectResponse{ + response := &V1ListProjectTpaIntegrationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14290,15 +14290,15 @@ func ParseListTPAForProjectResponse(rsp *http.Response) (*ListTPAForProjectRespo return response, nil } -// ParseCreateTPAForProjectResponse parses an HTTP response from a CreateTPAForProjectWithResponse call -func ParseCreateTPAForProjectResponse(rsp *http.Response) (*CreateTPAForProjectResponse, error) { +// ParseV1CreateProjectTpaIntegrationResponse parses an HTTP response from a V1CreateProjectTpaIntegrationWithResponse call +func ParseV1CreateProjectTpaIntegrationResponse(rsp *http.Response) (*V1CreateProjectTpaIntegrationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateTPAForProjectResponse{ + response := &V1CreateProjectTpaIntegrationResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14316,15 +14316,15 @@ func ParseCreateTPAForProjectResponse(rsp *http.Response) (*CreateTPAForProjectR return response, nil } -// ParseDeleteTPAForProjectResponse parses an HTTP response from a DeleteTPAForProjectWithResponse call -func ParseDeleteTPAForProjectResponse(rsp *http.Response) (*DeleteTPAForProjectResponse, error) { +// ParseV1DeleteProjectTpaIntegrationResponse parses an HTTP response from a V1DeleteProjectTpaIntegrationWithResponse call +func ParseV1DeleteProjectTpaIntegrationResponse(rsp *http.Response) (*V1DeleteProjectTpaIntegrationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteTPAForProjectResponse{ + response := &V1DeleteProjectTpaIntegrationResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14342,15 +14342,15 @@ func ParseDeleteTPAForProjectResponse(rsp *http.Response) (*DeleteTPAForProjectR return response, nil } -// ParseGetTPAForProjectResponse parses an HTTP response from a GetTPAForProjectWithResponse call -func ParseGetTPAForProjectResponse(rsp *http.Response) (*GetTPAForProjectResponse, error) { +// ParseV1GetProjectTpaIntegrationResponse parses an HTTP response from a V1GetProjectTpaIntegrationWithResponse call +func ParseV1GetProjectTpaIntegrationResponse(rsp *http.Response) (*V1GetProjectTpaIntegrationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetTPAForProjectResponse{ + response := &V1GetProjectTpaIntegrationResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -14770,15 +14770,15 @@ func ParseV1UndoResponse(rsp *http.Response) (*V1UndoResponse, error) { return response, nil } -// ParseGetDatabaseMetadataResponse parses an HTTP response from a GetDatabaseMetadataWithResponse call -func ParseGetDatabaseMetadataResponse(rsp *http.Response) (*GetDatabaseMetadataResponse, error) { +// ParseV1GetDatabaseMetadataResponse parses an HTTP response from a V1GetDatabaseMetadataWithResponse call +func ParseV1GetDatabaseMetadataResponse(rsp *http.Response) (*V1GetDatabaseMetadataResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetDatabaseMetadataResponse{ + response := &V1GetDatabaseMetadataResponse{ Body: bodyBytes, HTTPResponse: rsp, } diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index b9ec43b0b..c6cfdff10 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -933,20 +933,20 @@ const ( V1OauthAuthorizeProjectClaimParamsCodeChallengeMethodSha256 V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod = "sha256" ) -// Defines values for GetSecurityAdvisorsParamsLintType. +// Defines values for V1GetSecurityAdvisorsParamsLintType. const ( - Sql GetSecurityAdvisorsParamsLintType = "sql" + Sql V1GetSecurityAdvisorsParamsLintType = "sql" ) -// Defines values for GetApiCountsParamsInterval. +// Defines values for V1GetProjectUsageApiCountParamsInterval. const ( - N15min GetApiCountsParamsInterval = "15min" - N1day GetApiCountsParamsInterval = "1day" - N1hr GetApiCountsParamsInterval = "1hr" - N30min GetApiCountsParamsInterval = "30min" - N3day GetApiCountsParamsInterval = "3day" - N3hr GetApiCountsParamsInterval = "3hr" - N7day GetApiCountsParamsInterval = "7day" + N15min V1GetProjectUsageApiCountParamsInterval = "15min" + N1day V1GetProjectUsageApiCountParamsInterval = "1day" + N1hr V1GetProjectUsageApiCountParamsInterval = "1hr" + N30min V1GetProjectUsageApiCountParamsInterval = "30min" + N3day V1GetProjectUsageApiCountParamsInterval = "3day" + N3hr V1GetProjectUsageApiCountParamsInterval = "3hr" + N7day V1GetProjectUsageApiCountParamsInterval = "7day" ) // Defines values for V1GetServicesHealthParamsServices. @@ -2945,28 +2945,28 @@ type V1OauthAuthorizeProjectClaimParamsResponseType string // V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod defines parameters for V1OauthAuthorizeProjectClaim. type V1OauthAuthorizeProjectClaimParamsCodeChallengeMethod string -// GetSecurityAdvisorsParams defines parameters for GetSecurityAdvisors. -type GetSecurityAdvisorsParams struct { - LintType *GetSecurityAdvisorsParamsLintType `form:"lint_type,omitempty" json:"lint_type,omitempty"` +// V1GetSecurityAdvisorsParams defines parameters for V1GetSecurityAdvisors. +type V1GetSecurityAdvisorsParams struct { + LintType *V1GetSecurityAdvisorsParamsLintType `form:"lint_type,omitempty" json:"lint_type,omitempty"` } -// GetSecurityAdvisorsParamsLintType defines parameters for GetSecurityAdvisors. -type GetSecurityAdvisorsParamsLintType string +// V1GetSecurityAdvisorsParamsLintType defines parameters for V1GetSecurityAdvisors. +type V1GetSecurityAdvisorsParamsLintType string -// GetLogsParams defines parameters for GetLogs. -type GetLogsParams struct { +// V1GetProjectLogsParams defines parameters for V1GetProjectLogs. +type V1GetProjectLogsParams struct { Sql *string `form:"sql,omitempty" json:"sql,omitempty"` IsoTimestampStart *time.Time `form:"iso_timestamp_start,omitempty" json:"iso_timestamp_start,omitempty"` IsoTimestampEnd *time.Time `form:"iso_timestamp_end,omitempty" json:"iso_timestamp_end,omitempty"` } -// GetApiCountsParams defines parameters for GetApiCounts. -type GetApiCountsParams struct { - Interval *GetApiCountsParamsInterval `form:"interval,omitempty" json:"interval,omitempty"` +// V1GetProjectUsageApiCountParams defines parameters for V1GetProjectUsageApiCount. +type V1GetProjectUsageApiCountParams struct { + Interval *V1GetProjectUsageApiCountParamsInterval `form:"interval,omitempty" json:"interval,omitempty"` } -// GetApiCountsParamsInterval defines parameters for GetApiCounts. -type GetApiCountsParamsInterval string +// V1GetProjectUsageApiCountParamsInterval defines parameters for V1GetProjectUsageApiCount. +type V1GetProjectUsageApiCountParamsInterval string // V1GetProjectApiKeysParams defines parameters for V1GetProjectApiKeys. type V1GetProjectApiKeysParams struct { @@ -2974,20 +2974,20 @@ type V1GetProjectApiKeysParams struct { Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } -// CreateApiKeyParams defines parameters for CreateApiKey. -type CreateApiKeyParams struct { +// V1CreateProjectApiKeyParams defines parameters for V1CreateProjectApiKey. +type V1CreateProjectApiKeyParams struct { // Reveal Boolean string, true or false Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } -// UpdateLegacyApiKeysParams defines parameters for UpdateLegacyApiKeys. -type UpdateLegacyApiKeysParams struct { +// V1UpdateProjectLegacyApiKeysParams defines parameters for V1UpdateProjectLegacyApiKeys. +type V1UpdateProjectLegacyApiKeysParams struct { // Enabled Boolean string, true or false Enabled bool `form:"enabled" json:"enabled"` } -// DeleteApiKeyParams defines parameters for DeleteApiKey. -type DeleteApiKeyParams struct { +// V1DeleteProjectApiKeyParams defines parameters for V1DeleteProjectApiKey. +type V1DeleteProjectApiKeyParams struct { // Reveal Boolean string, true or false Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` @@ -2996,14 +2996,14 @@ type DeleteApiKeyParams struct { Reason *string `form:"reason,omitempty" json:"reason,omitempty"` } -// GetApiKeyParams defines parameters for GetApiKey. -type GetApiKeyParams struct { +// V1GetProjectApiKeyParams defines parameters for V1GetProjectApiKey. +type V1GetProjectApiKeyParams struct { // Reveal Boolean string, true or false Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } -// UpdateApiKeyParams defines parameters for UpdateApiKey. -type UpdateApiKeyParams struct { +// V1UpdateProjectApiKeyParams defines parameters for V1UpdateProjectApiKey. +type V1UpdateProjectApiKeyParams struct { // Reveal Boolean string, true or false Reveal *bool `form:"reveal,omitempty" json:"reveal,omitempty"` } @@ -3123,11 +3123,11 @@ type V1CreateAnOrganizationJSONRequestBody = CreateOrganizationV1 // V1CreateAProjectJSONRequestBody defines body for V1CreateAProject for application/json ContentType. type V1CreateAProjectJSONRequestBody = V1CreateProjectBody -// CreateApiKeyJSONRequestBody defines body for CreateApiKey for application/json ContentType. -type CreateApiKeyJSONRequestBody = CreateApiKeyBody +// V1CreateProjectApiKeyJSONRequestBody defines body for V1CreateProjectApiKey for application/json ContentType. +type V1CreateProjectApiKeyJSONRequestBody = CreateApiKeyBody -// UpdateApiKeyJSONRequestBody defines body for UpdateApiKey for application/json ContentType. -type UpdateApiKeyJSONRequestBody = UpdateApiKeyBody +// V1UpdateProjectApiKeyJSONRequestBody defines body for V1UpdateProjectApiKey for application/json ContentType. +type V1UpdateProjectApiKeyJSONRequestBody = UpdateApiKeyBody // V1ApplyProjectAddonJSONRequestBody defines body for V1ApplyProjectAddon for application/json ContentType. type V1ApplyProjectAddonJSONRequestBody = ApplyProjectAddonBody @@ -3138,11 +3138,11 @@ type V1CreateABranchJSONRequestBody = CreateBranchBody // V1UpdateAuthServiceConfigJSONRequestBody defines body for V1UpdateAuthServiceConfig for application/json ContentType. type V1UpdateAuthServiceConfigJSONRequestBody = UpdateAuthConfigBody -// CreateSigningKeyForProjectJSONRequestBody defines body for CreateSigningKeyForProject for application/json ContentType. -type CreateSigningKeyForProjectJSONRequestBody = CreateSigningKeyBody +// V1CreateProjectSigningKeyJSONRequestBody defines body for V1CreateProjectSigningKey for application/json ContentType. +type V1CreateProjectSigningKeyJSONRequestBody = CreateSigningKeyBody -// PatchSigningKeyJSONRequestBody defines body for PatchSigningKey for application/json ContentType. -type PatchSigningKeyJSONRequestBody = UpdateSigningKeyBody +// V1UpdateProjectSigningKeyJSONRequestBody defines body for V1UpdateProjectSigningKey for application/json ContentType. +type V1UpdateProjectSigningKeyJSONRequestBody = UpdateSigningKeyBody // V1CreateASsoProviderJSONRequestBody defines body for V1CreateASsoProvider for application/json ContentType. type V1CreateASsoProviderJSONRequestBody = CreateProviderBody @@ -3150,8 +3150,8 @@ type V1CreateASsoProviderJSONRequestBody = CreateProviderBody // V1UpdateASsoProviderJSONRequestBody defines body for V1UpdateASsoProvider for application/json ContentType. type V1UpdateASsoProviderJSONRequestBody = UpdateProviderBody -// CreateTPAForProjectJSONRequestBody defines body for CreateTPAForProject for application/json ContentType. -type CreateTPAForProjectJSONRequestBody = CreateThirdPartyAuthBody +// V1CreateProjectTpaIntegrationJSONRequestBody defines body for V1CreateProjectTpaIntegration for application/json ContentType. +type V1CreateProjectTpaIntegrationJSONRequestBody = CreateThirdPartyAuthBody // V1UpdatePoolerConfigJSONRequestBody defines body for V1UpdatePoolerConfig for application/json ContentType. type V1UpdatePoolerConfigJSONRequestBody = UpdateSupavisorConfigBody From 5a1b6cd3bd9f6c3f2f2696a4cb38c4f573268379 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 18 Jun 2025 18:17:01 +0800 Subject: [PATCH 214/359] fix: use go tool for dev dependencies (#3732) --- .github/workflows/ci.yml | 2 +- go.mod | 18 ++++++++++++------ main.go | 4 ++-- pkg/go.mod | 2 +- tools/tools.go | 14 -------------- 5 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 tools/tools.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d29506a6f..b8f733605 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - uses: t1m0thyj/unlock-keyring@v1 - run: | pkgs=$(go list ./pkg/... | grep -Ev 'pkg/api' | paste -sd ',' -) - go run gotest.tools/gotestsum -- -race -v -count=1 ./... \ + go tool gotestsum -- -race -v -count=1 ./... \ -coverpkg="./cmd/...,./internal/...,${pkgs}" -coverprofile=coverage.out - uses: coverallsapp/github-action@v2 diff --git a/go.mod b/go.mod index 25165cd30..6d1eb4972 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,11 @@ module github.com/supabase/cli -go 1.24.2 +go 1.24.4 require ( github.com/BurntSushi/toml v1.5.0 github.com/Netflix/go-env v0.1.2 + github.com/andybalholm/brotli v1.1.1 github.com/cenkalti/backoff/v4 v4.3.0 github.com/charmbracelet/bubbles v0.18.0 github.com/charmbracelet/bubbletea v0.25.0 @@ -15,11 +16,11 @@ require ( github.com/docker/cli v28.2.2+incompatible github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 + github.com/fsnotify/fsnotify v1.9.0 github.com/getsentry/sentry-go v0.33.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 - github.com/golangci/golangci-lint/v2 v2.1.6 github.com/google/go-github/v62 v62.0.0 github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 @@ -31,7 +32,6 @@ require ( github.com/joho/godotenv v1.5.1 github.com/mithrandie/csvq-driver v1.7.0 github.com/muesli/reflow v0.3.0 - github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 github.com/slack-go/slack v0.17.1 github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 @@ -49,7 +49,6 @@ require ( golang.org/x/term v0.32.0 google.golang.org/grpc v1.73.0 gopkg.in/yaml.v3 v3.0.1 - gotest.tools/gotestsum v1.12.2 ) require ( @@ -75,7 +74,6 @@ require ( github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect github.com/alingse/nilnesserr v0.2.0 // indirect - github.com/andybalholm/brotli v1.1.1 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.2.0 // indirect @@ -129,7 +127,6 @@ require ( github.com/fatih/structtag v1.2.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/firefart/nonamedreturns v1.0.6 // indirect - github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/getkin/kin-openapi v0.131.0 // indirect @@ -159,6 +156,7 @@ require ( github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect github.com/golangci/go-printf-func-name v0.1.0 // indirect github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect + github.com/golangci/golangci-lint/v2 v2.1.6 // indirect github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 // indirect github.com/golangci/misspell v0.6.0 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect @@ -243,6 +241,7 @@ require ( github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.19.1 // indirect github.com/oapi-codegen/nullable v1.1.0 // indirect + github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 // indirect github.com/oapi-codegen/runtime v1.1.1 // indirect github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect @@ -343,9 +342,16 @@ require ( google.golang.org/protobuf v1.36.6 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gotest.tools/gotestsum v1.12.2 // indirect honnef.co/go/tools v0.6.1 // indirect mvdan.cc/gofumpt v0.8.0 // indirect mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect ) replace github.com/supabase/cli/pkg v1.0.0 => ./pkg + +tool ( + github.com/golangci/golangci-lint/v2/cmd/golangci-lint + github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen + gotest.tools/gotestsum +) diff --git a/main.go b/main.go index 17774e656..825dde835 100644 --- a/main.go +++ b/main.go @@ -4,8 +4,8 @@ import ( "github.com/supabase/cli/cmd" ) -//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=pkg/api/types.cfg.yaml https://api.supabase.green/api/v1-yaml -//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=pkg/api/client.cfg.yaml https://api.supabase.green/api/v1-yaml +//go:generate go tool oapi-codegen -config pkg/api/types.cfg.yaml https://api.supabase.green/api/v1-yaml +//go:generate go tool oapi-codegen -config pkg/api/client.cfg.yaml https://api.supabase.green/api/v1-yaml func main() { cmd.Execute() diff --git a/pkg/go.mod b/pkg/go.mod index 0340f3cba..297aee7e5 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -1,6 +1,6 @@ module github.com/supabase/cli/pkg -go 1.24.2 +go 1.24.4 require ( github.com/BurntSushi/toml v1.5.0 diff --git a/tools/tools.go b/tools/tools.go deleted file mode 100644 index e0ae60a6c..000000000 --- a/tools/tools.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build tools - -package tools - -import ( - // Import all required tools so that they can be version controlled via go.mod & go.sum. - // These imports are tracked a sub package so as to not impact the dependencies of clients of - // the library. - // This should be migrated directly to go.mod when the following is complete: - // https://github.com/golang/go/issues/48429 - _ "github.com/golangci/golangci-lint/v2/cmd/golangci-lint" - _ "github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen" - _ "gotest.tools/gotestsum" -) From 58a366da2ab04c3a192d2e37a8c6180215ea168e Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:40:51 +0200 Subject: [PATCH 215/359] chore: sync API types from infrastructure (#3735) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/client.gen.go | 218 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index a00065344..b1180c329 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -256,6 +256,12 @@ type ClientInterface interface { V1CreateProjectSigningKey(ctx context.Context, ref string, body V1CreateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetLegacySigningKey request + V1GetLegacySigningKey(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1CreateLegacySigningKey request + V1CreateLegacySigningKey(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1RemoveProjectSigningKey request V1RemoveProjectSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1266,6 +1272,30 @@ func (c *Client) V1CreateProjectSigningKey(ctx context.Context, ref string, body return c.Client.Do(req) } +func (c *Client) V1GetLegacySigningKey(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetLegacySigningKeyRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1CreateLegacySigningKey(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1CreateLegacySigningKeyRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1RemoveProjectSigningKey(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1RemoveProjectSigningKeyRequest(c.Server, ref, id) if err != nil { @@ -4790,6 +4820,74 @@ func NewV1CreateProjectSigningKeyRequestWithBody(server string, ref string, cont return req, nil } +// NewV1GetLegacySigningKeyRequest generates requests for V1GetLegacySigningKey +func NewV1GetLegacySigningKeyRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/signing-keys/legacy", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1CreateLegacySigningKeyRequest generates requests for V1CreateLegacySigningKey +func NewV1CreateLegacySigningKeyRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/signing-keys/legacy", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1RemoveProjectSigningKeyRequest generates requests for V1RemoveProjectSigningKey func NewV1RemoveProjectSigningKeyRequest(server string, ref string, id openapi_types.UUID) (*http.Request, error) { var err error @@ -8531,6 +8629,12 @@ type ClientWithResponsesInterface interface { V1CreateProjectSigningKeyWithResponse(ctx context.Context, ref string, body V1CreateProjectSigningKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateProjectSigningKeyResponse, error) + // V1GetLegacySigningKeyWithResponse request + V1GetLegacySigningKeyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetLegacySigningKeyResponse, error) + + // V1CreateLegacySigningKeyWithResponse request + V1CreateLegacySigningKeyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CreateLegacySigningKeyResponse, error) + // V1RemoveProjectSigningKeyWithResponse request V1RemoveProjectSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1RemoveProjectSigningKeyResponse, error) @@ -9824,6 +9928,50 @@ func (r V1CreateProjectSigningKeyResponse) StatusCode() int { return 0 } +type V1GetLegacySigningKeyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SigningKeyResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetLegacySigningKeyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetLegacySigningKeyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1CreateLegacySigningKeyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *SigningKeyResponse +} + +// Status returns HTTPResponse.Status +func (r V1CreateLegacySigningKeyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1CreateLegacySigningKeyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1RemoveProjectSigningKeyResponse struct { Body []byte HTTPResponse *http.Response @@ -12025,6 +12173,24 @@ func (c *ClientWithResponses) V1CreateProjectSigningKeyWithResponse(ctx context. return ParseV1CreateProjectSigningKeyResponse(rsp) } +// V1GetLegacySigningKeyWithResponse request returning *V1GetLegacySigningKeyResponse +func (c *ClientWithResponses) V1GetLegacySigningKeyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetLegacySigningKeyResponse, error) { + rsp, err := c.V1GetLegacySigningKey(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetLegacySigningKeyResponse(rsp) +} + +// V1CreateLegacySigningKeyWithResponse request returning *V1CreateLegacySigningKeyResponse +func (c *ClientWithResponses) V1CreateLegacySigningKeyWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1CreateLegacySigningKeyResponse, error) { + rsp, err := c.V1CreateLegacySigningKey(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1CreateLegacySigningKeyResponse(rsp) +} + // V1RemoveProjectSigningKeyWithResponse request returning *V1RemoveProjectSigningKeyResponse func (c *ClientWithResponses) V1RemoveProjectSigningKeyWithResponse(ctx context.Context, ref string, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1RemoveProjectSigningKeyResponse, error) { rsp, err := c.V1RemoveProjectSigningKey(ctx, ref, id, reqEditors...) @@ -14056,6 +14222,58 @@ func ParseV1CreateProjectSigningKeyResponse(rsp *http.Response) (*V1CreateProjec return response, nil } +// ParseV1GetLegacySigningKeyResponse parses an HTTP response from a V1GetLegacySigningKeyWithResponse call +func ParseV1GetLegacySigningKeyResponse(rsp *http.Response) (*V1GetLegacySigningKeyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetLegacySigningKeyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SigningKeyResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1CreateLegacySigningKeyResponse parses an HTTP response from a V1CreateLegacySigningKeyWithResponse call +func ParseV1CreateLegacySigningKeyResponse(rsp *http.Response) (*V1CreateLegacySigningKeyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1CreateLegacySigningKeyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest SigningKeyResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil +} + // ParseV1RemoveProjectSigningKeyResponse parses an HTTP response from a V1RemoveProjectSigningKeyWithResponse call func ParseV1RemoveProjectSigningKeyResponse(rsp *http.Response) (*V1RemoveProjectSigningKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) From 9c3a439f6a9b0a8d3dc776f70f0b6ac8d3af94fb Mon Sep 17 00:00:00 2001 From: Andrew Valleteau Date: Thu, 19 Jun 2025 11:59:22 +0200 Subject: [PATCH 216/359] chore(ci): add pr automerge on approval (#3736) --- .github/workflows/api-sync.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/api-sync.yml b/.github/workflows/api-sync.yml index 8193d927a..764de088c 100644 --- a/.github/workflows/api-sync.yml +++ b/.github/workflows/api-sync.yml @@ -38,6 +38,7 @@ jobs: - name: Create Pull Request if: steps.check.outputs.has_changes == 'true' + id: cpr uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.GH_PAT }} @@ -52,3 +53,9 @@ jobs: labels: | automated pr api-sync + + - name: Enable Pull Request Automerge + if: steps.check.outputs.has_changes == 'true' + run: gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}" + env: + GH_TOKEN: ${{ secrets.GH_PAT }} From ff1056486937039acf2ca6ef8842efc5f94d0ebc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Jun 2025 10:03:47 +0000 Subject: [PATCH 217/359] chore(deps): bump supabase/realtime from v2.36.20 to v2.37.2 in /pkg/config/templates (#3734) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.36.20 to v2.37.2. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.37.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e8073571c..b873530d4 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.2 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.36.20 AS realtime +FROM supabase/realtime:v2.37.2 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 3e8220f176b29ebfb254949651f14d0b2009d500 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 05:08:47 +0000 Subject: [PATCH 218/359] chore(deps): bump supabase/supavisor from 2.5.2 to 2.5.3 in /pkg/config/templates (#3740) chore(deps): bump supabase/supavisor in /pkg/config/templates Bumps supabase/supavisor from 2.5.2 to 2.5.3. --- updated-dependencies: - dependency-name: supabase/supavisor dependency-version: 2.5.3 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index b873530d4..96c6babf3 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -9,7 +9,7 @@ FROM supabase/studio:2025.06.16-sha-c4316c3 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector -FROM supabase/supavisor:2.5.2 AS supavisor +FROM supabase/supavisor:2.5.3 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.37.2 AS realtime FROM supabase/storage-api:v1.24.6 AS storage From a1f79b444f9c4db7c21d284669418fc780d5045a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 04:52:55 +0000 Subject: [PATCH 219/359] chore(deps): bump supabase/realtime from v2.37.2 to v2.37.3 in /pkg/config/templates (#3745) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.37.2 to v2.37.3. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.37.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 96c6babf3..e11e0b223 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.3 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.37.2 AS realtime +FROM supabase/realtime:v2.37.3 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 8ca836afc38af8b812b4c66a440d8cee1ce84b34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 04:57:50 +0000 Subject: [PATCH 220/359] chore(deps): bump supabase/supavisor from 2.5.3 to 2.5.5 in /pkg/config/templates (#3746) chore(deps): bump supabase/supavisor in /pkg/config/templates Bumps supabase/supavisor from 2.5.3 to 2.5.5. --- updated-dependencies: - dependency-name: supabase/supavisor dependency-version: 2.5.5 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e11e0b223..5007c70b1 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -9,7 +9,7 @@ FROM supabase/studio:2025.06.16-sha-c4316c3 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector -FROM supabase/supavisor:2.5.3 AS supavisor +FROM supabase/supavisor:2.5.5 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.37.3 AS realtime FROM supabase/storage-api:v1.24.6 AS storage From f3aaa49640a3a592d172f6537e5d5bd77af3fdf1 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 23 Jun 2025 18:01:42 +0800 Subject: [PATCH 221/359] fix: diff declarative schemas without supabase stop (#3747) * fix: diff declarative schemas without supabase stop * fix: refactor entrypoint for older pg images * chore: update unit tests * chore: show stacktrace when developing locally --- cmd/root.go | 3 ++ internal/db/diff/diff.go | 87 +++++++++++++++-------------------- internal/db/diff/diff_test.go | 10 +++- internal/db/start/start.go | 37 ++++++++------- 4 files changed, 67 insertions(+), 70 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 54d88b0b8..a2cc6f0a7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -200,6 +200,9 @@ func recoverAndExit() { !viper.GetBool("DEBUG") { utils.CmdSuggestion = utils.SuggestDebugFlag } + if e, ok := err.(*errors.Error); ok && len(utils.Version) == 0 { + fmt.Fprintln(os.Stderr, string(e.Stack())) + } msg = err.Error() default: msg = fmt.Sprintf("%#v", err) diff --git a/internal/db/diff/diff.go b/internal/db/diff/diff.go index 646ee005d..01ce857ee 100644 --- a/internal/db/diff/diff.go +++ b/internal/db/diff/diff.go @@ -31,22 +31,6 @@ import ( type DiffFunc func(context.Context, string, string, []string) (string, error) func Run(ctx context.Context, schema []string, file string, config pgconn.Config, differ DiffFunc, fsys afero.Fs, options ...func(*pgx.ConnConfig)) (err error) { - // Sanity checks. - if utils.IsLocalDatabase(config) { - if declared, err := loadDeclaredSchemas(fsys); err != nil { - return err - } else if container, err := createShadowIfNotExists(ctx, declared); err != nil { - return err - } else if len(container) > 0 { - defer utils.DockerRemove(container) - if err := start.WaitForHealthyService(ctx, start.HealthTimeout, container); err != nil { - return err - } - if err := migrateBaseDatabase(ctx, container, declared, fsys, options...); err != nil { - return err - } - } - } // 1. Load all user defined schemas if len(schema) == 0 { schema, err = loadSchema(ctx, config, options...) @@ -72,22 +56,6 @@ func Run(ctx context.Context, schema []string, file string, config pgconn.Config return nil } -func createShadowIfNotExists(ctx context.Context, migrations []string) (string, error) { - if len(migrations) == 0 { - return "", nil - } - if err := utils.AssertSupabaseDbIsRunning(); !errors.Is(err, utils.ErrNotRunning) { - return "", err - } - fmt.Fprintln(os.Stderr, "Creating local database from declarative schemas:") - msg := make([]string, len(migrations)) - for i, m := range migrations { - msg[i] = fmt.Sprintf(" • %s", utils.Bold(m)) - } - fmt.Fprintln(os.Stderr, strings.Join(msg, "\n")) - return CreateShadowDatabase(ctx, utils.Config.Db.Port) -} - func loadDeclaredSchemas(fsys afero.Fs) ([]string, error) { if schemas := utils.Config.Db.Migrations.SchemaPaths; len(schemas) > 0 { return schemas.Files(afero.NewIOFS(fsys)) @@ -140,7 +108,8 @@ func loadSchema(ctx context.Context, config pgconn.Config, options ...func(*pgx. } func CreateShadowDatabase(ctx context.Context, port uint16) (string, error) { - config := start.NewContainerConfig() + // Disable background workers in shadow database + config := start.NewContainerConfig("-c", "max_worker_processes=0") hostPort := strconv.FormatUint(uint64(port), 10) hostConfig := container.HostConfig{ PortBindings: nat.PortMap{"5432/tcp": []nat.PortBinding{{HostPort: hostPort}}}, @@ -148,7 +117,6 @@ func CreateShadowDatabase(ctx context.Context, port uint16) (string, error) { } networkingConfig := network.NetworkingConfig{} if utils.Config.Db.MajorVersion <= 14 { - config.Entrypoint = nil hostConfig.Tmpfs = map[string]string{"/docker-entrypoint-initdb.d": ""} } return utils.DockerStart(ctx, config, hostConfig, networkingConfig, "") @@ -164,6 +132,9 @@ func ConnectShadowDatabase(ctx context.Context, timeout time.Duration, options . return backoff.RetryWithData(connect, policy) } +// Required to bypass pg_cron check: https://github.com/citusdata/pg_cron/blob/main/pg_cron.sql#L3 +const CREATE_TEMPLATE = "CREATE DATABASE contrib_regression TEMPLATE postgres" + func MigrateShadowDatabase(ctx context.Context, container string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { migrations, err := migration.ListLocalMigrations(utils.MigrationsDir, afero.NewIOFS(fsys)) if err != nil { @@ -177,19 +148,10 @@ func MigrateShadowDatabase(ctx context.Context, container string, fsys afero.Fs, if err := start.SetupDatabase(ctx, conn, container[:12], os.Stderr, fsys); err != nil { return err } - return migration.ApplyMigrations(ctx, migrations, conn, afero.NewIOFS(fsys)) -} - -func migrateBaseDatabase(ctx context.Context, container string, migrations []string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { - conn, err := utils.ConnectLocalPostgres(ctx, pgconn.Config{}, options...) - if err != nil { - return err - } - defer conn.Close(context.Background()) - if err := start.SetupDatabase(ctx, conn, container[:12], os.Stderr, fsys); err != nil { - return err + if _, err := conn.Exec(ctx, CREATE_TEMPLATE); err != nil { + return errors.Errorf("failed to create template database: %w", err) } - return migration.SeedGlobals(ctx, migrations, conn, afero.NewIOFS(fsys)) + return migration.ApplyMigrations(ctx, migrations, conn, afero.NewIOFS(fsys)) } func DiffDatabase(ctx context.Context, schema []string, config pgconn.Config, w io.Writer, fsys afero.Fs, differ func(context.Context, string, string, []string) (string, error), options ...func(*pgx.ConnConfig)) (string, error) { @@ -205,14 +167,41 @@ func DiffDatabase(ctx context.Context, schema []string, config pgconn.Config, w if err := MigrateShadowDatabase(ctx, shadow, fsys, options...); err != nil { return "", err } - fmt.Fprintln(w, "Diffing schemas:", strings.Join(schema, ",")) - source := utils.ToPostgresURL(pgconn.Config{ + shadowConfig := pgconn.Config{ Host: utils.Config.Hostname, Port: utils.Config.Db.ShadowPort, User: "postgres", Password: utils.Config.Db.Password, Database: "postgres", - }) + } + if utils.IsLocalDatabase(config) { + if declared, err := loadDeclaredSchemas(fsys); err != nil { + return "", err + } else if len(declared) > 0 { + config = shadowConfig + config.Database = "contrib_regression" + if err := migrateBaseDatabase(ctx, config, declared, fsys, options...); err != nil { + return "", err + } + } + } + fmt.Fprintln(w, "Diffing schemas:", strings.Join(schema, ",")) + source := utils.ToPostgresURL(shadowConfig) target := utils.ToPostgresURL(config) return differ(ctx, source, target, schema) } + +func migrateBaseDatabase(ctx context.Context, config pgconn.Config, migrations []string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { + fmt.Fprintln(os.Stderr, "Creating local database from declarative schemas:") + msg := make([]string, len(migrations)) + for i, m := range migrations { + msg[i] = fmt.Sprintf(" • %s", utils.Bold(m)) + } + fmt.Fprintln(os.Stderr, strings.Join(msg, "\n")) + conn, err := utils.ConnectLocalPostgres(ctx, config, options...) + if err != nil { + return err + } + defer conn.Close(context.Background()) + return migration.SeedGlobals(ctx, migrations, conn, afero.NewIOFS(fsys)) +} diff --git a/internal/db/diff/diff_test.go b/internal/db/diff/diff_test.go index 498c88da1..daadaf6bb 100644 --- a/internal/db/diff/diff_test.go +++ b/internal/db/diff/diff_test.go @@ -69,6 +69,8 @@ func TestRun(t *testing.T) { require.NoError(t, apitest.MockDockerLogs(utils.Docker, "test-migra", diff)) // Setup mock postgres conn := pgtest.NewConn() + conn.Query(CREATE_TEMPLATE). + Reply("CREATE DATABASE") defer conn.Close(t) // Run test err := Run(context.Background(), []string{"public"}, "file", dbConfig, DiffSchemaMigra, fsys, conn.Intercept) @@ -134,7 +136,9 @@ func TestMigrateShadow(t *testing.T) { conn.Query(utils.GlobalsSql). Reply("CREATE SCHEMA"). Query(utils.InitialSchemaPg14Sql). - Reply("CREATE SCHEMA") + Reply("CREATE SCHEMA"). + Query(CREATE_TEMPLATE). + Reply("CREATE DATABASE") helper.MockMigrationHistory(conn). Query(sql). Reply("CREATE SCHEMA"). @@ -308,7 +312,9 @@ create schema public`) conn.Query(utils.GlobalsSql). Reply("CREATE SCHEMA"). Query(utils.InitialSchemaPg14Sql). - Reply("CREATE SCHEMA") + Reply("CREATE SCHEMA"). + Query(CREATE_TEMPLATE). + Reply("CREATE DATABASE") helper.MockMigrationHistory(conn). Query(sql). Reply("CREATE SCHEMA"). diff --git a/internal/db/start/start.go b/internal/db/start/start.go index ff4b237f0..665c5f4f7 100644 --- a/internal/db/start/start.go +++ b/internal/db/start/start.go @@ -60,7 +60,11 @@ func Run(ctx context.Context, fromBackup string, fsys afero.Fs) error { return err } -func NewContainerConfig() container.Config { +func NewContainerConfig(args ...string) container.Config { + if utils.Config.Db.MajorVersion >= 14 { + // Extensions schema does not exist on PG13 and below + args = append(args, "-c", "search_path='$user,public,extensions'") + } env := []string{ "POSTGRES_PASSWORD=" + utils.Config.Db.Password, "POSTGRES_HOST=/var/run/postgresql", @@ -92,7 +96,7 @@ func NewContainerConfig() container.Config { cat <<'EOF' > /etc/postgresql.schema.sql && \ cat <<'EOF' > /etc/postgresql-custom/pgsodium_root.key && \ cat <<'EOF' >> /etc/postgresql/postgresql.conf && \ -docker-entrypoint.sh postgres -D /etc/postgresql +docker-entrypoint.sh postgres -D /etc/postgresql ` + strings.Join(args, " ") + ` ` + initialSchema + ` ` + webhookSchema + ` ` + _supabaseSchema + ` @@ -102,12 +106,15 @@ EOF ` + utils.Config.Db.Settings.ToPostgresConfig() + ` EOF`}, } - if utils.Config.Db.MajorVersion >= 14 { - config.Cmd = []string{"postgres", - "-c", "config_file=/etc/postgresql/postgresql.conf", - // Ref: https://postgrespro.com/list/thread-id/2448092 - "-c", `search_path="$user",public,extensions`, - } + if utils.Config.Db.MajorVersion <= 14 { + config.Entrypoint = []string{"sh", "-c", ` +cat <<'EOF' > /docker-entrypoint-initdb.d/supabase_schema.sql && \ +cat <<'EOF' >> /etc/postgresql/postgresql.conf && \ +docker-entrypoint.sh postgres -D /etc/postgresql ` + strings.Join(args, " ") + ` +` + _supabaseSchema + ` +EOF +` + utils.Config.Db.Settings.ToPostgresConfig() + ` +EOF`} } return config } @@ -122,6 +129,9 @@ func NewHostConfig() container.HostConfig { utils.ConfigId + ":/etc/postgresql-custom", }, } + if utils.Config.Db.MajorVersion <= 14 { + hostConfig.Tmpfs = map[string]string{"/docker-entrypoint-initdb.d": ""} + } return hostConfig } @@ -135,17 +145,6 @@ func StartDatabase(ctx context.Context, fromBackup string, fsys afero.Fs, w io.W }, }, } - if utils.Config.Db.MajorVersion <= 14 { - config.Entrypoint = []string{"sh", "-c", ` -cat <<'EOF' > /docker-entrypoint-initdb.d/supabase_schema.sql && \ -cat <<'EOF' >> /etc/postgresql/postgresql.conf && \ -docker-entrypoint.sh postgres -D /etc/postgresql -` + _supabaseSchema + ` -EOF -` + utils.Config.Db.Settings.ToPostgresConfig() + ` -EOF`} - hostConfig.Tmpfs = map[string]string{"/docker-entrypoint-initdb.d": ""} - } if len(fromBackup) > 0 { config.Entrypoint = []string{"sh", "-c", ` cat <<'EOF' > /etc/postgresql.schema.sql && \ From d609eac68913f1143eda8014163859d47fd21df9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 04:41:30 +0000 Subject: [PATCH 222/359] chore(deps): bump github.com/andybalholm/brotli from 1.1.1 to 1.2.0 (#3751) Bumps [github.com/andybalholm/brotli](https://github.com/andybalholm/brotli) from 1.1.1 to 1.2.0. - [Commits](https://github.com/andybalholm/brotli/compare/v1.1.1...v1.2.0) --- updated-dependencies: - dependency-name: github.com/andybalholm/brotli dependency-version: 1.2.0 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 6d1eb4972..f4a078d97 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.24.4 require ( github.com/BurntSushi/toml v1.5.0 github.com/Netflix/go-env v0.1.2 - github.com/andybalholm/brotli v1.1.1 + github.com/andybalholm/brotli v1.2.0 github.com/cenkalti/backoff/v4 v4.3.0 github.com/charmbracelet/bubbles v0.18.0 github.com/charmbracelet/bubbletea v0.25.0 diff --git a/go.sum b/go.sum index 40b6ea8ee..844e9e776 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,8 @@ github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQ github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/alingse/nilnesserr v0.2.0 h1:raLem5KG7EFVb4UIDAXgrv3N2JIaffeKNtcEXkEWd/w= github.com/alingse/nilnesserr v0.2.0/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg= -github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= -github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= +github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ= +github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= From 48236f22b815df37f2cde15b6ef4334af9d62a90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 05:07:19 +0000 Subject: [PATCH 223/359] chore(deps): bump github.com/andybalholm/brotli from 1.1.1 to 1.2.0 in /pkg (#3756) chore(deps): bump github.com/andybalholm/brotli in /pkg Bumps [github.com/andybalholm/brotli](https://github.com/andybalholm/brotli) from 1.1.1 to 1.2.0. - [Commits](https://github.com/andybalholm/brotli/compare/v1.1.1...v1.2.0) --- updated-dependencies: - dependency-name: github.com/andybalholm/brotli dependency-version: 1.2.0 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> --- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/go.mod b/pkg/go.mod index 297aee7e5..f1a9f408d 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -4,7 +4,7 @@ go 1.24.4 require ( github.com/BurntSushi/toml v1.5.0 - github.com/andybalholm/brotli v1.1.1 + github.com/andybalholm/brotli v1.2.0 github.com/cenkalti/backoff/v4 v4.3.0 github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.11 diff --git a/pkg/go.sum b/pkg/go.sum index c25f97883..344d50b33 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -3,8 +3,8 @@ github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= -github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= -github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= +github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ= +github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= From ad03264cfcaf986b5f8952d0370a7609db2a9a48 Mon Sep 17 00:00:00 2001 From: Chris Stockton <180184+cstockton@users.noreply.github.com> Date: Tue, 24 Jun 2025 07:39:22 -0700 Subject: [PATCH 224/359] feat: add support for before-user-created hook (#3749) --- internal/start/start.go | 8 +++++ pkg/config/auth.go | 19 ++++++++++++ pkg/config/auth_test.go | 29 +++++++++++++++++++ pkg/config/config.go | 9 ++++++ pkg/config/templates/config.toml | 5 ++++ .../local_disabled_remote_enabled.diff | 7 ++++- .../local_enabled_remote_disabled.diff | 10 ++++++- pkg/config/testdata/config.toml | 5 ++++ 8 files changed, 90 insertions(+), 2 deletions(-) diff --git a/internal/start/start.go b/internal/start/start.go index 122080c58..fcf654fe6 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -641,6 +641,14 @@ EOF "GOTRUE_HOOK_SEND_EMAIL_SECRETS="+hook.Secrets.Value, ) } + if hook := utils.Config.Auth.Hook.BeforeUserCreated; hook != nil && hook.Enabled { + env = append( + env, + "GOTRUE_HOOK_BEFORE_USER_CREATED_ENABLED=true", + "GOTRUE_HOOK_BEFORE_USER_CREATED_URI="+hook.URI, + "GOTRUE_HOOK_BEFORE_USER_CREATED_SECRETS="+hook.Secrets.Value, + ) + } if utils.Config.Auth.MFA.Phone.EnrollEnabled || utils.Config.Auth.MFA.Phone.VerifyEnabled { env = append( diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 50194af1b..9aa026315 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -201,6 +201,7 @@ type ( CustomAccessToken *hookConfig `toml:"custom_access_token"` SendSMS *hookConfig `toml:"send_sms"` SendEmail *hookConfig `toml:"send_email"` + BeforeUserCreated *hookConfig `toml:"before_user_created"` } factorTypeConfiguration struct { @@ -381,6 +382,14 @@ func (c *captcha) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { func (h hook) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { // When local config is not set, we assume platform defaults should not change + if hook := h.BeforeUserCreated; hook != nil { + if body.HookBeforeUserCreatedEnabled = nullable.NewNullableWithValue(hook.Enabled); hook.Enabled { + body.HookBeforeUserCreatedUri = nullable.NewNullableWithValue(hook.URI) + if len(hook.Secrets.SHA256) > 0 { + body.HookBeforeUserCreatedSecrets = nullable.NewNullableWithValue(hook.Secrets.Value) + } + } + } if hook := h.CustomAccessToken; hook != nil { if body.HookCustomAccessTokenEnabled = nullable.NewNullableWithValue(hook.Enabled); hook.Enabled { body.HookCustomAccessTokenUri = nullable.NewNullableWithValue(hook.URI) @@ -425,6 +434,16 @@ func (h hook) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) { } func (h *hook) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { // When local config is not set, we assume platform defaults should not change + if hook := h.BeforeUserCreated; hook != nil { + // Ignore disabled hooks because their envs are not loaded + if hook.Enabled { + hook.URI = ValOrDefault(remoteConfig.HookBeforeUserCreatedUri, "") + if len(hook.Secrets.SHA256) > 0 { + hook.Secrets.SHA256 = ValOrDefault(remoteConfig.HookBeforeUserCreatedSecrets, "") + } + } + hook.Enabled = ValOrDefault(remoteConfig.HookBeforeUserCreatedEnabled, false) + } if hook := h.CustomAccessToken; hook != nil { // Ignore disabled hooks because their envs are not loaded if hook.Enabled { diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index 1bab29847..bba212383 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -215,6 +215,14 @@ func TestHookDiff(t *testing.T) { t.Run("local and remote enabled", func(t *testing.T) { c := newWithDefaults() c.Hook = hook{ + BeforeUserCreated: &hookConfig{ + Enabled: true, + URI: "http://example.com", + Secrets: Secret{ + Value: "test-secret", + SHA256: "ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252", + }, + }, CustomAccessToken: &hookConfig{ Enabled: true, URI: "http://example.com", @@ -254,6 +262,9 @@ func TestHookDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ + HookBeforeUserCreatedEnabled: nullable.NewNullableWithValue(true), + HookBeforeUserCreatedUri: nullable.NewNullableWithValue("http://example.com"), + HookBeforeUserCreatedSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), HookCustomAccessTokenEnabled: nullable.NewNullableWithValue(true), HookCustomAccessTokenUri: nullable.NewNullableWithValue("http://example.com"), HookCustomAccessTokenSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), @@ -277,6 +288,9 @@ func TestHookDiff(t *testing.T) { t.Run("local disabled remote enabled", func(t *testing.T) { c := newWithDefaults() c.Hook = hook{ + BeforeUserCreated: &hookConfig{ + Enabled: false, + }, CustomAccessToken: &hookConfig{ Enabled: false, }, @@ -296,6 +310,9 @@ func TestHookDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ + HookBeforeUserCreatedEnabled: nullable.NewNullableWithValue(true), + HookBeforeUserCreatedUri: nullable.NewNullableWithValue("http://example.com"), + HookBeforeUserCreatedSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), HookCustomAccessTokenEnabled: nullable.NewNullableWithValue(true), HookCustomAccessTokenUri: nullable.NewNullableWithValue("http://example.com"), HookCustomAccessTokenSecrets: nullable.NewNullableWithValue("ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252"), @@ -318,6 +335,14 @@ func TestHookDiff(t *testing.T) { t.Run("local enabled remote disabled", func(t *testing.T) { c := newWithDefaults() c.Hook = hook{ + BeforeUserCreated: &hookConfig{ + Enabled: true, + URI: "http://example.com", + Secrets: Secret{ + Value: "test-secret", + SHA256: "ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252", + }, + }, CustomAccessToken: &hookConfig{ Enabled: true, URI: "http://example.com", @@ -346,6 +371,8 @@ func TestHookDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ + HookBeforeUserCreatedEnabled: nullable.NewNullableWithValue(false), + HookBeforeUserCreatedUri: nullable.NewNullableWithValue("pg-functions://postgres/public/beforeUserCreated"), HookCustomAccessTokenEnabled: nullable.NewNullableWithValue(false), HookCustomAccessTokenUri: nullable.NewNullableWithValue("pg-functions://postgres/public/customToken"), HookSendSmsEnabled: nullable.NewNullableWithValue(false), @@ -366,6 +393,7 @@ func TestHookDiff(t *testing.T) { t.Run("local and remote disabled", func(t *testing.T) { c := newWithDefaults() c.Hook = hook{ + BeforeUserCreated: &hookConfig{Enabled: false}, CustomAccessToken: &hookConfig{Enabled: false}, SendSMS: &hookConfig{Enabled: false}, SendEmail: &hookConfig{Enabled: false}, @@ -374,6 +402,7 @@ func TestHookDiff(t *testing.T) { } // Run test diff, err := c.DiffWithRemote(v1API.AuthConfigResponse{ + HookBeforeUserCreatedEnabled: nullable.NewNullableWithValue(false), HookCustomAccessTokenEnabled: nullable.NewNullableWithValue(false), HookSendSmsEnabled: nullable.NewNullableWithValue(false), HookSendEmailEnabled: nullable.NewNullableWithValue(false), diff --git a/pkg/config/config.go b/pkg/config/config.go index 75bf61fcd..9f9e05ee9 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -301,6 +301,10 @@ func (a *auth) Clone() auth { hook := *a.Hook.SendEmail copy.Hook.SendEmail = &hook } + if a.Hook.BeforeUserCreated != nil { + hook := *a.Hook.BeforeUserCreated + copy.Hook.BeforeUserCreated = &hook + } copy.Sms.TestOTP = maps.Clone(a.Sms.TestOTP) return copy } @@ -1161,6 +1165,11 @@ func (h *hook) validate() error { return err } } + if hook := h.BeforeUserCreated; hook != nil { + if err := hook.validate("before_user_created"); err != nil { + return err + } + } return nil } diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index d72ae5045..92a5367c1 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -204,6 +204,11 @@ max_frequency = "5s" # Force log out if the user has been inactive longer than the specified duration. # inactivity_timeout = "8h" +# This hook runs before a new user is created and allows developers to reject the request based on the incoming user object. +# [auth.hook.before_user_created] +# enabled = true +# uri = "pg-functions://postgres/auth/before-user-created-hook" + # 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 diff --git a/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff b/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff index 459c58f42..43bab9e10 100644 --- a/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff +++ b/pkg/config/testdata/TestHookDiff/local_disabled_remote_enabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -24,19 +24,19 @@ +@@ -24,23 +24,23 @@ [hook] [hook.mfa_verification_attempt] @@ -24,4 +24,9 @@ diff remote[auth] local[auth] +enabled = false uri = "" secrets = "" + [hook.before_user_created] +-enabled = true ++enabled = false + uri = "" + secrets = "" diff --git a/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff b/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff index 6065f9d20..ed61a4cdb 100644 --- a/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff +++ b/pkg/config/testdata/TestHookDiff/local_enabled_remote_disabled.diff @@ -1,7 +1,7 @@ diff remote[auth] local[auth] --- remote[auth] +++ local[auth] -@@ -24,20 +24,20 @@ +@@ -24,25 +24,25 @@ [hook] [hook.mfa_verification_attempt] @@ -27,5 +27,13 @@ diff remote[auth] local[auth] +enabled = true +uri = "pg-functions://postgres/public/sendEmail" secrets = "" + [hook.before_user_created] +-enabled = false +-uri = "pg-functions://postgres/public/beforeUserCreated" +-secrets = "" ++enabled = true ++uri = "http://example.com" ++secrets = "hash:ce62bb9bcced294fd4afe668f8ab3b50a89cf433093c526fffa3d0e46bf55252" [mfa] + max_enrolled_factors = 0 diff --git a/pkg/config/testdata/config.toml b/pkg/config/testdata/config.toml index ed0d508fc..0077ec956 100644 --- a/pkg/config/testdata/config.toml +++ b/pkg/config/testdata/config.toml @@ -204,6 +204,11 @@ timebox = "24h" # Force log out if the user has been inactive longer than the specified duration. inactivity_timeout = "8h" +# This hook runs before a new user is created and allows developers to reject the request based on the incoming user object. +[auth.hook.before_user_created] +enabled = true +uri = "pg-functions://postgres/auth/before-user-created-hook" + # 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 From 7f19e04cf53eba1b196c4c8d93889c5f1ad61f07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 04:22:54 +0000 Subject: [PATCH 225/359] chore(deps): bump github.com/docker/cli from 28.2.2+incompatible to 28.3.0+incompatible (#3761) chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.2.2+incompatible to 28.3.0+incompatible. - [Commits](https://github.com/docker/cli/compare/v28.2.2...v28.3.0) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-version: 28.3.0+incompatible 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 f4a078d97..a0decb5fc 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.63.1 - github.com/docker/cli v28.2.2+incompatible + github.com/docker/cli v28.3.0+incompatible github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 diff --git a/go.sum b/go.sum index 844e9e776..ac806a52b 100644 --- a/go.sum +++ b/go.sum @@ -237,8 +237,8 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v28.2.2+incompatible h1:qzx5BNUDFqlvyq4AHzdNB7gSyVTmU4cgsyN9SdInc1A= -github.com/docker/cli v28.2.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.3.0+incompatible h1:s+ttruVLhB5ayeuf2BciwDVxYdKi+RoUlxmwNHV3Vfo= +github.com/docker/cli v28.3.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= From 33123b9525762742dca46b89949d65bfecfab375 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 05:22:12 +0000 Subject: [PATCH 226/359] chore(deps): bump supabase/postgres from 17.4.1.043 to 17.4.1.45 in /pkg/config/templates (#3764) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.043 to 17.4.1.45. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.45 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5007c70b1..863aa1467 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.043 AS pg +FROM supabase/postgres:17.4.1.45 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From e731cb5add16ce3b1d3812c8266fbc3007216e57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 05:27:16 +0000 Subject: [PATCH 227/359] chore(deps): bump supabase/studio from 2025.06.16-sha-c4316c3 to 2025.06.23-sha-17632f7 in /pkg/config/templates (#3753) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.06.16-sha-c4316c3 to 2025.06.23-sha-17632f7. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.06.23-sha-17632f7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 863aa1467..8b9a84594 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.3 AS pgmeta -FROM supabase/studio:2025.06.16-sha-c4316c3 AS studio +FROM supabase/studio:2025.06.23-sha-17632f7 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From c552900274a6aaa25a44a36aeb52476ae9cc1df1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 05:32:18 +0000 Subject: [PATCH 228/359] chore(deps): bump supabase/realtime from v2.37.3 to v2.37.7 in /pkg/config/templates (#3763) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.37.3 to v2.37.7. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.37.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 8b9a84594..7aafa12ee 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.5 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.37.3 AS realtime +FROM supabase/realtime:v2.37.7 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 67d36eec3482c9f8c573befbbc22b68f6cef888c Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Wed, 25 Jun 2025 11:30:50 +0200 Subject: [PATCH 229/359] chore: sync API types from infrastructure (#3765) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/types.gen.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index c6cfdff10..726ccf532 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1954,15 +1954,15 @@ type ProjectUpgradeEligibilityResponse struct { CurrentAppVersionReleaseChannel ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel `json:"current_app_version_release_channel"` DurationEstimateHours float32 `json:"duration_estimate_hours"` Eligible bool `json:"eligible"` - ExtensionDependentObjects []string `json:"extension_dependent_objects"` LatestAppVersion string `json:"latest_app_version"` LegacyAuthCustomRoles []string `json:"legacy_auth_custom_roles"` - PotentialBreakingChanges []string `json:"potential_breaking_changes"` + ObjectsToBeDropped []string `json:"objects_to_be_dropped"` TargetUpgradeVersions []struct { AppVersion string `json:"app_version"` PostgresVersion ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion `json:"postgres_version"` ReleaseChannel ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel `json:"release_channel"` } `json:"target_upgrade_versions"` + UnsupportedExtensions []string `json:"unsupported_extensions"` } // ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel defines model for ProjectUpgradeEligibilityResponse.CurrentAppVersionReleaseChannel. From 372ed92af1b1da0221e9b412a23d849e8344d470 Mon Sep 17 00:00:00 2001 From: "Idris M. Celik" Date: Wed, 25 Jun 2025 19:09:22 +0200 Subject: [PATCH 230/359] feat: add --prune option to remove orphaned functions after deploy (#3720) * Fix #3719 (Add --prune option to 'supabase functions deploy' to remove orphaned functions) * chore: address PR comments * chore: simplify unit tests * chore: update api spec --------- Co-authored-by: Qiao Han Co-authored-by: Han Qiao --- api/overlay.yaml | 3 + cmd/functions.go | 4 +- cmd/root.go | 1 + internal/functions/delete/delete.go | 26 +-- internal/functions/delete/delete_test.go | 4 +- internal/functions/deploy/deploy.go | 58 +++++- internal/functions/deploy/deploy_test.go | 104 ++++++++++- internal/utils/console.go | 5 + pkg/api/types.gen.go | 219 ++++++++++++++++++++++- 9 files changed, 396 insertions(+), 28 deletions(-) diff --git a/api/overlay.yaml b/api/overlay.yaml index 92b28afae..b455dcc79 100644 --- a/api/overlay.yaml +++ b/api/overlay.yaml @@ -26,3 +26,6 @@ actions: - target: $.components.schemas.*.properties.connectionString description: Removes deprecated field that conflicts with naming convention remove: true +- target: $.components.schemas.*.properties.private_jwk.discriminator + description: Replaces discriminated union with concrete type + remove: true diff --git a/cmd/functions.go b/cmd/functions.go index cc5ffa53d..6b5684bc2 100644 --- a/cmd/functions.go +++ b/cmd/functions.go @@ -58,6 +58,7 @@ var ( useLegacyBundle bool noVerifyJWT = new(bool) importMapPath string + prune bool functionsDeployCmd = &cobra.Command{ Use: "deploy [Function name]", @@ -73,7 +74,7 @@ var ( } else if maxJobs > 1 { return errors.New("--jobs must be used together with --use-api") } - return deploy.Run(cmd.Context(), args, useDocker, noVerifyJWT, importMapPath, maxJobs, afero.NewOsFs()) + return deploy.Run(cmd.Context(), args, useDocker, noVerifyJWT, importMapPath, maxJobs, prune, afero.NewOsFs()) }, } @@ -139,6 +140,7 @@ func init() { cobra.CheckErr(deployFlags.MarkHidden("legacy-bundle")) deployFlags.UintVarP(&maxJobs, "jobs", "j", 1, "Maximum number of parallel jobs.") deployFlags.BoolVar(noVerifyJWT, "no-verify-jwt", false, "Disable JWT verification for the Function.") + deployFlags.BoolVar(&prune, "prune", false, "Delete Functions that exist in Supabase project but not locally.") deployFlags.StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.") deployFlags.StringVar(&importMapPath, "import-map", "", "Path to import map file.") functionsServeCmd.Flags().BoolVar(noVerifyJWT, "no-verify-jwt", false, "Disable JWT verification for the Function.") diff --git a/cmd/root.go b/cmd/root.go index a2cc6f0a7..d053045e8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -232,6 +232,7 @@ func init() { }) flags := rootCmd.PersistentFlags() + flags.Bool("yes", false, "answer yes to all prompts") flags.Bool("debug", false, "output debug logs to stderr") flags.String("workdir", "", "path to a Supabase project directory") flags.Bool("experimental", false, "enable experimental features") diff --git a/internal/functions/delete/delete.go b/internal/functions/delete/delete.go index 47d5957ef..5e087e71e 100644 --- a/internal/functions/delete/delete.go +++ b/internal/functions/delete/delete.go @@ -11,27 +11,29 @@ import ( ) func Run(ctx context.Context, slug string, projectRef string, fsys afero.Fs) error { - // 1. Sanity checks. - { - if err := utils.ValidateFunctionSlug(slug); err != nil { - return err - } + if err := utils.ValidateFunctionSlug(slug); err != nil { + return err } + if err := Undeploy(ctx, projectRef, slug); err != nil { + return err + } + fmt.Printf("Deleted Function %s from project %s.\n", utils.Aqua(slug), utils.Aqua(projectRef)) + return nil +} - // 2. Delete Function. +var ErrNoDelete = errors.New("nothing to delete") + +func Undeploy(ctx context.Context, projectRef string, slug string) error { resp, err := utils.GetSupabase().V1DeleteAFunctionWithResponse(ctx, projectRef, slug) if err != nil { return errors.Errorf("failed to delete function: %w", err) } switch resp.StatusCode() { case http.StatusNotFound: - return errors.New("Function " + utils.Aqua(slug) + " does not exist on the Supabase project.") + return errors.Errorf("Function %s does not exist on the Supabase project: %w", slug, ErrNoDelete) case http.StatusOK: - break + return nil default: - return errors.New("Failed to delete Function " + utils.Aqua(slug) + " on the Supabase project: " + string(resp.Body)) + return errors.Errorf("unexpected delete function status %d: %s", resp.StatusCode(), string(resp.Body)) } - - fmt.Println("Deleted Function " + utils.Aqua(slug) + " from project " + utils.Aqua(projectRef) + ".") - return nil } diff --git a/internal/functions/delete/delete_test.go b/internal/functions/delete/delete_test.go index 110208ea9..79bd2bb5a 100644 --- a/internal/functions/delete/delete_test.go +++ b/internal/functions/delete/delete_test.go @@ -73,7 +73,7 @@ func TestDeleteCommand(t *testing.T) { // Run test err := Run(context.Background(), slug, project, fsys) // Check error - assert.ErrorContains(t, err, "Function test-func does not exist on the Supabase project.") + assert.ErrorIs(t, err, ErrNoDelete) assert.Empty(t, apitest.ListUnmatchedRequests()) }) @@ -88,7 +88,7 @@ func TestDeleteCommand(t *testing.T) { // Run test err := Run(context.Background(), slug, project, fsys) // Check error - assert.ErrorContains(t, err, "Failed to delete Function test-func on the Supabase project:") + assert.ErrorContains(t, err, "unexpected delete function status 503:") assert.Empty(t, apitest.ListUnmatchedRequests()) }) } diff --git a/internal/functions/deploy/deploy.go b/internal/functions/deploy/deploy.go index 470a54304..8c815e779 100644 --- a/internal/functions/deploy/deploy.go +++ b/internal/functions/deploy/deploy.go @@ -9,13 +9,15 @@ import ( "github.com/go-errors/errors" "github.com/spf13/afero" + "github.com/supabase/cli/internal/functions/delete" "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/config" "github.com/supabase/cli/pkg/function" ) -func Run(ctx context.Context, slugs []string, useDocker bool, noVerifyJWT *bool, importMapPath string, maxJobs uint, fsys afero.Fs) error { +func Run(ctx context.Context, slugs []string, useDocker bool, noVerifyJWT *bool, importMapPath string, maxJobs uint, prune bool, fsys afero.Fs) error { // Load function config and project id if err := flags.LoadConfig(fsys); err != nil { return err @@ -49,6 +51,7 @@ func Run(ctx context.Context, slugs []string, useDocker bool, noVerifyJWT *bool, if err != nil { return err } + // Deploy new and updated functions opt := function.WithMaxJobs(maxJobs) if useDocker { if utils.IsDockerRunning(ctx) { @@ -67,7 +70,10 @@ func Run(ctx context.Context, slugs []string, useDocker bool, noVerifyJWT *bool, fmt.Printf("Deployed Functions on project %s: %s\n", utils.Aqua(flags.ProjectRef), strings.Join(slugs, ", ")) url := fmt.Sprintf("%s/project/%v/functions", utils.GetSupabaseDashboardURL(), flags.ProjectRef) fmt.Println("You can inspect your deployment in the Dashboard: " + url) - return nil + if !prune { + return nil + } + return pruneFunctions(ctx, functionConfig) } func GetFunctionSlugs(fsys afero.Fs) (slugs []string, err error) { @@ -155,3 +161,51 @@ func GetFunctionConfig(slugs []string, importMapPath string, noVerifyJWT *bool, } return functionConfig, nil } + +// pruneFunctions deletes functions that exist remotely but not locally +func pruneFunctions(ctx context.Context, functionConfig config.FunctionConfig) error { + resp, err := utils.GetSupabase().V1ListAllFunctionsWithResponse(ctx, flags.ProjectRef) + if err != nil { + return errors.Errorf("failed to list functions: %w", err) + } else if resp.JSON200 == nil { + return errors.Errorf("unexpected list functions status %d: %s", resp.StatusCode(), string(resp.Body)) + } + // No need to delete disabled functions + var toDelete []string + for _, deployed := range *resp.JSON200 { + if deployed.Status == api.FunctionResponseStatusREMOVED { + continue + } else if _, exists := functionConfig[deployed.Slug]; exists { + continue + } + toDelete = append(toDelete, deployed.Slug) + } + if len(toDelete) == 0 { + fmt.Fprintln(os.Stderr, "No functions to prune.") + return nil + } + // Confirm before pruning functions + msg := fmt.Sprintln(confirmPruneAll(toDelete)) + if shouldDelete, err := utils.NewConsole().PromptYesNo(ctx, msg, false); err != nil { + return err + } else if !shouldDelete { + return errors.New(context.Canceled) + } + for _, slug := range toDelete { + fmt.Fprintln(os.Stderr, "Deleting Function:", slug) + if err := delete.Undeploy(ctx, flags.ProjectRef, slug); errors.Is(err, delete.ErrNoDelete) { + fmt.Fprintln(utils.GetDebugLogger(), err) + } else if err != nil { + return err + } + } + return nil +} + +func confirmPruneAll(pending []string) string { + msg := fmt.Sprintln("Do you want to delete the following functions?") + for _, slug := range pending { + msg += fmt.Sprintf(" • %s\n", utils.Bold(slug)) + } + return msg +} diff --git a/internal/functions/deploy/deploy_test.go b/internal/functions/deploy/deploy_test.go index 9f0fb79db..e746da927 100644 --- a/internal/functions/deploy/deploy_test.go +++ b/internal/functions/deploy/deploy_test.go @@ -11,6 +11,7 @@ import ( "github.com/h2non/gock" "github.com/spf13/afero" + "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/supabase/cli/internal/testing/apitest" @@ -74,7 +75,7 @@ func TestDeployCommand(t *testing.T) { } // Run test noVerifyJWT := true - err = Run(context.Background(), functions, true, &noVerifyJWT, "", 1, fsys) + err = Run(context.Background(), functions, true, &noVerifyJWT, "", 1, false, fsys) // Check error assert.NoError(t, err) assert.Empty(t, apitest.ListUnmatchedRequests()) @@ -129,7 +130,7 @@ import_map = "./import_map.json" outputDir := filepath.Join(utils.TempDir, fmt.Sprintf(".output_%s", slug)) require.NoError(t, afero.WriteFile(fsys, filepath.Join(outputDir, "output.eszip"), []byte(""), 0644)) // Run test - err = Run(context.Background(), nil, true, nil, "", 1, fsys) + err = Run(context.Background(), nil, true, nil, "", 1, false, fsys) // Check error assert.NoError(t, err) assert.Empty(t, apitest.ListUnmatchedRequests()) @@ -182,7 +183,7 @@ import_map = "./import_map.json" outputDir := filepath.Join(utils.TempDir, ".output_enabled-func") require.NoError(t, afero.WriteFile(fsys, filepath.Join(outputDir, "output.eszip"), []byte(""), 0644)) // Run test - err = Run(context.Background(), nil, true, nil, "", 1, fsys) + err = Run(context.Background(), nil, true, nil, "", 1, false, fsys) // Check error assert.NoError(t, err) assert.Empty(t, apitest.ListUnmatchedRequests()) @@ -193,7 +194,7 @@ import_map = "./import_map.json" fsys := afero.NewMemMapFs() require.NoError(t, utils.WriteConfig(fsys, false)) // Run test - err := Run(context.Background(), []string{"_invalid"}, true, nil, "", 1, fsys) + err := Run(context.Background(), []string{"_invalid"}, true, nil, "", 1, false, fsys) // Check error assert.ErrorContains(t, err, "Invalid Function name.") }) @@ -203,7 +204,7 @@ import_map = "./import_map.json" fsys := afero.NewMemMapFs() require.NoError(t, utils.WriteConfig(fsys, false)) // Run test - err := Run(context.Background(), nil, true, nil, "", 1, fsys) + err := Run(context.Background(), nil, true, nil, "", 1, false, fsys) // Check error assert.ErrorContains(t, err, "No Functions specified or found in supabase/functions") }) @@ -249,7 +250,7 @@ verify_jwt = false outputDir := filepath.Join(utils.TempDir, fmt.Sprintf(".output_%s", slug)) require.NoError(t, afero.WriteFile(fsys, filepath.Join(outputDir, "output.eszip"), []byte(""), 0644)) // Run test - assert.NoError(t, Run(context.Background(), []string{slug}, true, nil, "", 1, fsys)) + assert.NoError(t, Run(context.Background(), []string{slug}, true, nil, "", 1, false, fsys)) // Validate api assert.Empty(t, apitest.ListUnmatchedRequests()) }) @@ -295,8 +296,8 @@ verify_jwt = false outputDir := filepath.Join(utils.TempDir, fmt.Sprintf(".output_%s", slug)) require.NoError(t, afero.WriteFile(fsys, filepath.Join(outputDir, "output.eszip"), []byte(""), 0644)) // Run test - noVerifyJwt := false - assert.NoError(t, Run(context.Background(), []string{slug}, true, &noVerifyJwt, "", 1, fsys)) + noVerifyJWT := false + assert.NoError(t, Run(context.Background(), []string{slug}, true, &noVerifyJWT, "", 1, false, fsys)) // Validate api assert.Empty(t, apitest.ListUnmatchedRequests()) }) @@ -372,3 +373,90 @@ func TestImportMapPath(t *testing.T) { assert.Equal(t, path, fc["test"].ImportMap) }) } + +func TestPruneFunctions(t *testing.T) { + flags.ProjectRef = apitest.RandomProjectRef() + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + viper.Set("YES", true) + + t.Run("prunes functions not in local directory", func(t *testing.T) { + // Setup function entrypoints + localFunctions := config.FunctionConfig{ + "local-func-1": {Enabled: true}, + "local-func-2": {Enabled: true}, + } + // Setup mock api - remote functions include local ones plus orphaned ones + defer gock.OffAll() + remoteFunctions := []api.FunctionResponse{ + {Slug: "local-func-1"}, + {Slug: "local-func-2"}, + {Slug: "orphaned-func-1"}, + {Slug: "orphaned-func-2"}, + } + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + flags.ProjectRef + "/functions"). + Reply(http.StatusOK). + JSON(remoteFunctions) + gock.New(utils.DefaultApiHost). + Delete("/v1/projects/" + flags.ProjectRef + "/functions/orphaned-func-1"). + Reply(http.StatusOK) + gock.New(utils.DefaultApiHost). + Delete("/v1/projects/" + flags.ProjectRef + "/functions/orphaned-func-2"). + Reply(http.StatusOK) + // Run test with prune and force (to skip confirmation) + err := pruneFunctions(context.Background(), localFunctions) + // Check error + assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("skips pruning when no orphaned functions", func(t *testing.T) { + // Setup function entrypoints + localFunctions := config.FunctionConfig{ + "local-func-1": {}, + "local-func-2": {}, + } + // Setup mock api - remote functions match local ones exactly + defer gock.OffAll() + remoteFunctions := []api.FunctionResponse{ + {Slug: "local-func-1"}, + {Slug: "local-func-2"}, + {Slug: "orphaned-func-1", Status: api.FunctionResponseStatusREMOVED}, + {Slug: "orphaned-func-2", Status: api.FunctionResponseStatusREMOVED}, + } + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + flags.ProjectRef + "/functions"). + Reply(http.StatusOK). + JSON(remoteFunctions) + // Run test with prune and force + err := pruneFunctions(context.Background(), localFunctions) + // Check error + assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) + + t.Run("handles 404 on delete gracefully", func(t *testing.T) { + // Setup function entrypoints + localFunctions := config.FunctionConfig{"local-func": {}} + // Setup mock api + defer gock.OffAll() + remoteFunctions := []api.FunctionResponse{ + {Slug: "local-func"}, + {Slug: "orphaned-func"}, + } + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + flags.ProjectRef + "/functions"). + Reply(http.StatusOK). + JSON(remoteFunctions) + // Mock delete endpoint with 404 (function already deleted) + gock.New(utils.DefaultApiHost). + Delete("/v1/projects/" + flags.ProjectRef + "/functions/orphaned-func"). + Reply(http.StatusNotFound) + // Run test with prune and force + err := pruneFunctions(context.Background(), localFunctions) + // Check error + assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) + }) +} diff --git a/internal/utils/console.go b/internal/utils/console.go index 85bebdc1e..f80099aa3 100644 --- a/internal/utils/console.go +++ b/internal/utils/console.go @@ -10,6 +10,7 @@ import ( "time" "github.com/go-errors/errors" + "github.com/spf13/viper" "github.com/supabase/cli/pkg/cast" "golang.org/x/term" ) @@ -66,6 +67,10 @@ func (c *Console) PromptYesNo(ctx context.Context, label string, def bool) (bool choices = "y/N" } labelWithChoice := fmt.Sprintf("%s [%s] ", label, choices) + if viper.GetBool("YES") { + fmt.Fprintln(os.Stderr, labelWithChoice+"y") + return true, nil + } // Any error will be handled as default value input, err := c.PromptText(ctx, labelWithChoice) if len(input) > 0 { diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 726ccf532..1509530e3 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -211,6 +211,41 @@ const ( CreateSigningKeyBodyAlgorithmRS256 CreateSigningKeyBodyAlgorithm = "RS256" ) +// Defines values for CreateSigningKeyBodyPrivateJwk0E. +const ( + AQAB CreateSigningKeyBodyPrivateJwk0E = "AQAB" +) + +// Defines values for CreateSigningKeyBodyPrivateJwk0Kty. +const ( + RSA CreateSigningKeyBodyPrivateJwk0Kty = "RSA" +) + +// Defines values for CreateSigningKeyBodyPrivateJwk1Crv. +const ( + P256 CreateSigningKeyBodyPrivateJwk1Crv = "P-256" +) + +// Defines values for CreateSigningKeyBodyPrivateJwk1Kty. +const ( + EC CreateSigningKeyBodyPrivateJwk1Kty = "EC" +) + +// Defines values for CreateSigningKeyBodyPrivateJwk2Crv. +const ( + Ed25519 CreateSigningKeyBodyPrivateJwk2Crv = "Ed25519" +) + +// Defines values for CreateSigningKeyBodyPrivateJwk2Kty. +const ( + OKP CreateSigningKeyBodyPrivateJwk2Kty = "OKP" +) + +// Defines values for CreateSigningKeyBodyPrivateJwk3Kty. +const ( + Oct CreateSigningKeyBodyPrivateJwk3Kty = "oct" +) + // Defines values for CreateSigningKeyBodyStatus. const ( CreateSigningKeyBodyStatusInUse CreateSigningKeyBodyStatus = "in_use" @@ -1444,13 +1479,76 @@ type CreateSecretBody = []struct { // CreateSigningKeyBody defines model for CreateSigningKeyBody. type CreateSigningKeyBody struct { - Algorithm CreateSigningKeyBodyAlgorithm `json:"algorithm"` - Status *CreateSigningKeyBodyStatus `json:"status,omitempty"` + Algorithm CreateSigningKeyBodyAlgorithm `json:"algorithm"` + PrivateJwk *CreateSigningKeyBody_PrivateJwk `json:"private_jwk,omitempty"` + Status *CreateSigningKeyBodyStatus `json:"status,omitempty"` } // CreateSigningKeyBodyAlgorithm defines model for CreateSigningKeyBody.Algorithm. type CreateSigningKeyBodyAlgorithm string +// CreateSigningKeyBodyPrivateJwk0 defines model for . +type CreateSigningKeyBodyPrivateJwk0 struct { + D string `json:"d"` + Dp string `json:"dp"` + Dq string `json:"dq"` + E CreateSigningKeyBodyPrivateJwk0E `json:"e"` + Kty CreateSigningKeyBodyPrivateJwk0Kty `json:"kty"` + N string `json:"n"` + P string `json:"p"` + Q string `json:"q"` + Qi string `json:"qi"` +} + +// CreateSigningKeyBodyPrivateJwk0E defines model for CreateSigningKeyBody.PrivateJwk.0.E. +type CreateSigningKeyBodyPrivateJwk0E string + +// CreateSigningKeyBodyPrivateJwk0Kty defines model for CreateSigningKeyBody.PrivateJwk.0.Kty. +type CreateSigningKeyBodyPrivateJwk0Kty string + +// CreateSigningKeyBodyPrivateJwk1 defines model for . +type CreateSigningKeyBodyPrivateJwk1 struct { + Crv CreateSigningKeyBodyPrivateJwk1Crv `json:"crv"` + D string `json:"d"` + Kty CreateSigningKeyBodyPrivateJwk1Kty `json:"kty"` + X string `json:"x"` + Y string `json:"y"` +} + +// CreateSigningKeyBodyPrivateJwk1Crv defines model for CreateSigningKeyBody.PrivateJwk.1.Crv. +type CreateSigningKeyBodyPrivateJwk1Crv string + +// CreateSigningKeyBodyPrivateJwk1Kty defines model for CreateSigningKeyBody.PrivateJwk.1.Kty. +type CreateSigningKeyBodyPrivateJwk1Kty string + +// CreateSigningKeyBodyPrivateJwk2 defines model for . +type CreateSigningKeyBodyPrivateJwk2 struct { + Crv CreateSigningKeyBodyPrivateJwk2Crv `json:"crv"` + D string `json:"d"` + Kty CreateSigningKeyBodyPrivateJwk2Kty `json:"kty"` + X string `json:"x"` +} + +// CreateSigningKeyBodyPrivateJwk2Crv defines model for CreateSigningKeyBody.PrivateJwk.2.Crv. +type CreateSigningKeyBodyPrivateJwk2Crv string + +// CreateSigningKeyBodyPrivateJwk2Kty defines model for CreateSigningKeyBody.PrivateJwk.2.Kty. +type CreateSigningKeyBodyPrivateJwk2Kty string + +// CreateSigningKeyBodyPrivateJwk3 defines model for . +type CreateSigningKeyBodyPrivateJwk3 struct { + K string `json:"k"` + Kty CreateSigningKeyBodyPrivateJwk3Kty `json:"kty"` +} + +// CreateSigningKeyBodyPrivateJwk3Kty defines model for CreateSigningKeyBody.PrivateJwk.3.Kty. +type CreateSigningKeyBodyPrivateJwk3Kty string + +// CreateSigningKeyBody_PrivateJwk defines model for CreateSigningKeyBody.PrivateJwk. +type CreateSigningKeyBody_PrivateJwk struct { + union json.RawMessage +} + // CreateSigningKeyBodyStatus defines model for CreateSigningKeyBody.Status. type CreateSigningKeyBodyStatus string @@ -1962,7 +2060,8 @@ type ProjectUpgradeEligibilityResponse struct { PostgresVersion ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion `json:"postgres_version"` ReleaseChannel ProjectUpgradeEligibilityResponseTargetUpgradeVersionsReleaseChannel `json:"release_channel"` } `json:"target_upgrade_versions"` - UnsupportedExtensions []string `json:"unsupported_extensions"` + UnsupportedExtensions []string `json:"unsupported_extensions"` + UserDefinedObjectsInInternalSchemas []string `json:"user_defined_objects_in_internal_schemas"` } // ProjectUpgradeEligibilityResponseCurrentAppVersionReleaseChannel defines model for ProjectUpgradeEligibilityResponse.CurrentAppVersionReleaseChannel. @@ -3552,6 +3651,120 @@ func (t *ApplyProjectAddonBody_AddonVariant) UnmarshalJSON(b []byte) error { return err } +// AsCreateSigningKeyBodyPrivateJwk0 returns the union data inside the CreateSigningKeyBody_PrivateJwk as a CreateSigningKeyBodyPrivateJwk0 +func (t CreateSigningKeyBody_PrivateJwk) AsCreateSigningKeyBodyPrivateJwk0() (CreateSigningKeyBodyPrivateJwk0, error) { + var body CreateSigningKeyBodyPrivateJwk0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromCreateSigningKeyBodyPrivateJwk0 overwrites any union data inside the CreateSigningKeyBody_PrivateJwk as the provided CreateSigningKeyBodyPrivateJwk0 +func (t *CreateSigningKeyBody_PrivateJwk) FromCreateSigningKeyBodyPrivateJwk0(v CreateSigningKeyBodyPrivateJwk0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeCreateSigningKeyBodyPrivateJwk0 performs a merge with any union data inside the CreateSigningKeyBody_PrivateJwk, using the provided CreateSigningKeyBodyPrivateJwk0 +func (t *CreateSigningKeyBody_PrivateJwk) MergeCreateSigningKeyBodyPrivateJwk0(v CreateSigningKeyBodyPrivateJwk0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsCreateSigningKeyBodyPrivateJwk1 returns the union data inside the CreateSigningKeyBody_PrivateJwk as a CreateSigningKeyBodyPrivateJwk1 +func (t CreateSigningKeyBody_PrivateJwk) AsCreateSigningKeyBodyPrivateJwk1() (CreateSigningKeyBodyPrivateJwk1, error) { + var body CreateSigningKeyBodyPrivateJwk1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromCreateSigningKeyBodyPrivateJwk1 overwrites any union data inside the CreateSigningKeyBody_PrivateJwk as the provided CreateSigningKeyBodyPrivateJwk1 +func (t *CreateSigningKeyBody_PrivateJwk) FromCreateSigningKeyBodyPrivateJwk1(v CreateSigningKeyBodyPrivateJwk1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeCreateSigningKeyBodyPrivateJwk1 performs a merge with any union data inside the CreateSigningKeyBody_PrivateJwk, using the provided CreateSigningKeyBodyPrivateJwk1 +func (t *CreateSigningKeyBody_PrivateJwk) MergeCreateSigningKeyBodyPrivateJwk1(v CreateSigningKeyBodyPrivateJwk1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsCreateSigningKeyBodyPrivateJwk2 returns the union data inside the CreateSigningKeyBody_PrivateJwk as a CreateSigningKeyBodyPrivateJwk2 +func (t CreateSigningKeyBody_PrivateJwk) AsCreateSigningKeyBodyPrivateJwk2() (CreateSigningKeyBodyPrivateJwk2, error) { + var body CreateSigningKeyBodyPrivateJwk2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromCreateSigningKeyBodyPrivateJwk2 overwrites any union data inside the CreateSigningKeyBody_PrivateJwk as the provided CreateSigningKeyBodyPrivateJwk2 +func (t *CreateSigningKeyBody_PrivateJwk) FromCreateSigningKeyBodyPrivateJwk2(v CreateSigningKeyBodyPrivateJwk2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeCreateSigningKeyBodyPrivateJwk2 performs a merge with any union data inside the CreateSigningKeyBody_PrivateJwk, using the provided CreateSigningKeyBodyPrivateJwk2 +func (t *CreateSigningKeyBody_PrivateJwk) MergeCreateSigningKeyBodyPrivateJwk2(v CreateSigningKeyBodyPrivateJwk2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsCreateSigningKeyBodyPrivateJwk3 returns the union data inside the CreateSigningKeyBody_PrivateJwk as a CreateSigningKeyBodyPrivateJwk3 +func (t CreateSigningKeyBody_PrivateJwk) AsCreateSigningKeyBodyPrivateJwk3() (CreateSigningKeyBodyPrivateJwk3, error) { + var body CreateSigningKeyBodyPrivateJwk3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromCreateSigningKeyBodyPrivateJwk3 overwrites any union data inside the CreateSigningKeyBody_PrivateJwk as the provided CreateSigningKeyBodyPrivateJwk3 +func (t *CreateSigningKeyBody_PrivateJwk) FromCreateSigningKeyBodyPrivateJwk3(v CreateSigningKeyBodyPrivateJwk3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeCreateSigningKeyBodyPrivateJwk3 performs a merge with any union data inside the CreateSigningKeyBody_PrivateJwk, using the provided CreateSigningKeyBodyPrivateJwk3 +func (t *CreateSigningKeyBody_PrivateJwk) MergeCreateSigningKeyBodyPrivateJwk3(v CreateSigningKeyBodyPrivateJwk3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t CreateSigningKeyBody_PrivateJwk) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *CreateSigningKeyBody_PrivateJwk) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + // AsListProjectAddonsResponseAvailableAddonsVariantsId0 returns the union data inside the ListProjectAddonsResponse_AvailableAddons_Variants_Id as a ListProjectAddonsResponseAvailableAddonsVariantsId0 func (t ListProjectAddonsResponse_AvailableAddons_Variants_Id) AsListProjectAddonsResponseAvailableAddonsVariantsId0() (ListProjectAddonsResponseAvailableAddonsVariantsId0, error) { var body ListProjectAddonsResponseAvailableAddonsVariantsId0 From 0a95b8cffbe10e63e13682d46a1940c507204a5d Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Thu, 26 Jun 2025 04:59:32 +0200 Subject: [PATCH 231/359] chore: sync API types from infrastructure (#3769) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/client.gen.go | 32 ++++++++++++++++++++++++++++++++ pkg/api/types.gen.go | 6 ++++++ 2 files changed, 38 insertions(+) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index b1180c329..8903bf4b8 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -6538,6 +6538,22 @@ func NewV1CreateAFunctionRequestWithBody(server string, ref string, params *V1Cr } + if params.EzbrSha256 != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ezbr_sha256", runtime.ParamLocationQuery, *params.EzbrSha256); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } @@ -6897,6 +6913,22 @@ func NewV1UpdateAFunctionRequestWithBody(server string, ref string, functionSlug } + if params.EzbrSha256 != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ezbr_sha256", runtime.ParamLocationQuery, *params.EzbrSha256); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 1509530e3..cd96838f1 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1337,6 +1337,7 @@ type BranchUpdateResponseMessage string type BulkUpdateFunctionBody = []struct { CreatedAt *int64 `json:"created_at,omitempty"` EntrypointPath *string `json:"entrypoint_path,omitempty"` + EzbrSha256 *string `json:"ezbr_sha256,omitempty"` Id string `json:"id"` ImportMap *bool `json:"import_map,omitempty"` ImportMapPath *string `json:"import_map_path,omitempty"` @@ -1355,6 +1356,7 @@ type BulkUpdateFunctionResponse struct { Functions []struct { CreatedAt int64 `json:"created_at"` EntrypointPath *string `json:"entrypoint_path,omitempty"` + EzbrSha256 *string `json:"ezbr_sha256,omitempty"` Id string `json:"id"` ImportMap *bool `json:"import_map,omitempty"` ImportMapPath *string `json:"import_map_path,omitempty"` @@ -1638,6 +1640,7 @@ type FunctionDeployBody struct { type FunctionResponse struct { CreatedAt int64 `json:"created_at"` EntrypointPath *string `json:"entrypoint_path,omitempty"` + EzbrSha256 *string `json:"ezbr_sha256,omitempty"` Id string `json:"id"` ImportMap *bool `json:"import_map,omitempty"` ImportMapPath *string `json:"import_map_path,omitempty"` @@ -1656,6 +1659,7 @@ type FunctionResponseStatus string type FunctionSlugResponse struct { CreatedAt int64 `json:"created_at"` EntrypointPath *string `json:"entrypoint_path,omitempty"` + EzbrSha256 *string `json:"ezbr_sha256,omitempty"` Id string `json:"id"` ImportMap *bool `json:"import_map,omitempty"` ImportMapPath *string `json:"import_map_path,omitempty"` @@ -3136,6 +3140,7 @@ type V1CreateAFunctionParams struct { ImportMap *bool `form:"import_map,omitempty" json:"import_map,omitempty"` EntrypointPath *string `form:"entrypoint_path,omitempty" json:"entrypoint_path,omitempty"` ImportMapPath *string `form:"import_map_path,omitempty" json:"import_map_path,omitempty"` + EzbrSha256 *string `form:"ezbr_sha256,omitempty" json:"ezbr_sha256,omitempty"` } // V1DeployAFunctionParams defines parameters for V1DeployAFunction. @@ -3158,6 +3163,7 @@ type V1UpdateAFunctionParams struct { ImportMap *bool `form:"import_map,omitempty" json:"import_map,omitempty"` EntrypointPath *string `form:"entrypoint_path,omitempty" json:"entrypoint_path,omitempty"` ImportMapPath *string `form:"import_map_path,omitempty" json:"import_map_path,omitempty"` + EzbrSha256 *string `form:"ezbr_sha256,omitempty" json:"ezbr_sha256,omitempty"` } // V1GetServicesHealthParams defines parameters for V1GetServicesHealth. From 25425659fd11c1c22de4943e65aff6e75473add3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 04:33:23 +0000 Subject: [PATCH 232/359] chore(deps): bump supabase/postgres from 17.4.1.45 to 17.4.1.47 in /pkg/config/templates (#3772) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.45 to 17.4.1.47. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.47 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 7aafa12ee..1e1e85801 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.45 AS pg +FROM supabase/postgres:17.4.1.47 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From f5bc1f8cdce6adb80d7664461711c998ba016bcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 04:38:23 +0000 Subject: [PATCH 233/359] chore(deps): bump supabase/realtime from v2.37.7 to v2.37.9 in /pkg/config/templates (#3770) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.37.7 to v2.37.9. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.37.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 1e1e85801..afc9627e9 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.5 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.37.7 AS realtime +FROM supabase/realtime:v2.37.9 AS realtime FROM supabase/storage-api:v1.24.6 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From d8b76b1fce018fa38ecba34170d90eb17e69462d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 04:43:46 +0000 Subject: [PATCH 234/359] chore(deps): bump supabase/storage-api from v1.24.6 to v1.24.7 in /pkg/config/templates (#3771) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.24.6 to v1.24.7. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.24.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index afc9627e9..b7d491095 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.5 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.37.9 AS realtime -FROM supabase/storage-api:v1.24.6 AS storage +FROM supabase/storage-api:v1.24.7 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 3c15def1074abe0d2dc8e0e4e2f311df5a125ae1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 13:17:25 +0800 Subject: [PATCH 235/359] chore(deps): bump github.com/getsentry/sentry-go from 0.33.0 to 0.34.0 (#3755) Bumps [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) from 0.33.0 to 0.34.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.33.0...v0.34.0) --- updated-dependencies: - dependency-name: github.com/getsentry/sentry-go dependency-version: 0.34.0 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 a0decb5fc..0c10bf67b 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 - github.com/getsentry/sentry-go v0.33.0 + github.com/getsentry/sentry-go v0.34.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 diff --git a/go.sum b/go.sum index ac806a52b..e67fccde4 100644 --- a/go.sum +++ b/go.sum @@ -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.33.0 h1:YWyDii0KGVov3xOaamOnF0mjOrqSjBqwv48UEzn7QFg= -github.com/getsentry/sentry-go v0.33.0/go.mod h1:C55omcY9ChRQIUcVcGcs+Zdy4ZpQGvNJ7JYHIoSWOtE= +github.com/getsentry/sentry-go v0.34.0 h1:1FCHBVp8TfSc8L10zqSwXUZNiOSF+10qw4czjarTiY4= +github.com/getsentry/sentry-go v0.34.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= From 7f98a219f3fc3110ba535f1536acdf66f45bd00e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 05:23:45 +0000 Subject: [PATCH 236/359] chore(deps): bump github.com/docker/docker from 28.2.2+incompatible to 28.3.0+incompatible (#3762) chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.2.2+incompatible to 28.3.0+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v28.2.2...v28.3.0) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-version: 28.3.0+incompatible 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 0c10bf67b..fd50f54a3 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.63.1 github.com/docker/cli v28.3.0+incompatible - github.com/docker/docker v28.2.2+incompatible + github.com/docker/docker v28.3.0+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 github.com/getsentry/sentry-go v0.34.0 diff --git a/go.sum b/go.sum index e67fccde4..05091cd49 100644 --- a/go.sum +++ b/go.sum @@ -242,8 +242,8 @@ github.com/docker/cli v28.3.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 v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw= -github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.3.0+incompatible h1:ffS62aKWupCWdvcee7nBU9fhnmknOqDPaJAMtfK0ImQ= +github.com/docker/docker v28.3.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= From 348d018c1d27ac57e052ecbe3e5a3e6bfddcbabd Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 26 Jun 2025 14:19:52 +0800 Subject: [PATCH 237/359] fix: skip unchanged functions when deploying (#3768) * fix: skip unchanged functions when deploying * chore: rename checksum for clarity --- internal/functions/deploy/deploy.go | 4 ++-- pkg/function/api.go | 1 + pkg/function/batch.go | 22 ++++++++++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/internal/functions/deploy/deploy.go b/internal/functions/deploy/deploy.go index 8c815e779..bcee53c55 100644 --- a/internal/functions/deploy/deploy.go +++ b/internal/functions/deploy/deploy.go @@ -181,7 +181,7 @@ func pruneFunctions(ctx context.Context, functionConfig config.FunctionConfig) e toDelete = append(toDelete, deployed.Slug) } if len(toDelete) == 0 { - fmt.Fprintln(os.Stderr, "No functions to prune.") + fmt.Fprintln(os.Stderr, "No Functions to prune.") return nil } // Confirm before pruning functions @@ -203,7 +203,7 @@ func pruneFunctions(ctx context.Context, functionConfig config.FunctionConfig) e } func confirmPruneAll(pending []string) string { - msg := fmt.Sprintln("Do you want to delete the following functions?") + msg := fmt.Sprintln("Do you want to delete the following Functions from your project?") for _, slug := range pending { msg += fmt.Sprintf(" • %s\n", utils.Bold(slug)) } diff --git a/pkg/function/api.go b/pkg/function/api.go index 9b3aa50e7..df4443240 100644 --- a/pkg/function/api.go +++ b/pkg/function/api.go @@ -20,6 +20,7 @@ type FunctionDeployMetadata struct { Name *string `json:"name,omitempty"` StaticPatterns *[]string `json:"static_patterns,omitempty"` VerifyJwt *bool `json:"verify_jwt,omitempty"` + SHA256 string `json:"sha256,omitempty"` } type EszipBundler interface { diff --git a/pkg/function/batch.go b/pkg/function/batch.go index 19aa4818a..69754f978 100644 --- a/pkg/function/batch.go +++ b/pkg/function/batch.go @@ -3,6 +3,8 @@ package function import ( "bytes" "context" + "crypto/sha256" + "encoding/hex" "fmt" "io" "net/http" @@ -14,6 +16,7 @@ import ( "github.com/docker/go-units" "github.com/go-errors/errors" "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/config" ) @@ -41,9 +44,9 @@ func (s *EdgeRuntimeAPI) UpsertFunctions(ctx context.Context, functionConfig con return err } policy.Reset() - exists := make(map[string]struct{}, len(result)) + checksum := make(map[string]string, len(result)) for _, f := range result { - exists[f.Slug] = struct{}{} + checksum[f.Slug] = cast.Val(f.EzbrSha256, "") } var toUpdate api.BulkUpdateFunctionBody OUTER: @@ -63,9 +66,16 @@ OUTER: return err } meta.VerifyJwt = &function.VerifyJWT + bodyHash := sha256.Sum256(body.Bytes()) + meta.SHA256 = hex.EncodeToString(bodyHash[:]) + // Skip if function has not changed + if checksum[slug] == meta.SHA256 { + fmt.Fprintln(os.Stderr, "No change found in Function:", slug) + continue + } // Update if function already exists upsert := func() (api.BulkUpdateFunctionBody, error) { - if _, ok := exists[slug]; ok { + if _, ok := checksum[slug]; ok { return s.updateFunction(ctx, slug, meta, bytes.NewReader(body.Bytes())) } return s.createFunction(ctx, slug, meta, bytes.NewReader(body.Bytes())) @@ -74,7 +84,7 @@ OUTER: fmt.Fprintf(os.Stderr, "Deploying Function: %s (script size: %s)\n", slug, functionSize) result, err := backoff.RetryNotifyWithData(upsert, policy, func(err error, d time.Duration) { if strings.Contains(err.Error(), "Duplicated function slug") { - exists[slug] = struct{}{} + checksum[slug] = "" } }) if err != nil { @@ -103,6 +113,7 @@ func (s *EdgeRuntimeAPI) updateFunction(ctx context.Context, slug string, meta F VerifyJwt: meta.VerifyJwt, ImportMapPath: meta.ImportMapPath, EntrypointPath: &meta.EntrypointPath, + EzbrSha256: &meta.SHA256, }, eszipContentType, body) if err != nil { return api.BulkUpdateFunctionBody{}, errors.Errorf("failed to update function: %w", err) @@ -120,6 +131,7 @@ func (s *EdgeRuntimeAPI) updateFunction(ctx context.Context, slug string, meta F VerifyJwt: resp.JSON200.VerifyJwt, Status: api.BulkUpdateFunctionBodyStatus(resp.JSON200.Status), CreatedAt: &resp.JSON200.CreatedAt, + EzbrSha256: resp.JSON200.EzbrSha256, }}, nil } @@ -130,6 +142,7 @@ func (s *EdgeRuntimeAPI) createFunction(ctx context.Context, slug string, meta F VerifyJwt: meta.VerifyJwt, ImportMapPath: meta.ImportMapPath, EntrypointPath: &meta.EntrypointPath, + EzbrSha256: &meta.SHA256, }, eszipContentType, body) if err != nil { return api.BulkUpdateFunctionBody{}, errors.Errorf("failed to create function: %w", err) @@ -147,5 +160,6 @@ func (s *EdgeRuntimeAPI) createFunction(ctx context.Context, slug string, meta F VerifyJwt: resp.JSON201.VerifyJwt, Status: api.BulkUpdateFunctionBodyStatus(resp.JSON201.Status), CreatedAt: &resp.JSON201.CreatedAt, + EzbrSha256: resp.JSON201.EzbrSha256, }}, nil } From 2e8672d925496be4a438bc086ed2ab990a603349 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 26 Jun 2025 23:13:18 +0800 Subject: [PATCH 238/359] fix: include scopes from deno.json (#3773) --- internal/utils/deno.go | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/internal/utils/deno.go b/internal/utils/deno.go index 5bece3a5a..86d12da0d 100644 --- a/internal/utils/deno.go +++ b/internal/utils/deno.go @@ -225,12 +225,7 @@ func BindHostModules(cwd, relEntrypointPath, relImportMapPath string, fsys afero } // Resolving all Import Graph addModule := func(unixPath string, w io.Writer) error { - hostPath := filepath.FromSlash(unixPath) - if path.IsAbs(unixPath) { - hostPath = filepath.VolumeName(cwd) + hostPath - } else { - hostPath = filepath.Join(cwd, hostPath) - } + hostPath := toHostPath(cwd, unixPath) f, err := fsys.Open(hostPath) if err != nil { return errors.Errorf("failed to read file: %w", err) @@ -247,10 +242,29 @@ func BindHostModules(cwd, relEntrypointPath, relImportMapPath string, fsys afero if err := importMap.WalkImportPaths(unixPath, addModule); err != nil { return nil, err } - // TODO: support scopes + // Also mount local directories declared in scopes + for _, scope := range importMap.Scopes { + for _, unixPath := range scope { + hostPath := toHostPath(cwd, unixPath) + // Ref: https://docs.deno.com/runtime/fundamentals/modules/#overriding-https-imports + if _, err := fsys.Stat(hostPath); err != nil { + return nil, errors.Errorf("failed to resolve scope: %w", err) + } + dockerPath := ToDockerPath(hostPath) + modules = append(modules, hostPath+":"+dockerPath+":ro") + } + } return modules, nil } +func toHostPath(cwd, unixPath string) string { + hostPath := filepath.FromSlash(unixPath) + if path.IsAbs(unixPath) { + return filepath.VolumeName(cwd) + hostPath + } + return filepath.Join(cwd, hostPath) +} + func ToDockerPath(absHostPath string) string { prefix := filepath.VolumeName(absHostPath) dockerPath := filepath.ToSlash(absHostPath) From 9317de3310c8ff6d3649058fd0eb9a20ae28b449 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 12:49:50 +0800 Subject: [PATCH 239/359] chore(deps): bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 (#3779) chore(deps): bump github.com/go-viper/mapstructure/v2 Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/go-viper/mapstructure/releases) - [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md) - [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.3.0) --- updated-dependencies: - dependency-name: github.com/go-viper/mapstructure/v2 dependency-version: 2.3.0 dependency-type: indirect ... 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 fd50f54a3..b1082363f 100644 --- a/go.mod +++ b/go.mod @@ -145,7 +145,7 @@ require ( github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect github.com/go-toolsmith/typep v1.1.0 // indirect - github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/go-viper/mapstructure/v2 v2.3.0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.12.1 // indirect diff --git a/go.sum b/go.sum index 05091cd49..189341d3d 100644 --- a/go.sum +++ b/go.sum @@ -361,8 +361,8 @@ github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQi github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= -github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= -github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= +github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUWY= github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= From bd308753ca5d382e9523541924bc979dbca079f1 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Mon, 30 Jun 2025 06:54:18 +0200 Subject: [PATCH 240/359] fix: handle nullable api key (#3774) * chore: sync API types from infrastructure * chore: handle nullable api key --------- Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> Co-authored-by: Qiao Han --- go.mod | 2 +- internal/bootstrap/bootstrap.go | 12 +++------ internal/bootstrap/bootstrap_test.go | 5 ++-- internal/link/link_test.go | 7 ++--- internal/projects/apiKeys/api_keys.go | 14 ++++++++-- internal/projects/apiKeys/api_keys_test.go | 6 ++++- internal/storage/cp/cp_test.go | 30 ++++++++-------------- internal/storage/ls/ls_test.go | 15 +++++------ internal/storage/mv/mv_test.go | 15 +++++------ internal/storage/rm/rm_test.go | 20 ++++++--------- internal/utils/tenant/client.go | 12 ++++++--- internal/utils/tenant/client_test.go | 15 ++++++----- pkg/api/types.gen.go | 2 +- 13 files changed, 78 insertions(+), 77 deletions(-) diff --git a/go.mod b/go.mod index b1082363f..f1b587cc3 100644 --- a/go.mod +++ b/go.mod @@ -32,6 +32,7 @@ require ( github.com/joho/godotenv v1.5.1 github.com/mithrandie/csvq-driver v1.7.0 github.com/muesli/reflow v0.3.0 + github.com/oapi-codegen/nullable v1.1.0 github.com/slack-go/slack v0.17.1 github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 @@ -240,7 +241,6 @@ require ( github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.19.1 // indirect - github.com/oapi-codegen/nullable v1.1.0 // indirect github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 // indirect github.com/oapi-codegen/runtime v1.1.1 // indirect github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index 9615256ca..ac04146fe 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -215,17 +215,11 @@ const ( func writeDotEnv(keys []api.ApiKeyResponse, config pgconn.Config, fsys afero.Fs) error { // Initialise default envs + initial := apiKeys.ToEnv(keys) + initial[SUPABASE_URL] = "https://" + utils.GetSupabaseHost(flags.ProjectRef) transactionMode := *config.Copy() transactionMode.Port = 6543 - initial := map[string]string{ - SUPABASE_URL: "https://" + utils.GetSupabaseHost(flags.ProjectRef), - POSTGRES_URL: utils.ToPostgresURL(transactionMode), - } - for _, entry := range keys { - name := strings.ToUpper(entry.Name) - key := fmt.Sprintf("SUPABASE_%s_KEY", name) - initial[key] = entry.ApiKey - } + initial[POSTGRES_URL] = utils.ToPostgresURL(transactionMode) // Populate from .env.example if exists envs, err := parseExampleEnv(fsys) if err != nil { diff --git a/internal/bootstrap/bootstrap_test.go b/internal/bootstrap/bootstrap_test.go index 6cf6eb6e4..ab12d1268 100644 --- a/internal/bootstrap/bootstrap_test.go +++ b/internal/bootstrap/bootstrap_test.go @@ -7,6 +7,7 @@ import ( "github.com/jackc/pgconn" "github.com/joho/godotenv" + "github.com/oapi-codegen/nullable" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -46,11 +47,11 @@ func TestSuggestAppStart(t *testing.T) { func TestWriteEnv(t *testing.T) { var apiKeys = []api.ApiKeyResponse{{ - ApiKey: "anonkey", Name: "anon", + ApiKey: nullable.NewNullableWithValue("anonkey"), }, { - ApiKey: "servicekey", Name: "service_role", + ApiKey: nullable.NewNullableWithValue("servicekey"), }} var dbConfig = pgconn.Config{ diff --git a/internal/link/link_test.go b/internal/link/link_test.go index 376886ff3..8e47d8cc2 100644 --- a/internal/link/link_test.go +++ b/internal/link/link_test.go @@ -10,6 +10,7 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgerrcode" "github.com/jackc/pgx/v4" + "github.com/oapi-codegen/nullable" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/supabase/cli/internal/testing/apitest" @@ -65,7 +66,7 @@ func TestLinkCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/api-keys"). Reply(200). - JSON([]api.ApiKeyResponse{{Name: "anon", ApiKey: "anon-key"}}) + JSON([]api.ApiKeyResponse{{Name: "anon", ApiKey: nullable.NewNullableWithValue("anon-key")}}) // Link configs gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/config/database/postgres"). @@ -134,7 +135,7 @@ func TestLinkCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/api-keys"). Reply(200). - JSON([]api.ApiKeyResponse{{Name: "anon", ApiKey: "anon-key"}}) + JSON([]api.ApiKeyResponse{{Name: "anon", ApiKey: nullable.NewNullableWithValue("anon-key")}}) // Link configs gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/config/database/postgres"). @@ -184,7 +185,7 @@ func TestLinkCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/api-keys"). Reply(200). - JSON([]api.ApiKeyResponse{{Name: "anon", ApiKey: "anon-key"}}) + JSON([]api.ApiKeyResponse{{Name: "anon", ApiKey: nullable.NewNullableWithValue("anon-key")}}) // Link configs gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/config/database/postgres"). diff --git a/internal/projects/apiKeys/api_keys.go b/internal/projects/apiKeys/api_keys.go index 5d5af351c..32a6d1cf0 100644 --- a/internal/projects/apiKeys/api_keys.go +++ b/internal/projects/apiKeys/api_keys.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/go-errors/errors" + "github.com/oapi-codegen/nullable" "github.com/spf13/afero" "github.com/supabase/cli/internal/migration/list" "github.com/supabase/cli/internal/utils" @@ -25,7 +26,9 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { |-|-| ` for _, entry := range keys { - table += fmt.Sprintf("|`%s`|`%s`|\n", strings.ReplaceAll(entry.Name, "|", "\\|"), entry.ApiKey) + k := strings.ReplaceAll(entry.Name, "|", "\\|") + v := toValue(entry.ApiKey) + table += fmt.Sprintf("|`%s`|`%s`|\n", k, v) } return list.RenderTable(table) @@ -51,7 +54,14 @@ func ToEnv(keys []api.ApiKeyResponse) map[string]string { for _, entry := range keys { name := strings.ToUpper(entry.Name) key := fmt.Sprintf("SUPABASE_%s_KEY", name) - envs[key] = entry.ApiKey + envs[key] = toValue(entry.ApiKey) } return envs } + +func toValue(v nullable.Nullable[string]) string { + if value, err := v.Get(); err == nil { + return value + } + return "******" +} diff --git a/internal/projects/apiKeys/api_keys_test.go b/internal/projects/apiKeys/api_keys_test.go index 48730a0a7..82030c003 100644 --- a/internal/projects/apiKeys/api_keys_test.go +++ b/internal/projects/apiKeys/api_keys_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/h2non/gock" + "github.com/oapi-codegen/nullable" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/supabase/cli/internal/testing/apitest" @@ -31,7 +32,10 @@ func TestProjectApiKeysCommand(t *testing.T) { Reply(200). JSON([]api.ApiKeyResponse{{ Name: "Test ApiKey", - ApiKey: "dummy-api-key-value", + ApiKey: nullable.NewNullableWithValue("dummy-api-key-value"), + }, { + Name: "Test NullKey", + ApiKey: nullable.NewNullNullable[string](), }}) // Run test err := Run(context.Background(), project, fsys) diff --git a/internal/storage/cp/cp_test.go b/internal/storage/cp/cp_test.go index 75a0cf3cd..9223c88d3 100644 --- a/internal/storage/cp/cp_test.go +++ b/internal/storage/cp/cp_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/h2non/gock" + "github.com/oapi-codegen/nullable" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -45,6 +46,10 @@ func TestStorageCP(t *testing.T) { // Setup valid access token token := apitest.RandomAccessToken(t) t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + apiKeys := []api.ApiKeyResponse{{ + Name: "service_role", + ApiKey: nullable.NewNullableWithValue("service-key"), + }} t.Run("copy local to remote", func(t *testing.T) { // Setup in-memory fs @@ -55,10 +60,7 @@ func TestStorageCP(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Post("/storage/v1/object/private/file"). Reply(http.StatusOK) @@ -77,10 +79,7 @@ func TestStorageCP(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Get("/storage/v1/bucket"). Reply(http.StatusOK). @@ -100,10 +99,7 @@ func TestStorageCP(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Get("/storage/v1/object/private/file"). Reply(http.StatusOK) @@ -125,10 +121,7 @@ func TestStorageCP(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Get("/storage/v1/bucket"). Reply(http.StatusOK). @@ -166,10 +159,7 @@ func TestStorageCP(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) // Run test err := Run(context.Background(), ".", ".", false, 1, fsys) // Check error diff --git a/internal/storage/ls/ls_test.go b/internal/storage/ls/ls_test.go index e0e2cd207..27c388f5f 100644 --- a/internal/storage/ls/ls_test.go +++ b/internal/storage/ls/ls_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/h2non/gock" + "github.com/oapi-codegen/nullable" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/supabase/cli/internal/storage/client" @@ -45,6 +46,10 @@ func TestStorageLS(t *testing.T) { // Setup valid access token token := apitest.RandomAccessToken(t) t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + apiKeys := []api.ApiKeyResponse{{ + Name: "service_role", + ApiKey: nullable.NewNullableWithValue("service-key"), + }} t.Run("lists buckets", func(t *testing.T) { // Setup in-memory fs @@ -54,10 +59,7 @@ func TestStorageLS(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Get("/storage/v1/bucket"). Reply(http.StatusOK). @@ -85,10 +87,7 @@ func TestStorageLS(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Get("/storage/v1/bucket"). Reply(http.StatusOK). diff --git a/internal/storage/mv/mv_test.go b/internal/storage/mv/mv_test.go index fd8ecfbcc..b22ed4d15 100644 --- a/internal/storage/mv/mv_test.go +++ b/internal/storage/mv/mv_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/h2non/gock" + "github.com/oapi-codegen/nullable" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/supabase/cli/internal/testing/apitest" @@ -43,6 +44,10 @@ func TestStorageMV(t *testing.T) { // Setup valid access token token := apitest.RandomAccessToken(t) t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + apiKeys := []api.ApiKeyResponse{{ + Name: "service_role", + ApiKey: nullable.NewNullableWithValue("service-key"), + }} t.Run("moves single object", func(t *testing.T) { // Setup in-memory fs @@ -52,10 +57,7 @@ func TestStorageMV(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Post("/storage/v1/object/move"). JSON(storage.MoveObjectRequest{ @@ -80,10 +82,7 @@ func TestStorageMV(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Post("/storage/v1/object/move"). JSON(storage.MoveObjectRequest{ diff --git a/internal/storage/rm/rm_test.go b/internal/storage/rm/rm_test.go index 46d204cf0..cc02418cf 100644 --- a/internal/storage/rm/rm_test.go +++ b/internal/storage/rm/rm_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/h2non/gock" + "github.com/oapi-codegen/nullable" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/supabase/cli/internal/testing/apitest" @@ -44,6 +45,10 @@ func TestStorageRM(t *testing.T) { // Setup valid access token token := apitest.RandomAccessToken(t) t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + apiKeys := []api.ApiKeyResponse{{ + Name: "service_role", + ApiKey: nullable.NewNullableWithValue("service-key"), + }} t.Run("throws error on invalid url", func(t *testing.T) { // Setup in-memory fs @@ -81,10 +86,7 @@ func TestStorageRM(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Delete("/storage/v1/object/private"). JSON(storage.DeleteObjectsRequest{Prefixes: []string{ @@ -120,10 +122,7 @@ func TestStorageRM(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) // Delete /test/ bucket gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Post("/storage/v1/object/list/test"). @@ -190,10 +189,7 @@ func TestStorageRM(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + flags.ProjectRef + "/api-keys"). Reply(http.StatusOK). - JSON([]api.ApiKeyResponse{{ - Name: "service_role", - ApiKey: "service-key", - }}) + JSON(apiKeys) gock.New("https://" + utils.GetSupabaseHost(flags.ProjectRef)). Delete("/storage/v1/object/private"). Reply(http.StatusServiceUnavailable) diff --git a/internal/utils/tenant/client.go b/internal/utils/tenant/client.go index ad0ef6aa7..c94696701 100644 --- a/internal/utils/tenant/client.go +++ b/internal/utils/tenant/client.go @@ -28,11 +28,15 @@ func (a ApiKey) IsEmpty() bool { func NewApiKey(resp []api.ApiKeyResponse) ApiKey { var result ApiKey for _, key := range resp { - if key.Name == "anon" { - result.Anon = key.ApiKey + value, err := key.ApiKey.Get() + if err != nil { + continue } - if key.Name == "service_role" { - result.ServiceRole = key.ApiKey + switch key.Name { + case "anon": + result.Anon = value + case "service_role": + result.ServiceRole = value } } return result diff --git a/internal/utils/tenant/client_test.go b/internal/utils/tenant/client_test.go index 6057f502f..183485fbe 100644 --- a/internal/utils/tenant/client_test.go +++ b/internal/utils/tenant/client_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/h2non/gock" + "github.com/oapi-codegen/nullable" "github.com/stretchr/testify/assert" "github.com/supabase/cli/internal/testing/apitest" "github.com/supabase/cli/internal/utils" @@ -15,8 +16,8 @@ import ( func TestApiKey(t *testing.T) { t.Run("creates api key from response", func(t *testing.T) { resp := []api.ApiKeyResponse{ - {Name: "anon", ApiKey: "anon-key"}, - {Name: "service_role", ApiKey: "service-key"}, + {Name: "anon", ApiKey: nullable.NewNullableWithValue("anon-key")}, + {Name: "service_role", ApiKey: nullable.NewNullableWithValue("service-key")}, } keys := NewApiKey(resp) @@ -27,7 +28,9 @@ func TestApiKey(t *testing.T) { }) t.Run("handles empty response", func(t *testing.T) { - resp := []api.ApiKeyResponse{} + resp := []api.ApiKeyResponse{ + {Name: "service_role", ApiKey: nullable.NewNullNullable[string]()}, + } keys := NewApiKey(resp) @@ -38,7 +41,7 @@ func TestApiKey(t *testing.T) { t.Run("handles partial response", func(t *testing.T) { resp := []api.ApiKeyResponse{ - {Name: "anon", ApiKey: "anon-key"}, + {Name: "anon", ApiKey: nullable.NewNullableWithValue("anon-key")}, } keys := NewApiKey(resp) @@ -60,8 +63,8 @@ func TestGetApiKeys(t *testing.T) { Get("/v1/projects/" + projectRef + "/api-keys"). Reply(http.StatusOK). JSON([]api.ApiKeyResponse{ - {Name: "anon", ApiKey: "anon-key"}, - {Name: "service_role", ApiKey: "service-key"}, + {Name: "anon", ApiKey: nullable.NewNullableWithValue("anon-key")}, + {Name: "service_role", ApiKey: nullable.NewNullableWithValue("service-key")}, }) keys, err := GetApiKeys(context.Background(), projectRef) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index cd96838f1..25fa2ccf0 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1041,7 +1041,7 @@ type AnalyticsResponse_Error struct { // ApiKeyResponse defines model for ApiKeyResponse. type ApiKeyResponse struct { - ApiKey string `json:"api_key"` + ApiKey nullable.Nullable[string] `json:"api_key,omitempty"` Description nullable.Nullable[string] `json:"description,omitempty"` Hash nullable.Nullable[string] `json:"hash,omitempty"` Id nullable.Nullable[string] `json:"id,omitempty"` From 6fe4fad1415b985af008cee21e39e026ec7d4518 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 05:01:58 +0000 Subject: [PATCH 241/359] chore(deps): bump go.opentelemetry.io/otel from 1.36.0 to 1.37.0 (#3776) * chore(deps): bump go.opentelemetry.io/otel from 1.36.0 to 1.37.0 Bumps [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) from 1.36.0 to 1.37.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.36.0...v1.37.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel dependency-version: 1.37.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: update pkg deps --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index f1b587cc3..4be814728 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,7 @@ require ( github.com/tidwall/jsonc v0.3.2 github.com/withfig/autocomplete-tools/packages/cobra v1.2.0 github.com/zalando/go-keyring v0.2.6 - go.opentelemetry.io/otel v1.36.0 + go.opentelemetry.io/otel v1.37.0 golang.org/x/mod v0.25.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.32.0 @@ -135,7 +135,7 @@ require ( github.com/go-critic/go-critic v0.13.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.2 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/logr v1.4.3 // indirect 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.1 // indirect @@ -321,10 +321,10 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect - go.opentelemetry.io/otel/metric v1.36.0 // indirect + go.opentelemetry.io/otel/metric v1.37.0 // indirect go.opentelemetry.io/otel/sdk v1.35.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect - go.opentelemetry.io/otel/trace v1.36.0 // indirect + go.opentelemetry.io/otel/trace v1.37.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // 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 189341d3d..9995fde04 100644 --- a/go.sum +++ b/go.sum @@ -324,8 +324,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= @@ -1046,8 +1046,8 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I= -go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= -go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= +go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= +go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 h1:ajl4QczuJVA2TU9W9AGw++86Xga/RKt//16z/yxPgdk= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0/go.mod h1:Vn3/rlOJ3ntf/Q3zAI0V5lDnTbHGaUsNUeF6nZmm7pA= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= @@ -1056,14 +1056,14 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0u go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 h1:BEj3SPM81McUZHYjRS5pEgNgnmzGJ5tRpU5krWnV8Bs= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0/go.mod h1:9cKLGBDzI/F3NoHLQGm4ZrYdIHsvGt6ej6hUowxY0J4= -go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= -go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= +go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= +go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= -go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= -go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= +go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= +go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/pkg/go.mod b/pkg/go.mod index f1a9f408d..e722b673a 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -9,7 +9,7 @@ require ( github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.11 github.com/go-errors/errors v1.5.1 - github.com/go-viper/mapstructure/v2 v2.2.1 + github.com/go-viper/mapstructure/v2 v2.3.0 github.com/golang-jwt/jwt/v5 v5.2.2 github.com/h2non/gock v1.2.0 github.com/jackc/pgconn v1.14.3 diff --git a/pkg/go.sum b/pkg/go.sum index 344d50b33..6086ffd66 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -36,8 +36,8 @@ github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3Bop github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= -github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= +github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= From 09d2f1b52fd9a1a56784946bea82501fead4f8b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 05:08:19 +0000 Subject: [PATCH 242/359] chore(deps): bump supabase/realtime from v2.37.9 to v2.37.11 in /pkg/config/templates (#3778) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.37.9 to v2.37.11. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.37.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index b7d491095..5caa9b16d 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.5 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.37.9 AS realtime +FROM supabase/realtime:v2.38.0 AS realtime FROM supabase/storage-api:v1.24.7 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 1f889d8364c0b1a55ae437db23a9c02cebf04ea4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 05:14:35 +0000 Subject: [PATCH 243/359] chore(deps): bump supabase/postgres from 17.4.1.47 to 17.4.1.048 in /pkg/config/templates (#3777) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.47 to 17.4.1.048. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.048 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5caa9b16d..3b51a8ad2 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.47 AS pg +FROM supabase/postgres:17.4.1.048 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From f321e1ebeed2e391f6832ef70501be83875a1007 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 05:20:46 +0000 Subject: [PATCH 244/359] chore(deps): bump supabase/supavisor from 2.5.5 to 2.5.6 in /pkg/config/templates (#3784) chore(deps): bump supabase/supavisor in /pkg/config/templates Bumps supabase/supavisor from 2.5.5 to 2.5.6. --- updated-dependencies: - dependency-name: supabase/supavisor dependency-version: 2.5.6 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 3b51a8ad2..1ab8520f4 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -9,7 +9,7 @@ FROM supabase/studio:2025.06.23-sha-17632f7 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector -FROM supabase/supavisor:2.5.5 AS supavisor +FROM supabase/supavisor:2.5.6 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.38.0 AS realtime FROM supabase/storage-api:v1.24.7 AS storage From b8838999ee8e2902660d05cee6aa2cd67191a890 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 05:25:57 +0000 Subject: [PATCH 245/359] chore(deps): bump supabase/studio from 2025.06.23-sha-17632f7 to 2025.06.30-sha-6f5982d in /pkg/config/templates (#3785) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.06.23-sha-17632f7 to 2025.06.30-sha-6f5982d. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.06.30-sha-6f5982d dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 1ab8520f4..af7cd18df 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.3 AS pgmeta -FROM supabase/studio:2025.06.23-sha-17632f7 AS studio +FROM supabase/studio:2025.06.30-sha-6f5982d AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 938ff4665bbb5e0b43f1da1fcf36a0e586ad01a0 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 30 Jun 2025 18:02:26 +0800 Subject: [PATCH 246/359] fix: handle windows path separator when globbing (#3788) --- pkg/config/config.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 9f9e05ee9..38db3d50f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -114,9 +114,10 @@ func (g Glob) Files(fsys fs.FS) ([]string, error) { sort.Strings(matches) // Remove duplicates for _, item := range matches { - if _, exists := set[item]; !exists { - set[item] = struct{}{} - result = append(result, item) + fp := filepath.ToSlash(item) + if _, exists := set[fp]; !exists { + set[fp] = struct{}{} + result = append(result, fp) } } } From d3760882ba2f6877fb56fd1ee4c1aa82ed9c0bf3 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Tue, 1 Jul 2025 06:44:13 +0200 Subject: [PATCH 247/359] chore: sync API types from infrastructure (#3789) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/types.gen.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 25fa2ccf0..e96f13242 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1390,6 +1390,7 @@ type CreateBranchBody struct { BranchName string `json:"branch_name"` DesiredInstanceSize *CreateBranchBodyDesiredInstanceSize `json:"desired_instance_size,omitempty"` GitBranch *string `json:"git_branch,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` Persistent *bool `json:"persistent,omitempty"` // PostgresEngine Postgres engine version. If not provided, the latest version will be used. From 8fdb5b48183f34b17710517dd163b9b5802fbfd4 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Tue, 1 Jul 2025 10:50:00 +0200 Subject: [PATCH 248/359] chore: sync API types from infrastructure (#3791) * chore: sync API types from infrastructure * chore: fix lint * chore: fix unwanted change --------- Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> Co-authored-by: avallete --- pkg/api/types.gen.go | 4 ++-- pkg/config/auth.go | 17 +++++++++-------- pkg/config/auth_test.go | 11 ++++++----- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index e96f13242..1f9546a0c 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1253,7 +1253,7 @@ type AuthConfigResponse struct { SmsVonageApiKey nullable.Nullable[string] `json:"sms_vonage_api_key"` SmsVonageApiSecret nullable.Nullable[string] `json:"sms_vonage_api_secret"` SmsVonageFrom nullable.Nullable[string] `json:"sms_vonage_from"` - SmtpAdminEmail nullable.Nullable[string] `json:"smtp_admin_email"` + SmtpAdminEmail nullable.Nullable[openapi_types.Email] `json:"smtp_admin_email"` SmtpHost nullable.Nullable[string] `json:"smtp_host"` SmtpMaxFrequency nullable.Nullable[int] `json:"smtp_max_frequency"` SmtpPass nullable.Nullable[string] `json:"smtp_pass"` @@ -2469,7 +2469,7 @@ type UpdateAuthConfigBody struct { SmsVonageApiKey nullable.Nullable[string] `json:"sms_vonage_api_key,omitempty"` SmsVonageApiSecret nullable.Nullable[string] `json:"sms_vonage_api_secret,omitempty"` SmsVonageFrom nullable.Nullable[string] `json:"sms_vonage_from,omitempty"` - SmtpAdminEmail nullable.Nullable[string] `json:"smtp_admin_email,omitempty"` + SmtpAdminEmail nullable.Nullable[openapi_types.Email] `json:"smtp_admin_email,omitempty"` SmtpHost nullable.Nullable[string] `json:"smtp_host,omitempty"` SmtpMaxFrequency nullable.Nullable[int] `json:"smtp_max_frequency,omitempty"` SmtpPass nullable.Nullable[string] `json:"smtp_pass,omitempty"` diff --git a/pkg/config/auth.go b/pkg/config/auth.go index 9aa026315..eff9d8070 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -7,6 +7,7 @@ import ( "github.com/go-errors/errors" "github.com/oapi-codegen/nullable" + openapi_types "github.com/oapi-codegen/runtime/types" v1API "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/diff" @@ -160,13 +161,13 @@ type ( } smtp struct { - Enabled bool `toml:"enabled"` - Host string `toml:"host"` - Port uint16 `toml:"port"` - User string `toml:"user"` - Pass Secret `toml:"pass"` - AdminEmail string `toml:"admin_email"` - SenderName string `toml:"sender_name"` + Enabled bool `toml:"enabled"` + Host string `toml:"host"` + Port uint16 `toml:"port"` + User string `toml:"user"` + Pass Secret `toml:"pass"` + AdminEmail openapi_types.Email `toml:"admin_email"` + SenderName string `toml:"sender_name"` } emailTemplate struct { @@ -732,7 +733,7 @@ func (s *smtp) fromAuthConfig(remoteConfig v1API.AuthConfigResponse) { if len(s.Pass.SHA256) > 0 { s.Pass.SHA256 = ValOrDefault(remoteConfig.SmtpPass, "") } - s.AdminEmail = ValOrDefault(remoteConfig.SmtpAdminEmail, "") + s.AdminEmail = ValOrDefault(remoteConfig.SmtpAdminEmail, openapi_types.Email("")) s.SenderName = ValOrDefault(remoteConfig.SmtpSenderName, "") portStr := ValOrDefault(remoteConfig.SmtpPort, "0") if port, err := strconv.ParseUint(portStr, 10, 16); err == nil { diff --git a/pkg/config/auth_test.go b/pkg/config/auth_test.go index bba212383..8ec52f0fa 100644 --- a/pkg/config/auth_test.go +++ b/pkg/config/auth_test.go @@ -8,6 +8,7 @@ import ( "github.com/go-errors/errors" "github.com/oapi-codegen/nullable" + openapi_types "github.com/oapi-codegen/runtime/types" "github.com/stretchr/testify/assert" v1API "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/cast" @@ -560,7 +561,7 @@ func TestEmailDiff(t *testing.T) { Value: "test-key", SHA256: "ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e", }, - AdminEmail: "admin@email.com", + AdminEmail: openapi_types.Email("admin@email.com"), SenderName: "Admin", }, MaxFrequency: time.Second, @@ -579,7 +580,7 @@ func TestEmailDiff(t *testing.T) { SmtpPort: nullable.NewNullableWithValue("587"), SmtpUser: nullable.NewNullableWithValue("apikey"), SmtpPass: nullable.NewNullableWithValue("ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e"), - SmtpAdminEmail: nullable.NewNullableWithValue("admin@email.com"), + SmtpAdminEmail: nullable.NewNullableWithValue(openapi_types.Email("admin@email.com")), SmtpSenderName: nullable.NewNullableWithValue("Admin"), SmtpMaxFrequency: nullable.NewNullableWithValue(1), // Custom templates @@ -641,7 +642,7 @@ func TestEmailDiff(t *testing.T) { Value: "test-key", SHA256: "ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e", }, - AdminEmail: "admin@email.com", + AdminEmail: openapi_types.Email("admin@email.com"), SenderName: "Admin", }, MaxFrequency: time.Second, @@ -696,7 +697,7 @@ func TestEmailDiff(t *testing.T) { SmtpPort: nullable.NewNullableWithValue("587"), SmtpUser: nullable.NewNullableWithValue("apikey"), SmtpPass: nullable.NewNullableWithValue("ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e"), - SmtpAdminEmail: nullable.NewNullableWithValue("admin@email.com"), + SmtpAdminEmail: nullable.NewNullableWithValue(openapi_types.Email("admin@email.com")), SmtpSenderName: nullable.NewNullableWithValue("Admin"), SmtpMaxFrequency: nullable.NewNullableWithValue(1), // Custom templates @@ -739,7 +740,7 @@ func TestEmailDiff(t *testing.T) { Value: "test-key", SHA256: "ed64b7695a606bc6ab4fcb41fe815b5ddf1063ccbc87afe1fa89756635db520e", }, - AdminEmail: "admin@email.com", + AdminEmail: openapi_types.Email("admin@email.com"), SenderName: "Admin", }, MaxFrequency: time.Minute, From 01c5db1806c8806193114714f30b58ba17ac5c27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:37:46 +0000 Subject: [PATCH 249/359] chore(deps): bump supabase/supavisor from 2.5.6 to 2.5.7 in /pkg/config/templates (#3793) chore(deps): bump supabase/supavisor in /pkg/config/templates Bumps supabase/supavisor from 2.5.6 to 2.5.7. --- updated-dependencies: - dependency-name: supabase/supavisor dependency-version: 2.5.7 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index af7cd18df..8d3e45318 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -9,7 +9,7 @@ FROM supabase/studio:2025.06.30-sha-6f5982d AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector -FROM supabase/supavisor:2.5.6 AS supavisor +FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.38.0 AS realtime FROM supabase/storage-api:v1.24.7 AS storage From 4bde0c495e9d01d2da02bfe08ab87aee3eec00a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:46:47 +0000 Subject: [PATCH 250/359] chore(deps): bump supabase/realtime from v2.38.0 to v2.39.0 in /pkg/config/templates (#3792) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.38.0 to v2.39.0. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.39.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 8d3e45318..5fbf95c62 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.38.0 AS realtime +FROM supabase/realtime:v2.39.3 AS realtime FROM supabase/storage-api:v1.24.7 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From babafa789255829993042bd53b2e81e3d1df83af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 05:39:13 +0100 Subject: [PATCH 251/359] chore(deps): bump supabase/realtime from v2.39.3 to v2.39.4 in /pkg/config/templates (#3797) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.39.3 to v2.39.4. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.39.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5fbf95c62..6afc53ca9 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.39.3 AS realtime +FROM supabase/realtime:v2.39.4 AS realtime FROM supabase/storage-api:v1.24.7 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From c4e0f9567d5d5c74cd774f5e777dddf509eab18a Mon Sep 17 00:00:00 2001 From: Andrew Valleteau Date: Wed, 2 Jul 2025 15:08:36 +0200 Subject: [PATCH 252/359] feat(config): add network_restrictions to db config (#3759) * feat(config): add network_restrictions to config * chore: factorise and add validate * chore: fix lint * chore: simplify network config --------- Co-authored-by: Qiao Han --- internal/link/link.go | 19 ++++++- internal/link/link_test.go | 12 ++++ pkg/config/db.go | 64 +++++++++++++++++---- pkg/config/db_test.go | 97 ++++++++++++++++++++++++++++++++ pkg/config/templates/config.toml | 10 ++++ pkg/config/testdata/config.toml | 10 ++++ pkg/config/updater.go | 32 +++++++++++ 7 files changed, 232 insertions(+), 12 deletions(-) diff --git a/internal/link/link.go b/internal/link/link.go index 2e5747fd5..b7a49fe85 100644 --- a/internal/link/link.go +++ b/internal/link/link.go @@ -76,13 +76,19 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func( func LinkServices(ctx context.Context, projectRef, anonKey string, fsys afero.Fs) { // Ignore non-fatal errors linking services var wg sync.WaitGroup - wg.Add(7) + wg.Add(8) go func() { defer wg.Done() if err := linkDatabaseSettings(ctx, projectRef); err != nil && viper.GetBool("DEBUG") { fmt.Fprintln(os.Stderr, err) } }() + go func() { + defer wg.Done() + if err := linkNetworkRestrictions(ctx, projectRef); err != nil && viper.GetBool("DEBUG") { + fmt.Fprintln(os.Stderr, err) + } + }() go func() { defer wg.Done() if err := linkPostgrest(ctx, projectRef); err != nil && viper.GetBool("DEBUG") { @@ -193,6 +199,17 @@ func linkDatabaseSettings(ctx context.Context, projectRef string) error { return nil } +func linkNetworkRestrictions(ctx context.Context, projectRef string) error { + resp, err := utils.GetSupabase().V1GetNetworkRestrictionsWithResponse(ctx, projectRef) + if err != nil { + return errors.Errorf("failed to read network restrictions: %w", err) + } else if resp.JSON200 == nil { + return errors.Errorf("unexpected network restrictions status %d: %s", resp.StatusCode(), string(resp.Body)) + } + utils.Config.Db.NetworkRestrictions.FromRemoteNetworkRestrictions(*resp.JSON200) + return nil +} + func linkDatabase(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error { conn, err := utils.ConnectByConfig(ctx, config, options...) if err != nil { diff --git a/internal/link/link_test.go b/internal/link/link_test.go index 8e47d8cc2..c1e869cca 100644 --- a/internal/link/link_test.go +++ b/internal/link/link_test.go @@ -88,6 +88,10 @@ func TestLinkCommand(t *testing.T) { Get("/v1/projects/" + project + "/config/database/pooler"). Reply(200). JSON(api.V1PgbouncerConfigResponse{}) + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + project + "/network-restrictions"). + Reply(200). + JSON(api.NetworkRestrictionsResponse{}) // Link versions auth := tenant.HealthResponse{Version: "v2.74.2"} gock.New("https://" + utils.GetSupabaseHost(project)). @@ -152,6 +156,10 @@ func TestLinkCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/config/database/pooler"). ReplyError(errors.New("network error")) + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + project + "/network-restrictions"). + Reply(200). + JSON(api.NetworkRestrictionsResponse{}) // Link versions gock.New("https://" + utils.GetSupabaseHost(project)). Get("/auth/v1/health"). @@ -202,6 +210,10 @@ func TestLinkCommand(t *testing.T) { gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/config/database/pooler"). ReplyError(errors.New("network error")) + gock.New(utils.DefaultApiHost). + Get("/v1/projects/" + project + "/network-restrictions"). + Reply(200). + JSON(api.NetworkRestrictionsResponse{}) // Link versions gock.New("https://" + utils.GetSupabaseHost(project)). Get("/auth/v1/health"). diff --git a/pkg/config/db.go b/pkg/config/db.go index 0f216a23f..740dabf53 100644 --- a/pkg/config/db.go +++ b/pkg/config/db.go @@ -67,18 +67,25 @@ type ( WorkMem *string `toml:"work_mem"` } + networkRestrictions struct { + Enabled bool `toml:"enabled"` + AllowedCidrs []string `toml:"allowed_cidrs"` + AllowedCidrsV6 []string `toml:"allowed_cidrs_v6"` + } + db struct { - Image string `toml:"-"` - Port uint16 `toml:"port"` - ShadowPort uint16 `toml:"shadow_port"` - MajorVersion uint `toml:"major_version"` - Password string `toml:"-"` - RootKey Secret `toml:"root_key"` - Pooler pooler `toml:"pooler"` - Migrations migrations `toml:"migrations"` - Seed seed `toml:"seed"` - Settings settings `toml:"settings"` - Vault map[string]Secret `toml:"vault"` + Image string `toml:"-"` + Port uint16 `toml:"port"` + ShadowPort uint16 `toml:"shadow_port"` + MajorVersion uint `toml:"major_version"` + Password string `toml:"-"` + RootKey Secret `toml:"root_key"` + Pooler pooler `toml:"pooler"` + Migrations migrations `toml:"migrations"` + Seed seed `toml:"seed"` + Settings settings `toml:"settings"` + NetworkRestrictions networkRestrictions `toml:"network_restrictions"` + Vault map[string]Secret `toml:"vault"` } migrations struct { @@ -188,3 +195,38 @@ func (a *settings) DiffWithRemote(remoteConfig v1API.PostgresConfigResponse) ([] } return diff.Diff("remote[db.settings]", remoteCompare, "local[db.settings]", currentValue), nil } + +func (n networkRestrictions) ToUpdateNetworkRestrictionsBody() v1API.V1UpdateNetworkRestrictionsJSONRequestBody { + body := v1API.V1UpdateNetworkRestrictionsJSONRequestBody{ + DbAllowedCidrs: &n.AllowedCidrs, + DbAllowedCidrsV6: &n.AllowedCidrsV6, + } + return body +} + +func (n *networkRestrictions) FromRemoteNetworkRestrictions(remoteConfig v1API.NetworkRestrictionsResponse) { + if !n.Enabled { + return + } + if remoteConfig.Config.DbAllowedCidrs != nil { + n.AllowedCidrs = *remoteConfig.Config.DbAllowedCidrs + } + if remoteConfig.Config.DbAllowedCidrsV6 != nil { + n.AllowedCidrsV6 = *remoteConfig.Config.DbAllowedCidrsV6 + } +} + +func (n *networkRestrictions) DiffWithRemote(remoteConfig v1API.NetworkRestrictionsResponse) ([]byte, error) { + copy := *n + // Convert the config values into easily comparable remoteConfig values + currentValue, err := ToTomlBytes(copy) + if err != nil { + return nil, err + } + copy.FromRemoteNetworkRestrictions(remoteConfig) + remoteCompare, err := ToTomlBytes(copy) + if err != nil { + return nil, err + } + return diff.Diff("remote[db.network_restrictions]", remoteCompare, "local[db.network_restrictions]", currentValue), nil +} diff --git a/pkg/config/db_test.go b/pkg/config/db_test.go index 575fd202d..93ba47d6d 100644 --- a/pkg/config/db_test.go +++ b/pkg/config/db_test.go @@ -182,3 +182,100 @@ func TestSettingsToPostgresConfig(t *testing.T) { assert.NotContains(t, got, "=") }) } + +func TestNetworkRestrictionsFromRemote(t *testing.T) { + t.Run("converts from remote config with restrictions", func(t *testing.T) { + ipv4Cidrs := []string{"192.168.1.0/24"} + ipv6Cidrs := []string{"2001:db8::/32"} + remoteConfig := v1API.NetworkRestrictionsResponse{} + remoteConfig.Config.DbAllowedCidrs = &ipv4Cidrs + remoteConfig.Config.DbAllowedCidrsV6 = &ipv6Cidrs + nr := networkRestrictions{Enabled: true} + nr.FromRemoteNetworkRestrictions(remoteConfig) + assert.ElementsMatch(t, ipv4Cidrs, nr.AllowedCidrs) + assert.ElementsMatch(t, ipv6Cidrs, nr.AllowedCidrsV6) + }) + + t.Run("converts from remote config with allow all", func(t *testing.T) { + ipv4Cidrs := []string{"0.0.0.0/0"} + ipv6Cidrs := []string{"::/0"} + remoteConfig := v1API.NetworkRestrictionsResponse{} + remoteConfig.Config.DbAllowedCidrs = &ipv4Cidrs + remoteConfig.Config.DbAllowedCidrsV6 = &ipv6Cidrs + nr := networkRestrictions{Enabled: true} + nr.FromRemoteNetworkRestrictions(remoteConfig) + assert.ElementsMatch(t, ipv4Cidrs, nr.AllowedCidrs) + assert.ElementsMatch(t, ipv6Cidrs, nr.AllowedCidrsV6) + }) + + t.Run("ignores locally disabled network restrictions", func(t *testing.T) { + remoteConfig := v1API.NetworkRestrictionsResponse{} + remoteConfig.Config.DbAllowedCidrs = &[]string{"192.168.1.0/24"} + remoteConfig.Config.DbAllowedCidrsV6 = &[]string{"2001:db8::/32"} + nr := networkRestrictions{} + nr.FromRemoteNetworkRestrictions(remoteConfig) + assert.False(t, nr.Enabled) + assert.Empty(t, nr.AllowedCidrs) + assert.Empty(t, nr.AllowedCidrsV6) + }) +} + +func TestNetworkRestrictionsDiff(t *testing.T) { + t.Run("detects differences", func(t *testing.T) { + local := networkRestrictions{ + Enabled: true, + AllowedCidrs: []string{"192.168.1.0/24"}, + AllowedCidrsV6: []string{"2001:db8::/32"}, + } + remoteConfig := v1API.NetworkRestrictionsResponse{} + remoteConfig.Config.DbAllowedCidrs = &[]string{"10.0.0.0/8"} + remoteConfig.Config.DbAllowedCidrsV6 = &[]string{"fd00::/8"} + diff, err := local.DiffWithRemote(remoteConfig) + assert.NoError(t, err) + assert.Contains(t, string(diff), "-db_allowed_cidrs = [\"10.0.0.0/8\"]") + assert.Contains(t, string(diff), "+db_allowed_cidrs = [\"192.168.1.0/24\"]") + assert.Contains(t, string(diff), "-db_allowed_cidrs_v6 = [\"2001:db8::/32\"]") + assert.Contains(t, string(diff), "+db_allowed_cidrs_v6 = [\"fd00::/8\"]") + }) + + t.Run("no differences", func(t *testing.T) { + local := networkRestrictions{ + Enabled: true, + AllowedCidrs: []string{"192.168.1.0/24"}, + AllowedCidrsV6: []string{"2001:db8::/32"}, + } + remoteConfig := v1API.NetworkRestrictionsResponse{} + remoteConfig.Config.DbAllowedCidrs = &local.AllowedCidrs + remoteConfig.Config.DbAllowedCidrsV6 = &local.AllowedCidrsV6 + diff, err := local.DiffWithRemote(remoteConfig) + assert.NoError(t, err) + assert.Empty(t, diff) + }) + + t.Run("both have no restrictions - disabled vs allow all", func(t *testing.T) { + local := networkRestrictions{} + remoteConfig := v1API.NetworkRestrictionsResponse{} + remoteConfig.Config.DbAllowedCidrs = &[]string{"0.0.0.0/0"} + remoteConfig.Config.DbAllowedCidrsV6 = &[]string{"::/0"} + diff, err := local.DiffWithRemote(remoteConfig) + assert.NoError(t, err) + assert.Empty(t, diff) + }) + + t.Run("local disallow all, remote allow all", func(t *testing.T) { + local := networkRestrictions{ + Enabled: true, + AllowedCidrs: []string{}, + AllowedCidrsV6: []string{}, + } + remoteConfig := v1API.NetworkRestrictionsResponse{} + remoteConfig.Config.DbAllowedCidrs = &[]string{"0.0.0.0/0"} + remoteConfig.Config.DbAllowedCidrsV6 = &[]string{"::/0"} + diff, err := local.DiffWithRemote(remoteConfig) + assert.NoError(t, err) + assert.Contains(t, string(diff), "-db_allowed_cidrs = [\"0.0.0.0/0\"]") + assert.Contains(t, string(diff), "+db_allowed_cidrs = []") + assert.Contains(t, string(diff), "-db_allowed_cidrs_v6 = [\"::/0\"]") + assert.Contains(t, string(diff), "+db_allowed_cidrs_v6 = []") + }) +} diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index 92a5367c1..429cbd689 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -59,6 +59,16 @@ enabled = true # Supports glob patterns relative to supabase directory: "./seeds/*.sql" sql_paths = ["./seed.sql"] +[db.network_restrictions] +# Enable management of network restrictions. +enabled = false +# List of IPv4 CIDR blocks allowed to connect to the database. +# Defaults to allow all IPv4 connections. Set empty array to block all IPs. +allowed_cidrs = ["0.0.0.0/0"] +# List of IPv6 CIDR blocks allowed to connect to the database. +# Defaults to allow all IPv6 connections. Set empty array to block all IPs. +allowed_cidrs_v6 = ["::/0"] + [realtime] enabled = true # Bind realtime via either IPv4 or IPv6. (default: IPv4) diff --git a/pkg/config/testdata/config.toml b/pkg/config/testdata/config.toml index 0077ec956..65ed7cdca 100644 --- a/pkg/config/testdata/config.toml +++ b/pkg/config/testdata/config.toml @@ -59,6 +59,16 @@ enabled = true # Supports glob patterns relative to supabase directory: "./seeds/*.sql" sql_paths = ["./seed.sql"] +[db.network_restrictions] +# Enable management of network restrictions. +enabled = true +# List of IPv4 CIDR blocks allowed to connect to the database. +# Defaults to allow all IPv4 connections. Set empty array to block all IPs. +allowed_cidrs = ["0.0.0.0/0"] +# List of IPv6 CIDR blocks allowed to connect to the database. +# Defaults to allow all IPv6 connections. Set empty array to block all IPs. +allowed_cidrs_v6 = ["::/0"] + [realtime] enabled = true # Bind realtime via either IPv4 or IPv6. (default: IPv6) diff --git a/pkg/config/updater.go b/pkg/config/updater.go index e5f42aceb..96b73efd2 100644 --- a/pkg/config/updater.go +++ b/pkg/config/updater.go @@ -97,6 +97,38 @@ func (u *ConfigUpdater) UpdateDbConfig(ctx context.Context, projectRef string, c if err := u.UpdateDbSettingsConfig(ctx, projectRef, c.Settings, filter...); err != nil { return err } + if err := u.UpdateDbNetworkRestrictionsConfig(ctx, projectRef, c.NetworkRestrictions, filter...); err != nil { + return err + } + return nil +} + +func (u *ConfigUpdater) UpdateDbNetworkRestrictionsConfig(ctx context.Context, projectRef string, n networkRestrictions, filter ...func(string) bool) error { + networkRestrictionsConfig, err := u.client.V1GetNetworkRestrictionsWithResponse(ctx, projectRef) + if err != nil { + return errors.Errorf("failed to read network restrictions config: %w", err) + } else if networkRestrictionsConfig.JSON200 == nil { + return errors.Errorf("unexpected status %d: %s", networkRestrictionsConfig.StatusCode(), string(networkRestrictionsConfig.Body)) + } + networkRestrictionsDiff, err := n.DiffWithRemote(*networkRestrictionsConfig.JSON200) + if err != nil { + return err + } else if len(networkRestrictionsDiff) == 0 { + fmt.Fprintln(os.Stderr, "Remote DB Network restrictions config is up to date.") + return nil + } + fmt.Fprintln(os.Stderr, "Updating network restrictions with config:", string(networkRestrictionsDiff)) + for _, keep := range filter { + if !keep("db") { + return nil + } + } + updateBody := n.ToUpdateNetworkRestrictionsBody() + if resp, err := u.client.V1UpdateNetworkRestrictionsWithResponse(ctx, projectRef, updateBody); err != nil { + return errors.Errorf("failed to update network restrictions config: %w", err) + } else if resp.JSON201 == nil { + return errors.Errorf("unexpected status %d: %s", resp.StatusCode(), string(resp.Body)) + } return nil } From 036b161288f8a4bdb9ae9261044d91857ef373fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:38:12 +0000 Subject: [PATCH 253/359] chore(deps): bump github.com/slack-go/slack from 0.17.1 to 0.17.2 (#3786) Bumps [github.com/slack-go/slack](https://github.com/slack-go/slack) from 0.17.1 to 0.17.2. - [Release notes](https://github.com/slack-go/slack/releases) - [Changelog](https://github.com/slack-go/slack/blob/master/history.go) - [Commits](https://github.com/slack-go/slack/compare/v0.17.1...v0.17.2) --- updated-dependencies: - dependency-name: github.com/slack-go/slack dependency-version: 0.17.2 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 4be814728..79ec3cd20 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/mithrandie/csvq-driver v1.7.0 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/nullable v1.1.0 - github.com/slack-go/slack v0.17.1 + github.com/slack-go/slack v0.17.2 github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 diff --git a/go.sum b/go.sum index 9995fde04..f65581eb3 100644 --- a/go.sum +++ b/go.sum @@ -905,8 +905,8 @@ github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+W github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= -github.com/slack-go/slack v0.17.1 h1:x0Mnc6biHBea5vfxLR+x4JFl/Rm3eIo0iS3xDZenX+o= -github.com/slack-go/slack v0.17.1/go.mod h1:X+UqOufi3LYQHDnMG1vxf0J8asC6+WllXrVrhl8/Prk= +github.com/slack-go/slack v0.17.2 h1:UG3IG9qwdU6gJ5uIMmvxZ6FuljgUajUa6Hj1BZGnEnU= +github.com/slack-go/slack v0.17.2/go.mod h1:X+UqOufi3LYQHDnMG1vxf0J8asC6+WllXrVrhl8/Prk= github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= From 53278c127a3044f45cf72c98cd36b47f9a659fd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 04:32:28 +0000 Subject: [PATCH 254/359] chore(deps): bump github.com/docker/docker from 28.3.0+incompatible to 28.3.1+incompatible (#3800) chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.3.0+incompatible to 28.3.1+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v28.3.0...v28.3.1) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-version: 28.3.1+incompatible 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 79ec3cd20..fcae1ab66 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.63.1 github.com/docker/cli v28.3.0+incompatible - github.com/docker/docker v28.3.0+incompatible + github.com/docker/docker v28.3.1+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 github.com/getsentry/sentry-go v0.34.0 diff --git a/go.sum b/go.sum index f65581eb3..e0146bec2 100644 --- a/go.sum +++ b/go.sum @@ -242,8 +242,8 @@ github.com/docker/cli v28.3.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 v28.3.0+incompatible h1:ffS62aKWupCWdvcee7nBU9fhnmknOqDPaJAMtfK0ImQ= -github.com/docker/docker v28.3.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.3.1+incompatible h1:20+BmuA9FXlCX4ByQ0vYJcUEnOmRM6XljDnFWR+jCyY= +github.com/docker/docker v28.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= From 040dc5d903b7a6f9dbea58319616f4436288d787 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 04:38:38 +0000 Subject: [PATCH 255/359] chore(deps): bump github.com/docker/cli from 28.3.0+incompatible to 28.3.1+incompatible (#3799) chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.3.0+incompatible to 28.3.1+incompatible. - [Commits](https://github.com/docker/cli/compare/v28.3.0...v28.3.1) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-version: 28.3.1+incompatible 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 fcae1ab66..d9235d062 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.63.1 - github.com/docker/cli v28.3.0+incompatible + github.com/docker/cli v28.3.1+incompatible github.com/docker/docker v28.3.1+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 diff --git a/go.sum b/go.sum index e0146bec2..272b6fc16 100644 --- a/go.sum +++ b/go.sum @@ -237,8 +237,8 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v28.3.0+incompatible h1:s+ttruVLhB5ayeuf2BciwDVxYdKi+RoUlxmwNHV3Vfo= -github.com/docker/cli v28.3.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.3.1+incompatible h1:ZUdwOLDEBoE3TE5rdC9IXGY5HPHksJK3M+hJEWhh2mc= +github.com/docker/cli v28.3.1+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= From c2aca6fb77c1b58cfccea9b1f09d015be99ece4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 05:10:41 +0000 Subject: [PATCH 256/359] chore(deps): bump supabase/storage-api from v1.24.7 to v1.25.1 in /pkg/config/templates (#3801) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.24.7 to v1.25.1. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.25.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 6afc53ca9..a5ea1a04a 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.39.4 AS realtime -FROM supabase/storage-api:v1.24.7 AS storage +FROM supabase/storage-api:v1.25.1 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 847326b1fd4730cff8a570478e7079883764344f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 04:39:15 +0000 Subject: [PATCH 257/359] chore(deps): bump supabase/realtime from v2.39.4 to v2.39.6 in /pkg/config/templates (#3804) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.39.4 to v2.39.6. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.39.6 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index a5ea1a04a..e803de7e7 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.39.4 AS realtime +FROM supabase/realtime:v2.39.6 AS realtime FROM supabase/storage-api:v1.25.1 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From abad90fdb002181e3e55e93c48eb309ede4e2c3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 04:44:15 +0000 Subject: [PATCH 258/359] chore(deps): bump supabase/storage-api from v1.25.1 to v1.25.3 in /pkg/config/templates (#3803) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.25.1 to v1.25.3. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.25.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e803de7e7..a16eea933 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue FROM supabase/realtime:v2.39.6 AS realtime -FROM supabase/storage-api:v1.25.1 AS storage +FROM supabase/storage-api:v1.25.3 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From d5c2b57e10f8b49a6cc213041be22b3adca04db6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 04:49:03 +0000 Subject: [PATCH 259/359] chore(deps): bump supabase/postgres from 17.4.1.048 to 17.4.1.049 in /pkg/config/templates (#3805) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.048 to 17.4.1.049. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.049 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index a16eea933..7d4fd2908 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.048 AS pg +FROM supabase/postgres:17.4.1.049 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 50426e0ebad2ae7cf27a1dd8a2f20398befcf960 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Fri, 4 Jul 2025 09:48:31 +0200 Subject: [PATCH 260/359] chore: sync API types from infrastructure (#3806) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/types.gen.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 1f9546a0c..21b2fc110 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1611,6 +1611,7 @@ type DeleteProviderResponse struct { type DeployFunctionResponse struct { CreatedAt *int64 `json:"created_at,omitempty"` EntrypointPath *string `json:"entrypoint_path,omitempty"` + EzbrSha256 *string `json:"ezbr_sha256,omitempty"` Id string `json:"id"` ImportMap *bool `json:"import_map,omitempty"` ImportMapPath *string `json:"import_map_path,omitempty"` From 5903f5ef1a71f4626daf9081bb22a41c350f928b Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Mon, 7 Jul 2025 16:49:38 +0200 Subject: [PATCH 261/359] chore: sync API types from infrastructure (#3807) * chore: sync API types from infrastructure * chore: update api response types --------- Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> Co-authored-by: Qiao Han --- cmd/branches.go | 4 ++-- internal/branches/create/create_test.go | 3 ++- internal/branches/list/list.go | 4 ++-- internal/utils/render.go | 6 ++++- pkg/api/types.gen.go | 32 +++++++++++++------------ 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/cmd/branches.go b/cmd/branches.go index 481109bdf..45f88167d 100644 --- a/cmd/branches.go +++ b/cmd/branches.go @@ -202,7 +202,7 @@ func promptBranchId(ctx context.Context, args []string, fsys afero.Fs) error { } else if len(branches) == 0 { return errors.Errorf("branch not found: %s", branchId) } else if len(branches) == 1 { - branchId = branches[0].Id + branchId = branches[0].Id.String() return nil } // Let user choose from a list of branches @@ -210,7 +210,7 @@ func promptBranchId(ctx context.Context, args []string, fsys afero.Fs) error { for i, branch := range branches { items[i] = utils.PromptItem{ Summary: branch.Name, - Details: branch.Id, + Details: branch.Id.String(), } } title := "Select a branch:" diff --git a/internal/branches/create/create_test.go b/internal/branches/create/create_test.go index e07e10387..2fd2a0904 100644 --- a/internal/branches/create/create_test.go +++ b/internal/branches/create/create_test.go @@ -6,6 +6,7 @@ import ( "net/http" "testing" + "github.com/google/uuid" "github.com/h2non/gock" "github.com/spf13/afero" "github.com/stretchr/testify/assert" @@ -33,7 +34,7 @@ func TestCreateCommand(t *testing.T) { Post("/v1/projects/" + flags.ProjectRef + "/branches"). Reply(http.StatusCreated). JSON(api.BranchResponse{ - Id: "test-uuid", + Id: uuid.New(), }) // Run test err := Run(context.Background(), api.CreateBranchBody{ diff --git a/internal/branches/list/list.go b/internal/branches/list/list.go index 85b00411b..4807c7059 100644 --- a/internal/branches/list/list.go +++ b/internal/branches/list/list.go @@ -37,8 +37,8 @@ func Run(ctx context.Context, fsys afero.Fs) error { branch.IsDefault, strings.ReplaceAll(gitBranch, "|", "\\|"), branch.Status, - utils.FormatTimestamp(branch.CreatedAt), - utils.FormatTimestamp(branch.UpdatedAt), + utils.FormatTime(branch.CreatedAt), + utils.FormatTime(branch.UpdatedAt), ) } return list.RenderTable(table) diff --git a/internal/utils/render.go b/internal/utils/render.go index 247b9c7f6..07d674d29 100644 --- a/internal/utils/render.go +++ b/internal/utils/render.go @@ -10,6 +10,10 @@ const ( layoutHuman = "2006-01-02 15:04:05" ) +func FormatTime(t time.Time) string { + return t.UTC().Format(layoutHuman) +} + func FormatTimestamp(timestamp string) string { return parse(time.RFC3339, timestamp) } @@ -24,7 +28,7 @@ func parse(layout, value string) string { fmt.Fprintln(GetDebugLogger(), err) return value } - return t.UTC().Format(layoutHuman) + return FormatTime(t) } func FormatRegion(region string) string { diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 21b2fc110..d76054e10 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1304,21 +1304,22 @@ type BranchDetailResponseStatus string // BranchResponse defines model for BranchResponse. type BranchResponse struct { - CreatedAt string `json:"created_at"` - GitBranch *string `json:"git_branch,omitempty"` - Id string `json:"id"` - IsDefault bool `json:"is_default"` + CreatedAt time.Time `json:"created_at"` + GitBranch *string `json:"git_branch,omitempty"` + Id openapi_types.UUID `json:"id"` + IsDefault bool `json:"is_default"` // LatestCheckRunId This field is deprecated and will not be populated. // Deprecated: - LatestCheckRunId *float32 `json:"latest_check_run_id,omitempty"` - Name string `json:"name"` - ParentProjectRef string `json:"parent_project_ref"` - Persistent bool `json:"persistent"` - PrNumber *int32 `json:"pr_number,omitempty"` - ProjectRef string `json:"project_ref"` - Status BranchResponseStatus `json:"status"` - UpdatedAt string `json:"updated_at"` + LatestCheckRunId *float32 `json:"latest_check_run_id,omitempty"` + Name string `json:"name"` + ParentProjectRef string `json:"parent_project_ref"` + Persistent bool `json:"persistent"` + PrNumber *int32 `json:"pr_number,omitempty"` + ProjectRef string `json:"project_ref"` + ReviewRequestedAt *time.Time `json:"review_requested_at,omitempty"` + Status BranchResponseStatus `json:"status"` + UpdatedAt time.Time `json:"updated_at"` } // BranchResponseStatus defines model for BranchResponse.Status. @@ -2491,9 +2492,10 @@ type UpdateAuthConfigBodySmsProvider string // UpdateBranchBody defines model for UpdateBranchBody. type UpdateBranchBody struct { - BranchName *string `json:"branch_name,omitempty"` - GitBranch *string `json:"git_branch,omitempty"` - Persistent *bool `json:"persistent,omitempty"` + BranchName *string `json:"branch_name,omitempty"` + GitBranch *string `json:"git_branch,omitempty"` + Persistent *bool `json:"persistent,omitempty"` + RequestReview *bool `json:"request_review,omitempty"` // ResetOnPush This field is deprecated and will be ignored. Use v1-reset-a-branch endpoint directly instead. // Deprecated: From 2fb49561d7792e8681d2f28727b0479c7d977f20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 15:02:29 +0000 Subject: [PATCH 262/359] chore(deps): bump supabase/realtime from v2.39.6 to v2.40.0 in /pkg/config/templates (#3813) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.39.6 to v2.40.0. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.40.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 7d4fd2908..116f35f50 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.39.6 AS realtime +FROM supabase/realtime:v2.40.0 AS realtime FROM supabase/storage-api:v1.25.3 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 332d01e586ee5b8a7cdabe8b57480f2a389c66a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 15:07:47 +0000 Subject: [PATCH 263/359] chore(deps): bump supabase/studio from 2025.06.30-sha-6f5982d to 2025.07.07-sha-1d3b0ba in /pkg/config/templates (#3814) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.06.30-sha-6f5982d to 2025.07.07-sha-1d3b0ba. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.07.07-sha-1d3b0ba dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 116f35f50..28e2c4a9b 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.89.3 AS pgmeta -FROM supabase/studio:2025.06.30-sha-6f5982d AS studio +FROM supabase/studio:2025.07.07-sha-1d3b0ba AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From 210c5507a27ed641d1c10be7c4ac91228aef79e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 15:14:12 +0000 Subject: [PATCH 264/359] chore(deps): bump supabase/postgres-meta from v0.89.3 to v0.91.0 in /pkg/config/templates (#3812) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.89.3 to v0.91.0. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.91.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 28e2c4a9b..8cd286787 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.049 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.89.3 AS pgmeta +FROM supabase/postgres-meta:v0.91.0 AS pgmeta FROM supabase/studio:2025.07.07-sha-1d3b0ba AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From b4fbbed97d887f10beb6374b580ae20dbb9274e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 23:31:43 +0800 Subject: [PATCH 265/359] chore(deps): bump github.com/slack-go/slack from 0.17.2 to 0.17.3 (#3811) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d9235d062..c3cac6510 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/mithrandie/csvq-driver v1.7.0 github.com/muesli/reflow v0.3.0 github.com/oapi-codegen/nullable v1.1.0 - github.com/slack-go/slack v0.17.2 + github.com/slack-go/slack v0.17.3 github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 diff --git a/go.sum b/go.sum index 272b6fc16..ddc27f72b 100644 --- a/go.sum +++ b/go.sum @@ -905,8 +905,8 @@ github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+W github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= -github.com/slack-go/slack v0.17.2 h1:UG3IG9qwdU6gJ5uIMmvxZ6FuljgUajUa6Hj1BZGnEnU= -github.com/slack-go/slack v0.17.2/go.mod h1:X+UqOufi3LYQHDnMG1vxf0J8asC6+WllXrVrhl8/Prk= +github.com/slack-go/slack v0.17.3 h1:zV5qO3Q+WJAQ/XwbGfNFrRMaJ5T/naqaonyPV/1TP4g= +github.com/slack-go/slack v0.17.3/go.mod h1:X+UqOufi3LYQHDnMG1vxf0J8asC6+WllXrVrhl8/Prk= github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= From 25c0de57e0e40564263d81cd8a5a7f5f9ae3c82e Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 8 Jul 2025 13:18:03 +0800 Subject: [PATCH 266/359] fix: remove transaction timeout from pg_dump (#3816) * fix: remove transaction timeout from pg_dump * Update dump_schema.sh --- pkg/migration/scripts/dump_schema.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/migration/scripts/dump_schema.sh b/pkg/migration/scripts/dump_schema.sh index 71aae4828..dbcd18dc2 100755 --- a/pkg/migration/scripts/dump_schema.sh +++ b/pkg/migration/scripts/dump_schema.sh @@ -21,6 +21,7 @@ export PGDATABASE="$PGDATABASE" # - do not include event triggers # - do not create pgtle schema and extension comments # - do not create publication "supabase_realtime" +# - do not set transaction_timeout which requires pg17 pg_dump \ --schema-only \ --quote-all-identifier \ @@ -47,6 +48,7 @@ pg_dump \ | sed -E 's/^COMMENT ON EXTENSION (.+)/-- &/' \ | sed -E 's/^CREATE POLICY "cron_job_/-- &/' \ | sed -E 's/^ALTER TABLE "cron"/-- &/' \ +| sed -E 's/^SET transaction_timeout = 0;/-- &/' \ | sed -E "${EXTRA_SED:-}" # Reset session config generated by pg_dump From da27e6e2e9290e8c4121979cf62c2eb2b3f429fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 14:34:07 +0800 Subject: [PATCH 267/359] chore(deps): bump supabase/postgres from 17.4.1.049 to 17.4.1.051 in /pkg/config/templates (#3820) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.049 to 17.4.1.051. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.051 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 8cd286787..e8579814a 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.049 AS pg +FROM supabase/postgres:17.4.1.051 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 03659562ac90c9c8f8832eee1b7af878da0263d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 06:39:02 +0000 Subject: [PATCH 268/359] chore(deps): bump supabase/realtime from v2.40.0 to v2.40.1 in /pkg/config/templates (#3821) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.40.0 to v2.40.1. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.40.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e8579814a..4c0ca5042 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.176.1 AS gotrue -FROM supabase/realtime:v2.40.0 AS realtime +FROM supabase/realtime:v2.40.2 AS realtime FROM supabase/storage-api:v1.25.3 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 6df21bc84d2c1712b6bd0f1a5d68d544bb2db1d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 05:20:32 +0000 Subject: [PATCH 269/359] chore(deps): bump supabase/gotrue from v2.176.1 to v2.177.0 in /pkg/config/templates (#3825) chore(deps): bump supabase/gotrue in /pkg/config/templates Bumps supabase/gotrue from v2.176.1 to v2.177.0. --- updated-dependencies: - dependency-name: supabase/gotrue dependency-version: v2.177.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 4c0ca5042..c85c00ed6 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -10,7 +10,7 @@ FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor -FROM supabase/gotrue:v2.176.1 AS gotrue +FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.40.2 AS realtime FROM supabase/storage-api:v1.25.3 AS storage FROM supabase/logflare:1.14.2 AS logflare From 5713d20465baf8421d8ddc4301e49e03ab0e0fe8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 05:25:53 +0000 Subject: [PATCH 270/359] chore(deps): bump supabase/postgres from 17.4.1.051 to 17.4.1.052 in /pkg/config/templates (#3826) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.051 to 17.4.1.052. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.052 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index c85c00ed6..3fce73b63 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.051 AS pg +FROM supabase/postgres:17.4.1.052 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 1f45c83f8533e50ecb966cbeab31f9a5e5c4e10e Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Wed, 9 Jul 2025 16:07:15 +0200 Subject: [PATCH 271/359] chore: sync API types from infrastructure (#3828) * chore: sync API types from infrastructure * chore: update client types --------- Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> Co-authored-by: Qiao Han --- pkg/api/types.gen.go | 6 ++++++ pkg/config/storage.go | 11 +++++++---- pkg/config/updater_test.go | 11 +++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index d76054e10..57d2cba1c 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -2237,6 +2237,9 @@ type SslEnforcementResponse struct { // StorageConfigResponse defines model for StorageConfigResponse. type StorageConfigResponse struct { Features struct { + IcebergCatalog *struct { + Enabled bool `json:"enabled"` + } `json:"icebergCatalog,omitempty"` ImageTransformation struct { Enabled bool `json:"enabled"` } `json:"imageTransformation"` @@ -2636,6 +2639,9 @@ type UpdateSigningKeyBodyStatus string // UpdateStorageConfigBody defines model for UpdateStorageConfigBody. type UpdateStorageConfigBody struct { Features *struct { + IcebergCatalog *struct { + Enabled bool `json:"enabled"` + } `json:"icebergCatalog,omitempty"` ImageTransformation struct { Enabled bool `json:"enabled"` } `json:"imageTransformation"` diff --git a/pkg/config/storage.go b/pkg/config/storage.go index fa575653a..0c50cbb6d 100644 --- a/pkg/config/storage.go +++ b/pkg/config/storage.go @@ -45,12 +45,15 @@ func (s *storage) ToUpdateStorageConfigBody() v1API.UpdateStorageConfigBody { // When local config is not set, we assume platform defaults should not change if s.ImageTransformation != nil { body.Features = &struct { + IcebergCatalog *struct { + Enabled bool `json:"enabled"` + } `json:"icebergCatalog,omitempty"` ImageTransformation struct { - Enabled bool "json:\"enabled\"" - } "json:\"imageTransformation\"" + Enabled bool `json:"enabled"` + } `json:"imageTransformation"` S3Protocol struct { - Enabled bool "json:\"enabled\"" - } "json:\"s3Protocol\"" + Enabled bool `json:"enabled"` + } `json:"s3Protocol"` }{} body.Features.ImageTransformation.Enabled = s.ImageTransformation.Enabled } diff --git a/pkg/config/updater_test.go b/pkg/config/updater_test.go index bad62f4dd..ad12812e5 100644 --- a/pkg/config/updater_test.go +++ b/pkg/config/updater_test.go @@ -223,12 +223,15 @@ func TestUpdateStorageConfig(t *testing.T) { mockStorage := v1API.StorageConfigResponse{ FileSizeLimit: 100, Features: struct { + IcebergCatalog *struct { + Enabled bool `json:"enabled"` + } `json:"icebergCatalog,omitempty"` ImageTransformation struct { - Enabled bool "json:\"enabled\"" - } "json:\"imageTransformation\"" + Enabled bool `json:"enabled"` + } `json:"imageTransformation"` S3Protocol struct { - Enabled bool "json:\"enabled\"" - } "json:\"s3Protocol\"" + Enabled bool `json:"enabled"` + } `json:"s3Protocol"` }{}, } mockStorage.Features.ImageTransformation.Enabled = true From 223e3731c3e43f78c9b5f3d80894c065125a6185 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 9 Jul 2025 22:12:20 +0800 Subject: [PATCH 272/359] fix: allow diff to run with stopped db (#3829) --- internal/db/diff/diff.go | 14 ++++++-------- internal/db/diff/diff_test.go | 14 -------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/internal/db/diff/diff.go b/internal/db/diff/diff.go index 01ce857ee..3187fd242 100644 --- a/internal/db/diff/diff.go +++ b/internal/db/diff/diff.go @@ -31,14 +31,6 @@ import ( type DiffFunc func(context.Context, string, string, []string) (string, error) func Run(ctx context.Context, schema []string, file string, config pgconn.Config, differ DiffFunc, fsys afero.Fs, options ...func(*pgx.ConnConfig)) (err error) { - // 1. Load all user defined schemas - if len(schema) == 0 { - schema, err = loadSchema(ctx, config, options...) - if err != nil { - return err - } - } - // 3. Run migra to diff schema out, err := DiffDatabase(ctx, schema, config, os.Stderr, fsys, differ, options...) if err != nil { return err @@ -185,6 +177,12 @@ func DiffDatabase(ctx context.Context, schema []string, config pgconn.Config, w } } } + // Load all user defined schemas + if len(schema) == 0 { + if schema, err = loadSchema(ctx, config, options...); err != nil { + return "", err + } + } fmt.Fprintln(w, "Diffing schemas:", strings.Join(schema, ",")) source := utils.ToPostgresURL(shadowConfig) target := utils.ToPostgresURL(config) diff --git a/internal/db/diff/diff_test.go b/internal/db/diff/diff_test.go index daadaf6bb..47e2a0d49 100644 --- a/internal/db/diff/diff_test.go +++ b/internal/db/diff/diff_test.go @@ -87,20 +87,6 @@ func TestRun(t *testing.T) { assert.Equal(t, []byte(diff), contents) }) - t.Run("throws error on failure to load user schemas", func(t *testing.T) { - // Setup in-memory fs - fsys := afero.NewMemMapFs() - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(migration.ListSchemas, migration.ManagedSchemas). - ReplyError(pgerrcode.DuplicateTable, `relation "test" already exists`) - // Run test - err := Run(context.Background(), []string{}, "", dbConfig, DiffSchemaMigra, fsys, conn.Intercept) - // Check error - assert.ErrorContains(t, err, `ERROR: relation "test" already exists (SQLSTATE 42P07)`) - }) - t.Run("throws error on failure to diff target", func(t *testing.T) { // Setup in-memory fs fsys := afero.NewMemMapFs() From 8240dfb5f69d60e34d1c79f91a2a42deda12c844 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 14:18:29 +0000 Subject: [PATCH 273/359] chore(deps): bump github.com/getsentry/sentry-go from 0.34.0 to 0.34.1 (#3822) Bumps [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) from 0.34.0 to 0.34.1. - [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.34.0...v0.34.1) --- updated-dependencies: - dependency-name: github.com/getsentry/sentry-go dependency-version: 0.34.1 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 c3cac6510..13c9f2c5f 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/docker/docker v28.3.1+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 - github.com/getsentry/sentry-go v0.34.0 + github.com/getsentry/sentry-go v0.34.1 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 diff --git a/go.sum b/go.sum index ddc27f72b..fe42cd7ab 100644 --- a/go.sum +++ b/go.sum @@ -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.0 h1:1FCHBVp8TfSc8L10zqSwXUZNiOSF+10qw4czjarTiY4= -github.com/getsentry/sentry-go v0.34.0/go.mod h1:C55omcY9ChRQIUcVcGcs+Zdy4ZpQGvNJ7JYHIoSWOtE= +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/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= From 0e0a38b535e66d38e2301ec5adc3ec5096e3e851 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 04:12:03 +0000 Subject: [PATCH 274/359] chore(deps): bump github.com/docker/docker from 28.3.1+incompatible to 28.3.2+incompatible (#3832) chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.3.1+incompatible to 28.3.2+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v28.3.1...v28.3.2) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-version: 28.3.2+incompatible 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 13c9f2c5f..2a07fff4a 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.63.1 github.com/docker/cli v28.3.1+incompatible - github.com/docker/docker v28.3.1+incompatible + github.com/docker/docker v28.3.2+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 github.com/getsentry/sentry-go v0.34.1 diff --git a/go.sum b/go.sum index fe42cd7ab..404d57d78 100644 --- a/go.sum +++ b/go.sum @@ -242,8 +242,8 @@ github.com/docker/cli v28.3.1+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 v28.3.1+incompatible h1:20+BmuA9FXlCX4ByQ0vYJcUEnOmRM6XljDnFWR+jCyY= -github.com/docker/docker v28.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.3.2+incompatible h1:wn66NJ6pWB1vBZIilP8G3qQPqHy5XymfYn5vsqeA5oA= +github.com/docker/docker v28.3.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= From 2185a1f071544e32afcea1c6654f7241a4ee72a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 04:53:05 +0000 Subject: [PATCH 275/359] chore(deps): bump supabase/postgres from 17.4.1.052 to 17.4.1.053 in /pkg/config/templates (#3834) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.052 to 17.4.1.053. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.053 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 3fce73b63..7ce2cb575 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.052 AS pg +FROM supabase/postgres:17.4.1.053 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 71b5b5c8da4b82d029470b1753fff972bbf74e66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 04:58:18 +0000 Subject: [PATCH 276/359] chore(deps): bump supabase/realtime from v2.40.2 to v2.40.3 in /pkg/config/templates (#3836) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.40.2 to v2.40.3. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.40.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 7ce2cb575..f1db0e405 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.40.2 AS realtime +FROM supabase/realtime:v2.40.3 AS realtime FROM supabase/storage-api:v1.25.3 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From f775d281b61a1f34e540c074a1c950b8de9d1b51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 14:33:19 +0800 Subject: [PATCH 277/359] chore(deps): bump golang.org/x/term from 0.32.0 to 0.33.0 (#3833) Bumps [golang.org/x/term](https://github.com/golang/term) from 0.32.0 to 0.33.0. - [Commits](https://github.com/golang/term/compare/v0.32.0...v0.33.0) --- updated-dependencies: - dependency-name: golang.org/x/term dependency-version: 0.33.0 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 2a07fff4a..1f812b073 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,7 @@ require ( go.opentelemetry.io/otel v1.37.0 golang.org/x/mod v0.25.0 golang.org/x/oauth2 v0.30.0 - golang.org/x/term v0.32.0 + golang.org/x/term v0.33.0 google.golang.org/grpc v1.73.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -334,7 +334,7 @@ require ( golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect golang.org/x/net v0.39.0 // indirect golang.org/x/sync v0.13.0 // indirect - golang.org/x/sys v0.33.0 // indirect + golang.org/x/sys v0.34.0 // indirect golang.org/x/text v0.24.0 // indirect golang.org/x/tools v0.32.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect diff --git a/go.sum b/go.sum index 404d57d78..82c5a8701 100644 --- a/go.sum +++ b/go.sum @@ -1296,8 +1296,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= +golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 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= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1308,8 +1308,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= -golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= +golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= +golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= 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 0d1caf9c48a8f7e5ecd70e96cefbded89f2c08d2 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Thu, 10 Jul 2025 09:40:01 +0200 Subject: [PATCH 278/359] chore: sync API types from infrastructure (#3838) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/client.gen.go | 116 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index 8903bf4b8..f236f9a7a 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -231,6 +231,9 @@ type ClientInterface interface { V1CreateABranch(ctx context.Context, ref string, body V1CreateABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetABranch request + V1GetABranch(ctx context.Context, ref string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1DeleteProjectClaimToken request V1DeleteProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1164,6 +1167,18 @@ func (c *Client) V1CreateABranch(ctx context.Context, ref string, body V1CreateA return c.Client.Do(req) } +func (c *Client) V1GetABranch(ctx context.Context, ref string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetABranchRequest(c.Server, ref, name) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1DeleteProjectClaimToken(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1DeleteProjectClaimTokenRequest(c.Server, ref) if err != nil { @@ -4556,6 +4571,47 @@ func NewV1CreateABranchRequestWithBody(server string, ref string, contentType st return req, nil } +// NewV1GetABranchRequest generates requests for V1GetABranch +func NewV1GetABranchRequest(server string, ref string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/branches/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1DeleteProjectClaimTokenRequest generates requests for V1DeleteProjectClaimToken func NewV1DeleteProjectClaimTokenRequest(server string, ref string) (*http.Request, error) { var err error @@ -8636,6 +8692,9 @@ type ClientWithResponsesInterface interface { V1CreateABranchWithResponse(ctx context.Context, ref string, body V1CreateABranchJSONRequestBody, reqEditors ...RequestEditorFn) (*V1CreateABranchResponse, error) + // V1GetABranchWithResponse request + V1GetABranchWithResponse(ctx context.Context, ref string, name string, reqEditors ...RequestEditorFn) (*V1GetABranchResponse, error) + // V1DeleteProjectClaimTokenWithResponse request V1DeleteProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeleteProjectClaimTokenResponse, error) @@ -9807,6 +9866,28 @@ func (r V1CreateABranchResponse) StatusCode() int { return 0 } +type V1GetABranchResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *BranchResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetABranchResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetABranchResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1DeleteProjectClaimTokenResponse struct { Body []byte HTTPResponse *http.Response @@ -12126,6 +12207,15 @@ func (c *ClientWithResponses) V1CreateABranchWithResponse(ctx context.Context, r return ParseV1CreateABranchResponse(rsp) } +// V1GetABranchWithResponse request returning *V1GetABranchResponse +func (c *ClientWithResponses) V1GetABranchWithResponse(ctx context.Context, ref string, name string, reqEditors ...RequestEditorFn) (*V1GetABranchResponse, error) { + rsp, err := c.V1GetABranch(ctx, ref, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetABranchResponse(rsp) +} + // V1DeleteProjectClaimTokenWithResponse request returning *V1DeleteProjectClaimTokenResponse func (c *ClientWithResponses) V1DeleteProjectClaimTokenWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1DeleteProjectClaimTokenResponse, error) { rsp, err := c.V1DeleteProjectClaimToken(ctx, ref, reqEditors...) @@ -14082,6 +14172,32 @@ func ParseV1CreateABranchResponse(rsp *http.Response) (*V1CreateABranchResponse, return response, nil } +// ParseV1GetABranchResponse parses an HTTP response from a V1GetABranchWithResponse call +func ParseV1GetABranchResponse(rsp *http.Response) (*V1GetABranchResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetABranchResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BranchResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseV1DeleteProjectClaimTokenResponse parses an HTTP response from a V1DeleteProjectClaimTokenWithResponse call func ParseV1DeleteProjectClaimTokenResponse(rsp *http.Response) (*V1DeleteProjectClaimTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) From c0852c00aeb5a2ca0124b31c44055ef06d243e52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 04:34:43 +0000 Subject: [PATCH 279/359] chore(deps): bump github.com/docker/cli from 28.3.1+incompatible to 28.3.2+incompatible (#3842) chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.3.1+incompatible to 28.3.2+incompatible. - [Commits](https://github.com/docker/cli/compare/v28.3.1...v28.3.2) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-version: 28.3.2+incompatible 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 1f812b073..4c1badfc9 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.63.1 - github.com/docker/cli v28.3.1+incompatible + github.com/docker/cli v28.3.2+incompatible github.com/docker/docker v28.3.2+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 diff --git a/go.sum b/go.sum index 82c5a8701..3eacb6021 100644 --- a/go.sum +++ b/go.sum @@ -237,8 +237,8 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v28.3.1+incompatible h1:ZUdwOLDEBoE3TE5rdC9IXGY5HPHksJK3M+hJEWhh2mc= -github.com/docker/cli v28.3.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.3.2+incompatible h1:mOt9fcLE7zaACbxW1GeS65RI67wIJrTnqS3hP2huFsY= +github.com/docker/cli v28.3.2+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= From e40792e0d18f9c6e4347626e4ae6da4d5e22fcb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 05:03:39 +0000 Subject: [PATCH 280/359] chore(deps): bump supabase/postgres from 17.4.1.053 to 17.4.1.054 in /pkg/config/templates (#3844) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.053 to 17.4.1.054. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.054 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index f1db0e405..a4ba9a38b 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.053 AS pg +FROM supabase/postgres:17.4.1.054 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 3167da15ccabdd7ffda73680fd066f0e0bde01be Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Mon, 14 Jul 2025 08:02:07 +0200 Subject: [PATCH 281/359] chore: sync API types from infrastructure (#3845) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/types.gen.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 57d2cba1c..894c96463 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -2783,10 +2783,14 @@ type V1OrganizationSlugResponsePlan string // V1PgbouncerConfigResponse defines model for V1PgbouncerConfigResponse. type V1PgbouncerConfigResponse struct { ConnectionString *string `json:"connection_string,omitempty"` - DefaultPoolSize *float32 `json:"default_pool_size,omitempty"` + DefaultPoolSize *int `json:"default_pool_size,omitempty"` IgnoreStartupParameters *string `json:"ignore_startup_parameters,omitempty"` - MaxClientConn *float32 `json:"max_client_conn,omitempty"` + MaxClientConn *int `json:"max_client_conn,omitempty"` PoolMode *V1PgbouncerConfigResponsePoolMode `json:"pool_mode,omitempty"` + QueryWaitTimeout *int `json:"query_wait_timeout,omitempty"` + ReservePoolSize *int `json:"reserve_pool_size,omitempty"` + ServerIdleTimeout *int `json:"server_idle_timeout,omitempty"` + ServerLifetime *int `json:"server_lifetime,omitempty"` } // V1PgbouncerConfigResponsePoolMode defines model for V1PgbouncerConfigResponse.PoolMode. From 1db6f372392f559f739994d47ec0c0bb41115eb8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 14:20:10 +0800 Subject: [PATCH 282/359] chore(deps): bump golang.org/x/mod from 0.25.0 to 0.26.0 (#3843) Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.25.0 to 0.26.0. - [Commits](https://github.com/golang/mod/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-version: 0.26.0 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 | 12 ++++++------ go.sum | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 4c1badfc9..a519fa707 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/withfig/autocomplete-tools/packages/cobra v1.2.0 github.com/zalando/go-keyring v0.2.6 go.opentelemetry.io/otel v1.37.0 - golang.org/x/mod v0.25.0 + golang.org/x/mod v0.26.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.33.0 google.golang.org/grpc v1.73.0 @@ -330,13 +330,13 @@ 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/crypto v0.37.0 // indirect + golang.org/x/crypto v0.39.0 // indirect golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect - golang.org/x/net v0.39.0 // indirect - golang.org/x/sync v0.13.0 // indirect + golang.org/x/net v0.41.0 // indirect + golang.org/x/sync v0.15.0 // indirect golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.24.0 // indirect - golang.org/x/tools v0.32.0 // indirect + golang.org/x/text v0.26.0 // indirect + golang.org/x/tools v0.34.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect google.golang.org/protobuf v1.36.6 // indirect diff --git a/go.sum b/go.sum index 3eacb6021..e84f18729 100644 --- a/go.sum +++ b/go.sum @@ -1107,8 +1107,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1154,8 +1154,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= -golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1203,8 +1203,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= -golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1228,8 +1228,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1324,8 +1324,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1395,8 +1395,8 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= -golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= -golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 1ca4d8efcac48bd6497fbae946b24e17d4b45f6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 06:25:52 +0000 Subject: [PATCH 283/359] chore(deps): bump supabase/realtime from v2.40.3 to v2.40.5 in /pkg/config/templates (#3849) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.40.3 to v2.40.5. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.40.5 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index a4ba9a38b..557be5aa1 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.40.3 AS realtime +FROM supabase/realtime:v2.40.5 AS realtime FROM supabase/storage-api:v1.25.3 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 0f9af3b74292ca11bbfb49ae40a5895acc162ee6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 06:31:02 +0000 Subject: [PATCH 284/359] chore(deps): bump supabase/postgres from 17.4.1.054 to 17.4.1.055 in /pkg/config/templates (#3850) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.054 to 17.4.1.055. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.055 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 557be5aa1..039d602cf 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.054 AS pg +FROM supabase/postgres:17.4.1.055 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 3c96a2b37638e801a13a4faca5793f2fc42d2c67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 06:36:05 +0000 Subject: [PATCH 285/359] chore(deps): bump supabase/storage-api from v1.25.3 to v1.25.7 in /pkg/config/templates (#3851) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.25.3 to v1.25.7. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.25.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 039d602cf..eb46e08e4 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.40.5 AS realtime -FROM supabase/storage-api:v1.25.3 AS storage +FROM supabase/storage-api:v1.25.7 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 29ed4d3caac406969fe7d65a19047cce426bcf3b Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 14 Jul 2025 18:17:55 +0800 Subject: [PATCH 286/359] fix: delete all buckets with storage rm (#3853) --- cmd/storage.go | 1 - internal/storage/rm/rm.go | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cmd/storage.go b/cmd/storage.go index 3e6eb8fea..aa3876e92 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -70,7 +70,6 @@ cp -r ss:///bucket/docs . Example: `rm -r ss:///bucket/docs rm ss:///bucket/docs/example.md ss:///bucket/readme.md `, - Args: cobra.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { return rm.Run(cmd.Context(), args, recursive, afero.NewOsFs()) }, diff --git a/internal/storage/rm/rm.go b/internal/storage/rm/rm.go index 720bbce02..56e55a797 100644 --- a/internal/storage/rm/rm.go +++ b/internal/storage/rm/rm.go @@ -49,9 +49,22 @@ func Run(ctx context.Context, paths []string, recursive bool, fsys afero.Fs) err if err != nil { return err } + if len(groups) == 0 { + if !recursive { + return errors.New(errMissingFlag) + } + buckets, err := api.ListBuckets(ctx) + if err != nil { + return err + } + for _, b := range buckets { + groups[b.Name] = []string{""} + } + } + console := utils.NewConsole() for bucket, prefixes := range groups { confirm := fmt.Sprintf("Confirm deleting files in bucket %v?", utils.Bold(bucket)) - if shouldDelete, err := utils.NewConsole().PromptYesNo(ctx, confirm, false); err != nil { + if shouldDelete, err := console.PromptYesNo(ctx, confirm, false); err != nil { return err } else if !shouldDelete { continue From 61a5a67ad7b532c10ffb3190c925f5a858b58e23 Mon Sep 17 00:00:00 2001 From: yyh-gl Date: Mon, 14 Jul 2025 21:40:20 +0900 Subject: [PATCH 287/359] fix: `bootstrap` command for creation scratch project (#3848) --- internal/bootstrap/bootstrap.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index ac04146fe..311ad5534 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -78,8 +78,10 @@ func Run(ctx context.Context, starter StarterTemplate, fsys afero.Fs, options .. } // 2. Create project params := api.V1CreateProjectBody{ - Name: filepath.Base(workdir), - TemplateUrl: &starter.Url, + Name: filepath.Base(workdir), + } + if len(starter.Url) > 0 { + params.TemplateUrl = &starter.Url } if err := create.Run(ctx, params, fsys); err != nil { return err From e09251212416323408c80de174d544253be70777 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 11:38:13 +0800 Subject: [PATCH 288/359] chore(deps): bump golang.org/x/mod from 0.25.0 to 0.26.0 in /pkg (#3837) Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.25.0 to 0.26.0. - [Commits](https://github.com/golang/mod/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-version: 0.26.0 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> --- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/go.mod b/pkg/go.mod index e722b673a..118444742 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -25,7 +25,7 @@ require ( github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 github.com/tidwall/jsonc v0.3.2 - golang.org/x/mod v0.25.0 + golang.org/x/mod v0.26.0 google.golang.org/grpc v1.73.0 ) diff --git a/pkg/go.sum b/pkg/go.sum index 6086ffd66..11ee9235a 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -226,8 +226,8 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= -golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= From 1405873bf492362007ba6b5ca85eb57e4f0c08d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 11:38:49 +0800 Subject: [PATCH 289/359] chore(deps): bump supabase/studio from 2025.07.07-sha-1d3b0ba to 2025.07.14-sha-80b9b6f in /pkg/config/templates (#3852) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.07.07-sha-1d3b0ba to 2025.07.14-sha-80b9b6f. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.07.14-sha-80b9b6f dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index eb46e08e4..160f2af17 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.91.0 AS pgmeta -FROM supabase/studio:2025.07.07-sha-1d3b0ba AS studio +FROM supabase/studio:2025.07.14-sha-80b9b6f AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From f0eba06831dcf2e688c09541278ab0aeea194c41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 06:28:59 +0000 Subject: [PATCH 290/359] chore(deps): bump supabase/realtime from v2.40.5 to v2.40.10 in /pkg/config/templates (#3855) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.40.5 to v2.40.10. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.40.10 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 160f2af17..b097caffe 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.40.5 AS realtime +FROM supabase/realtime:v2.40.10 AS realtime FROM supabase/storage-api:v1.25.7 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From c03f23974f3acbcefc16d0f066ef3613630d8280 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 08:43:00 +0000 Subject: [PATCH 291/359] chore(deps): bump supabase/storage-api from v1.25.7 to v1.25.8 in /pkg/config/templates (#3857) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.25.7 to v1.25.8. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.25.8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index b097caffe..f41d8f340 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.40.10 AS realtime -FROM supabase/storage-api:v1.25.7 AS storage +FROM supabase/storage-api:v1.25.8 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From befd3d412cb3d97bdd42fdbfa7a9b2deea7e3a05 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 08:48:10 +0000 Subject: [PATCH 292/359] chore(deps): bump supabase/postgres-meta from v0.91.0 to v0.91.1 in /pkg/config/templates (#3856) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.91.0 to v0.91.1. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.91.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index f41d8f340..7ea648da1 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.055 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.91.0 AS pgmeta +FROM supabase/postgres-meta:v0.91.1 AS pgmeta FROM supabase/studio:2025.07.14-sha-80b9b6f AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.67.4 AS edgeruntime From dd543202069c27108f3599c9779d96dbc392f8a9 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 15 Jul 2025 17:34:12 +0800 Subject: [PATCH 293/359] fix: validate jwt secret is at least 16 characters (#3859) --- pkg/config/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index 38db3d50f..83f8f22a3 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -585,6 +585,9 @@ func (c *config) Load(path string, fsys fs.FS) error { return err } // Generate JWT tokens + if len(c.Auth.JwtSecret.Value) < 16 { + return errors.Errorf("Invalid config for auth.jwt_secret. Must be at least 16 characters") + } if len(c.Auth.AnonKey.Value) == 0 { anonToken := CustomClaims{Role: "anon"}.NewToken() if signed, err := anonToken.SignedString([]byte(c.Auth.JwtSecret.Value)); err != nil { From 5314351c2ea37ac9a76a1ee43a8bc80fae840a83 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 15 Jul 2025 20:59:51 +0800 Subject: [PATCH 294/359] fix: handle deno import url separately (#3860) --- pkg/function/deno.go | 17 +++++++++-------- pkg/function/deno_test.go | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pkg/function/deno.go b/pkg/function/deno.go index bcc77a3de..ec785c246 100644 --- a/pkg/function/deno.go +++ b/pkg/function/deno.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "io/fs" + "net/url" "os" "path" "path/filepath" @@ -54,7 +55,7 @@ func (m *ImportMap) Load(imPath string, fsys fs.FS, opts ...func(string, io.Read if err := m.Parse(data); err != nil { return err } - if err := m.Resolve(imPath, fsys); err != nil { + if err := m.Resolve(imPath); err != nil { return err } for _, apply := range opts { @@ -74,29 +75,29 @@ func (m *ImportMap) Parse(data []byte) error { return nil } -func (m *ImportMap) Resolve(imPath string, fsys fs.FS) error { +func (m *ImportMap) Resolve(imPath string) error { // Resolve all paths relative to current file for k, v := range m.Imports { - m.Imports[k] = resolveHostPath(imPath, v, fsys) + m.Imports[k] = resolveHostPath(imPath, v) } for module, mapping := range m.Scopes { for k, v := range mapping { - m.Scopes[module][k] = resolveHostPath(imPath, v, fsys) + m.Scopes[module][k] = resolveHostPath(imPath, v) } } return nil } -func resolveHostPath(jsonPath, hostPath string, fsys fs.FS) string { +func resolveHostPath(jsonPath, hostPath string) string { // Leave absolute paths unchanged if path.IsAbs(hostPath) { return hostPath } - resolved := path.Join(path.Dir(jsonPath), hostPath) - if _, err := fs.Stat(fsys, filepath.FromSlash(resolved)); err != nil { - // Leave URLs unchanged + // Leave URLs unchanged + if parsed, err := url.Parse(hostPath); err == nil && len(parsed.Scheme) > 0 { return hostPath } + resolved := path.Join(path.Dir(jsonPath), hostPath) // Directory imports need to be suffixed with / // Ref: https://deno.com/manual@v1.33.0/basics/import_maps if strings.HasSuffix(hostPath, "/") { diff --git a/pkg/function/deno_test.go b/pkg/function/deno_test.go index efa08c08d..ee3ac7795 100644 --- a/pkg/function/deno_test.go +++ b/pkg/function/deno_test.go @@ -58,7 +58,7 @@ func TestImportPaths(t *testing.T) { im := ImportMap{Imports: map[string]string{ "module-name/": "../shared/", }} - assert.NoError(t, im.Resolve("testdata/modules/deno.json", testImports)) + assert.NoError(t, im.Resolve("testdata/modules/deno.json")) // Run test err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) // Check error @@ -79,7 +79,7 @@ func TestImportPaths(t *testing.T) { im := ImportMap{Imports: map[string]string{ "module-name/": "./shared/", }} - assert.NoError(t, im.Resolve("testdata/import_map.json", testImports)) + assert.NoError(t, im.Resolve("testdata/import_map.json")) // Run test err := im.WalkImportPaths("testdata/modules/imports.ts", fsys.ReadFile) // Check error @@ -116,7 +116,7 @@ func TestResolveImports(t *testing.T) { assert.Equal(t, "./common", resolved.Imports["root"]) assert.Equal(t, "./supabase/tests", resolved.Imports["parent"]) assert.Equal(t, "./supabase/functions/child/", resolved.Imports["child"]) - assert.Equal(t, "../missing", resolved.Imports["missing"]) + assert.Equal(t, "./supabase/missing", resolved.Imports["missing"]) }) t.Run("resolves parent scopes", func(t *testing.T) { From 8c392d91cdc394e76422f786716dd5b47e3f5de6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 04:34:30 +0000 Subject: [PATCH 295/359] chore(deps): bump supabase/realtime from v2.40.10 to v2.41.0 in /pkg/config/templates (#3865) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.40.10 to v2.41.0. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 7ea648da1..3d907c274 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.67.4 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.40.10 AS realtime +FROM supabase/realtime:v2.41.0 AS realtime FROM supabase/storage-api:v1.25.8 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From b0a237d5d10910014482dcfa912bc35bee53af76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 04:39:32 +0000 Subject: [PATCH 296/359] chore(deps): bump supabase/postgres from 17.4.1.055 to 17.4.1.056 in /pkg/config/templates (#3864) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.055 to 17.4.1.056. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.056 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 3d907c274..5ac535db7 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.055 AS pg +FROM supabase/postgres:17.4.1.056 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From a1b9459ac2b54ca6973c653a95a53ad7c208deca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 04:48:58 +0000 Subject: [PATCH 297/359] chore(deps): bump github.com/spf13/pflag from 1.0.6 to 1.0.7 (#3871) Bumps [github.com/spf13/pflag](https://github.com/spf13/pflag) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/spf13/pflag/releases) - [Commits](https://github.com/spf13/pflag/compare/v1.0.6...v1.0.7) --- updated-dependencies: - dependency-name: github.com/spf13/pflag dependency-version: 1.0.7 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 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a519fa707..ec67deac9 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/slack-go/slack v0.17.3 github.com/spf13/afero v1.14.0 github.com/spf13/cobra v1.9.1 - github.com/spf13/pflag v1.0.6 + github.com/spf13/pflag v1.0.7 github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 github.com/stripe/pg-schema-diff v0.9.0 diff --git a/go.sum b/go.sum index e84f18729..1552da9c7 100644 --- a/go.sum +++ b/go.sum @@ -926,8 +926,9 @@ github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wx github.com/spf13/jwalterweatherman v0.0.0-20141219030609-3d60171a6431/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.0/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M= +github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v0.0.0-20150530192845-be5ff3e4840c/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= From aee7ff7ac53609e8453a46aff95739f7024b664b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 04:54:50 +0000 Subject: [PATCH 298/359] chore(deps): bump google.golang.org/grpc from 1.73.0 to 1.74.0 (#3870) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.73.0 to 1.74.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.73.0...v1.74.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.74.0 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 ec67deac9..b9defdeb0 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( golang.org/x/mod v0.26.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.33.0 - google.golang.org/grpc v1.73.0 + google.golang.org/grpc v1.74.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -322,8 +322,8 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect go.opentelemetry.io/otel/metric v1.37.0 // indirect - go.opentelemetry.io/otel/sdk v1.35.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect + go.opentelemetry.io/otel/sdk v1.36.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.36.0 // indirect go.opentelemetry.io/otel/trace v1.37.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.uber.org/atomic v1.9.0 // indirect @@ -337,8 +337,8 @@ require ( golang.org/x/sys v0.34.0 // indirect golang.org/x/text v0.26.0 // indirect golang.org/x/tools v0.34.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 1552da9c7..da155ea7c 100644 --- a/go.sum +++ b/go.sum @@ -1059,10 +1059,10 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 h1:BEj3S go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0/go.mod h1:9cKLGBDzI/F3NoHLQGm4ZrYdIHsvGt6ej6hUowxY0J4= go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= -go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= -go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= -go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= -go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= +go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs= +go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY= +go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis= +go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4= go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= @@ -1455,10 +1455,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-20250324211829-b45e905df463 h1:hE3bRWtU6uceqlh4fhrSnUyjKHMKB9KrTLLG+bc0ddM= -google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463/go.mod h1:U90ffi8eUL9MwPcrJylN5+Mk2v3vuPDptd5yyNUiRR8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a h1:SGktgSolFCo75dnHJF2yMvnns6jCmHFJ0vE4Vn2JKvQ= +google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a/go.mod h1:a77HrdMjoeKbnd2jmgcWdaS++ZLZAEq3orIOAEIKiVw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= 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= @@ -1472,8 +1472,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.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= -google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= +google.golang.org/grpc v1.74.0 h1:sxRSkyLxlceWQiqDofxDot3d4u7DyoHPc7SBXMj8gGY= +google.golang.org/grpc v1.74.0/go.mod h1:NZUaK8dAMUfzhK6uxZ+9511LtOrk73UGWOFoNvz7z+s= 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 4de951da0e733f37c0d11143e43d3ecae2b48564 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 05:16:49 +0000 Subject: [PATCH 299/359] chore(deps): bump supabase/edge-runtime from v1.67.4 to v1.68.0 in /pkg/config/templates (#3874) chore(deps): bump supabase/edge-runtime in /pkg/config/templates Bumps supabase/edge-runtime from v1.67.4 to v1.68.0. --- updated-dependencies: - dependency-name: supabase/edge-runtime dependency-version: v1.68.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5ac535db7..7813522d6 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -7,7 +7,7 @@ FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.91.1 AS pgmeta FROM supabase/studio:2025.07.14-sha-80b9b6f AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy -FROM supabase/edge-runtime:v1.67.4 AS edgeruntime +FROM supabase/edge-runtime:v1.68.0 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue From dd9d9dc652d6c89cbeef55c1c14a854a9d6465d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 05:21:59 +0000 Subject: [PATCH 300/359] chore(deps): bump supabase/postgres from 17.4.1.056 to 17.4.1.058 in /pkg/config/templates (#3873) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.056 to 17.4.1.058. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.058 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 7813522d6..4106e2367 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.056 AS pg +FROM supabase/postgres:17.4.1.058 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From bf5db84f7a8a6aa3e4977468d9cd68db58bdab97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 05:27:19 +0000 Subject: [PATCH 301/359] chore(deps): bump supabase/realtime from v2.41.0 to v2.41.2 in /pkg/config/templates (#3875) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.41.0 to v2.41.2. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 4106e2367..fdc5f2703 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.68.0 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.41.0 AS realtime +FROM supabase/realtime:v2.41.2 AS realtime FROM supabase/storage-api:v1.25.8 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From c1f3ba8c8dee8e05eb50c40bd3b1db43d8b5d609 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 04:43:51 +0000 Subject: [PATCH 302/359] chore(deps): bump supabase/storage-api from v1.25.8 to v1.25.9 in /pkg/config/templates (#3883) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.25.8 to v1.25.9. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.25.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index fdc5f2703..5281ad121 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.41.2 AS realtime -FROM supabase/storage-api:v1.25.8 AS storage +FROM supabase/storage-api:v1.25.9 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 9af2fe596378dae0e730fe0c518e1315b0ace9d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 04:49:16 +0000 Subject: [PATCH 303/359] chore(deps): bump supabase/postgres from 17.4.1.058 to 17.4.1.059 in /pkg/config/templates (#3882) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.058 to 17.4.1.059. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.059 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5281ad121..d725d8819 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.058 AS pg +FROM supabase/postgres:17.4.1.059 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 06e8ee31a8bc47b820aa5c4e551a2128dee37cde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 13:31:51 +0800 Subject: [PATCH 304/359] chore(deps): bump github.com/go-viper/mapstructure/v2 from 2.3.0 to 2.4.0 in /pkg (#3866) * chore(deps): bump github.com/go-viper/mapstructure/v2 in /pkg --- updated-dependencies: - dependency-name: github.com/go-viper/mapstructure/v2 dependency-version: 2.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: bump main package dep --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han --- go.mod | 2 +- go.sum | 4 ++-- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index b9defdeb0..b80e31949 100644 --- a/go.mod +++ b/go.mod @@ -146,7 +146,7 @@ require ( github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect github.com/go-toolsmith/typep v1.1.0 // indirect - github.com/go-viper/mapstructure/v2 v2.3.0 // indirect + github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.12.1 // indirect diff --git a/go.sum b/go.sum index da155ea7c..56321e098 100644 --- a/go.sum +++ b/go.sum @@ -361,8 +361,8 @@ github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQi github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= -github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= -github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUWY= github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= diff --git a/pkg/go.mod b/pkg/go.mod index 118444742..4e9e2592c 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -9,7 +9,7 @@ require ( github.com/docker/go-units v0.5.0 github.com/ecies/go/v2 v2.0.11 github.com/go-errors/errors v1.5.1 - github.com/go-viper/mapstructure/v2 v2.3.0 + github.com/go-viper/mapstructure/v2 v2.4.0 github.com/golang-jwt/jwt/v5 v5.2.2 github.com/h2non/gock v1.2.0 github.com/jackc/pgconn v1.14.3 diff --git a/pkg/go.sum b/pkg/go.sum index 11ee9235a..6fc22ca31 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -36,8 +36,8 @@ github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3Bop github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= -github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= From 58468c0b77e983cd589817095ff5050a2ba71fde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 13:32:47 +0800 Subject: [PATCH 305/359] chore(deps): bump github.com/oapi-codegen/runtime from 1.1.1 to 1.1.2 in /pkg (#3868) * chore(deps): bump github.com/oapi-codegen/runtime in /pkg --- updated-dependencies: - dependency-name: github.com/oapi-codegen/runtime dependency-version: 1.1.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore: bump main package dep --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han --- go.mod | 2 +- go.sum | 4 ++-- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index b80e31949..480ff5c6d 100644 --- a/go.mod +++ b/go.mod @@ -242,7 +242,7 @@ require ( github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.19.1 // indirect github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 // indirect - github.com/oapi-codegen/runtime v1.1.1 // indirect + github.com/oapi-codegen/runtime v1.1.2 // indirect github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect diff --git a/go.sum b/go.sum index 56321e098..36c951128 100644 --- a/go.sum +++ b/go.sum @@ -753,8 +753,8 @@ github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/ github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY= github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 h1:ykgG34472DWey7TSjd8vIfNykXgjOgYJZoQbKfEeY/Q= github.com/oapi-codegen/oapi-codegen/v2 v2.4.1/go.mod h1:N5+lY1tiTDV3V1BeHtOxeWXHoPVeApvsvjJqegfoaz8= -github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= -github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= +github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI= +github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY= github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw= github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c= diff --git a/pkg/go.mod b/pkg/go.mod index 4e9e2592c..c8b7136e5 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -20,7 +20,7 @@ require ( github.com/jackc/pgx/v4 v4.18.3 github.com/joho/godotenv v1.5.1 github.com/oapi-codegen/nullable v1.1.0 - github.com/oapi-codegen/runtime v1.1.1 + github.com/oapi-codegen/runtime v1.1.2 github.com/spf13/afero v1.14.0 github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 diff --git a/pkg/go.sum b/pkg/go.sum index 6fc22ca31..ec8ab88e4 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -132,8 +132,8 @@ github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs= github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY= -github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= -github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= +github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI= +github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= From 265675ed4fcacd052e514ba503c76251ba0b5c42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 13:33:01 +0800 Subject: [PATCH 306/359] chore(deps): bump google.golang.org/grpc from 1.73.0 to 1.74.0 in /pkg (#3869) * chore(deps): bump google.golang.org/grpc from 1.73.0 to 1.74.0 in /pkg Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.73.0 to 1.74.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.73.0...v1.74.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.74.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: bump main package dep --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han --- pkg/go.mod | 6 +++--- pkg/go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/go.mod b/pkg/go.mod index c8b7136e5..40341dd3b 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -26,7 +26,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/tidwall/jsonc v0.3.2 golang.org/x/mod v0.26.0 - google.golang.org/grpc v1.73.0 + google.golang.org/grpc v1.74.0 ) require ( @@ -53,8 +53,8 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.9.0 // indirect - golang.org/x/crypto v0.37.0 // indirect + golang.org/x/crypto v0.38.0 // indirect golang.org/x/sys v0.33.0 // indirect - golang.org/x/text v0.24.0 // indirect + golang.org/x/text v0.25.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/go.sum b/pkg/go.sum index ec8ab88e4..751285857 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -219,8 +219,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= +golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -274,8 +274,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= +golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -292,8 +292,8 @@ golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= -google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= +google.golang.org/grpc v1.74.0 h1:sxRSkyLxlceWQiqDofxDot3d4u7DyoHPc7SBXMj8gGY= +google.golang.org/grpc v1.74.0/go.mod h1:NZUaK8dAMUfzhK6uxZ+9511LtOrk73UGWOFoNvz7z+s= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From ff2aa9567deafb114f7f5264ccd0482b310a4d92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 14:08:49 +0800 Subject: [PATCH 307/359] chore(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.2 to 5.2.3 in /pkg (#3867) * chore(deps): bump github.com/golang-jwt/jwt/v5 in /pkg --- updated-dependencies: - dependency-name: github.com/golang-jwt/jwt/v5 dependency-version: 5.2.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore: bump main package dep --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han Co-authored-by: Han Qiao --- go.mod | 2 +- go.sum | 4 ++-- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 480ff5c6d..b6c0b9434 100644 --- a/go.mod +++ b/go.mod @@ -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.2 // indirect + github.com/golang-jwt/jwt/v5 v5.2.3 // 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 diff --git a/go.sum b/go.sum index 36c951128..1f841853b 100644 --- a/go.sum +++ b/go.sum @@ -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.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +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-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= diff --git a/pkg/go.mod b/pkg/go.mod index 40341dd3b..1b44d056c 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -10,7 +10,7 @@ require ( github.com/ecies/go/v2 v2.0.11 github.com/go-errors/errors v1.5.1 github.com/go-viper/mapstructure/v2 v2.4.0 - github.com/golang-jwt/jwt/v5 v5.2.2 + github.com/golang-jwt/jwt/v5 v5.2.3 github.com/h2non/gock v1.2.0 github.com/jackc/pgconn v1.14.3 github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 diff --git a/pkg/go.sum b/pkg/go.sum index 751285857..981620239 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -40,8 +40,8 @@ github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9L github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +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/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= From cb775cb1d684152cf799d556dc8d43819e211c93 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 18 Jul 2025 14:11:04 +0800 Subject: [PATCH 308/359] fix: escape drop schema statements (#3877) --- internal/migration/down/down_test.go | 18 +++--------------- pkg/migration/drop.go | 18 ------------------ pkg/migration/drop_test.go | 24 ++---------------------- pkg/migration/queries/drop.sql | 15 +++++++++++++++ pkg/migration/queries/list.sql | 7 ++----- 5 files changed, 22 insertions(+), 60 deletions(-) diff --git a/internal/migration/down/down_test.go b/internal/migration/down/down_test.go index e8d08b806..76baefe97 100644 --- a/internal/migration/down/down_test.go +++ b/internal/migration/down/down_test.go @@ -76,8 +76,6 @@ func TestMigrationsDown(t *testing.T) { }) } -var escapedSchemas = append(migration.ManagedSchemas, "extensions", "public") - func TestResetRemote(t *testing.T) { t.Run("resets remote database", func(t *testing.T) { // Setup in-memory fs @@ -87,11 +85,7 @@ func TestResetRemote(t *testing.T) { // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(migration.ListSchemas, escapedSchemas). - Reply("SELECT 1", []interface{}{"private"}). - Query("DROP SCHEMA IF EXISTS private CASCADE"). - Reply("DROP SCHEMA"). - Query(migration.DropObjects). + conn.Query(migration.DropObjects). Reply("INSERT 0") helper.MockMigrationHistory(conn). Query(migration.INSERT_MIGRATION_VERSION, "0", "schema", nil). @@ -113,11 +107,7 @@ func TestResetRemote(t *testing.T) { // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(migration.ListSchemas, escapedSchemas). - Reply("SELECT 1", []interface{}{"private"}). - Query("DROP SCHEMA IF EXISTS private CASCADE"). - Reply("DROP SCHEMA"). - Query(migration.DropObjects). + conn.Query(migration.DropObjects). Reply("INSERT 0") helper.MockMigrationHistory(conn). Query(migration.INSERT_MIGRATION_VERSION, "0", "schema", nil). @@ -135,9 +125,7 @@ func TestResetRemote(t *testing.T) { // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(migration.ListSchemas, escapedSchemas). - Reply("SELECT 0"). - Query(migration.DropObjects). + conn.Query(migration.DropObjects). ReplyError(pgerrcode.InsufficientPrivilege, "permission denied for relation supabase_migrations") // Run test err := ResetAll(context.Background(), "", conn.MockClient(t), fsys) diff --git a/pkg/migration/drop.go b/pkg/migration/drop.go index 4fcdd805c..aa44407ca 100644 --- a/pkg/migration/drop.go +++ b/pkg/migration/drop.go @@ -3,7 +3,6 @@ package migration import ( "context" _ "embed" - "fmt" "github.com/go-errors/errors" "github.com/jackc/pgx/v4" @@ -33,24 +32,7 @@ var ( ) func DropUserSchemas(ctx context.Context, conn *pgx.Conn) error { - // Only drop objects in extensions and public schema - excludes := append(ManagedSchemas, - "extensions", - "public", - ) - userSchemas, err := ListUserSchemas(ctx, conn, excludes...) - if err != nil { - return err - } - // Drop all user defined schemas migration := MigrationFile{} - for _, schema := range userSchemas { - sql := fmt.Sprintf("DROP SCHEMA IF EXISTS %s CASCADE", schema) - migration.Statements = append(migration.Statements, sql) - } - // If an extension uses a schema it doesn't create, dropping the schema will cascade to also - // drop the extension. But if an extension creates its own schema, dropping the schema will - // throw an error. Hence, we drop the extension instead so it cascades to its own schema. migration.Statements = append(migration.Statements, DropObjects) return migration.ExecBatch(ctx, conn) } diff --git a/pkg/migration/drop_test.go b/pkg/migration/drop_test.go index d2c25ed56..644fb69be 100644 --- a/pkg/migration/drop_test.go +++ b/pkg/migration/drop_test.go @@ -9,18 +9,12 @@ import ( "github.com/supabase/cli/pkg/pgtest" ) -var escapedSchemas = append(ManagedSchemas, "extensions", "public") - func TestDropSchemas(t *testing.T) { t.Run("resets remote database", func(t *testing.T) { // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(ListSchemas, escapedSchemas). - Reply("SELECT 1", []interface{}{"private"}). - Query("DROP SCHEMA IF EXISTS private CASCADE"). - Reply("DROP SCHEMA"). - Query(DropObjects). + conn.Query(DropObjects). Reply("INSERT 0") // Run test err := DropUserSchemas(context.Background(), conn.MockClient(t)) @@ -28,25 +22,11 @@ func TestDropSchemas(t *testing.T) { assert.NoError(t, err) }) - t.Run("throws error on list schema failure", func(t *testing.T) { - // Setup mock postgres - conn := pgtest.NewConn() - defer conn.Close(t) - conn.Query(ListSchemas, escapedSchemas). - ReplyError(pgerrcode.InsufficientPrivilege, "permission denied for relation information_schema") - // Run test - err := DropUserSchemas(context.Background(), conn.MockClient(t)) - // Check error - assert.ErrorContains(t, err, "ERROR: permission denied for relation information_schema (SQLSTATE 42501)") - }) - t.Run("throws error on drop schema failure", func(t *testing.T) { // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(ListSchemas, escapedSchemas). - Reply("SELECT 0"). - Query(DropObjects). + conn.Query(DropObjects). ReplyError(pgerrcode.InsufficientPrivilege, "permission denied for relation supabase_migrations") // Run test err := DropUserSchemas(context.Background(), conn.MockClient(t)) diff --git a/pkg/migration/queries/drop.sql b/pkg/migration/queries/drop.sql index ff2f1b22b..9ce1c8fbb 100644 --- a/pkg/migration/queries/drop.sql +++ b/pkg/migration/queries/drop.sql @@ -1,6 +1,21 @@ do $$ declare rec record; begin + -- schemas + for rec in + select pn.* + from pg_namespace pn + left join pg_depend pd on pd.objid = pn.oid + where pd.deptype is null + and not pn.nspname like any(array['information\_schema', 'pg\_%', '\_analytics', '\_realtime', '\_supavisor', 'pgbouncer', 'pgmq', 'pgsodium', 'pgtle', 'supabase\_migrations', 'vault', 'extensions', 'public']) + and pn.nspowner::regrole::text != 'supabase_admin' + loop + -- If an extension uses a schema it doesn't create, dropping the schema will cascade to also + -- drop the extension. But if an extension creates its own schema, dropping the schema will + -- throw an error. Hence, we drop schemas first while excluding those created by extensions. + execute format('drop schema if exists %I cascade', rec.nspname); + end loop; + -- extensions for rec in select * diff --git a/pkg/migration/queries/list.sql b/pkg/migration/queries/list.sql index 67f40a3fd..33b7be176 100644 --- a/pkg/migration/queries/list.sql +++ b/pkg/migration/queries/list.sql @@ -3,11 +3,8 @@ -- Supabase managed schemas select pn.nspname from pg_namespace pn -left join pg_depend pd - on pd.objid = pn.oid -join pg_roles r - on pn.nspowner = r.oid +left join pg_depend pd on pd.objid = pn.oid where pd.deptype is null and not pn.nspname like any($1) - and r.rolname != 'supabase_admin' + and pn.nspowner::regrole::text != 'supabase_admin' order by pn.nspname From 9b5886c037fabadef35bfeb3057816a348260f0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 05:05:32 +0000 Subject: [PATCH 309/359] chore(deps): bump github.com/stripe/pg-schema-diff from 0.9.0 to 0.9.1 (#3887) Bumps [github.com/stripe/pg-schema-diff](https://github.com/stripe/pg-schema-diff) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/stripe/pg-schema-diff/releases) - [Commits](https://github.com/stripe/pg-schema-diff/compare/v0.9.0...v0.9.1) --- updated-dependencies: - dependency-name: github.com/stripe/pg-schema-diff dependency-version: 0.9.1 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 b6c0b9434..a35919e01 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/spf13/pflag v1.0.7 github.com/spf13/viper v1.20.1 github.com/stretchr/testify v1.10.0 - github.com/stripe/pg-schema-diff v0.9.0 + github.com/stripe/pg-schema-diff v0.9.1 github.com/supabase/cli/pkg v1.0.0 github.com/tidwall/jsonc v0.3.2 github.com/withfig/autocomplete-tools/packages/cobra v1.2.0 diff --git a/go.sum b/go.sum index 1f841853b..a5ecb0868 100644 --- a/go.sum +++ b/go.sum @@ -955,8 +955,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stripe/pg-schema-diff v0.9.0 h1:qzm2VUdbZ2kYwqxoQqtEP3uLQI0B+ymS947zqFTZGBk= -github.com/stripe/pg-schema-diff v0.9.0/go.mod h1:cl2VC6te/cCTOewTRvv4pYsgQqAOhvRQmatCHfYwy8c= +github.com/stripe/pg-schema-diff v0.9.1 h1:vF8PBxgrTGSxy2qOgRrcjnHGh1rQmE3ZALJNO3Juc8Y= +github.com/stripe/pg-schema-diff v0.9.1/go.mod h1:cl2VC6te/cCTOewTRvv4pYsgQqAOhvRQmatCHfYwy8c= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tdakkota/asciicheck v0.4.1 h1:bm0tbcmi0jezRA2b5kg4ozmMuGAFotKI3RZfrhfovg8= From 67f4b7d7df6062e79ec5818014eb2db810b9b718 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:09:54 +0800 Subject: [PATCH 310/359] chore(deps): bump supabase/studio from 2025.07.14-sha-80b9b6f to 2025.07.21-sha-88dca02 in /pkg/config/templates (#3889) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.07.14-sha-80b9b6f to 2025.07.21-sha-88dca02. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.07.21-sha-88dca02 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index d725d8819..eb0fee1b0 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.91.1 AS pgmeta -FROM supabase/studio:2025.07.14-sha-80b9b6f AS studio +FROM supabase/studio:2025.07.21-sha-88dca02 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.68.0 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From e7033b3e39b33010058e2ce022e2f83bc01028a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:10:08 +0800 Subject: [PATCH 311/359] chore(deps): bump supabase/realtime from v2.41.2 to v2.41.3 in /pkg/config/templates (#3888) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.41.2 to v2.41.3. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index eb0fee1b0..ae8bbfcf8 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.68.0 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.41.2 AS realtime +FROM supabase/realtime:v2.41.3 AS realtime FROM supabase/storage-api:v1.25.9 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From afa8aff46cab520713e3c7261a6e3d7faf26addf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:26:55 +0800 Subject: [PATCH 312/359] chore(deps): bump github.com/containers/common from 0.63.1 to 0.64.0 (#3880) Bumps [github.com/containers/common](https://github.com/containers/common) from 0.63.1 to 0.64.0. - [Release notes](https://github.com/containers/common/releases) - [Commits](https://github.com/containers/common/compare/v0.63.1...v0.64.0) --- updated-dependencies: - dependency-name: github.com/containers/common dependency-version: 0.64.0 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 | 14 +++++++------- go.sum | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index a35919e01..73a360fc5 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/charmbracelet/glamour v0.9.1 github.com/charmbracelet/lipgloss v1.1.0 github.com/containerd/errdefs v1.0.0 - github.com/containers/common v0.63.1 + github.com/containers/common v0.64.0 github.com/docker/cli v28.3.2+incompatible github.com/docker/docker v28.3.2+incompatible github.com/docker/go-connections v0.5.0 @@ -56,7 +56,7 @@ require ( 4d63.com/gocheckcompilerdirectives v1.3.0 // indirect 4d63.com/gochecknoglobals v0.2.2 // indirect al.essio.dev/pkg/shellescape v1.5.1 // indirect - dario.cat/mergo v1.0.1 // indirect + dario.cat/mergo v1.0.2 // indirect github.com/4meepo/tagalign v1.4.2 // indirect github.com/Abirdcfly/dupword v0.1.3 // indirect github.com/Antonboom/errname v1.1.0 // indirect @@ -104,7 +104,7 @@ require ( github.com/cloudflare/circl v1.6.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect - github.com/containers/storage v1.58.0 // indirect + github.com/containers/storage v1.59.0 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/daixiang0/gci v0.13.6 // indirect @@ -316,7 +316,7 @@ require ( go-simpler.org/sloglint v0.11.0 // indirect go.augendre.info/fatcontext v0.8.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect @@ -330,12 +330,12 @@ 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/crypto v0.39.0 // indirect + golang.org/x/crypto v0.40.0 // indirect golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect golang.org/x/net v0.41.0 // indirect - golang.org/x/sync v0.15.0 // indirect + golang.org/x/sync v0.16.0 // indirect golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.26.0 // indirect + golang.org/x/text v0.27.0 // indirect golang.org/x/tools v0.34.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect diff --git a/go.sum b/go.sum index a5ecb0868..1cce30855 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= -dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= +dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/4meepo/tagalign v1.4.2 h1:0hcLHPGMjDyM1gHG58cS73aQF8J4TdVR96TZViorO9E= github.com/4meepo/tagalign v1.4.2/go.mod h1:+p4aMyFM+ra7nb41CnFG6aSDXqRxU/w1VQqScKqDARI= @@ -199,10 +199,10 @@ github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151X github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/containers/common v0.63.1 h1:6g02gbW34PaRVH4Heb2Pk11x0SdbQ+8AfeKKeQGqYBE= -github.com/containers/common v0.63.1/go.mod h1:+3GCotSqNdIqM3sPs152VvW7m5+Mg8Kk+PExT3G9hZw= -github.com/containers/storage v1.58.0 h1:Q7SyyCCjqgT3wYNgRNIL8o/wUS92heIj2/cc8Sewvcc= -github.com/containers/storage v1.58.0/go.mod h1:w7Jl6oG+OpeLGLzlLyOZPkmUso40kjpzgrHUk5tyBlo= +github.com/containers/common v0.64.0 h1:Jdjq1e5tqrLov9tcAVc/AfvQCgX4krhcfDBgOXwrSfw= +github.com/containers/common v0.64.0/go.mod h1:bq2UIiFP8vUJdgM+WN8E8jkD7wF69SpDRGzU7epJljg= +github.com/containers/storage v1.59.0 h1:r2pYSTzQpJTROZbjJQ54Z0GT+rUC6+wHzlSY8yPjsXk= +github.com/containers/storage v1.59.0/go.mod h1:KoAYHnAjP3/cTsRS+mmWZGkufSY2GACiKQ4V3ZLQnR0= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -1045,8 +1045,8 @@ 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.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ= go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 h1:ajl4QczuJVA2TU9W9AGw++86Xga/RKt//16z/yxPgdk= @@ -1108,8 +1108,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= -golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= -golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= +golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= +golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1229,8 +1229,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1325,8 +1325,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= -golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= +golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From cfe8808c5080cc823efde0c4fd0bc21870bc3604 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Mon, 21 Jul 2025 14:31:03 +0800 Subject: [PATCH 313/359] fix: version bump to update studio From 63a8891d75909544fc2016e3cec676b173f6f44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cemal=20K=C4=B1l=C4=B1=C3=A7?= Date: Mon, 21 Jul 2025 15:26:49 +0300 Subject: [PATCH 314/359] feat: support jwt signing keys for local auth (#3841) * feat: add `generate-key` cmd for generating jwt signing keys * chore: default formatting as json * feat: add jwt_keys env variable to auth if configured * chore: `go generate` * chore: separate block for jwt config * chore: rename cmd to `signing-key` * feat: include precomputed fields for rsa key * chore: gofmt * feat: use file-based approach for signing keys * feat: use file-based approach for JWT signing keys * chore: address PR comments * chore: update command short text * fix: unit tests * fix: allow appending to new key * chore: confirm before overwriting existing key * chore: show suggestion only for stdout * chore: skip warning if file is already ignored * chore: minor refactor * chore: add config to test template --------- Co-authored-by: Qiao Han --- cmd/gen.go | 25 ++ internal/gen/signingkeys/signingkeys.go | 249 +++++++++++++++++++ internal/gen/signingkeys/signingkeys_test.go | 109 ++++++++ internal/start/start.go | 7 +- internal/utils/misc.go | 19 ++ pkg/config/auth.go | 1 + pkg/config/config.go | 72 ++++-- pkg/config/templates/config.toml | 2 + pkg/config/testdata/config.toml | 2 + 9 files changed, 459 insertions(+), 27 deletions(-) create mode 100644 internal/gen/signingkeys/signingkeys.go create mode 100644 internal/gen/signingkeys/signingkeys_test.go diff --git a/cmd/gen.go b/cmd/gen.go index 5849a5ce0..48a800f17 100644 --- a/cmd/gen.go +++ b/cmd/gen.go @@ -9,6 +9,7 @@ import ( "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/supabase/cli/internal/gen/keys" + "github.com/supabase/cli/internal/gen/signingkeys" "github.com/supabase/cli/internal/gen/types" "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/internal/utils/flags" @@ -93,6 +94,26 @@ var ( supabase gen types --project-id abc-def-123 --schema public --schema private supabase gen types --db-url 'postgresql://...' --schema public --schema auth`, } + + algorithm = utils.EnumFlag{ + Allowed: signingkeys.GetSupportedAlgorithms(), + Value: string(signingkeys.AlgES256), + } + appendKeys bool + + genSigningKeyCmd = &cobra.Command{ + Use: "signing-key", + Short: "Generate a JWT signing key", + Long: `Securely generate a private JWT signing key for use in the CLI or to import in the dashboard. + +Supported algorithms: + ES256 - ECDSA with P-256 curve and SHA-256 (recommended) + RS256 - RSA with SHA-256 +`, + RunE: func(cmd *cobra.Command, args []string) error { + return signingkeys.Run(cmd.Context(), algorithm.Value, appendKeys, afero.NewOsFs()) + }, + } ) func init() { @@ -111,5 +132,9 @@ func init() { keyFlags.StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.") keyFlags.StringSliceVar(&override, "override-name", []string{}, "Override specific variable names.") genCmd.AddCommand(genKeysCmd) + signingKeyFlags := genSigningKeyCmd.Flags() + signingKeyFlags.Var(&algorithm, "algorithm", "Algorithm for signing key generation.") + signingKeyFlags.BoolVar(&appendKeys, "append", false, "Append new key to existing keys file instead of overwriting.") + genCmd.AddCommand(genSigningKeyCmd) rootCmd.AddCommand(genCmd) } diff --git a/internal/gen/signingkeys/signingkeys.go b/internal/gen/signingkeys/signingkeys.go new file mode 100644 index 000000000..7394a99c4 --- /dev/null +++ b/internal/gen/signingkeys/signingkeys.go @@ -0,0 +1,249 @@ +package signingkeys + +import ( + "context" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "math/big" + "os" + "path/filepath" + + "github.com/go-errors/errors" + "github.com/google/uuid" + "github.com/spf13/afero" + "github.com/supabase/cli/internal/utils" + "github.com/supabase/cli/internal/utils/flags" + "github.com/supabase/cli/pkg/cast" +) + +type Algorithm string + +const ( + AlgRS256 Algorithm = "RS256" + AlgES256 Algorithm = "ES256" +) + +type JWK struct { + KeyType string `json:"kty"` + KeyID string `json:"kid,omitempty"` + Use string `json:"use,omitempty"` + KeyOps []string `json:"key_ops,omitempty"` + Algorithm string `json:"alg,omitempty"` + Extractable *bool `json:"ext,omitempty"` + // RSA specific fields + Modulus string `json:"n,omitempty"` + Exponent string `json:"e,omitempty"` + // RSA private key fields + PrivateExponent string `json:"d,omitempty"` + FirstPrimeFactor string `json:"p,omitempty"` + SecondPrimeFactor string `json:"q,omitempty"` + FirstFactorCRTExponent string `json:"dp,omitempty"` + SecondFactorCRTExponent string `json:"dq,omitempty"` + FirstCRTCoefficient string `json:"qi,omitempty"` + // EC specific fields + Curve string `json:"crv,omitempty"` + X string `json:"x,omitempty"` + Y string `json:"y,omitempty"` +} + +type KeyPair struct { + PublicKey JWK + PrivateKey JWK +} + +// GenerateKeyPair generates a new key pair for the specified algorithm +func GenerateKeyPair(alg Algorithm) (*KeyPair, error) { + keyID := uuid.New().String() + + switch alg { + case AlgRS256: + return generateRSAKeyPair(keyID) + case AlgES256: + return generateECDSAKeyPair(keyID) + default: + return nil, errors.Errorf("unsupported algorithm: %s", alg) + } +} + +func generateRSAKeyPair(keyID string) (*KeyPair, error) { + // Generate RSA key pair (2048 bits for RS256) + privateKey, err := rsa.GenerateKey(rand.Reader, 2048) + if err != nil { + return nil, errors.Errorf("failed to generate RSA key: %w", err) + } + + publicKey := &privateKey.PublicKey + + // Precompute CRT values for completeness + privateKey.Precompute() + + // Convert to JWK format + privateJWK := JWK{ + KeyType: "RSA", + KeyID: keyID, + Use: "sig", + KeyOps: []string{"sign", "verify"}, + Algorithm: "RS256", + Extractable: cast.Ptr(true), + Modulus: base64.RawURLEncoding.EncodeToString(publicKey.N.Bytes()), + Exponent: base64.RawURLEncoding.EncodeToString(big.NewInt(int64(publicKey.E)).Bytes()), + PrivateExponent: base64.RawURLEncoding.EncodeToString(privateKey.D.Bytes()), + FirstPrimeFactor: base64.RawURLEncoding.EncodeToString(privateKey.Primes[0].Bytes()), + SecondPrimeFactor: base64.RawURLEncoding.EncodeToString(privateKey.Primes[1].Bytes()), + FirstFactorCRTExponent: base64.RawURLEncoding.EncodeToString(privateKey.Precomputed.Dp.Bytes()), + SecondFactorCRTExponent: base64.RawURLEncoding.EncodeToString(privateKey.Precomputed.Dq.Bytes()), + FirstCRTCoefficient: base64.RawURLEncoding.EncodeToString(privateKey.Precomputed.Qinv.Bytes()), + } + + publicJWK := JWK{ + KeyType: "RSA", + KeyID: keyID, + Use: "sig", + KeyOps: []string{"verify"}, + Algorithm: "RS256", + Extractable: cast.Ptr(true), + Modulus: privateJWK.Modulus, + Exponent: privateJWK.Exponent, + } + + return &KeyPair{ + PublicKey: publicJWK, + PrivateKey: privateJWK, + }, nil +} + +func generateECDSAKeyPair(keyID string) (*KeyPair, error) { + // Generate ECDSA key pair (P-256 curve for ES256) + privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + return nil, errors.Errorf("failed to generate ECDSA key: %w", err) + } + + publicKey := &privateKey.PublicKey + + // Convert to JWK format + privateJWK := JWK{ + KeyType: "EC", + KeyID: keyID, + Use: "sig", + KeyOps: []string{"sign", "verify"}, + Algorithm: "ES256", + Extractable: cast.Ptr(true), + Curve: "P-256", + X: base64.RawURLEncoding.EncodeToString(publicKey.X.Bytes()), + Y: base64.RawURLEncoding.EncodeToString(publicKey.Y.Bytes()), + PrivateExponent: base64.RawURLEncoding.EncodeToString(privateKey.D.Bytes()), + } + + publicJWK := JWK{ + KeyType: "EC", + KeyID: keyID, + Use: "sig", + KeyOps: []string{"verify"}, + Algorithm: "ES256", + Extractable: cast.Ptr(true), + Curve: "P-256", + X: privateJWK.X, + Y: privateJWK.Y, + } + + return &KeyPair{ + PublicKey: publicJWK, + PrivateKey: privateJWK, + }, nil +} + +// Run generates a key pair and writes it to the specified file path +func Run(ctx context.Context, algorithm string, appendMode bool, fsys afero.Fs) error { + err := flags.LoadConfig(fsys) + if err != nil { + return err + } + outputPath := utils.Config.Auth.SigningKeysPath + + // Generate key pair + keyPair, err := GenerateKeyPair(Algorithm(algorithm)) + if err != nil { + return err + } + + out := io.Writer(os.Stdout) + var jwkArray []JWK + if len(outputPath) > 0 { + if err := utils.MkdirIfNotExistFS(fsys, filepath.Dir(outputPath)); err != nil { + return err + } + f, err := fsys.OpenFile(outputPath, os.O_RDWR|os.O_CREATE, 0600) + if err != nil { + return errors.Errorf("failed to open signing key: %w", err) + } + defer f.Close() + if appendMode { + // Load existing key and reset file + dec := json.NewDecoder(f) + // Since a new file is empty, we must ignore EOF error + if err := dec.Decode(&jwkArray); err != nil && !errors.Is(err, io.EOF) { + return errors.Errorf("failed to decode signing key: %w", err) + } + if _, err = f.Seek(0, io.SeekStart); err != nil { + return errors.Errorf("failed to seek signing key: %w", err) + } + } else if fi, err := f.Stat(); fi.Size() > 0 { + if err != nil { + fmt.Fprintln(utils.GetDebugLogger(), err) + } + label := fmt.Sprintf("Do you want to overwrite the existing %s file?", utils.Bold(outputPath)) + if shouldOverwrite, err := utils.NewConsole().PromptYesNo(ctx, label, true); err != nil { + return err + } else if !shouldOverwrite { + return errors.New(context.Canceled) + } + if err := f.Truncate(0); err != nil { + return errors.Errorf("failed to truncate signing key: %w", err) + } + } + out = f + } + jwkArray = append(jwkArray, keyPair.PrivateKey) + + // Write to file + enc := json.NewEncoder(out) + enc.SetIndent("", " ") + if err := enc.Encode(jwkArray); err != nil { + return errors.Errorf("failed to encode signing key: %w", err) + } + + if len(outputPath) == 0 { + utils.CmdSuggestion = fmt.Sprintf(` +To enable JWT signing keys in your local project: +1. Save the generated key to %s +2. Update your %s with the new keys path + +[auth] +signing_keys_path = "./signing_key.json" +`, utils.Bold(filepath.Join(utils.SupabaseDirPath, "signing_key.json")), utils.Bold(utils.ConfigPath)) + return nil + } + + fmt.Fprintf(os.Stderr, "JWT signing key appended to: %s (now contains %d keys)\n", utils.Bold(outputPath), len(jwkArray)) + if len(jwkArray) == 1 { + if ignored, err := utils.IsGitIgnored(outputPath); err != nil { + fmt.Fprintln(utils.GetDebugLogger(), err) + } else if !ignored { + // Since the output path is user defined, we can't update the managed .gitignore file. + fmt.Fprintln(os.Stderr, utils.Yellow("IMPORTANT:"), "Add your signing key path to .gitignore to prevent committing to version control.") + } + } + return nil +} + +// GetSupportedAlgorithms returns a list of supported algorithms +func GetSupportedAlgorithms() []string { + return []string{string(AlgRS256), string(AlgES256)} +} diff --git a/internal/gen/signingkeys/signingkeys_test.go b/internal/gen/signingkeys/signingkeys_test.go new file mode 100644 index 000000000..51333887d --- /dev/null +++ b/internal/gen/signingkeys/signingkeys_test.go @@ -0,0 +1,109 @@ +package signingkeys + +import ( + "testing" +) + +func TestGenerateKeyPair(t *testing.T) { + tests := []struct { + name string + algorithm Algorithm + wantErr bool + }{ + { + name: "RSA key generation", + algorithm: AlgRS256, + wantErr: false, + }, + { + name: "ECDSA key generation", + algorithm: AlgES256, + wantErr: false, + }, + { + name: "unsupported algorithm", + algorithm: "UNSUPPORTED", + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + keyPair, err := GenerateKeyPair(tt.algorithm) + if (err != nil) != tt.wantErr { + t.Errorf("GenerateKeyPair(%s) error = %v, wantErr %v", tt.algorithm, err, tt.wantErr) + return + } + if !tt.wantErr { + if keyPair == nil { + t.Error("GenerateKeyPair() returned nil key pair") + return + } + + // Check that both public and private keys are generated + if keyPair.PublicKey.KeyType == "" { + t.Error("Public key type is empty") + } + if keyPair.PrivateKey.KeyType == "" { + t.Error("Private key type is empty") + } + + // Check that key IDs match + if keyPair.PublicKey.KeyID != keyPair.PrivateKey.KeyID { + t.Error("Public and private key IDs don't match") + } + + // Algorithm-specific checks + switch tt.algorithm { + case AlgRS256: + if keyPair.PublicKey.KeyType != "RSA" { + t.Errorf("Expected RSA key type, got %s", keyPair.PublicKey.KeyType) + } + if keyPair.PrivateKey.Algorithm != "RS256" { + t.Errorf("Expected RS256 algorithm, got %s", keyPair.PrivateKey.Algorithm) + } + // Check that RSA-specific fields are present + if keyPair.PrivateKey.Modulus == "" { + t.Error("RSA private key missing modulus") + } + if keyPair.PrivateKey.PrivateExponent == "" { + t.Error("RSA private key missing private exponent") + } + case AlgES256: + if keyPair.PublicKey.KeyType != "EC" { + t.Errorf("Expected EC key type, got %s", keyPair.PublicKey.KeyType) + } + if keyPair.PrivateKey.Algorithm != "ES256" { + t.Errorf("Expected ES256 algorithm, got %s", keyPair.PrivateKey.Algorithm) + } + // Check that EC-specific fields are present + if keyPair.PrivateKey.Curve != "P-256" { + t.Errorf("Expected P-256 curve, got %s", keyPair.PrivateKey.Curve) + } + if keyPair.PrivateKey.X == "" { + t.Error("EC private key missing X coordinate") + } + if keyPair.PrivateKey.Y == "" { + t.Error("EC private key missing Y coordinate") + } + } + } + }) + } +} + +func TestGetSupportedAlgorithms(t *testing.T) { + algorithms := GetSupportedAlgorithms() + expected := []string{"RS256", "ES256"} + + if len(algorithms) != len(expected) { + t.Errorf("GetSupportedAlgorithms() length = %d, expected %d", len(algorithms), len(expected)) + return + } + + for i, alg := range algorithms { + if alg != expected[i] { + t.Errorf("GetSupportedAlgorithms()[%d] = %s, expected %s", i, alg, expected[i]) + } + } +} diff --git a/internal/start/start.go b/internal/start/start.go index fcf654fe6..feaa305ff 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -145,7 +145,7 @@ func run(p utils.Program, ctx context.Context, fsys afero.Fs, excludedContainers excluded[name] = true } - jwks, err := utils.Config.Auth.ResolveJWKS(ctx) + jwks, err := utils.Config.Auth.ResolveJWKS(ctx, fsys) if err != nil { return err } @@ -508,6 +508,11 @@ EOF fmt.Sprintf("GOTRUE_RATE_LIMIT_WEB3=%v", utils.Config.Auth.RateLimit.Web3), } + // Since signing key is validated by ResolveJWKS, simply read the key file. + if keys, err := afero.ReadFile(fsys, utils.Config.Auth.SigningKeysPath); err == nil && len(keys) > 0 { + env = append(env, "GOTRUE_JWT_KEYS="+string(keys)) + } + if utils.Config.Auth.Email.Smtp != nil && utils.Config.Auth.Email.Smtp.Enabled { env = append(env, fmt.Sprintf("GOTRUE_RATE_LIMIT_EMAIL_SENT=%v", utils.Config.Auth.RateLimit.EmailSent), diff --git a/internal/utils/misc.go b/internal/utils/misc.go index 46a9d3d12..80fb13b27 100644 --- a/internal/utils/misc.go +++ b/internal/utils/misc.go @@ -14,6 +14,7 @@ import ( "github.com/docker/docker/client" "github.com/go-errors/errors" "github.com/go-git/go-git/v5" + "github.com/go-git/go-git/v5/plumbing/format/gitignore" "github.com/spf13/afero" "github.com/spf13/viper" "github.com/supabase/cli/pkg/migration" @@ -125,6 +126,24 @@ func IsGitRepo() bool { return err == nil } +func IsGitIgnored(fp ...string) (bool, error) { + opts := &git.PlainOpenOptions{DetectDotGit: true} + repo, err := git.PlainOpenWithOptions(".", opts) + if err != nil { + return false, err + } + wt, err := repo.Worktree() + if err != nil { + return false, err + } + ps, err := gitignore.ReadPatterns(wt.Filesystem, nil) + if err != nil { + return false, err + } + m := gitignore.NewMatcher(ps) + return m.Match(fp, false), nil +} + // If the `os.Getwd()` is within a supabase project, this will return // the root of the given project as the current working directory. // Otherwise, the `os.Getwd()` is kept as is. diff --git a/pkg/config/auth.go b/pkg/config/auth.go index eff9d8070..2b0e155d7 100644 --- a/pkg/config/auth.go +++ b/pkg/config/auth.go @@ -84,6 +84,7 @@ type ( EnableAnonymousSignIns bool `toml:"enable_anonymous_sign_ins"` MinimumPasswordLength uint `toml:"minimum_password_length"` PasswordRequirements PasswordRequirements `toml:"password_requirements"` + SigningKeysPath string `toml:"signing_keys_path"` RateLimit rateLimit `toml:"rate_limit"` Captcha *captcha `toml:"captcha"` diff --git a/pkg/config/config.go b/pkg/config/config.go index 83f8f22a3..d96cc3952 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -29,6 +29,7 @@ import ( "github.com/go-viper/mapstructure/v2" "github.com/golang-jwt/jwt/v5" "github.com/joho/godotenv" + "github.com/spf13/afero" "github.com/spf13/viper" "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/fetcher" @@ -707,6 +708,10 @@ func (c *baseConfig) resolve(builder pathBuilder, fsys fs.FS) error { } c.Storage.Buckets[name] = bucket } + // Resolve signing keys path for cross-platform compatibility + if len(c.Auth.SigningKeysPath) > 0 && !filepath.IsAbs(c.Auth.SigningKeysPath) { + c.Auth.SigningKeysPath = filepath.Join(builder.SupabaseDirPath, c.Auth.SigningKeysPath) + } // Resolve functions config for slug, function := range c.Functions { if len(function.Entrypoint) == 0 { @@ -1376,16 +1381,28 @@ func (tpa *thirdParty) IssuerURL() string { return "" } +type ( + remoteJWKS struct { + Keys []json.RawMessage `json:"keys"` + } + + oidcConfiguration struct { + JWKSURI string `json:"jwks_uri"` + } + + secretJWK struct { + KeyType string `json:"kty"` + KeyBase64URL string `json:"k"` + } +) + // ResolveJWKS creates the JWKS from the JWT secret and Third-Party Auth // configs by resolving the JWKS via the OIDC discovery URL. // It always returns a JWKS string, except when there's an error fetching. -func (a *auth) ResolveJWKS(ctx context.Context) (string, error) { - var jwks struct { - Keys []json.RawMessage `json:"keys"` - } +func (a *auth) ResolveJWKS(ctx context.Context, fsys afero.Fs) (string, error) { + var jwks remoteJWKS - issuerURL := a.ThirdParty.IssuerURL() - if issuerURL != "" { + if issuerURL := a.ThirdParty.IssuerURL(); issuerURL != "" { discoveryURL := issuerURL + "/.well-known/openid-configuration" t := &http.Client{Timeout: 10 * time.Second} @@ -1400,10 +1417,6 @@ func (a *auth) ResolveJWKS(ctx context.Context) (string, error) { return "", err } - type oidcConfiguration struct { - JWKSURI string `json:"jwks_uri"` - } - oidcConfig, err := fetcher.ParseJSON[oidcConfiguration](resp.Body) if err != nil { return "", err @@ -1424,10 +1437,6 @@ func (a *auth) ResolveJWKS(ctx context.Context) (string, error) { return "", err } - type remoteJWKS struct { - Keys []json.RawMessage `json:"keys"` - } - rJWKS, err := fetcher.ParseJSON[remoteJWKS](resp.Body) if err != nil { return "", err @@ -1437,24 +1446,35 @@ func (a *auth) ResolveJWKS(ctx context.Context) (string, error) { return "", fmt.Errorf("auth.third_party: JWKS at URL %q as discovered from %q does not contain any JWK keys", oidcConfig.JWKSURI, discoveryURL) } - jwks.Keys = rJWKS.Keys + jwks.Keys = append(jwks.Keys, rJWKS.Keys...) } - var secretJWK struct { - KeyType string `json:"kty"` - KeyBase64URL string `json:"k"` - } + // If SIGNING_KEYS_PATH is provided, read from file + if len(a.SigningKeysPath) > 0 { + f, err := fsys.Open(a.SigningKeysPath) + if err != nil { + return "", errors.Errorf("failed to read signing key: %w", err) + } + jwtKeysArray, err := fetcher.ParseJSON[[]json.RawMessage](f) + if err != nil { + return "", err + } + jwks.Keys = append(jwks.Keys, jwtKeysArray...) + } else { + // Fallback to JWT_SECRET for backward compatibility + jwtSecret := secretJWK{ + KeyType: "oct", + KeyBase64URL: base64.RawURLEncoding.EncodeToString([]byte(a.JwtSecret.Value)), + } - secretJWK.KeyType = "oct" - secretJWK.KeyBase64URL = base64.RawURLEncoding.EncodeToString([]byte(a.JwtSecret.Value)) + secretJWKEncoded, err := json.Marshal(&jwtSecret) + if err != nil { + return "", errors.Errorf("failed to marshal secret jwk: %w", err) + } - secretJWKEncoded, err := json.Marshal(&secretJWK) - if err != nil { - return "", errors.Errorf("failed to marshal secret jwk: %w", err) + jwks.Keys = append(jwks.Keys, json.RawMessage(secretJWKEncoded)) } - jwks.Keys = append(jwks.Keys, json.RawMessage(secretJWKEncoded)) - jwksEncoded, err := json.Marshal(jwks) if err != nil { return "", errors.Errorf("failed to marshal jwks keys: %w", err) diff --git a/pkg/config/templates/config.toml b/pkg/config/templates/config.toml index 429cbd689..fea0c284d 100644 --- a/pkg/config/templates/config.toml +++ b/pkg/config/templates/config.toml @@ -122,6 +122,8 @@ site_url = "http://127.0.0.1:3000" additional_redirect_urls = ["https://127.0.0.1:3000"] # How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). jwt_expiry = 3600 +# Path to JWT signing key. DO NOT commit your signing keys file to git. +# signing_keys_path = "./signing_keys.json" # If disabled, the refresh token will never expire. enable_refresh_token_rotation = true # Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. diff --git a/pkg/config/testdata/config.toml b/pkg/config/testdata/config.toml index 65ed7cdca..37b515865 100644 --- a/pkg/config/testdata/config.toml +++ b/pkg/config/testdata/config.toml @@ -122,6 +122,8 @@ site_url = "http://127.0.0.1:3000" additional_redirect_urls = ["https://127.0.0.1:3000", "env(AUTH_CALLBACK_URL)"] # How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). jwt_expiry = 3600 +# Path to JWT signing key. DO NOT commit your signing keys file to git. +signing_keys_path = "./signing_keys.json" # If disabled, the refresh token will never expire. enable_refresh_token_rotation = true # Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. From bcbc26783cc19f35df1baf69b36bd11f57808ff5 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:53:34 +0200 Subject: [PATCH 315/359] chore: sync API types from infrastructure (#3892) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/types.gen.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 894c96463..c8639e3db 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1401,6 +1401,7 @@ type CreateBranchBody struct { // ReleaseChannel Release channel. If not provided, GA will be used. ReleaseChannel *CreateBranchBodyReleaseChannel `json:"release_channel,omitempty"` Secrets *map[string]string `json:"secrets,omitempty"` + WithData *bool `json:"with_data,omitempty"` } // CreateBranchBodyDesiredInstanceSize defines model for CreateBranchBody.DesiredInstanceSize. From 6e2f6fb583db7f8b8d763be566e6ad00f9254a6f Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 21 Jul 2025 21:32:18 +0800 Subject: [PATCH 316/359] feat: password-less database login (#3885) --- cmd/root.go | 2 +- internal/bootstrap/bootstrap.go | 2 +- internal/link/link.go | 13 +--- internal/link/link_test.go | 29 +++++++-- internal/utils/flags/db_url.go | 89 ++++++++++++++++++++------- internal/utils/flags/db_url_test.go | 23 +++---- internal/utils/flags/queries/role.sql | 16 +++++ pkg/pgxv5/connect.go | 11 ++++ 8 files changed, 132 insertions(+), 53 deletions(-) create mode 100644 internal/utils/flags/queries/role.sql diff --git a/cmd/root.go b/cmd/root.go index d053045e8..24aad18d3 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -111,7 +111,7 @@ var ( } } } - if err := flags.ParseDatabaseConfig(cmd.Flags(), fsys); err != nil { + if err := flags.ParseDatabaseConfig(ctx, cmd.Flags(), fsys); err != nil { return err } // Prepare context diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index 311ad5534..70aa6305b 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -113,7 +113,7 @@ func Run(ctx context.Context, starter StarterTemplate, fsys afero.Fs, options .. return err } // 6. Push migrations - config := flags.NewDbConfigWithPassword(flags.ProjectRef) + config := flags.NewDbConfigWithPassword(ctx, flags.ProjectRef) if err := writeDotEnv(keys, config, fsys); err != nil { fmt.Fprintln(os.Stderr, "Failed to create .env file:", err) } diff --git a/internal/link/link.go b/internal/link/link.go index b7a49fe85..471d469d9 100644 --- a/internal/link/link.go +++ b/internal/link/link.go @@ -14,7 +14,6 @@ import ( "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" @@ -43,15 +42,9 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func( LinkServices(ctx, projectRef, keys.Anon, fsys) // 2. Check database connection - config := flags.GetDbConfigOptionalPassword(projectRef) - if len(config.Password) > 0 { - if err := linkDatabase(ctx, config, fsys, options...); err != nil { - return err - } - // Save database password - if err := credentials.StoreProvider.Set(projectRef, config.Password); err != nil { - fmt.Fprintln(os.Stderr, "Failed to save database password:", err) - } + config := flags.NewDbConfigWithPassword(ctx, projectRef) + if err := linkDatabase(ctx, config, fsys, options...); err != nil { + return err } // 3. Save project ref diff --git a/internal/link/link_test.go b/internal/link/link_test.go index c1e869cca..15ff82962 100644 --- a/internal/link/link_test.go +++ b/internal/link/link_test.go @@ -21,6 +21,7 @@ import ( "github.com/supabase/cli/pkg/api" "github.com/supabase/cli/pkg/migration" "github.com/supabase/cli/pkg/pgtest" + "github.com/supabase/cli/pkg/pgxv5" "github.com/zalando/go-keyring" ) @@ -47,7 +48,9 @@ func TestLinkCommand(t *testing.T) { // Setup mock postgres conn := pgtest.NewConn() defer conn.Close(t) - conn.Query(GET_LATEST_STORAGE_MIGRATION). + conn.Query(pgxv5.SET_SESSION_ROLE). + Reply("SET ROLE"). + Query(GET_LATEST_STORAGE_MIGRATION). Reply("SELECT 1", []interface{}{"custom-metadata"}) helper.MockMigrationHistory(conn) helper.MockSeedHistory(conn) @@ -92,6 +95,9 @@ func TestLinkCommand(t *testing.T) { Get("/v1/projects/" + project + "/network-restrictions"). Reply(200). JSON(api.NetworkRestrictionsResponse{}) + gock.New(utils.DefaultApiHost). + Post("/v1/projects/" + project + "/database/query"). + Reply(http.StatusCreated) // Link versions auth := tenant.HealthResponse{Version: "v2.74.2"} gock.New("https://" + utils.GetSupabaseHost(project)). @@ -158,8 +164,11 @@ func TestLinkCommand(t *testing.T) { ReplyError(errors.New("network error")) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/network-restrictions"). - Reply(200). + Reply(http.StatusOK). JSON(api.NetworkRestrictionsResponse{}) + gock.New(utils.DefaultApiHost). + Post("/v1/projects/" + project + "/database/query"). + Reply(http.StatusServiceUnavailable) // Link versions gock.New("https://" + utils.GetSupabaseHost(project)). Get("/auth/v1/health"). @@ -181,6 +190,15 @@ func TestLinkCommand(t *testing.T) { t.Run("throws error on write failure", func(t *testing.T) { // Setup in-memory fs fsys := afero.NewReadOnlyFs(afero.NewMemMapFs()) + // Setup mock postgres + conn := pgtest.NewConn() + defer conn.Close(t) + conn.Query(pgxv5.SET_SESSION_ROLE). + Reply("SET ROLE"). + Query(GET_LATEST_STORAGE_MIGRATION). + Reply("SELECT 1", []interface{}{"custom-metadata"}) + helper.MockMigrationHistory(conn) + helper.MockSeedHistory(conn) // Flush pending mocks after test execution defer gock.OffAll() // Mock project status @@ -212,8 +230,11 @@ func TestLinkCommand(t *testing.T) { ReplyError(errors.New("network error")) gock.New(utils.DefaultApiHost). Get("/v1/projects/" + project + "/network-restrictions"). - Reply(200). + Reply(http.StatusOK). JSON(api.NetworkRestrictionsResponse{}) + gock.New(utils.DefaultApiHost). + Post("/v1/projects/" + project + "/database/query"). + Reply(http.StatusCreated) // Link versions gock.New("https://" + utils.GetSupabaseHost(project)). Get("/auth/v1/health"). @@ -225,7 +246,7 @@ func TestLinkCommand(t *testing.T) { Get("/v1/projects"). ReplyError(errors.New("network error")) // Run test - err := Run(context.Background(), project, fsys) + err := Run(context.Background(), project, fsys, conn.Intercept) // Check error assert.ErrorContains(t, err, "operation not permitted") assert.Empty(t, apitest.ListUnmatchedRequests()) diff --git a/internal/utils/flags/db_url.go b/internal/utils/flags/db_url.go index 46aad3734..0b666d6e1 100644 --- a/internal/utils/flags/db_url.go +++ b/internal/utils/flags/db_url.go @@ -1,11 +1,16 @@ package flags import ( + "bytes" + "context" "crypto/rand" + _ "embed" "fmt" "math/big" + "net/http" "os" "strings" + "text/template" "github.com/go-errors/errors" "github.com/jackc/pgconn" @@ -14,7 +19,9 @@ import ( "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/pkg/config" + "github.com/supabase/cli/pkg/pgxv5" ) type connection int @@ -29,7 +36,7 @@ const ( var DbConfig pgconn.Config -func ParseDatabaseConfig(flagSet *pflag.FlagSet, fsys afero.Fs) error { +func ParseDatabaseConfig(ctx context.Context, flagSet *pflag.FlagSet, fsys afero.Fs) error { // Changed flags take precedence over default values var connType connection if flag := flagSet.Lookup("db-url"); flag != nil && flag.Changed { @@ -77,7 +84,7 @@ func ParseDatabaseConfig(flagSet *pflag.FlagSet, fsys afero.Fs) error { if err := LoadConfig(fsys); err != nil { return err } - DbConfig = NewDbConfigWithPassword(ProjectRef) + DbConfig = NewDbConfigWithPassword(ctx, ProjectRef) case proxy: token, err := utils.LoadAccessTokenFS(fsys) if err != nil { @@ -95,23 +102,71 @@ func ParseDatabaseConfig(flagSet *pflag.FlagSet, fsys afero.Fs) error { return nil } -func NewDbConfigWithPassword(projectRef string) pgconn.Config { - config := getDbConfig(projectRef) - config.Password = getPassword(projectRef) - return config +const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +func RandomString(size int) (string, error) { + data := make([]byte, size) + _, err := rand.Read(data) + if err != nil { + return "", errors.Errorf("failed to read random: %w", err) + } + for i := range data { + n := int(data[i]) % len(letters) + data[i] = letters[n] + } + return string(data), nil } -func getPassword(projectRef string) string { - if password := viper.GetString("DB_PASSWORD"); len(password) > 0 { - return password +func NewDbConfigWithPassword(ctx context.Context, projectRef string) pgconn.Config { + config := getDbConfig(projectRef) + config.Password = viper.GetString("DB_PASSWORD") + if len(config.Password) > 0 { + return config } - if password, err := credentials.StoreProvider.Get(projectRef); err == nil { - return password + var err error + if config.Password, err = RandomString(32); err == nil { + newRole := pgconn.Config{ + User: pgxv5.CLI_LOGIN_ROLE, + Password: config.Password, + } + if err := initLoginRole(ctx, projectRef, newRole); err == nil { + // Special handling for pooler username + if suffix := "." + projectRef; strings.HasSuffix(config.User, suffix) { + newRole.User += suffix + } + config.User = newRole.User + return config + } + } + if config.Password, err = credentials.StoreProvider.Get(projectRef); err == nil { + return config } resetUrl := fmt.Sprintf("%s/project/%s/settings/database", utils.GetSupabaseDashboardURL(), projectRef) fmt.Fprintln(os.Stderr, "Forgot your password? Reset it from the Dashboard:", utils.Bold(resetUrl)) fmt.Fprint(os.Stderr, "Enter your database password: ") - return credentials.PromptMasked(os.Stdin) + config.Password = credentials.PromptMasked(os.Stdin) + return config +} + +var ( + //go:embed queries/role.sql + initRoleEmbed string + initRoleTemplate = template.Must(template.New("initRole").Parse(initRoleEmbed)) +) + +func initLoginRole(ctx context.Context, projectRef string, config pgconn.Config) error { + fmt.Fprintf(os.Stderr, "Initialising %s role...\n", config.User) + var initRoleBuf bytes.Buffer + if err := initRoleTemplate.Option("missingkey=error").Execute(&initRoleBuf, config); err != nil { + return errors.Errorf("failed to exec template: %w", err) + } + body := api.V1RunQueryBody{Query: initRoleBuf.String()} + if resp, err := utils.GetSupabase().V1RunAQueryWithResponse(ctx, projectRef, body); err != nil { + return errors.Errorf("failed to initialise login role: %w", err) + } else if resp.StatusCode() != http.StatusCreated { + return errors.Errorf("unexpected query status %d: %s", resp.StatusCode(), string(resp.Body)) + } + return nil } const PASSWORD_LENGTH = 16 @@ -148,13 +203,3 @@ func getDbConfig(projectRef string) pgconn.Config { Database: "postgres", } } - -func GetDbConfigOptionalPassword(projectRef string) pgconn.Config { - config := getDbConfig(projectRef) - config.Password = viper.GetString("DB_PASSWORD") - if config.Password == "" { - fmt.Fprint(os.Stderr, "Enter your database password (or leave blank to skip): ") - config.Password = credentials.PromptMasked(os.Stdin) - } - return config -} diff --git a/internal/utils/flags/db_url_test.go b/internal/utils/flags/db_url_test.go index ba9676b5f..1bb3fcc79 100644 --- a/internal/utils/flags/db_url_test.go +++ b/internal/utils/flags/db_url_test.go @@ -1,12 +1,12 @@ package flags import ( + "context" "os" "testing" "github.com/spf13/afero" "github.com/spf13/pflag" - "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/supabase/cli/internal/testing/apitest" @@ -14,6 +14,10 @@ import ( ) func TestParseDatabaseConfig(t *testing.T) { + // Setup valid access token + token := apitest.RandomAccessToken(t) + t.Setenv("SUPABASE_ACCESS_TOKEN", string(token)) + t.Run("parses direct connection from db-url flag", func(t *testing.T) { flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) flagSet.String("db-url", "postgres://postgres:password@localhost:5432/postgres", "") @@ -22,7 +26,7 @@ func TestParseDatabaseConfig(t *testing.T) { fsys := afero.NewMemMapFs() - err = ParseDatabaseConfig(flagSet, fsys) + err = ParseDatabaseConfig(context.Background(), flagSet, fsys) assert.NoError(t, err) assert.Equal(t, "db.example.com", DbConfig.Host) @@ -44,7 +48,7 @@ func TestParseDatabaseConfig(t *testing.T) { utils.Config.Db.Port = 54322 utils.Config.Db.Password = "local-password" - err = ParseDatabaseConfig(flagSet, fsys) + err = ParseDatabaseConfig(context.Background(), flagSet, fsys) assert.NoError(t, err) assert.Equal(t, "localhost", DbConfig.Host) @@ -66,7 +70,7 @@ func TestParseDatabaseConfig(t *testing.T) { err = afero.WriteFile(fsys, utils.ProjectRefPath, []byte(project), 0644) require.NoError(t, err) - err = ParseDatabaseConfig(flagSet, fsys) + err = ParseDatabaseConfig(context.Background(), flagSet, fsys) assert.NoError(t, err) assert.Equal(t, utils.GetSupabaseDbHost(project), DbConfig.Host) @@ -105,14 +109,3 @@ func TestPromptPassword(t *testing.T) { assert.NotEqual(t, "", password) }) } - -func TestGetDbConfigOptionalPassword(t *testing.T) { - t.Run("uses environment variable when available", func(t *testing.T) { - viper.Set("DB_PASSWORD", "env-password") - projectRef := apitest.RandomProjectRef() - - config := GetDbConfigOptionalPassword(projectRef) - - assert.Equal(t, "env-password", config.Password) - }) -} diff --git a/internal/utils/flags/queries/role.sql b/internal/utils/flags/queries/role.sql new file mode 100644 index 000000000..2e10035ae --- /dev/null +++ b/internal/utils/flags/queries/role.sql @@ -0,0 +1,16 @@ +do $func$ +begin + if not exists ( + select 1 + from pg_roles + where rolname = '{{ .User }}' + ) + then + create role "{{ .User }}" noinherit login noreplication in role postgres; + end if; + execute format( + $$alter role "{{ .User }}" with password '{{ .Password }}' valid until %L$$, + now() + interval '5 minutes' + ); +end +$func$ language plpgsql; diff --git a/pkg/pgxv5/connect.go b/pkg/pgxv5/connect.go index 218b1b775..daacb5fc0 100644 --- a/pkg/pgxv5/connect.go +++ b/pkg/pgxv5/connect.go @@ -4,12 +4,18 @@ import ( "context" "fmt" "os" + "strings" "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" ) +const ( + CLI_LOGIN_ROLE = "cli_login_postgres" + SET_SESSION_ROLE = "SET SESSION ROLE postgres" +) + // Extends pgx.Connect with support for programmatically overriding parsed config func Connect(ctx context.Context, connString string, options ...func(*pgx.ConnConfig)) (*pgx.Conn, error) { // Parse connection url @@ -20,6 +26,11 @@ func Connect(ctx context.Context, connString string, options ...func(*pgx.ConnCo config.OnNotice = func(pc *pgconn.PgConn, n *pgconn.Notice) { fmt.Fprintf(os.Stderr, "%s (%s): %s\n", n.Severity, n.Code, n.Message) } + if strings.HasPrefix(config.User, CLI_LOGIN_ROLE) { + config.AfterConnect = func(ctx context.Context, pgconn *pgconn.PgConn) error { + return pgconn.Exec(ctx, SET_SESSION_ROLE).Close() + } + } // Apply config overrides for _, op := range options { op(config) From 031f785bab66f3398cce8f49b13d772871d6d46c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 05:15:06 +0000 Subject: [PATCH 317/359] chore(deps): bump supabase/realtime from v2.41.3 to v2.41.4 in /pkg/config/templates (#3897) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.41.3 to v2.41.4. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index ae8bbfcf8..5c670392c 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.68.0 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.41.3 AS realtime +FROM supabase/realtime:v2.41.4 AS realtime FROM supabase/storage-api:v1.25.9 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From f78564d2db5d404d798640772338ac16f6db14fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 05:22:26 +0000 Subject: [PATCH 318/359] chore(deps): bump supabase/postgres from 17.4.1.059 to 17.4.1.061 in /pkg/config/templates (#3898) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.059 to 17.4.1.061. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.061 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5c670392c..87566f0c2 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.059 AS pg +FROM supabase/postgres:17.4.1.061 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 4679e5a1022cc2147f5c791caccc2b3a36020752 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 05:31:47 +0000 Subject: [PATCH 319/359] chore(deps): bump supabase/storage-api from v1.25.9 to v1.25.10 in /pkg/config/templates (#3899) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.25.9 to v1.25.10. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.25.10 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 87566f0c2..4ed647dc7 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.41.4 AS realtime -FROM supabase/storage-api:v1.25.9 AS storage +FROM supabase/storage-api:v1.25.10 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From ae011d7b89fa8e0a568c5867037dd93503c55aec Mon Sep 17 00:00:00 2001 From: Lenny Date: Tue, 22 Jul 2025 23:40:36 -0400 Subject: [PATCH 320/359] fix: Update img proxy env to be consistent with prod (#3901) --- internal/start/start.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/start/start.go b/internal/start/start.go index feaa305ff..f922addf3 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -911,6 +911,8 @@ EOF "IMGPROXY_MAX_SRC_FILE_SIZE=25000000", "IMGPROXY_MAX_ANIMATION_FRAMES=60", "IMGPROXY_ENABLE_WEBP_DETECTION=true", + "IMGPROXY_PRESETS=default=width:3000/height:8192", + "IMGPROXY_FORMAT_QUALITY=jpeg=80,avif=62,webp=80", }, Healthcheck: &container.HealthConfig{ Test: []string{"CMD", "imgproxy", "health"}, From 508c01f7f14c91b0a1cedb8a42aced6f888ade92 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Thu, 24 Jul 2025 08:44:32 +0200 Subject: [PATCH 321/359] chore: sync API types from infrastructure (#3903) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/client.gen.go | 16 ++++++++++++++++ pkg/api/types.gen.go | 3 +++ 2 files changed, 19 insertions(+) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index f236f9a7a..644f2b852 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -3033,6 +3033,22 @@ func NewV1AuthorizeUserRequest(server string, params *V1AuthorizeUserParams) (*h } + if params.OrganizationSlug != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "organization_slug", runtime.ParamLocationQuery, *params.OrganizationSlug); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index c8639e3db..c719cec23 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -3036,6 +3036,9 @@ type V1AuthorizeUserParams struct { ResponseMode *string `form:"response_mode,omitempty" json:"response_mode,omitempty"` CodeChallenge *string `form:"code_challenge,omitempty" json:"code_challenge,omitempty"` CodeChallengeMethod *V1AuthorizeUserParamsCodeChallengeMethod `form:"code_challenge_method,omitempty" json:"code_challenge_method,omitempty"` + + // OrganizationSlug Organization slug + OrganizationSlug *string `form:"organization_slug,omitempty" json:"organization_slug,omitempty"` } // V1AuthorizeUserParamsResponseType defines parameters for V1AuthorizeUser. From d8bddb51d84a9b86890982f98da95f070b55f253 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:53:29 +0800 Subject: [PATCH 322/359] chore(deps): bump google.golang.org/grpc from 1.74.0 to 1.74.2 (#3904) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.74.0 to 1.74.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.74.0...v1.74.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.74.2 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 73a360fc5..3631c1fdd 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( golang.org/x/mod v0.26.0 golang.org/x/oauth2 v0.30.0 golang.org/x/term v0.33.0 - google.golang.org/grpc v1.74.0 + google.golang.org/grpc v1.74.2 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 1cce30855..3ec3a0f04 100644 --- a/go.sum +++ b/go.sum @@ -1472,8 +1472,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.74.0 h1:sxRSkyLxlceWQiqDofxDot3d4u7DyoHPc7SBXMj8gGY= -google.golang.org/grpc v1.74.0/go.mod h1:NZUaK8dAMUfzhK6uxZ+9511LtOrk73UGWOFoNvz7z+s= +google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4= +google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM= 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 9cd8094c552089e9b37ec0eea6ec26ee641713c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:53:57 +0800 Subject: [PATCH 323/359] chore(deps): bump supabase/storage-api from v1.25.10 to v1.25.11 in /pkg/config/templates (#3907) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.25.10 to v1.25.11. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.25.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 4ed647dc7..5821c9bd6 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.41.4 AS realtime -FROM supabase/storage-api:v1.25.10 AS storage +FROM supabase/storage-api:v1.25.11 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 9f9645c733ac24ac897b4c89da954412a9d30f0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:54:22 +0800 Subject: [PATCH 324/359] chore(deps): bump supabase/postgres from 17.4.1.061 to 17.4.1.064 in /pkg/config/templates (#3911) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.061 to 17.4.1.064. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.064 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5821c9bd6..7ba592a01 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.061 AS pg +FROM supabase/postgres:17.4.1.064 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 53cbced25590f96505c6217c0893bb10a9b5ff37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 06:58:56 +0000 Subject: [PATCH 325/359] chore(deps): bump google.golang.org/grpc from 1.74.0 to 1.74.2 in /pkg (#3908) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.74.2 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> --- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/go.mod b/pkg/go.mod index 1b44d056c..6af4557b6 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -26,7 +26,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/tidwall/jsonc v0.3.2 golang.org/x/mod v0.26.0 - google.golang.org/grpc v1.74.0 + google.golang.org/grpc v1.74.2 ) require ( diff --git a/pkg/go.sum b/pkg/go.sum index 981620239..f347a7ff0 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -292,8 +292,8 @@ golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/grpc v1.74.0 h1:sxRSkyLxlceWQiqDofxDot3d4u7DyoHPc7SBXMj8gGY= -google.golang.org/grpc v1.74.0/go.mod h1:NZUaK8dAMUfzhK6uxZ+9511LtOrk73UGWOFoNvz7z+s= +google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4= +google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From e5ec38b498a535b7065bfad1f7126600f9995360 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:19:54 +0800 Subject: [PATCH 326/359] chore(deps): bump supabase/edge-runtime from v1.68.0 to v1.68.2 in /pkg/config/templates (#3912) chore(deps): bump supabase/edge-runtime in /pkg/config/templates Bumps supabase/edge-runtime from v1.68.0 to v1.68.2. --- updated-dependencies: - dependency-name: supabase/edge-runtime dependency-version: v1.68.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 7ba592a01..729e8fcbe 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -7,7 +7,7 @@ FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.91.1 AS pgmeta FROM supabase/studio:2025.07.21-sha-88dca02 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy -FROM supabase/edge-runtime:v1.68.0 AS edgeruntime +FROM supabase/edge-runtime:v1.68.2 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue From a1d5f857526e46614c76a6bc3859e64291fa6eaa Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 24 Jul 2025 16:42:38 +0800 Subject: [PATCH 327/359] fix: flag to create data branch (#3913) --- cmd/branches.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/branches.go b/cmd/branches.go index 45f88167d..a9a8ce392 100644 --- a/cmd/branches.go +++ b/cmd/branches.go @@ -32,6 +32,7 @@ var ( Allowed: awsRegions(), } persistent bool + withData bool branchCreateCmd = &cobra.Command{ Use: "create [name]", @@ -53,6 +54,9 @@ var ( if cmdFlags.Changed("persistent") { body.Persistent = &persistent } + if cmdFlags.Changed("with-data") { + body.WithData = &withData + } return create.Run(cmd.Context(), body, afero.NewOsFs()) }, } @@ -157,6 +161,7 @@ func init() { createFlags.Var(&branchRegion, "region", "Select a region to deploy the branch database.") createFlags.Var(&size, "size", "Select a desired instance size for the branch database.") createFlags.BoolVar(&persistent, "persistent", false, "Whether to create a persistent branch.") + createFlags.BoolVar(&withData, "with-data", false, "Whether to clone production data to the branch database.") branchesCmd.AddCommand(branchCreateCmd) branchesCmd.AddCommand(branchListCmd) branchesCmd.AddCommand(branchGetCmd) From 61b41fd278b741db06592dc75d707e00fa3669bc Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Thu, 24 Jul 2025 18:25:31 +0200 Subject: [PATCH 328/359] chore: sync API types from infrastructure (#3914) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/client.gen.go | 16 ++++++++++++++++ pkg/api/types.gen.go | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index 644f2b852..45e92c6a4 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -3049,6 +3049,22 @@ func NewV1AuthorizeUserRequest(server string, params *V1AuthorizeUserParams) (*h } + if params.Resource != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "resource", runtime.ParamLocationQuery, *params.Resource); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index c719cec23..061d3b3f6 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -492,6 +492,11 @@ const ( RefreshToken OAuthTokenBodyGrantType = "refresh_token" ) +// Defines values for OAuthTokenBodyResource. +const ( + OAuthTokenBodyResourceHttpsapiSupabaseGreenmcp OAuthTokenBodyResource = "https://api.supabase.green/mcp" +) + // Defines values for OAuthTokenResponseTokenType. const ( Bearer OAuthTokenResponseTokenType = "Bearer" @@ -954,6 +959,11 @@ const ( V1AuthorizeUserParamsCodeChallengeMethodSha256 V1AuthorizeUserParamsCodeChallengeMethod = "sha256" ) +// Defines values for V1AuthorizeUserParamsResource. +const ( + V1AuthorizeUserParamsResourceHttpsapiSupabaseGreenmcp V1AuthorizeUserParamsResource = "https://api.supabase.green/mcp" +) + // Defines values for V1OauthAuthorizeProjectClaimParamsResponseType. const ( V1OauthAuthorizeProjectClaimParamsResponseTypeCode V1OauthAuthorizeProjectClaimParamsResponseType = "code" @@ -1938,11 +1948,17 @@ type OAuthTokenBody struct { GrantType *OAuthTokenBodyGrantType `json:"grant_type,omitempty"` RedirectUri *string `json:"redirect_uri,omitempty"` RefreshToken *string `json:"refresh_token,omitempty"` + + // Resource Resource indicator for MCP (Model Context Protocol) clients + Resource *OAuthTokenBodyResource `json:"resource,omitempty"` } // OAuthTokenBodyGrantType defines model for OAuthTokenBody.GrantType. type OAuthTokenBodyGrantType string +// OAuthTokenBodyResource Resource indicator for MCP (Model Context Protocol) clients +type OAuthTokenBodyResource string + // OAuthTokenResponse defines model for OAuthTokenResponse. type OAuthTokenResponse struct { AccessToken string `json:"access_token"` @@ -3039,6 +3055,9 @@ type V1AuthorizeUserParams struct { // OrganizationSlug Organization slug OrganizationSlug *string `form:"organization_slug,omitempty" json:"organization_slug,omitempty"` + + // Resource Resource indicator for MCP (Model Context Protocol) clients + Resource *V1AuthorizeUserParamsResource `form:"resource,omitempty" json:"resource,omitempty"` } // V1AuthorizeUserParamsResponseType defines parameters for V1AuthorizeUser. @@ -3047,6 +3066,9 @@ type V1AuthorizeUserParamsResponseType string // V1AuthorizeUserParamsCodeChallengeMethod defines parameters for V1AuthorizeUser. type V1AuthorizeUserParamsCodeChallengeMethod string +// V1AuthorizeUserParamsResource defines parameters for V1AuthorizeUser. +type V1AuthorizeUserParamsResource string + // V1OauthAuthorizeProjectClaimParams defines parameters for V1OauthAuthorizeProjectClaim. type V1OauthAuthorizeProjectClaimParams struct { // ProjectRef Project ref From 760122f344911889eb08fae1ff6d360400fe8342 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 05:05:07 +0000 Subject: [PATCH 329/359] chore(deps): bump supabase/postgres-meta from v0.91.1 to v0.91.2 in /pkg/config/templates (#3915) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.91.1 to v0.91.2. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.91.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 729e8fcbe..aa885ecc4 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.064 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.91.1 AS pgmeta +FROM supabase/postgres-meta:v0.91.2 AS pgmeta FROM supabase/studio:2025.07.21-sha-88dca02 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.68.2 AS edgeruntime From 635c79c7dac37676b20ccfd9ca21c0e6a22c2ffa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 05:10:35 +0000 Subject: [PATCH 330/359] chore(deps): bump supabase/realtime from v2.41.4 to v2.41.7 in /pkg/config/templates (#3916) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.41.4 to v2.41.7. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index aa885ecc4..31aaef7ba 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.68.2 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.41.4 AS realtime +FROM supabase/realtime:v2.41.7 AS realtime FROM supabase/storage-api:v1.25.11 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From b720b1240ad6b1cf681b0879ef6f0a627c76cbd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 05:15:37 +0000 Subject: [PATCH 331/359] chore(deps): bump supabase/storage-api from v1.25.11 to v1.25.12 in /pkg/config/templates (#3917) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.25.11 to v1.25.12. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.25.12 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 31aaef7ba..5a7494b0a 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.41.7 AS realtime -FROM supabase/storage-api:v1.25.11 AS storage +FROM supabase/storage-api:v1.25.12 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From 46552173fc245353fc0258d6ef7e7dd15af47ab4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 06:52:24 +0000 Subject: [PATCH 332/359] chore(deps): bump supabase/realtime from v2.41.7 to v2.41.8 in /pkg/config/templates (#3922) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.41.7 to v2.41.8. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5a7494b0a..2a68accaf 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.68.2 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.41.7 AS realtime +FROM supabase/realtime:v2.41.8 AS realtime FROM supabase/storage-api:v1.25.12 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 481417601b18283fcf2ba0463341bda5ec069d2b Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Tue, 29 Jul 2025 07:56:25 +0200 Subject: [PATCH 333/359] chore: sync API types from infrastructure (#3926) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/types.gen.go | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 061d3b3f6..ca0fd71c5 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -1051,18 +1051,16 @@ type AnalyticsResponse_Error struct { // ApiKeyResponse defines model for ApiKeyResponse. type ApiKeyResponse struct { - ApiKey nullable.Nullable[string] `json:"api_key,omitempty"` - Description nullable.Nullable[string] `json:"description,omitempty"` - Hash nullable.Nullable[string] `json:"hash,omitempty"` - Id nullable.Nullable[string] `json:"id,omitempty"` - InsertedAt nullable.Nullable[time.Time] `json:"inserted_at,omitempty"` - Name string `json:"name"` - Prefix nullable.Nullable[string] `json:"prefix,omitempty"` - SecretJwtTemplate nullable.Nullable[struct { - Role string `json:"role"` - }] `json:"secret_jwt_template,omitempty"` - Type nullable.Nullable[ApiKeyResponseType] `json:"type,omitempty"` - UpdatedAt nullable.Nullable[time.Time] `json:"updated_at,omitempty"` + ApiKey nullable.Nullable[string] `json:"api_key,omitempty"` + Description nullable.Nullable[string] `json:"description,omitempty"` + Hash nullable.Nullable[string] `json:"hash,omitempty"` + Id nullable.Nullable[string] `json:"id,omitempty"` + InsertedAt nullable.Nullable[time.Time] `json:"inserted_at,omitempty"` + Name string `json:"name"` + Prefix nullable.Nullable[string] `json:"prefix,omitempty"` + SecretJwtTemplate nullable.Nullable[map[string]interface{}] `json:"secret_jwt_template,omitempty"` + Type nullable.Nullable[ApiKeyResponseType] `json:"type,omitempty"` + UpdatedAt nullable.Nullable[time.Time] `json:"updated_at,omitempty"` } // ApiKeyResponseType defines model for ApiKeyResponse.Type. @@ -1385,12 +1383,10 @@ type BulkUpdateFunctionResponseFunctionsStatus string // CreateApiKeyBody defines model for CreateApiKeyBody. type CreateApiKeyBody struct { - Description nullable.Nullable[string] `json:"description,omitempty"` - Name string `json:"name"` - SecretJwtTemplate nullable.Nullable[struct { - Role string `json:"role"` - }] `json:"secret_jwt_template,omitempty"` - Type CreateApiKeyBodyType `json:"type"` + Description nullable.Nullable[string] `json:"description,omitempty"` + Name string `json:"name"` + SecretJwtTemplate nullable.Nullable[map[string]interface{}] `json:"secret_jwt_template,omitempty"` + Type CreateApiKeyBodyType `json:"type"` } // CreateApiKeyBodyType defines model for CreateApiKeyBody.Type. @@ -2316,11 +2312,9 @@ type TypescriptResponse struct { // UpdateApiKeyBody defines model for UpdateApiKeyBody. type UpdateApiKeyBody struct { - Description nullable.Nullable[string] `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - SecretJwtTemplate nullable.Nullable[struct { - Role string `json:"role"` - }] `json:"secret_jwt_template,omitempty"` + Description nullable.Nullable[string] `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + SecretJwtTemplate nullable.Nullable[map[string]interface{}] `json:"secret_jwt_template,omitempty"` } // UpdateAuthConfigBody defines model for UpdateAuthConfigBody. From 73fb104b6c26584f7267d5a6c33e5ae8ab464e13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 13:56:59 +0800 Subject: [PATCH 334/359] chore(deps): bump supabase/studio from 2025.07.21-sha-88dca02 to 2025.07.28-sha-578b707 in /pkg/config/templates (#3924) chore(deps): bump supabase/studio in /pkg/config/templates Bumps supabase/studio from 2025.07.21-sha-88dca02 to 2025.07.28-sha-578b707. --- updated-dependencies: - dependency-name: supabase/studio dependency-version: 2025.07.28-sha-578b707 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 2a68accaf..2dd6ef1be 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -5,7 +5,7 @@ FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.91.2 AS pgmeta -FROM supabase/studio:2025.07.21-sha-88dca02 AS studio +FROM supabase/studio:2025.07.28-sha-578b707 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.68.2 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector From c4992496e96c15643e3246b002b7d73a746d1c96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 13:57:12 +0800 Subject: [PATCH 335/359] chore(deps): bump supabase/postgres from 17.4.1.064 to 17.4.1.067 in /pkg/config/templates (#3923) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.064 to 17.4.1.067. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.067 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 2dd6ef1be..7ef06d81b 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.064 AS pg +FROM supabase/postgres:17.4.1.067 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 8f8ddb2cd3d5c85927029af6430c445694fecad1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 06:03:32 +0000 Subject: [PATCH 336/359] chore(deps): bump supabase/postgres-meta from v0.91.2 to v0.91.3 in /pkg/config/templates (#3927) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.91.2 to v0.91.3. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.91.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 7ef06d81b..289c95812 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.067 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.91.2 AS pgmeta +FROM supabase/postgres-meta:v0.91.3 AS pgmeta FROM supabase/studio:2025.07.28-sha-578b707 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.68.2 AS edgeruntime From 9d8ef5b7a875fc2151783b32102973a321e66a84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:46:38 +0800 Subject: [PATCH 337/359] chore(deps): bump supabase/realtime from v2.41.8 to v2.41.9 in /pkg/config/templates (#3928) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.41.8 to v2.41.9. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 289c95812..12c6968f4 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.68.2 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.41.8 AS realtime +FROM supabase/realtime:v2.41.9 AS realtime FROM supabase/storage-api:v1.25.12 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 1cf9098b47146115c35b70c732a9fb62def96ca4 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 29 Jul 2025 16:45:26 +0800 Subject: [PATCH 338/359] fix: handle new tenant api key (#3929) --- internal/status/status.go | 15 +++------ internal/storage/client/api.go | 14 ++++---- internal/utils/tenant/client.go | 48 ++++++++++++++++++---------- internal/utils/tenant/client_test.go | 29 ++++++++--------- pkg/fetcher/gateway.go | 28 ++++++++++++++++ 5 files changed, 83 insertions(+), 51 deletions(-) create mode 100644 pkg/fetcher/gateway.go diff --git a/internal/status/status.go b/internal/status/status.go index ef5d42c25..7dd64ecd0 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -176,16 +176,11 @@ var ( func checkHTTPHead(ctx context.Context, path string) error { healthOnce.Do(func() { - server := utils.Config.Api.ExternalUrl - header := func(req *http.Request) { - req.Header.Add("apikey", utils.Config.Auth.AnonKey.Value) - } - client := NewKongClient() - healthClient = fetcher.NewFetcher( - server, - fetcher.WithHTTPClient(client), - fetcher.WithRequestEditor(header), - fetcher.WithExpectedStatus(http.StatusOK), + healthClient = fetcher.NewServiceGateway( + utils.Config.Api.ExternalUrl, + utils.Config.Auth.AnonKey.Value, + fetcher.WithHTTPClient(NewKongClient()), + fetcher.WithUserAgent("SupabaseCLI/"+utils.Version), ) }) // HEAD method does not return response body diff --git a/internal/storage/client/api.go b/internal/storage/client/api.go index a05eaffeb..33b5d6711 100644 --- a/internal/storage/client/api.go +++ b/internal/storage/client/api.go @@ -28,21 +28,19 @@ func NewStorageAPI(ctx context.Context, projectRef string) (storage.StorageAPI, } func newLocalClient() *fetcher.Fetcher { - client := status.NewKongClient() - return fetcher.NewFetcher( + return fetcher.NewServiceGateway( utils.Config.Api.ExternalUrl, - fetcher.WithHTTPClient(client), - fetcher.WithBearerToken(utils.Config.Auth.ServiceRoleKey.Value), + utils.Config.Auth.ServiceRoleKey.Value, + fetcher.WithHTTPClient(status.NewKongClient()), fetcher.WithUserAgent("SupabaseCLI/"+utils.Version), - fetcher.WithExpectedStatus(http.StatusOK), ) } func newRemoteClient(projectRef, token string) *fetcher.Fetcher { - return fetcher.NewFetcher( + return fetcher.NewServiceGateway( "https://"+utils.GetSupabaseHost(projectRef), - fetcher.WithBearerToken(token), + token, + fetcher.WithHTTPClient(http.DefaultClient), fetcher.WithUserAgent("SupabaseCLI/"+utils.Version), - fetcher.WithExpectedStatus(http.StatusOK), ) } diff --git a/internal/utils/tenant/client.go b/internal/utils/tenant/client.go index c94696701..3868e7555 100644 --- a/internal/utils/tenant/client.go +++ b/internal/utils/tenant/client.go @@ -2,8 +2,7 @@ package tenant import ( "context" - "net/http" - "time" + "strings" "github.com/go-errors/errors" "github.com/supabase/cli/internal/utils" @@ -32,16 +31,41 @@ func NewApiKey(resp []api.ApiKeyResponse) ApiKey { if err != nil { continue } + if t, err := key.Type.Get(); err == nil { + switch t { + case api.ApiKeyResponseTypePublishable: + result.Anon = value + continue + case api.ApiKeyResponseTypeSecret: + if isServiceRole(key) { + result.ServiceRole = value + } + continue + } + } switch key.Name { case "anon": - result.Anon = value + if len(result.Anon) == 0 { + result.Anon = value + } case "service_role": - result.ServiceRole = value + if len(result.ServiceRole) == 0 { + result.ServiceRole = value + } } } return result } +func isServiceRole(key api.ApiKeyResponse) bool { + if tmpl, err := key.SecretJwtTemplate.Get(); err == nil { + if role, ok := tmpl["role"].(string); ok { + return strings.EqualFold(role, "service_role") + } + } + return false +} + func GetApiKeys(ctx context.Context, projectRef string) (ApiKey, error) { resp, err := utils.GetSupabase().V1GetProjectApiKeysWithResponse(ctx, projectRef, &api.V1GetProjectApiKeysParams{}) if err != nil { @@ -62,19 +86,9 @@ type TenantAPI struct { } func NewTenantAPI(ctx context.Context, projectRef, anonKey string) TenantAPI { - server := "https://" + utils.GetSupabaseHost(projectRef) - client := &http.Client{ - Timeout: 10 * time.Second, - } - header := func(req *http.Request) { - req.Header.Add("apikey", anonKey) - } - api := TenantAPI{Fetcher: fetcher.NewFetcher( - server, - fetcher.WithHTTPClient(client), - fetcher.WithRequestEditor(header), + return TenantAPI{Fetcher: fetcher.NewServiceGateway( + "https://"+utils.GetSupabaseHost(projectRef), + anonKey, fetcher.WithUserAgent("SupabaseCLI/"+utils.Version), - fetcher.WithExpectedStatus(http.StatusOK), )} - return api } diff --git a/internal/utils/tenant/client_test.go b/internal/utils/tenant/client_test.go index 183485fbe..849629284 100644 --- a/internal/utils/tenant/client_test.go +++ b/internal/utils/tenant/client_test.go @@ -131,24 +131,21 @@ func TestGetApiKeys(t *testing.T) { } func TestNewTenantAPI(t *testing.T) { - t.Run("creates tenant api client", func(t *testing.T) { - projectRef := apitest.RandomProjectRef() - anonKey := "test-key" - - api := NewTenantAPI(context.Background(), projectRef, anonKey) + projectRef := apitest.RandomProjectRef() + anonKey := "test-key" - assert.NotNil(t, api.Fetcher) + api := NewTenantAPI(context.Background(), projectRef, anonKey) + assert.NotNil(t, api.Fetcher) - defer gock.OffAll() - gock.New("https://"+utils.GetSupabaseHost(projectRef)). - Get("/test"). - MatchHeader("apikey", anonKey). - MatchHeader("User-Agent", "SupabaseCLI/"+utils.Version). - Reply(http.StatusOK) + defer gock.OffAll() + gock.New("https://"+utils.GetSupabaseHost(projectRef)). + Get("/test"). + MatchHeader("Authorization", "Bearer "+anonKey). + MatchHeader("User-Agent", "SupabaseCLI/"+utils.Version). + Reply(http.StatusOK) - _, err := api.Send(context.Background(), http.MethodGet, "/test", nil) + _, err := api.Send(context.Background(), http.MethodGet, "/test", nil) - assert.NoError(t, err) - assert.Empty(t, apitest.ListUnmatchedRequests()) - }) + assert.NoError(t, err) + assert.Empty(t, apitest.ListUnmatchedRequests()) } diff --git a/pkg/fetcher/gateway.go b/pkg/fetcher/gateway.go new file mode 100644 index 000000000..86c6735d4 --- /dev/null +++ b/pkg/fetcher/gateway.go @@ -0,0 +1,28 @@ +package fetcher + +import ( + "net/http" + "strings" + "time" +) + +func NewServiceGateway(server, token string, overrides ...FetcherOption) *Fetcher { + opts := append([]FetcherOption{ + WithHTTPClient(&http.Client{ + Timeout: 10 * time.Second, + }), + withAuthToken(token), + WithExpectedStatus(http.StatusOK), + }, overrides...) + return NewFetcher(server, opts...) +} + +func withAuthToken(token string) FetcherOption { + if strings.HasPrefix(token, "sb_") { + header := func(req *http.Request) { + req.Header.Add("apikey", token) + } + return WithRequestEditor(header) + } + return WithBearerToken(token) +} From 1d1b50e17e645ae94a80d7b3c1ae76ff9e6bf9b3 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 29 Jul 2025 19:07:47 +0800 Subject: [PATCH 339/359] fix: add mysterious apikey header (#3931) --- pkg/fetcher/gateway.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/fetcher/gateway.go b/pkg/fetcher/gateway.go index 86c6735d4..d8fa597f7 100644 --- a/pkg/fetcher/gateway.go +++ b/pkg/fetcher/gateway.go @@ -24,5 +24,9 @@ func withAuthToken(token string) FetcherOption { } return WithRequestEditor(header) } - return WithBearerToken(token) + header := func(req *http.Request) { + req.Header.Add("apikey", token) + req.Header.Add("Authorization", "Bearer "+token) + } + return WithRequestEditor(header) } From 3f6d9357e5a39768975da89ccad05c668e6e5d67 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Tue, 29 Jul 2025 23:22:19 +0800 Subject: [PATCH 340/359] fix: reveal new keys when loading from api (#3935) --- internal/utils/tenant/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/utils/tenant/client.go b/internal/utils/tenant/client.go index 3868e7555..c8bb26cfe 100644 --- a/internal/utils/tenant/client.go +++ b/internal/utils/tenant/client.go @@ -7,6 +7,7 @@ import ( "github.com/go-errors/errors" "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/pkg/api" + "github.com/supabase/cli/pkg/cast" "github.com/supabase/cli/pkg/fetcher" ) @@ -67,7 +68,9 @@ func isServiceRole(key api.ApiKeyResponse) bool { } func GetApiKeys(ctx context.Context, projectRef string) (ApiKey, error) { - resp, err := utils.GetSupabase().V1GetProjectApiKeysWithResponse(ctx, projectRef, &api.V1GetProjectApiKeysParams{}) + resp, err := utils.GetSupabase().V1GetProjectApiKeysWithResponse(ctx, projectRef, &api.V1GetProjectApiKeysParams{ + Reveal: cast.Ptr(true), + }) if err != nil { return ApiKey{}, errors.Errorf("failed to get api keys: %w", err) } From ac00aed28e22cd80c53654d9179db5676de05923 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 20:17:36 +0000 Subject: [PATCH 341/359] chore(deps): bump github.com/docker/docker from 28.3.2+incompatible to 28.3.3+incompatible (#3940) chore(deps): bump github.com/docker/docker Bumps [github.com/docker/docker](https://github.com/docker/docker) from 28.3.2+incompatible to 28.3.3+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](https://github.com/docker/docker/compare/v28.3.2...v28.3.3) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-version: 28.3.3+incompatible dependency-type: direct:production ... 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 3631c1fdd..c336f017f 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.64.0 github.com/docker/cli v28.3.2+incompatible - github.com/docker/docker v28.3.2+incompatible + 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 diff --git a/go.sum b/go.sum index 3ec3a0f04..9e312a538 100644 --- a/go.sum +++ b/go.sum @@ -242,8 +242,8 @@ github.com/docker/cli v28.3.2+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 v28.3.2+incompatible h1:wn66NJ6pWB1vBZIilP8G3qQPqHy5XymfYn5vsqeA5oA= -github.com/docker/docker v28.3.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI= +github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= From 82d044d24e97f1f3d610c7724143a5a4b9049a4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 04:10:10 +0000 Subject: [PATCH 342/359] chore(deps): bump github.com/docker/cli from 28.3.2+incompatible to 28.3.3+incompatible (#3943) chore(deps): bump github.com/docker/cli Bumps [github.com/docker/cli](https://github.com/docker/cli) from 28.3.2+incompatible to 28.3.3+incompatible. - [Commits](https://github.com/docker/cli/compare/v28.3.2...v28.3.3) --- updated-dependencies: - dependency-name: github.com/docker/cli dependency-version: 28.3.3+incompatible 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 c336f017f..0c20f3ae4 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/containerd/errdefs v1.0.0 github.com/containers/common v0.64.0 - github.com/docker/cli v28.3.2+incompatible + github.com/docker/cli v28.3.3+incompatible github.com/docker/docker v28.3.3+incompatible github.com/docker/go-connections v0.5.0 github.com/fsnotify/fsnotify v1.9.0 diff --git a/go.sum b/go.sum index 9e312a538..6dea04751 100644 --- a/go.sum +++ b/go.sum @@ -237,8 +237,8 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= -github.com/docker/cli v28.3.2+incompatible h1:mOt9fcLE7zaACbxW1GeS65RI67wIJrTnqS3hP2huFsY= -github.com/docker/cli v28.3.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.3.3+incompatible h1:fp9ZHAr1WWPGdIWBM1b3zLtgCF+83gRdVMTJsUeiyAo= +github.com/docker/cli v28.3.3+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= From ed075049aa40e08d9e7b52486974ca76a21724ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 05:20:57 +0000 Subject: [PATCH 343/359] chore(deps): bump supabase/postgres from 17.4.1.067 to 17.4.1.068 in /pkg/config/templates (#3944) chore(deps): bump supabase/postgres in /pkg/config/templates Bumps supabase/postgres from 17.4.1.067 to 17.4.1.068. --- updated-dependencies: - dependency-name: supabase/postgres dependency-version: 17.4.1.068 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 12c6968f4..5e98a8e97 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -1,5 +1,5 @@ # Exposed for updates by .github/dependabot.yml -FROM supabase/postgres:17.4.1.067 AS pg +FROM supabase/postgres:17.4.1.068 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit From 8d331e2ee2cae96227fd707ddf84b71d5060d781 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 05:26:07 +0000 Subject: [PATCH 344/359] chore(deps): bump supabase/realtime from v2.41.9 to v2.41.10 in /pkg/config/templates (#3946) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.41.9 to v2.41.10. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.10 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 5e98a8e97..52d1f6c4a 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.68.2 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.41.9 AS realtime +FROM supabase/realtime:v2.41.10 AS realtime FROM supabase/storage-api:v1.25.12 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From a1ce2e77b5baebc8d8f22c45a84508a4c1f0582e Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 30 Jul 2025 15:25:39 +0800 Subject: [PATCH 345/359] fix: disable ssl when connecting in debug mode (#3947) --- internal/gen/types/types.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/gen/types/types.go b/internal/gen/types/types.go index 9ffc7dc72..26f3c09bf 100644 --- a/internal/gen/types/types.go +++ b/internal/gen/types/types.go @@ -12,6 +12,7 @@ import ( "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" "github.com/spf13/afero" + "github.com/spf13/viper" "github.com/supabase/cli/internal/utils" "github.com/supabase/cli/pkg/api" ) @@ -113,5 +114,6 @@ func isRequireSSL(ctx context.Context, dbUrl string, options ...func(*pgx.ConnCo } return false, err } - return true, conn.Close(ctx) + // SSL is not supported in debug mode + return !viper.GetBool("DEBUG"), conn.Close(ctx) } From 2b6e22b5f4d1522a306a556050877142744efc6e Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 30 Jul 2025 19:44:53 +0800 Subject: [PATCH 346/359] fix: retry pooler connection after password change (#3949) --- pkg/pgxv5/connect.go | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/pkg/pgxv5/connect.go b/pkg/pgxv5/connect.go index daacb5fc0..c16f769c8 100644 --- a/pkg/pgxv5/connect.go +++ b/pkg/pgxv5/connect.go @@ -5,7 +5,9 @@ import ( "fmt" "os" "strings" + "time" + "github.com/cenkalti/backoff/v4" "github.com/go-errors/errors" "github.com/jackc/pgconn" "github.com/jackc/pgx/v4" @@ -26,19 +28,31 @@ func Connect(ctx context.Context, connString string, options ...func(*pgx.ConnCo config.OnNotice = func(pc *pgconn.PgConn, n *pgconn.Notice) { fmt.Fprintf(os.Stderr, "%s (%s): %s\n", n.Severity, n.Code, n.Message) } + maxRetries := uint64(0) if strings.HasPrefix(config.User, CLI_LOGIN_ROLE) { config.AfterConnect = func(ctx context.Context, pgconn *pgconn.PgConn) error { return pgconn.Exec(ctx, SET_SESSION_ROLE).Close() } + // Add retry to allow enough time for password change to propagate to pooler + if len(config.User) > len(CLI_LOGIN_ROLE) { + maxRetries = 3 + } } // Apply config overrides for _, op := range options { op(config) } // Connect to database - conn, err := pgx.ConnectConfig(ctx, config) - if err != nil { - return nil, errors.Errorf("failed to connect to postgres: %w", err) + connect := func() (*pgx.Conn, error) { + conn, err := pgx.ConnectConfig(ctx, config) + if err != nil { + return nil, errors.Errorf("failed to connect to postgres: %w", err) + } + return conn, nil } - return conn, nil + policy := backoff.WithContext(backoff.WithMaxRetries(backoff.NewExponentialBackOff( + backoff.WithInitialInterval(3*time.Second)), + maxRetries), + ctx) + return backoff.RetryWithData(connect, policy) } From 1e0743438461eb1ca6a78a5d0b87f6353005fb86 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Wed, 30 Jul 2025 17:18:30 +0200 Subject: [PATCH 347/359] chore: sync API types from infrastructure (#3951) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/types.gen.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index ca0fd71c5..06ea4188a 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -537,6 +537,8 @@ const ( // Defines values for ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion. const ( + N13 ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion = "13" + N14 ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion = "14" N15 ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion = "15" N17 ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion = "17" N17Oriole ProjectUpgradeEligibilityResponseTargetUpgradeVersionsPostgresVersion = "17-oriole" From 2fe9b8b02f7913d6298b6faaf8268e91757674ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 04:34:23 +0000 Subject: [PATCH 348/359] chore(deps): bump supabase/realtime from v2.41.10 to v2.41.11 in /pkg/config/templates (#3953) chore(deps): bump supabase/realtime in /pkg/config/templates Bumps supabase/realtime from v2.41.10 to v2.41.11. --- updated-dependencies: - dependency-name: supabase/realtime dependency-version: v2.41.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 52d1f6c4a..f4bd4853e 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -11,7 +11,7 @@ FROM supabase/edge-runtime:v1.68.2 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue -FROM supabase/realtime:v2.41.10 AS realtime +FROM supabase/realtime:v2.41.11 AS realtime FROM supabase/storage-api:v1.25.12 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below From 821f7b988b9c064a1528a70ef886359961c8a8c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 04:39:34 +0000 Subject: [PATCH 349/359] chore(deps): bump supabase/edge-runtime from v1.68.2 to v1.68.3 in /pkg/config/templates (#3954) chore(deps): bump supabase/edge-runtime in /pkg/config/templates Bumps supabase/edge-runtime from v1.68.2 to v1.68.3. --- updated-dependencies: - dependency-name: supabase/edge-runtime dependency-version: v1.68.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index f4bd4853e..32c139f6e 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -7,7 +7,7 @@ FROM postgrest/postgrest:v12.2.12 AS postgrest FROM supabase/postgres-meta:v0.91.3 AS pgmeta FROM supabase/studio:2025.07.28-sha-578b707 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy -FROM supabase/edge-runtime:v1.68.2 AS edgeruntime +FROM supabase/edge-runtime:v1.68.3 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.5.7 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue From 933798a99a7d4270587f4d5e14c8fb5e93c45bc5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 04:44:44 +0000 Subject: [PATCH 350/359] chore(deps): bump supabase/supavisor from 2.5.7 to 2.6.0 in /pkg/config/templates (#3945) chore(deps): bump supabase/supavisor in /pkg/config/templates Bumps supabase/supavisor from 2.5.7 to 2.6.0. --- updated-dependencies: - dependency-name: supabase/supavisor dependency-version: 2.6.0 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> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 32c139f6e..4cc22d7b7 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -9,7 +9,7 @@ FROM supabase/studio:2025.07.28-sha-578b707 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.68.3 AS edgeruntime FROM timberio/vector:0.28.1-alpine AS vector -FROM supabase/supavisor:2.5.7 AS supavisor +FROM supabase/supavisor:2.6.0 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.41.11 AS realtime FROM supabase/storage-api:v1.25.12 AS storage From 100ae3e492bb80bf688828f5923d7ed1fa2645f5 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 31 Jul 2025 16:45:17 +0800 Subject: [PATCH 351/359] fix: set postgres role for pg_dump (#3958) --- pkg/migration/scripts/dump_data.sh | 1 + pkg/migration/scripts/dump_role.sh | 1 + pkg/migration/scripts/dump_schema.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/pkg/migration/scripts/dump_data.sh b/pkg/migration/scripts/dump_data.sh index 764766510..c3c5d478b 100755 --- a/pkg/migration/scripts/dump_data.sh +++ b/pkg/migration/scripts/dump_data.sh @@ -22,6 +22,7 @@ echo "SET session_replication_role = replica; pg_dump \ --data-only \ --quote-all-identifier \ + --role "postgres" \ --exclude-schema "${EXCLUDED_SCHEMAS:-}" \ --exclude-table "auth.schema_migrations" \ --exclude-table "storage.migrations" \ diff --git a/pkg/migration/scripts/dump_role.sh b/pkg/migration/scripts/dump_role.sh index e5c157ba3..cadc8c542 100755 --- a/pkg/migration/scripts/dump_role.sh +++ b/pkg/migration/scripts/dump_role.sh @@ -19,6 +19,7 @@ export PGDATABASE="$PGDATABASE" # - do not alter membership grants by supabase_admin role pg_dumpall \ --roles-only \ + --role "postgres" \ --quote-all-identifier \ --no-role-passwords \ --no-comments \ diff --git a/pkg/migration/scripts/dump_schema.sh b/pkg/migration/scripts/dump_schema.sh index dbcd18dc2..ee8407dad 100755 --- a/pkg/migration/scripts/dump_schema.sh +++ b/pkg/migration/scripts/dump_schema.sh @@ -25,6 +25,7 @@ export PGDATABASE="$PGDATABASE" pg_dump \ --schema-only \ --quote-all-identifier \ + --role "postgres" \ --exclude-schema "${EXCLUDED_SCHEMAS:-}" \ ${EXTRA_FLAGS:-} \ | sed -E 's/^CREATE SCHEMA "/CREATE SCHEMA IF NOT EXISTS "/' \ From e020422a02b1ac1121cc60772905a7edec217fbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 05:11:26 +0000 Subject: [PATCH 352/359] chore(deps): bump supabase/postgres-meta from v0.91.3 to v0.91.4 in /pkg/config/templates (#3963) chore(deps): bump supabase/postgres-meta in /pkg/config/templates Bumps supabase/postgres-meta from v0.91.3 to v0.91.4. --- updated-dependencies: - dependency-name: supabase/postgres-meta dependency-version: v0.91.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 4cc22d7b7..e29f36f6f 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -4,7 +4,7 @@ FROM supabase/postgres:17.4.1.068 AS pg FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit FROM postgrest/postgrest:v12.2.12 AS postgrest -FROM supabase/postgres-meta:v0.91.3 AS pgmeta +FROM supabase/postgres-meta:v0.91.4 AS pgmeta FROM supabase/studio:2025.07.28-sha-578b707 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy FROM supabase/edge-runtime:v1.68.3 AS edgeruntime From d0b7c5cfce2815275882fb681d6f895f3ac738ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 05:16:42 +0000 Subject: [PATCH 353/359] chore(deps): bump supabase/storage-api from v1.25.12 to v1.26.0 in /pkg/config/templates (#3965) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.25.12 to v1.26.0. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.26.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index e29f36f6f..4b1bd5ad0 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.6.0 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.41.11 AS realtime -FROM supabase/storage-api:v1.25.12 AS storage +FROM supabase/storage-api:v1.26.0 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ From bea370c39c8fd0684ce78558dc5e61590dfaeaef Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Fri, 1 Aug 2025 10:32:43 +0200 Subject: [PATCH 354/359] chore: sync API types from infrastructure (#3959) Co-authored-by: avallete <8771783+avallete@users.noreply.github.com> --- pkg/api/client.gen.go | 469 ++++++++++++++++++++++++++++++++++++++++++ pkg/api/types.gen.go | 60 ++++++ 2 files changed, 529 insertions(+) diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index 45e92c6a4..b3898e0f3 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -377,6 +377,20 @@ type ClientInterface interface { // V1GetDatabaseMetadata request V1GetDatabaseMetadata(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1GetJitAccess request + V1GetJitAccess(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1UpdateJitAccessWithBody request with any body + V1UpdateJitAccessWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + V1UpdateJitAccess(ctx context.Context, ref string, body V1UpdateJitAccessJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1ListJitAccess request + V1ListJitAccess(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // V1DeleteJitAccess request + V1DeleteJitAccess(ctx context.Context, ref string, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // V1ListMigrationHistory request V1ListMigrationHistory(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1803,6 +1817,66 @@ func (c *Client) V1GetDatabaseMetadata(ctx context.Context, ref string, reqEdito return c.Client.Do(req) } +func (c *Client) V1GetJitAccess(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1GetJitAccessRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1UpdateJitAccessWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateJitAccessRequestWithBody(c.Server, ref, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1UpdateJitAccess(ctx context.Context, ref string, body V1UpdateJitAccessJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1UpdateJitAccessRequest(c.Server, ref, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1ListJitAccess(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1ListJitAccessRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) V1DeleteJitAccess(ctx context.Context, ref string, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewV1DeleteJitAccessRequest(c.Server, ref, userId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) V1ListMigrationHistory(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewV1ListMigrationHistoryRequest(c.Server, ref) if err != nil { @@ -6217,6 +6291,162 @@ func NewV1GetDatabaseMetadataRequest(server string, ref string) (*http.Request, return req, nil } +// NewV1GetJitAccessRequest generates requests for V1GetJitAccess +func NewV1GetJitAccessRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/database/jit", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1UpdateJitAccessRequest calls the generic V1UpdateJitAccess builder with application/json body +func NewV1UpdateJitAccessRequest(server string, ref string, body V1UpdateJitAccessJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewV1UpdateJitAccessRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewV1UpdateJitAccessRequestWithBody generates requests for V1UpdateJitAccess with any type of body +func NewV1UpdateJitAccessRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/database/jit", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewV1ListJitAccessRequest generates requests for V1ListJitAccess +func NewV1ListJitAccessRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/database/jit/list", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewV1DeleteJitAccessRequest generates requests for V1DeleteJitAccess +func NewV1DeleteJitAccessRequest(server string, ref string, userId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "user_id", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/database/jit/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewV1ListMigrationHistoryRequest generates requests for V1ListMigrationHistory func NewV1ListMigrationHistoryRequest(server string, ref string) (*http.Request, error) { var err error @@ -8870,6 +9100,20 @@ type ClientWithResponsesInterface interface { // V1GetDatabaseMetadataWithResponse request V1GetDatabaseMetadataWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetDatabaseMetadataResponse, error) + // V1GetJitAccessWithResponse request + V1GetJitAccessWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetJitAccessResponse, error) + + // V1UpdateJitAccessWithBodyWithResponse request with any body + V1UpdateJitAccessWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateJitAccessResponse, error) + + V1UpdateJitAccessWithResponse(ctx context.Context, ref string, body V1UpdateJitAccessJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateJitAccessResponse, error) + + // V1ListJitAccessWithResponse request + V1ListJitAccessWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListJitAccessResponse, error) + + // V1DeleteJitAccessWithResponse request + V1DeleteJitAccessWithResponse(ctx context.Context, ref string, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1DeleteJitAccessResponse, error) + // V1ListMigrationHistoryWithResponse request V1ListMigrationHistoryWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListMigrationHistoryResponse, error) @@ -10773,6 +11017,93 @@ func (r V1GetDatabaseMetadataResponse) StatusCode() int { return 0 } +type V1GetJitAccessResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *JitAccessResponse +} + +// Status returns HTTPResponse.Status +func (r V1GetJitAccessResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1GetJitAccessResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1UpdateJitAccessResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *JitAccessResponse +} + +// Status returns HTTPResponse.Status +func (r V1UpdateJitAccessResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1UpdateJitAccessResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1ListJitAccessResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *JitListAccessResponse +} + +// Status returns HTTPResponse.Status +func (r V1ListJitAccessResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1ListJitAccessResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type V1DeleteJitAccessResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r V1DeleteJitAccessResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r V1DeleteJitAccessResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type V1ListMigrationHistoryResponse struct { Body []byte HTTPResponse *http.Response @@ -12703,6 +13034,50 @@ func (c *ClientWithResponses) V1GetDatabaseMetadataWithResponse(ctx context.Cont return ParseV1GetDatabaseMetadataResponse(rsp) } +// V1GetJitAccessWithResponse request returning *V1GetJitAccessResponse +func (c *ClientWithResponses) V1GetJitAccessWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1GetJitAccessResponse, error) { + rsp, err := c.V1GetJitAccess(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1GetJitAccessResponse(rsp) +} + +// V1UpdateJitAccessWithBodyWithResponse request with arbitrary body returning *V1UpdateJitAccessResponse +func (c *ClientWithResponses) V1UpdateJitAccessWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*V1UpdateJitAccessResponse, error) { + rsp, err := c.V1UpdateJitAccessWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdateJitAccessResponse(rsp) +} + +func (c *ClientWithResponses) V1UpdateJitAccessWithResponse(ctx context.Context, ref string, body V1UpdateJitAccessJSONRequestBody, reqEditors ...RequestEditorFn) (*V1UpdateJitAccessResponse, error) { + rsp, err := c.V1UpdateJitAccess(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1UpdateJitAccessResponse(rsp) +} + +// V1ListJitAccessWithResponse request returning *V1ListJitAccessResponse +func (c *ClientWithResponses) V1ListJitAccessWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListJitAccessResponse, error) { + rsp, err := c.V1ListJitAccess(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1ListJitAccessResponse(rsp) +} + +// V1DeleteJitAccessWithResponse request returning *V1DeleteJitAccessResponse +func (c *ClientWithResponses) V1DeleteJitAccessWithResponse(ctx context.Context, ref string, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*V1DeleteJitAccessResponse, error) { + rsp, err := c.V1DeleteJitAccess(ctx, ref, userId, reqEditors...) + if err != nil { + return nil, err + } + return ParseV1DeleteJitAccessResponse(rsp) +} + // V1ListMigrationHistoryWithResponse request returning *V1ListMigrationHistoryResponse func (c *ClientWithResponses) V1ListMigrationHistoryWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*V1ListMigrationHistoryResponse, error) { rsp, err := c.V1ListMigrationHistory(ctx, ref, reqEditors...) @@ -15194,6 +15569,100 @@ func ParseV1GetDatabaseMetadataResponse(rsp *http.Response) (*V1GetDatabaseMetad return response, nil } +// ParseV1GetJitAccessResponse parses an HTTP response from a V1GetJitAccessWithResponse call +func ParseV1GetJitAccessResponse(rsp *http.Response) (*V1GetJitAccessResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1GetJitAccessResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest JitAccessResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1UpdateJitAccessResponse parses an HTTP response from a V1UpdateJitAccessWithResponse call +func ParseV1UpdateJitAccessResponse(rsp *http.Response) (*V1UpdateJitAccessResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1UpdateJitAccessResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest JitAccessResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1ListJitAccessResponse parses an HTTP response from a V1ListJitAccessWithResponse call +func ParseV1ListJitAccessResponse(rsp *http.Response) (*V1ListJitAccessResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1ListJitAccessResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest JitListAccessResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseV1DeleteJitAccessResponse parses an HTTP response from a V1DeleteJitAccessWithResponse call +func ParseV1DeleteJitAccessResponse(rsp *http.Response) (*V1DeleteJitAccessResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &V1DeleteJitAccessResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseV1ListMigrationHistoryResponse parses an HTTP response from a V1ListMigrationHistoryWithResponse call func ParseV1ListMigrationHistoryResponse(rsp *http.Response) (*V1ListMigrationHistoryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 06ea4188a..7079302fc 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -634,6 +634,12 @@ const ( SnippetResponseVisibilityUser SnippetResponseVisibility = "user" ) +// Defines values for StorageConfigResponseExternalUpstreamTarget. +const ( + StorageConfigResponseExternalUpstreamTargetCanary StorageConfigResponseExternalUpstreamTarget = "canary" + StorageConfigResponseExternalUpstreamTargetMain StorageConfigResponseExternalUpstreamTarget = "main" +) + // Defines values for SupavisorConfigResponseDatabaseType. const ( PRIMARY SupavisorConfigResponseDatabaseType = "PRIMARY" @@ -703,6 +709,12 @@ const ( UpdateSigningKeyBodyStatusStandby UpdateSigningKeyBodyStatus = "standby" ) +// Defines values for UpdateStorageConfigBodyExternalUpstreamTarget. +const ( + UpdateStorageConfigBodyExternalUpstreamTargetCanary UpdateStorageConfigBodyExternalUpstreamTarget = "canary" + UpdateStorageConfigBodyExternalUpstreamTargetMain UpdateStorageConfigBodyExternalUpstreamTarget = "main" +) + // Defines values for UpdateSupavisorConfigBodyPoolMode. const ( UpdateSupavisorConfigBodyPoolModeSession UpdateSupavisorConfigBodyPoolMode = "session" @@ -1746,6 +1758,26 @@ type GetProviderResponse struct { UpdatedAt *string `json:"updated_at,omitempty"` } +// JitAccessResponse defines model for JitAccessResponse. +type JitAccessResponse struct { + UserId openapi_types.UUID `json:"user_id"` + UserRoles []struct { + ExpiresAt *string `json:"expires_at,omitempty"` + Role string `json:"role"` + } `json:"user_roles"` +} + +// JitListAccessResponse defines model for JitListAccessResponse. +type JitListAccessResponse struct { + Items []struct { + UserId openapi_types.UUID `json:"user_id"` + UserRoles []struct { + ExpiresAt *string `json:"expires_at,omitempty"` + Role string `json:"role"` + } `json:"user_roles"` + } `json:"items"` +} + // LegacyApiKeysResponse defines model for LegacyApiKeysResponse. type LegacyApiKeysResponse struct { Enabled bool `json:"enabled"` @@ -2251,6 +2283,13 @@ type SslEnforcementResponse struct { // StorageConfigResponse defines model for StorageConfigResponse. type StorageConfigResponse struct { + Capabilities struct { + IcebergCatalog bool `json:"iceberg_catalog"` + ListV2 bool `json:"list_v2"` + } `json:"capabilities"` + External struct { + UpstreamTarget StorageConfigResponseExternalUpstreamTarget `json:"upstreamTarget"` + } `json:"external"` Features struct { IcebergCatalog *struct { Enabled bool `json:"enabled"` @@ -2265,6 +2304,9 @@ type StorageConfigResponse struct { FileSizeLimit int64 `json:"fileSizeLimit"` } +// StorageConfigResponseExternalUpstreamTarget defines model for StorageConfigResponse.External.UpstreamTarget. +type StorageConfigResponseExternalUpstreamTarget string + // StreamableFile defines model for StreamableFile. type StreamableFile = map[string]interface{} @@ -2563,6 +2605,15 @@ type UpdateCustomHostnameResponse struct { // UpdateCustomHostnameResponseStatus defines model for UpdateCustomHostnameResponse.Status. type UpdateCustomHostnameResponseStatus string +// UpdateJitAccessBody defines model for UpdateJitAccessBody. +type UpdateJitAccessBody struct { + Roles []struct { + ExpiresAt *string `json:"expires_at,omitempty"` + Role string `json:"role"` + } `json:"roles"` + UserId openapi_types.UUID `json:"user_id"` +} + // UpdatePgsodiumConfigBody defines model for UpdatePgsodiumConfigBody. type UpdatePgsodiumConfigBody struct { RootKey string `json:"root_key"` @@ -2651,6 +2702,9 @@ type UpdateSigningKeyBodyStatus string // UpdateStorageConfigBody defines model for UpdateStorageConfigBody. type UpdateStorageConfigBody struct { + External *struct { + UpstreamTarget UpdateStorageConfigBodyExternalUpstreamTarget `json:"upstreamTarget"` + } `json:"external,omitempty"` Features *struct { IcebergCatalog *struct { Enabled bool `json:"enabled"` @@ -2665,6 +2719,9 @@ type UpdateStorageConfigBody struct { FileSizeLimit *int64 `json:"fileSizeLimit,omitempty"` } +// UpdateStorageConfigBodyExternalUpstreamTarget defines model for UpdateStorageConfigBody.External.UpstreamTarget. +type UpdateStorageConfigBodyExternalUpstreamTarget string + // UpdateSupavisorConfigBody defines model for UpdateSupavisorConfigBody. type UpdateSupavisorConfigBody struct { DefaultPoolSize nullable.Nullable[int] `json:"default_pool_size,omitempty"` @@ -3315,6 +3372,9 @@ type V1CreateRestorePointJSONRequestBody = V1RestorePointPostBody // V1UndoJSONRequestBody defines body for V1Undo for application/json ContentType. type V1UndoJSONRequestBody = V1UndoBody +// V1UpdateJitAccessJSONRequestBody defines body for V1UpdateJitAccess for application/json ContentType. +type V1UpdateJitAccessJSONRequestBody = UpdateJitAccessBody + // V1ApplyAMigrationJSONRequestBody defines body for V1ApplyAMigration for application/json ContentType. type V1ApplyAMigrationJSONRequestBody = V1CreateMigrationBody From e35c33f50a366132a8f33fe39df81299888b03d1 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Fri, 1 Aug 2025 21:30:13 +0800 Subject: [PATCH 355/359] fix: use service key for version checks (#3961) --- internal/link/link.go | 6 +++--- internal/services/services.go | 7 ++++++- internal/utils/tenant/client.go | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/internal/link/link.go b/internal/link/link.go index 471d469d9..9bf77675e 100644 --- a/internal/link/link.go +++ b/internal/link/link.go @@ -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) @@ -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) @@ -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") { diff --git a/internal/services/services.go b/internal/services/services.go index 0d31891ac..a84e3a878 100644 --- a/internal/services/services.go +++ b/internal/services/services.go @@ -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" @@ -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() diff --git a/internal/utils/tenant/client.go b/internal/utils/tenant/client.go index c8bb26cfe..3d6d039fa 100644 --- a/internal/utils/tenant/client.go +++ b/internal/utils/tenant/client.go @@ -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), )} } From 601be609337ceab733b9558ea1e6617cbce90eb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 21:30:28 +0800 Subject: [PATCH 356/359] chore(deps): bump github.com/getsentry/sentry-go from 0.34.1 to 0.35.0 (#3962) Bumps [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) from 0.34.1 to 0.35.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.34.1...v0.35.0) --- updated-dependencies: - dependency-name: github.com/getsentry/sentry-go dependency-version: 0.35.0 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 0c20f3ae4..5f7f3c816 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 6dea04751..71496bddd 100644 --- a/go.sum +++ b/go.sum @@ -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= From dacebc909f1f1fdc8495fd0eb47060ef32a902ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 21:58:54 +0800 Subject: [PATCH 357/359] chore(deps): bump postgrest/postgrest from v12.2.12 to v13.0.4 in /pkg/config/templates (#3729) chore(deps): bump postgrest/postgrest in /pkg/config/templates Bumps postgrest/postgrest from v12.2.12 to v13.0.4. --- updated-dependencies: - dependency-name: postgrest/postgrest dependency-version: v13.0.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Han Qiao --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 4b1bd5ad0..80a6488fd 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -3,7 +3,7 @@ FROM supabase/postgres:17.4.1.068 AS pg # Append to ServiceImages when adding new dependencies below FROM library/kong:2.8.1 AS kong FROM axllent/mailpit:v1.22.3 AS mailpit -FROM postgrest/postgrest:v12.2.12 AS postgrest +FROM postgrest/postgrest:v13.0.4 AS postgrest FROM supabase/postgres-meta:v0.91.4 AS pgmeta FROM supabase/studio:2025.07.28-sha-578b707 AS studio FROM darthsim/imgproxy:v3.8.0 AS imgproxy From 7ad7d9f5c4191e9bc5ef31e365e467452da32911 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 22:39:47 +0800 Subject: [PATCH 358/359] chore(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.3 to 5.3.0 in /pkg (#3955) * chore(deps): bump github.com/golang-jwt/jwt/v5 in /pkg Bumps [github.com/golang-jwt/jwt/v5](https://github.com/golang-jwt/jwt) from 5.2.3 to 5.3.0. - [Release notes](https://github.com/golang-jwt/jwt/releases) - [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md) - [Commits](https://github.com/golang-jwt/jwt/compare/v5.2.3...v5.3.0) --- updated-dependencies: - dependency-name: github.com/golang-jwt/jwt/v5 dependency-version: 5.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: bump cli deps --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiao Han --- go.mod | 2 +- go.sum | 4 ++-- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5f7f3c816..033126a15 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 71496bddd..eff73ce59 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/pkg/go.mod b/pkg/go.mod index 6af4557b6..da9ff4f6c 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -10,7 +10,7 @@ require ( github.com/ecies/go/v2 v2.0.11 github.com/go-errors/errors v1.5.1 github.com/go-viper/mapstructure/v2 v2.4.0 - github.com/golang-jwt/jwt/v5 v5.2.3 + github.com/golang-jwt/jwt/v5 v5.3.0 github.com/h2non/gock v1.2.0 github.com/jackc/pgconn v1.14.3 github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 diff --git a/pkg/go.sum b/pkg/go.sum index f347a7ff0..c7f70e16f 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -40,8 +40,8 @@ github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9L github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -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/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= From 8652151c891f70db49100b042b25f80f0e1cfcaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 05:43:24 +0000 Subject: [PATCH 359/359] chore(deps): bump supabase/storage-api from v1.26.0 to v1.26.1 in /pkg/config/templates (#3976) chore(deps): bump supabase/storage-api in /pkg/config/templates Bumps supabase/storage-api from v1.26.0 to v1.26.1. --- updated-dependencies: - dependency-name: supabase/storage-api dependency-version: v1.26.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pkg/config/templates/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/templates/Dockerfile b/pkg/config/templates/Dockerfile index 80a6488fd..ac78c890c 100644 --- a/pkg/config/templates/Dockerfile +++ b/pkg/config/templates/Dockerfile @@ -12,7 +12,7 @@ FROM timberio/vector:0.28.1-alpine AS vector FROM supabase/supavisor:2.6.0 AS supavisor FROM supabase/gotrue:v2.177.0 AS gotrue FROM supabase/realtime:v2.41.11 AS realtime -FROM supabase/storage-api:v1.26.0 AS storage +FROM supabase/storage-api:v1.26.1 AS storage FROM supabase/logflare:1.14.2 AS logflare # Append to JobImages when adding new dependencies below FROM supabase/pgadmin-schema-diff:cli-0.0.5 AS differ