Skip to content

Commit

Permalink
Merge branch 'develop' into avallete/feat-stop-all-projects
Browse files Browse the repository at this point in the history
  • Loading branch information
avallete authored Sep 13, 2024
2 parents 3b96427 + 54fa898 commit 1c657ca
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 102 deletions.
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ func init() {
flags.String("workdir", "", "path to a Supabase project directory")
flags.Bool("experimental", false, "enable experimental features")
flags.String("network-id", "", "use the specified docker network instead of a generated one")
flags.Var(&utils.OutputFormat, "output", "output format of status variables")
flags.Var(&utils.DNSResolver, "dns-resolver", "lookup domain names using the specified resolver")
flags.BoolVar(&createTicket, "create-ticket", false, "create a support ticket for any CLI error")
cobra.CheckErr(viper.BindPFlags(flags))
Expand Down
17 changes: 6 additions & 11 deletions cmd/sso.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ var (
ssoDomains []string
ssoAddDomains []string
ssoRemoveDomains []string
ssoOutput = utils.EnumFlag{
Allowed: utils.OutputDefaultAllowed,
Value: utils.OutputPretty,
}

ssoAddCmd = &cobra.Command{
Use: "add",
Expand All @@ -47,7 +43,7 @@ var (
return create.Run(cmd.Context(), create.RunParams{
ProjectRef: flags.ProjectRef,
Type: ssoProviderType.String(),
Format: ssoOutput.Value,
Format: utils.OutputFormat.Value,
MetadataFile: ssoMetadataFile,
MetadataURL: ssoMetadataURL,
SkipURLValidation: ssoSkipURLValidation,
Expand All @@ -68,7 +64,7 @@ var (
return errors.Errorf("identity provider ID %q is not a UUID", args[0])
}

return remove.Run(cmd.Context(), flags.ProjectRef, args[0], ssoOutput.Value)
return remove.Run(cmd.Context(), flags.ProjectRef, args[0], utils.OutputFormat.Value)
},
}

Expand All @@ -86,7 +82,7 @@ var (
return update.Run(cmd.Context(), update.RunParams{
ProjectRef: flags.ProjectRef,
ProviderID: args[0],
Format: ssoOutput.Value,
Format: utils.OutputFormat.Value,

MetadataFile: ssoMetadataFile,
MetadataURL: ssoMetadataURL,
Expand All @@ -110,7 +106,7 @@ var (
return errors.Errorf("identity provider ID %q is not a UUID", args[0])
}

format := ssoOutput.Value
format := utils.OutputFormat.Value
if ssoMetadata {
format = utils.OutputMetadata
}
Expand All @@ -125,7 +121,7 @@ var (
Long: "List all connections to a SSO identity provider to your Supabase project.",
Example: ` supabase sso list --project-ref mwjylndxudmiehsxhmmz`,
RunE: func(cmd *cobra.Command, args []string) error {
return list.Run(cmd.Context(), flags.ProjectRef, ssoOutput.Value)
return list.Run(cmd.Context(), flags.ProjectRef, utils.OutputFormat.Value)
},
}

Expand All @@ -135,15 +131,14 @@ var (
Long: "Returns all of the important SSO information necessary for your project to be registered with a SAML 2.0 compatible identity provider.",
Example: ` supabase sso info --project-ref mwjylndxudmiehsxhmmz`,
RunE: func(cmd *cobra.Command, args []string) error {
return info.Run(cmd.Context(), flags.ProjectRef, ssoOutput.Value)
return info.Run(cmd.Context(), flags.ProjectRef, utils.OutputFormat.Value)
},
}
)

func init() {
persistentFlags := ssoCmd.PersistentFlags()
persistentFlags.StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.")
persistentFlags.VarP(&ssoOutput, "output", "o", "Output format")
ssoAddFlags := ssoAddCmd.Flags()
ssoAddFlags.VarP(&ssoProviderType, "type", "t", "Type of identity provider (according to supported protocol).")
ssoAddFlags.StringSliceVar(&ssoDomains, "domains", nil, "Comma separated list of email domains to associate with the added identity provider.")
Expand Down
1 change: 1 addition & 0 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var (
Allowed: append([]string{utils.OutputEnv}, utils.OutputDefaultAllowed...),
Value: utils.OutputPretty,
}

statusCmd = &cobra.Command{
GroupID: groupLocalDev,
Use: "status",
Expand Down
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/glamour v0.7.0
github.com/charmbracelet/lipgloss v0.12.1
github.com/containers/common v0.59.2
github.com/containers/common v0.60.2
github.com/danieljoos/wincred v1.2.1
github.com/deepmap/oapi-codegen/v2 v2.2.0
github.com/docker/cli v27.2.1+incompatible
Expand Down Expand Up @@ -40,7 +40,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/muesli/reflow v0.3.0
github.com/oapi-codegen/runtime v1.1.1
github.com/slack-go/slack v0.13.1
github.com/slack-go/slack v0.14.0
github.com/spf13/afero v1.11.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
Expand All @@ -49,11 +49,11 @@ require (
github.com/stripe/pg-schema-diff v0.7.0
github.com/withfig/autocomplete-tools/packages/cobra v1.2.0
github.com/zalando/go-keyring v0.2.5
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel v1.30.0
golang.org/x/mod v0.20.0
golang.org/x/oauth2 v0.21.0
golang.org/x/term v0.22.0
google.golang.org/grpc v1.65.0
golang.org/x/oauth2 v0.23.0
golang.org/x/term v0.24.0
google.golang.org/grpc v1.66.2
gopkg.in/yaml.v3 v3.0.1
gotest.tools/gotestsum v1.12.0
)
Expand Down Expand Up @@ -111,17 +111,17 @@ require (
github.com/cloudwego/iasm v0.2.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.54.0 // indirect
github.com/containers/storage v1.55.0 // indirect
github.com/curioswitch/go-reassign v0.2.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.5 // indirect
github.com/cyphar/filepath-securejoin v0.3.1 // indirect
github.com/daixiang0/gci v0.13.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/denis-tingaikin/go-header v0.5.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/dlclark/regexp2 v1.4.0 // 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.1 // 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/emirpasic/gods v1.18.1 // indirect
Expand Down Expand Up @@ -225,7 +225,7 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mgechev/revive v1.3.7 // indirect
github.com/microcosm-cc/bluemonday v1.0.25 // indirect
Expand Down Expand Up @@ -322,24 +322,24 @@ require (
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.22.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/protobuf v1.34.2 // indirect
Expand Down
Loading

0 comments on commit 1c657ca

Please sign in to comment.