The access-control API accepts capability names only, never numbers #31
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#296 API inputs that take an enum as text accept member names only
lantea-one/ninlil
Reference
lantea-one/ninlil#31
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
DnsAccessControlRulesController.TryParseCapabilities(
src/dotnet/src/Ninlil.Web/Controllers/DnsAccessControlRulesController.cs:289-324) usesEnum.TryParse, which also accepts a digit string.Enum.IsDefined(:306) rejects a combinedvalue such as
"3"when 3 is not a member, but a digit string equal to a single member's value(for example
"1") is accepted today. The API documents an array of member names(
Models/DnsAccessControlRuleModels.cs:18-20), and the summary at:285-287says names arematched case-sensitively. The owner decided on names only, so this is a small code fix, not only
documentation.
What changes
TryParseCapabilities: accept an entry only when it equals a member name exactly (ordinalcomparison against
Enum.GetNames<DnsAccessControlCapabilityEnum>(),Noneexcluded); everyother entry gets the existing 400 message with the list of valid names. Update the summary to
say digit strings are refused.
Acceptance
["1"](a single member's value) gives 400;["3"]still gives400; every member name is still accepted.
OpenApiSnapshotTestspasses unchanged (no model text change).Source
d-design.md:393,b23-design.md:243,u-design.md:221.Owner decision 2026-10-31 (Q-REL-5 = Q-BUG-10): "names only".
Ghost referenced this issue2026-11-05 07:50:56 -05:00
Ghost referenced this issue2026-11-05 07:51:19 -05:00