Repository navigation
fix: require 802.1x username for PEAP-MSCHAPv2 in wireless profile API - #1319
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The tightened API contract is not reflected in OpenAPI or Postman artifacts.
1 open finding
What changed in this PR
Adds PEAP-MSCHAPv2 username validation to the wireless profile API.
Changes:
- Rejects PEAP profiles without usernames.
- Adds DTO and HTTP-route validation tests.
| File | Description |
|---|---|
internal/entity/dto/v1/wifiprofile.go |
Enforces PEAP usernames. |
internal/entity/dto/v1/wifiprofile_test.go |
Tests validation behavior. |
internal/controller/httpapi/v1/wifiprofile_test.go |
Tests API rejection and acceptance. |
🧠 Review effort: Balanced
JIRA:
#1099
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1319 +/- ##
==========================================
+ Coverage 62.24% 62.28% +0.03%
==========================================
Files 159 159
Lines 13417 13420 +3
==========================================
+ Hits 8351 8358 +7
+ Misses 5066 5062 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
16157a3 to
72b0ca6
Compare
There was a problem hiding this comment.
Thanks @choonkeat1986! Thanks for adding the username check. does PEAP also need a password?, if so please require that too, and confirm that PEAP requests without a username never worked anyway, since those requests now get a 400 error.
72b0ca6 to
de569be
Compare
Yes. PEAPv0/EAP-MSCHAPv2 logs in with a username and a password, so the validator now requires both, and a request that is missing either gets 400. Yes, requests without a username: console sent them to AMT with no Username element (go-wsman-messages uses omitempty), so the profile had no identity and MSCHAPv2 could not authenticate. |
|
🎉 This PR is included in version 1.46.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |

#1099