• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 19497490251

19 Nov 2025 10:07AM UTC coverage: 55.082% (+0.006%) from 55.076%
19497490251

Pull #4420

github

web-flow
Merge 7439d428c into 28425f504
Pull Request #4420: feat: support append mode when updating network restrictions

25 of 38 new or added lines in 3 files covered. (65.79%)

57 existing lines in 3 files now uncovered.

6530 of 11855 relevant lines covered (55.08%)

6.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/restrictions.go
1
package cmd
2

3
import (
4
        "github.com/spf13/cobra"
5
        "github.com/supabase/cli/internal/restrictions/get"
6
        "github.com/supabase/cli/internal/restrictions/update"
7
        "github.com/supabase/cli/internal/utils/flags"
8
)
9

10
var (
11
        restrictionsCmd = &cobra.Command{
12
                GroupID: groupManagementAPI,
13
                Use:     "network-restrictions",
14
                Short:   "Manage network restrictions",
15
        }
16

17
        dbCidrsToAllow   []string
18
        bypassCidrChecks bool
19
        appendMode       bool
20

21
        restrictionsUpdateCmd = &cobra.Command{
22
                Use:   "update",
23
                Short: "Update network restrictions",
24
                RunE: func(cmd *cobra.Command, args []string) error {
×
NEW
25
                        return update.Run(cmd.Context(), flags.ProjectRef, dbCidrsToAllow, bypassCidrChecks, appendMode)
×
26
                },
×
27
        }
28

29
        restrictionsGetCmd = &cobra.Command{
30
                Use:   "get",
31
                Short: "Get the current network restrictions",
32
                RunE: func(cmd *cobra.Command, args []string) error {
×
33
                        return get.Run(cmd.Context(), flags.ProjectRef)
×
34
                },
×
35
        }
36
)
37

38
func init() {
×
39
        restrictionsCmd.PersistentFlags().StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.")
×
40
        restrictionsUpdateCmd.Flags().StringSliceVar(&dbCidrsToAllow, "db-allow-cidr", []string{}, "CIDR to allow DB connections from.")
×
41
        restrictionsUpdateCmd.Flags().BoolVar(&bypassCidrChecks, "bypass-cidr-checks", false, "Bypass some of the CIDR validation checks.")
×
NEW
42
        restrictionsUpdateCmd.Flags().BoolVar(&appendMode, "append", false, "Append to existing restrictions instead of replacing them.")
×
43
        restrictionsCmd.AddCommand(restrictionsGetCmd)
×
44
        restrictionsCmd.AddCommand(restrictionsUpdateCmd)
×
45
        rootCmd.AddCommand(restrictionsCmd)
×
46
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc