Conversation
There was a problem hiding this comment.
Pull request overview
Adds server-side validation for the dnsSuffix field on device create/update routes to prevent query-string injection (issue #2389), along with a focused unit test for the new validator behavior.
Changes:
- Add
dnsSuffixvalidation to the existing devices request validator (length + FQDN). - Add a new unit test suite covering valid/null/invalid
dnsSuffixvalues.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/routes/devices/deviceValidator.ts |
Introduces dnsSuffix validation using express-validator (isLength + isFQDN). |
src/routes/devices/deviceValidator.test.ts |
Adds unit tests to exercise the new dnsSuffix validation chain. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f481917 to
40480fd
Compare
|
Thanks for this! would like to see a postman api test call update to cover some of the enhanced validation. but will approve nonetheless. |
40480fd to
90f34ea
Compare
good call, I have added total of 8 API tests (positive and negative) into the collection and the CI is passed. |
## [2.26.5](v2.26.4...v2.26.5) (2026-04-21) ### Bug Fixes * added input validator for dnsSuffix ([#2393](#2393)) ([355bb85](355bb85))
|
🎉 This PR is included in version 2.26.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
PR Checklist
What are you changing?
Anything the reviewer should know when reviewing this PR?
Testing
MPS return 400 instead of 200
If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )