feat(endpoint): warn when added security item's option toggle is disabled (DX-5701)#33
Merged
johnpmitsch merged 1 commit intoJun 13, 2026
Conversation
…bled (DX-5701) Items added under a disabled security option are not enforced and do not appear in list output until the option is enabled via set-options, so a plain success message made them look like they silently vanished. After every toggle-governed add/set (token create, referrer add, ip add, jwt add, domain-mask add, request-filter create, ip-header set), the CLI now makes one best-effort GET of the endpoint's security options and, if the governing option is disabled, prints a stderr warning with the exact 'qn endpoint security set-options --<option> enabled <ID>' command. The check never blocks: a failed lookup is swallowed (the add already succeeded), and --quiet skips the extra request entirely. Adds OutputCtx::warn for advisory stderr messages alongside note. Tests: 4 in-process (disabled warns, quiet skips the GET, failed check still exits 0, second command coverage) + 2 subprocess stderr-content tests (warning text with enable hint; no warning when enabled).
markwu35
approved these changes
Jun 12, 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.
Summary
Items added under a disabled security option are not enforced and don't appear in list output until the option is enabled via
set-options— so a plain success message made them look like they silently vanished:After every toggle-governed add/set (
token create,referrer add,ip add,jwt add,domain-mask add,request-filter create,ip-header set), the CLI now makes one best-effortGET /endpoints/{id}/security_optionsand, if the governing option is disabled, warns on stderr with the exact enable command:The check never blocks: a failed lookup is swallowed (the add already succeeded, exit 0 either way), and
--quietskips the extra request entirely. AddsOutputCtx::warnfor advisory stderr messages alongsidenote.Closes DX-5701
Test plan
endpoint_security_referrer_add_warns_when_option_disabled— add + options GET both hit, exit 0endpoint_security_referrer_add_skips_options_check_when_quiet— options GET.expect(0)under--quietendpoint_security_referrer_add_succeeds_when_options_check_fails— options GET 500 → still exit 0endpoint_security_domain_mask_add_checks_options— second-command coveragecargo test(all suites green),cargo clippy --all-targets -- -D warnings,cargo fmt --check