diff --git a/api/beta.yaml b/api/beta.yaml index e2acab5c6..79f3dc8f0 100644 --- a/api/beta.yaml +++ b/api/beta.yaml @@ -1316,6 +1316,8 @@ paths: responses: '201': description: '' + '403': + description: '' '500': description: Failed to set up read replica tags: @@ -1344,6 +1346,8 @@ paths: responses: '201': description: '' + '403': + description: '' '500': description: Failed to remove read replica tags: @@ -1605,7 +1609,7 @@ paths: /v1/projects/{ref}/config/auth/third-party-auth: post: operationId: createTPAForProject - summary: '[Alpha] Creates a new third-party auth integration' + summary: Creates a new third-party auth integration parameters: - name: ref required: true @@ -2439,6 +2443,15 @@ components: type: boolean persistent: type: boolean + status: + enum: + - CREATING_PROJECT + - RUNNING_MIGRATIONS + - MIGRATIONS_PASSED + - MIGRATIONS_FAILED + - FUNCTIONS_DEPLOYED + - FUNCTIONS_FAILED + type: string BranchResponse: type: object properties: @@ -2826,10 +2839,14 @@ components: CreateBranchBody: type: object properties: + desired_instance_size: + $ref: '#/components/schemas/DesiredInstanceSize' branch_name: type: string git_branch: type: string + persistent: + type: boolean region: type: string required: @@ -3900,6 +3917,26 @@ components: mfa_max_enrolled_factors: type: number 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_phone_otp_length: + type: number + mfa_phone_template: + type: string + nullable: true + mfa_phone_max_frequency: + type: number + nullable: true password_hibp_enabled: type: boolean nullable: true @@ -4166,6 +4203,13 @@ components: - 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_phone_otp_length + - mfa_phone_template + - mfa_phone_max_frequency - password_hibp_enabled - password_min_length - password_required_characters @@ -4585,6 +4629,24 @@ components: type: number api_max_request_duration: type: number + mfa_totp_enroll_enabled: + type: boolean + mfa_totp_verify_enabled: + type: boolean + mfa_phone_enroll_enabled: + type: boolean + mfa_phone_verify_enabled: + type: boolean + mfa_phone_max_frequency: + type: number + minimum: 0 + maximum: 32767 + mfa_phone_otp_length: + type: number + minimum: 0 + maximum: 32767 + mfa_phone_template: + type: string CreateThirdPartyAuthBody: type: object properties: @@ -4946,6 +5008,7 @@ components: - PENDING - REMOVED - ARCHIVED + - CANCELLED is_physical_backup: type: boolean inserted_at: diff --git a/cmd/bootstrap.go b/cmd/bootstrap.go index da5d96e49..1d8faa263 100644 --- a/cmd/bootstrap.go +++ b/cmd/bootstrap.go @@ -37,7 +37,7 @@ var ( viper.Set("WORKDIR", workdir) } } - client := utils.GetGtihubClient(ctx) + client := utils.GetGitHubClient(ctx) templates, err := bootstrap.ListSamples(ctx, client) if err != nil { return err diff --git a/cmd/branches.go b/cmd/branches.go index db688a60c..df2b48a8f 100644 --- a/cmd/branches.go +++ b/cmd/branches.go @@ -29,8 +29,9 @@ var ( } branchRegion = utils.EnumFlag{ - Allowed: make([]string, len(utils.FlyRegions)), + Allowed: flyRegions(), } + persistent bool branchCreateCmd = &cobra.Command{ Use: "create [name]", @@ -38,11 +39,21 @@ var ( Long: "Create a preview branch for the linked project.", Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - var name string + var body api.CreateBranchBody if len(args) > 0 { - name = args[0] + body.BranchName = args[0] } - return create.Run(cmd.Context(), name, branchRegion.Value, afero.NewOsFs()) + cmdFlags := cmd.Flags() + if cmdFlags.Changed("region") { + body.Region = &branchRegion.Value + } + if cmdFlags.Changed("size") { + body.DesiredInstanceSize = (*api.DesiredInstanceSize)(&size.Value) + } + if cmdFlags.Changed("persistent") { + body.Persistent = &persistent + } + return create.Run(cmd.Context(), body, afero.NewOsFs()) }, } @@ -76,6 +87,15 @@ var ( }, } + branchStatus = utils.EnumFlag{ + Allowed: []string{ + string(api.BranchResponseStatusRUNNINGMIGRATIONS), + string(api.BranchResponseStatusMIGRATIONSPASSED), + string(api.BranchResponseStatusMIGRATIONSFAILED), + string(api.BranchResponseStatusFUNCTIONSDEPLOYED), + string(api.BranchResponseStatusFUNCTIONSFAILED), + }, + } branchName string gitBranch string resetOnPush bool @@ -84,18 +104,25 @@ var ( Use: "update [branch-id]", Short: "Update a preview branch", Long: "Update a preview branch by its ID.", - Args: cobra.ExactArgs(1), + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + cmdFlags := cmd.Flags() var body api.UpdateBranchBody - if cmd.Flags().Changed("name") { + if cmdFlags.Changed("name") { body.BranchName = &branchName } - if cmd.Flags().Changed("git-branch") { + if cmdFlags.Changed("git-branch") { body.GitBranch = &gitBranch } - if cmd.Flags().Changed("reset-on-push") { + if cmdFlags.Changed("reset-on-push") { body.ResetOnPush = &resetOnPush } + if cmdFlags.Changed("persistent") { + body.Persistent = &persistent + } + if cmdFlags.Changed("status") { + body.Status = (*api.UpdateBranchBodyStatus)(&branchStatus.Value) + } ctx := cmd.Context() if len(args) == 0 { if err := promptBranchId(ctx, flags.ProjectRef); err != nil { @@ -139,15 +166,10 @@ var ( func init() { branchFlags := branchesCmd.PersistentFlags() branchFlags.StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.") - // Setup enum flags - i := 0 - for k := range utils.FlyRegions { - branchRegion.Allowed[i] = k - i++ - } - sort.Strings(branchRegion.Allowed) createFlags := branchCreateCmd.Flags() 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.") branchesCmd.AddCommand(branchCreateCmd) branchesCmd.AddCommand(branchListCmd) branchesCmd.AddCommand(branchGetCmd) @@ -155,12 +177,25 @@ func init() { updateFlags.StringVar(&branchName, "name", "", "Rename the preview branch.") updateFlags.StringVar(&gitBranch, "git-branch", "", "Change the associated git branch.") updateFlags.BoolVar(&resetOnPush, "reset-on-push", false, "Reset the preview branch on git push.") + updateFlags.BoolVar(&persistent, "persistent", false, "Switch between ephemeral and persistent branch.") + updateFlags.Var(&branchStatus, "status", "Override the current branch status.") branchesCmd.AddCommand(branchUpdateCmd) branchesCmd.AddCommand(branchDeleteCmd) branchesCmd.AddCommand(branchDisableCmd) rootCmd.AddCommand(branchesCmd) } +func flyRegions() []string { + result := make([]string, len(utils.FlyRegions)) + i := 0 + for k := range utils.FlyRegions { + result[i] = k + i++ + } + sort.Strings(result) + return result +} + func promptBranchId(ctx context.Context, ref string) error { resp, err := utils.GetSupabase().V1ListAllBranchesWithResponse(ctx, ref) if err != nil { diff --git a/cmd/projects.go b/cmd/projects.go index e2c1ddb45..08ec10dd8 100644 --- a/cmd/projects.go +++ b/cmd/projects.go @@ -30,12 +30,26 @@ var ( dbPassword string region = utils.EnumFlag{ - Allowed: make([]string, len(utils.RegionMap)), + Allowed: awsRegions(), } plan = utils.EnumFlag{ Allowed: []string{string(api.V1CreateProjectBodyPlanFree), string(api.V1CreateProjectBodyPlanPro)}, Value: string(api.V1CreateProjectBodyPlanFree), } + size = utils.EnumFlag{ + Allowed: []string{ + string(api.Micro), + string(api.Small), + string(api.Medium), + string(api.Large), + string(api.Xlarge), + string(api.N2xlarge), + string(api.N4xlarge), + string(api.N8xlarge), + string(api.N12xlarge), + string(api.N16xlarge), + }, + } projectsCreateCmd = &cobra.Command{ Use: "create [project name]", @@ -55,12 +69,16 @@ var ( if len(args) > 0 { projectName = args[0] } - return create.Run(cmd.Context(), api.V1CreateProjectBody{ + body := api.V1CreateProjectBody{ Name: projectName, OrganizationId: orgId, DbPass: dbPassword, Region: api.V1CreateProjectBodyRegion(region.Value), - }, afero.NewOsFs()) + } + if cmd.Flags().Changed("size") { + body.DesiredInstanceSize = (*api.DesiredInstanceSize)(&size.Value) + } + return create.Run(cmd.Context(), body, afero.NewOsFs()) }, } @@ -108,13 +126,6 @@ var ( ) func init() { - // Setup enum flags - i := 0 - for k := range utils.RegionMap { - region.Allowed[i] = k - i++ - } - sort.Strings(region.Allowed) // Add flags to cobra command createFlags := projectsCreateCmd.Flags() createFlags.BoolVarP(&interactive, "interactive", "i", true, "Enables interactive mode.") @@ -124,6 +135,7 @@ func init() { 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.") 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"))) apiKeysFlags := projectsApiKeysCmd.Flags() @@ -136,3 +148,14 @@ func init() { projectsCmd.AddCommand(projectsApiKeysCmd) rootCmd.AddCommand(projectsCmd) } + +func awsRegions() []string { + result := make([]string, len(utils.RegionMap)) + i := 0 + for k := range utils.RegionMap { + result[i] = k + i++ + } + sort.Strings(result) + return result +} diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index 06b05e581..4769a81d1 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -57,7 +57,7 @@ func Run(ctx context.Context, starter StarterTemplate, fsys afero.Fs, options .. } // 0. Download starter template if len(starter.Url) > 0 { - client := utils.GetGtihubClient(ctx) + client := utils.GetGitHubClient(ctx) if err := downloadSample(ctx, client, starter.Url, fsys); err != nil { return err } diff --git a/internal/branches/create/create.go b/internal/branches/create/create.go index 7486b9141..bf2931b68 100644 --- a/internal/branches/create/create.go +++ b/internal/branches/create/create.go @@ -12,23 +12,20 @@ import ( "github.com/supabase/cli/pkg/api" ) -func Run(ctx context.Context, name, region string, fsys afero.Fs) error { +func Run(ctx context.Context, body api.CreateBranchBody, fsys afero.Fs) error { gitBranch := keys.GetGitBranchOrDefault("", fsys) - if len(name) == 0 && len(gitBranch) > 0 { + if len(body.BranchName) == 0 && len(gitBranch) > 0 { title := fmt.Sprintf("Do you want to create a branch named %s?", utils.Aqua(gitBranch)) if shouldCreate, err := utils.NewConsole().PromptYesNo(ctx, title, true); err != nil { return err } else if !shouldCreate { return errors.New(context.Canceled) } - name = gitBranch + body.BranchName = gitBranch } + body.GitBranch = &gitBranch - resp, err := utils.GetSupabase().V1CreateABranchWithResponse(ctx, flags.ProjectRef, api.V1CreateABranchJSONRequestBody{ - BranchName: name, - GitBranch: &gitBranch, - Region: ®ion, - }) + resp, err := utils.GetSupabase().V1CreateABranchWithResponse(ctx, flags.ProjectRef, body) if err != nil { return errors.Errorf("failed to create preview branch: %w", err) } diff --git a/internal/branches/create/create_test.go b/internal/branches/create/create_test.go index 911aa23f7..6f56b586f 100644 --- a/internal/branches/create/create_test.go +++ b/internal/branches/create/create_test.go @@ -35,7 +35,9 @@ func TestCreateCommand(t *testing.T) { Id: "test-uuid", }) // Run test - err := Run(context.Background(), "", "sin", fsys) + err := Run(context.Background(), api.CreateBranchBody{ + Region: utils.Ptr("sin"), + }, fsys) // Check error assert.NoError(t, err) }) @@ -50,7 +52,9 @@ func TestCreateCommand(t *testing.T) { Post("/v1/projects/" + flags.ProjectRef + "/branches"). ReplyError(net.ErrClosed) // Run test - err := Run(context.Background(), "", "sin", fsys) + err := Run(context.Background(), api.CreateBranchBody{ + Region: utils.Ptr("sin"), + }, fsys) // Check error assert.ErrorIs(t, err, net.ErrClosed) }) @@ -65,7 +69,9 @@ func TestCreateCommand(t *testing.T) { Post("/v1/projects/" + flags.ProjectRef + "/branches"). Reply(http.StatusServiceUnavailable) // Run test - err := Run(context.Background(), "", "sin", fsys) + err := Run(context.Background(), api.CreateBranchBody{ + Region: utils.Ptr("sin"), + }, fsys) // Check error assert.ErrorContains(t, err, "Unexpected error creating preview branch:") }) diff --git a/internal/db/dump/templates/dump_schema.sh b/internal/db/dump/templates/dump_schema.sh index c45f36d9f..e1f6bc363 100755 --- a/internal/db/dump/templates/dump_schema.sh +++ b/internal/db/dump/templates/dump_schema.sh @@ -45,8 +45,7 @@ pg_dump \ | sed -E 's/^COMMENT ON EXTENSION (.+)/-- &/' \ | sed -E 's/^CREATE POLICY "cron_job_/-- &/' \ | sed -E 's/^ALTER TABLE "cron"/-- &/' \ -| sed -E "${EXTRA_SED:-}" \ -| uniq +| sed -E "${EXTRA_SED:-}" # Reset session config generated by pg_dump echo "RESET ALL;" diff --git a/internal/start/start.go b/internal/start/start.go index a37dc8ba7..dd14ad3f5 100644 --- a/internal/start/start.go +++ b/internal/start/start.go @@ -31,6 +31,7 @@ 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 suggestUpdateCmd(serviceImages map[string]string) string { @@ -110,10 +111,18 @@ 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").Parse(kongConfigEmbed)) + kongConfigTemplate = template.Must(template.New("kongConfig").Funcs(template.FuncMap{ + "StorageVersionBelow": StorageVersionBelow, + }).Parse(kongConfigEmbed)) //go:embed templates/custom_nginx.template nginxConfigEmbed string @@ -393,6 +402,7 @@ EOF "KONG_DECLARATIVE_CONFIG=/home/kong/kong.yml", "KONG_DNS_ORDER=LAST,A,CNAME", // https://github.com/supabase/cli/issues/14 "KONG_PLUGINS=request-transformer,cors", + fmt.Sprintf("KONG_PORT_MAPS=%d:8000", utils.Config.Api.Port), // Need to increase the nginx buffers in kong to avoid it rejecting the rather // sizeable response headers azure can generate // Ref: https://github.com/Kong/kong/issues/3974#issuecomment-482105126 @@ -841,7 +851,7 @@ 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", - "S3_ALLOW_FORWARDED_HEADER=true", + 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 6927edde1..3865eba1c 100644 --- a/internal/start/templates/kong.yml +++ b/internal/start/templates/kong.yml @@ -108,11 +108,13 @@ 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/internal/utils/access_token.go b/internal/utils/access_token.go index cce87611c..c94b9de83 100644 --- a/internal/utils/access_token.go +++ b/internal/utils/access_token.go @@ -12,7 +12,7 @@ import ( ) var ( - AccessTokenPattern = regexp.MustCompile(`^sbp_[a-f0-9]{40}$`) + AccessTokenPattern = regexp.MustCompile(`^sbp_(oauth_)?[a-f0-9]{40}$`) ErrInvalidToken = errors.New("Invalid access token format. Must be like `sbp_0102...1920`.") ErrMissingToken = errors.Errorf("Access token not provided. Supply an access token by running %s or setting the SUPABASE_ACCESS_TOKEN environment variable.", Aqua("supabase login")) ErrNotLoggedIn = errors.New("You were not logged in, nothing to do.") diff --git a/internal/utils/release.go b/internal/utils/release.go index e48df3b70..c68430c6a 100644 --- a/internal/utils/release.go +++ b/internal/utils/release.go @@ -16,7 +16,7 @@ var ( githubOnce sync.Once ) -func GetGtihubClient(ctx context.Context) *github.Client { +func GetGitHubClient(ctx context.Context) *github.Client { githubOnce.Do(func() { var client *http.Client if token := os.Getenv("GITHUB_TOKEN"); len(token) > 0 { @@ -36,7 +36,7 @@ const ( ) func GetLatestRelease(ctx context.Context) (string, error) { - client := GetGtihubClient(ctx) + client := GetGitHubClient(ctx) release, _, err := client.Repositories.GetLatestRelease(ctx, CLI_OWNER, CLI_REPO) if err != nil { return "", errors.Errorf("Failed to fetch latest release: %w", err) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index e3f8db9c3..c59dae1a5 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -42,12 +42,12 @@ const ( // Defines values for BranchResponseStatus. const ( - CREATINGPROJECT BranchResponseStatus = "CREATING_PROJECT" - FUNCTIONSDEPLOYED BranchResponseStatus = "FUNCTIONS_DEPLOYED" - FUNCTIONSFAILED BranchResponseStatus = "FUNCTIONS_FAILED" - MIGRATIONSFAILED BranchResponseStatus = "MIGRATIONS_FAILED" - MIGRATIONSPASSED BranchResponseStatus = "MIGRATIONS_PASSED" - RUNNINGMIGRATIONS BranchResponseStatus = "RUNNING_MIGRATIONS" + BranchResponseStatusCREATINGPROJECT BranchResponseStatus = "CREATING_PROJECT" + BranchResponseStatusFUNCTIONSDEPLOYED BranchResponseStatus = "FUNCTIONS_DEPLOYED" + BranchResponseStatusFUNCTIONSFAILED BranchResponseStatus = "FUNCTIONS_FAILED" + BranchResponseStatusMIGRATIONSFAILED BranchResponseStatus = "MIGRATIONS_FAILED" + BranchResponseStatusMIGRATIONSPASSED BranchResponseStatus = "MIGRATIONS_PASSED" + BranchResponseStatusRUNNINGMIGRATIONS BranchResponseStatus = "RUNNING_MIGRATIONS" ) // Defines values for CreateProviderBodyType. @@ -213,6 +213,16 @@ const ( Empty UpdateAuthConfigBodyPasswordRequiredCharacters = "" ) +// Defines values for UpdateBranchBodyStatus. +const ( + UpdateBranchBodyStatusCREATINGPROJECT UpdateBranchBodyStatus = "CREATING_PROJECT" + UpdateBranchBodyStatusFUNCTIONSDEPLOYED UpdateBranchBodyStatus = "FUNCTIONS_DEPLOYED" + UpdateBranchBodyStatusFUNCTIONSFAILED UpdateBranchBodyStatus = "FUNCTIONS_FAILED" + UpdateBranchBodyStatusMIGRATIONSFAILED UpdateBranchBodyStatus = "MIGRATIONS_FAILED" + UpdateBranchBodyStatusMIGRATIONSPASSED UpdateBranchBodyStatus = "MIGRATIONS_PASSED" + UpdateBranchBodyStatusRUNNINGMIGRATIONS UpdateBranchBodyStatus = "RUNNING_MIGRATIONS" +) + // Defines values for UpdateCustomHostnameResponseStatus. const ( N1NotStarted UpdateCustomHostnameResponseStatus = "1_not_started" @@ -244,6 +254,7 @@ const ( // Defines values for V1BackupStatus. const ( V1BackupStatusARCHIVED V1BackupStatus = "ARCHIVED" + V1BackupStatusCANCELLED V1BackupStatus = "CANCELLED" V1BackupStatusCOMPLETED V1BackupStatus = "COMPLETED" V1BackupStatusFAILED V1BackupStatus = "FAILED" V1BackupStatusPENDING V1BackupStatus = "PENDING" @@ -503,6 +514,13 @@ type AuthConfigResponse struct { MailerTemplatesReauthenticationContent *string `json:"mailer_templates_reauthentication_content"` MailerTemplatesRecoveryContent *string `json:"mailer_templates_recovery_content"` MfaMaxEnrolledFactors *float32 `json:"mfa_max_enrolled_factors"` + MfaPhoneEnrollEnabled *bool `json:"mfa_phone_enroll_enabled"` + MfaPhoneMaxFrequency *float32 `json:"mfa_phone_max_frequency"` + MfaPhoneOtpLength float32 `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"` PasswordHibpEnabled *bool `json:"password_hibp_enabled"` PasswordMinLength *float32 `json:"password_min_length"` PasswordRequiredCharacters *string `json:"password_required_characters"` @@ -623,9 +641,11 @@ type CfResponse struct { // CreateBranchBody defines model for CreateBranchBody. type CreateBranchBody struct { - BranchName string `json:"branch_name"` - GitBranch *string `json:"git_branch,omitempty"` - Region *string `json:"region,omitempty"` + BranchName string `json:"branch_name"` + DesiredInstanceSize *DesiredInstanceSize `json:"desired_instance_size,omitempty"` + GitBranch *string `json:"git_branch,omitempty"` + Persistent *bool `json:"persistent,omitempty"` + Region *string `json:"region,omitempty"` } // CreateOrganizationBodyV1 defines model for CreateOrganizationBodyV1. @@ -1196,6 +1216,13 @@ type UpdateAuthConfigBody struct { MailerTemplatesReauthenticationContent *string `json:"mailer_templates_reauthentication_content,omitempty"` MailerTemplatesRecoveryContent *string `json:"mailer_templates_recovery_content,omitempty"` MfaMaxEnrolledFactors *float32 `json:"mfa_max_enrolled_factors,omitempty"` + MfaPhoneEnrollEnabled *bool `json:"mfa_phone_enroll_enabled,omitempty"` + MfaPhoneMaxFrequency *float32 `json:"mfa_phone_max_frequency,omitempty"` + MfaPhoneOtpLength *float32 `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"` PasswordHibpEnabled *bool `json:"password_hibp_enabled,omitempty"` PasswordMinLength *float32 `json:"password_min_length,omitempty"` PasswordRequiredCharacters *UpdateAuthConfigBodyPasswordRequiredCharacters `json:"password_required_characters,omitempty"` @@ -1256,12 +1283,16 @@ type UpdateAuthConfigBodyPasswordRequiredCharacters 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"` - ResetOnPush *bool `json:"reset_on_push,omitempty"` + BranchName *string `json:"branch_name,omitempty"` + GitBranch *string `json:"git_branch,omitempty"` + Persistent *bool `json:"persistent,omitempty"` + ResetOnPush *bool `json:"reset_on_push,omitempty"` + Status *UpdateBranchBodyStatus `json:"status,omitempty"` } +// UpdateBranchBodyStatus defines model for UpdateBranchBody.Status. +type UpdateBranchBodyStatus string + // UpdateCustomHostnameBody defines model for UpdateCustomHostnameBody. type UpdateCustomHostnameBody struct { CustomHostname string `json:"custom_hostname"` diff --git a/pkg/config/config.go b/pkg/config/config.go index 984b9a587..5935addf4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -145,7 +145,7 @@ type ( MaxRows uint `toml:"max_rows"` Tls tlsKong `toml:"tls"` // TODO: replace [auth|studio].api_url - ExternalUrl string `toml:"-"` + ExternalUrl string `toml:"external_url"` } tlsKong struct { diff --git a/pkg/config/constants.go b/pkg/config/constants.go index f1be3f2bc..81f636b47 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -12,12 +12,12 @@ const ( pgmetaImage = "supabase/postgres-meta:v0.83.2" studioImage = "supabase/studio:20240729-ce42139" imageProxyImage = "darthsim/imgproxy:v3.8.0" - edgeRuntimeImage = "supabase/edge-runtime:v1.56.0" + edgeRuntimeImage = "supabase/edge-runtime:v1.56.1" vectorImage = "timberio/vector:0.28.1-alpine" supavisorImage = "supabase/supavisor:1.1.56" gotrueImage = "supabase/gotrue:v2.158.1" realtimeImage = "supabase/realtime:v2.30.23" - storageImage = "supabase/storage-api:v1.0.6" + storageImage = "supabase/storage-api:v1.10.1" logflareImage = "supabase/logflare:1.4.0" // Append to JobImages when adding new dependencies below DifferImage = "supabase/pgadmin-schema-diff:cli-0.0.5" diff --git a/tools/bumpdoc/main.go b/tools/bumpdoc/main.go index e8c754fdc..55d9de344 100644 --- a/tools/bumpdoc/main.go +++ b/tools/bumpdoc/main.go @@ -46,7 +46,7 @@ func updateRefDoc(ctx context.Context, path string, stdin io.Reader) error { return nil } fmt.Fprintf(os.Stderr, "Updating reference doc: %s\n", path) - client := utils.GetGtihubClient(ctx) + client := utils.GetGitHubClient(ctx) branch := "cli/ref-doc" master := "master" if err := shared.CreateGitBranch(ctx, client, SUPABASE_OWNER, SUPABASE_REPO, branch, master); err != nil { diff --git a/tools/changelog/main.go b/tools/changelog/main.go index 9940a05c4..97b587ed4 100644 --- a/tools/changelog/main.go +++ b/tools/changelog/main.go @@ -30,7 +30,7 @@ func main() { } func showChangeLog(ctx context.Context, slackChannel string) error { - client := utils.GetGtihubClient(ctx) + client := utils.GetGitHubClient(ctx) releases, _, err := client.Repositories.ListReleases(ctx, utils.CLI_OWNER, utils.CLI_REPO, &github.ListOptions{}) if err != nil { return err diff --git a/tools/publish/main.go b/tools/publish/main.go index 7ff943ff0..be2474edb 100644 --- a/tools/publish/main.go +++ b/tools/publish/main.go @@ -66,7 +66,7 @@ func publishPackages(ctx context.Context, version string, beta bool) error { config.Description += " (Beta)" filename += "-beta" } - client := utils.GetGtihubClient(ctx) + client := utils.GetGitHubClient(ctx) if err := updatePackage(ctx, client, HOMEBREW_REPO, filename+".rb", brewFormulaTemplate, config); err != nil { return err } diff --git a/tools/selfhost/main.go b/tools/selfhost/main.go index 10b0f2e11..cb9ada3a0 100644 --- a/tools/selfhost/main.go +++ b/tools/selfhost/main.go @@ -43,7 +43,7 @@ type ComposeFile struct { } func updateSelfHosted(ctx context.Context, branch string) error { - client := utils.GetGtihubClient(ctx) + client := utils.GetGitHubClient(ctx) master := "master" if err := shared.CreateGitBranch(ctx, client, SUPABASE_OWNER, SUPABASE_REPO, branch, master); err != nil { return err