Skip to content

feat: add wireless profile management API#921

Draft
shaoboon wants to merge 1 commit intomainfrom
sb_wifiprofile_api2
Draft

feat: add wireless profile management API#921
shaoboon wants to merge 1 commit intomainfrom
sb_wifiprofile_api2

Conversation

@shaoboon
Copy link
Copy Markdown
Contributor

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 74.68880% with 122 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.36%. Comparing base (b532c62) to head (ef25e79).

Files with missing lines Patch % Lines
internal/mocks/wsman_mocks.go 0.00% 44 Missing ⚠️
internal/controller/openapi/devicemanagement.go 0.00% 28 Missing ⚠️
internal/mocks/devicemanagement_mocks.go 0.00% 18 Missing ⚠️
internal/mocks/wsv1_mocks.go 0.00% 18 Missing ⚠️
internal/controller/httpapi/router.go 0.00% 13 Missing ⚠️
internal/usecase/devices/wifiprofile.go 99.64% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #921      +/-   ##
==========================================
+ Coverage   39.92%   41.36%   +1.43%     
==========================================
  Files         123      126       +3     
  Lines       11355    11832     +477     
==========================================
+ Hits         4534     4894     +360     
- Misses       6424     6541     +117     
  Partials      397      397              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a wireless profile management API to the device management surface, wiring new WSMAN operations through the devices usecase and exposing HTTP/OpenAPI endpoints backed by request validation.

Changes:

  • Extend WSMAN Management + devices Feature interfaces to support WiFi profile CRUD-like operations (list/apply) and IEEE802.1x dependencies.
  • Add devices usecase implementation for GetWirelessProfiles / ApplyWirelessProfiles, including certificate/credential handling for 802.1x.
  • Introduce DTO request type + custom validators and register them in the HTTP router; add HTTP routes, mocks, and tests.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
internal/usecase/devices/wsman/interfaces.go Expands WSMAN management interface with WiFi profile + 802.1x/cert helpers.
internal/usecase/devices/wifistate.go Import cleanup (no functional change).
internal/usecase/devices/wifistate_test.go Import cleanup (no functional change).
internal/usecase/devices/wifiprofile.go New usecase logic to list/apply wireless profiles, map 802.1x associations, and manage cert handles.
internal/usecase/devices/wifiprofile_test.go New usecase tests for list/apply flows.
internal/usecase/devices/wifiprofile_private_test.go New unit tests for internal mapping/handle-resolution helpers.
internal/usecase/devices/interfaces.go Adds GetWirelessProfiles/ApplyWirelessProfiles to the devices feature interface.
internal/mocks/wsv1_mocks.go Updates WS v1 mocks for new feature methods.
internal/mocks/wsman_mocks.go Updates WSMAN mocks with new management methods.
internal/mocks/devicemanagement_mocks.go Updates device management feature mocks for new API methods.
internal/entity/dto/v1/wifiprofile.go Adds WirelessProfilesApplyRequest and custom validators for wireless profile payloads.
internal/entity/dto/v1/wifiprofile_test.go Adds tests for new validators.
internal/controller/ws/v1/interface.go Extends WS interface with wireless profile operations.
internal/controller/openapi/devicemanagement.go Adds OpenAPI route definitions + example handlers for wireless profiles.
internal/controller/httpapi/v1/wifiprofile.go Adds HTTP handlers for get/apply wireless profiles.
internal/controller/httpapi/v1/wifiprofile_test.go Adds route tests for wireless profile endpoints.
internal/controller/httpapi/v1/devicemanagement.go Registers new WiFi profile routes under /amt/networkSettings/wireless/profile/:guid.
internal/controller/httpapi/router.go Refactors and centralizes custom validator registration; registers new wireless-profile validators.
integration-test/collections/console_mps_apis.postman_collection.json Adds Postman collection entries for the new endpoints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/controller/openapi/devicemanagement.go
Comment thread internal/usecase/devices/wifiprofile.go Outdated
Comment thread internal/usecase/devices/wifiprofile.go Outdated
Comment thread internal/controller/httpapi/v1/wifiprofile_test.go
Comment thread internal/usecase/devices/wifiprofile.go Outdated
Comment thread internal/usecase/devices/wifiprofile.go Outdated
@shaoboon shaoboon force-pushed the sb_wifiprofile_api2 branch from ad49ca8 to 66c8f6e Compare May 4, 2026 06:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/usecase/devices/wifiprofile.go
Comment on lines +73 to +79
if err := clearWirelessProfiles(device); err != nil {
return nil, err
}

if err := applyPreparedWirelessProfiles(device, preparedProfiles); err != nil {
return nil, err
}
Comment on lines +17 to +20
// WirelessProfilesApplyRequest carries the desired wireless profile list for one device.
type WirelessProfilesApplyRequest struct {
Profiles []config.WirelessProfile `json:"profiles" binding:"wirelessprofilescount,wirelessprofilesuniquepriorities,dive,wirelessprofile"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants