MCPcopy Create free account
hub / github.com/auth0/auth0-cli / updateBotDetectionCmd

Function updateBotDetectionCmd

internal/cli/attack_protection_bot_detection.go:121–149  ·  view source on GitHub ↗
(cli *cli)

Source from the content-addressed store, hash-verified

119}
120
121func updateBotDetectionCmd(cli *cli) *cobra.Command {
122 var inputs botDetectionInputs
123
124 cmd := &cobra.Command{
125 Use: "update",
126 Args: cobra.NoArgs,
127 Short: "Update bot detection settings",
128 Long: "Update the bot detection settings.",
129 Example: ` auth0 protection bot-detection update
130 auth0 ap bd update --bot-detection-level medium --json-compact
131 auth0 ap bd update --bot-detection-level low --challenge-password-policy never
132 auth0 ap bd update --monitoring-mode-enabled=true --allowlist "198.51.100.42,10.0.0.0/24"
133 auth0 ap bd update -l high -a "198.51.100.42" -m=false --json`,
134 RunE: updateBotDetectionCmdRun(cli, &inputs),
135 }
136
137 bdFlags.BotDetectionLevel.RegisterStringU(cmd, &inputs.BotDetectionLevel, "")
138 bdFlags.ChallengePasswordPolicy.RegisterStringU(cmd, &inputs.ChallengePasswordPolicy, "")
139 bdFlags.ChallengePasswordlessPolicy.RegisterStringU(cmd, &inputs.ChallengePasswordlessPolicy, "")
140 bdFlags.ChallengePasswordResetPolicy.RegisterStringU(cmd, &inputs.ChallengePasswordResetPolicy, "")
141 bdFlags.AllowList.RegisterStringSliceU(cmd, &inputs.AllowList, []string{})
142 bdFlags.MonitoringModeEnabled.RegisterBoolU(cmd, &inputs.MonitoringModeEnabled, false)
143
144 cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.")
145 cmd.Flags().BoolVar(&cli.jsonCompact, "json-compact", false, "Output in compact json format.")
146 cmd.MarkFlagsMutuallyExclusive("json", "json-compact")
147
148 return cmd
149}
150
151func showBotDetectionCmdRun(cli *cli) func(cmd *cobra.Command, args []string) error {
152 return func(cmd *cobra.Command, args []string) error {

Callers 1

botDetectionCmdFunction · 0.85

Calls 4

updateBotDetectionCmdRunFunction · 0.85
RegisterStringUMethod · 0.80
RegisterStringSliceUMethod · 0.80
RegisterBoolUMethod · 0.80

Tested by

no test coverage detected