Skip to content

refactor: deprecate redundant rule flags from network-acl create and update - #1647

Merged
bkiran6398 merged 6 commits into
mainfrom
DXCDT-2385/remove-redundant-flags-network-acl
Sep 9, 2026
Merged

refactor: deprecate redundant rule flags from network-acl create and update#1647
bkiran6398 merged 6 commits into
mainfrom
DXCDT-2385/remove-redundant-flags-network-acl

Conversation

@bkiran6398

@bkiran6398 bkiran6398 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🔧 Changes

auth0 network-acl create and update registered 12 rule flags (--action, --redirect-uri, --scope, --asns, --country-codes, --subdivision-codes, --ipv4-cidrs, --ipv6-cidrs, --ja3-fingerprints, --ja4-fingerprints, --user-agents, --auth0-managed) that were never used. The rule was built only from --rule (JSON) or interactive prompts, so passing these flags had no effect and silently misled users.

Update done to fix:

  • Deperecate the 12 no-op flags from both commands. Interactive prompting behavior for the same values (when --rule is not supplied) is unchanged.
  • Registers --description, --active, --priority, and --rule through the shared flag definitions and switches flag checks to the standard "is set" helper, aligning with the rest of the CLI.
  • Consolidates description validation into one reusable check.
> auth0 network-acl create --ipv4-cidrs "0.0.0.2"
Flag --ipv4-cidrs has been deprecated, use `--rule` to set the configuration as JSON.
 Description: Test1
 Active: Yes
 Priority: 1

📚 References

🔬 Testing

  • Manually verified:
    • non-interactive create/update with --rule
    • interactive prompting with/without --rule
    • invalid --rule JSON fails before prompting
    • deprecated flags now warns to use --rule flag

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

- Remove the 12 rule flags (--action, --redirect-uri, --scope, --asns,
  --country-codes, --subdivision-codes, --ipv4-cidrs, --ipv6-cidrs,
  --ja3-fingerprints, --ja4-fingerprints, --user-agents, --auth0-managed)
  from create and update; they were never read non-interactively, where the
  rule is built only from --rule. Interactive prompting for these values is
  unchanged.
- Register --description, --active, --priority and --rule through the
  package-level Flag structs (RegisterString/RegisterInt and the U variants)
  and switch flag checks to IsSet, dropping raw cmd.Flags() calls.
- Collapse the two update branches that patch from flags into one guard placed
  before the ACL read, removing a wasted API call when flags are provided in
  interactive mode.
- Extract validateNetworkACLDescription and reuse it across create and update.
- Regenerate command docs.

BREAKING CHANGE: the 12 removed flags now fail with an "unknown flag" error.
Pass the full rule as JSON via --rule to configure it non-interactively.
@bkiran6398 bkiran6398 changed the title refactor(network-acl)!: remove redundant rule flags refactor!: remove redundant rule flags from network-acl create and update Sep 8, 2026
@bkiran6398 bkiran6398 changed the title refactor!: remove redundant rule flags from network-acl create and update refactor: remove redundant rule flags from network-acl create and update Sep 8, 2026
@bkiran6398
bkiran6398 marked this pull request as ready for review September 8, 2026 08:43
@bkiran6398
bkiran6398 requested a review from a team as a code owner September 8, 2026 08:43
- Re-add the 12 per-criteria rule flags (--action, --redirect-uri, --scope,
  --asns, --country-codes, --subdivision-codes, --ipv4-cidrs, --ipv6-cidrs,
  --ja3-fingerprints, --ja4-fingerprints, --user-agents, --auth0-managed) to
  create and update, restoring backward compatibility so existing scripts no
  longer fail with an "unknown flag" error.
- Mark each flag deprecated via a new Flag.Deprecate helper, which wraps
  cobra's MarkDeprecated and panics with the flag name on failure. Using a
  flag now prints guidance to pass the rule as JSON via --rule, and the flag
  is hidden from help and generated docs.
- The flags are accepted but ignored when building the rule, matching their
  prior non-interactive behavior; the rule is still built solely from --rule
  or the interactive prompts.
@bkiran6398 bkiran6398 changed the title refactor: remove redundant rule flags from network-acl create and update refactor: deprecate redundant rule flags from network-acl create and update Sep 9, 2026
bkiran6398 and others added 3 commits September 9, 2026 12:52
- Replace shared top-level Flag variables with locally-defined Flag structs
  in promptForRuleDetails and promptForMatchCriteria, so interactive prompts
  no longer reuse the deprecated command flags.
- Drop the LongForm on the inlined prompt flags, which is unused for
  interactive prompting.
@bkiran6398
bkiran6398 merged commit 1126f91 into main Sep 9, 2026
6 checks passed
@bkiran6398
bkiran6398 deleted the DXCDT-2385/remove-redundant-flags-network-acl branch September 9, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants