refactor: deprecate redundant rule flags from network-acl create and update - #1647
Merged
Merged
Conversation
- 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
marked this pull request as ready for review
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.
- 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.
ramya18101
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Changes
auth0 network-aclcreateandupdateregistered 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:
--ruleis not supplied) is unchanged.--description,--active,--priority, and--rulethrough the shared flag definitions and switches flag checks to the standard "is set" helper, aligning with the rest of the CLI.📚 References
🔬 Testing
--rule--rule--ruleJSON fails before prompting--ruleflag📝 Checklist