feat(api): add wireless local and UEFI profile sync endpoints#1063
feat(api): add wireless local and UEFI profile sync endpoints#1063shaoboon wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1063 +/- ##
==========================================
+ Coverage 43.39% 43.44% +0.04%
==========================================
Files 141 143 +2
Lines 13397 13621 +224
==========================================
+ Hits 5814 5917 +103
- Misses 7022 7143 +121
Partials 561 561 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds /api/v1 endpoints to read/toggle AMT wireless profile synchronization settings (Local Profile Sync + UEFI Profile Share) by driving WiFiPortConfigurationService over WSMAN, and wires the feature through interfaces, OpenAPI declarations, mocks, Postman collection, and unit tests.
Changes:
- Introduces use-case methods and WSMAN interface support for GET/PUT on
WiFiPortConfigurationServiceto manage local/UEFI WiFi profile sync flags. - Adds new v1 Gin handlers + DTOs for
enabledpayloads, plus OpenAPI (Fuego) route declarations. - Updates generated mocks and extends the MPS Postman collection; adds handler/use-case/DTO unit tests.
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/usecase/devices/wsman/interfaces.go | Extends WSMAN Management interface with WiFi port config service GET/PUT. |
| internal/usecase/devices/wifiprofilesync.go | New use-case implementation for local + UEFI profile sync toggles. |
| internal/usecase/devices/wifiprofilesync_test.go | Unit tests for new use-case behavior. |
| internal/usecase/devices/interfaces.go | Adds new feature methods to devices use-case interface. |
| internal/mocks/wsv1_mocks.go | Regenerated mocks for ws/v1 feature interface changes. |
| internal/mocks/wsman_mocks.go | Regenerated WSMAN mocks for new management methods. |
| internal/mocks/devicemanagement_mocks.go | Regenerated device management feature mocks for new methods. |
| internal/entity/dto/v1/wifiprofilesync.go | New DTO request/response for { "enabled": <bool> }. |
| internal/entity/dto/v1/wifiprofilesync_test.go | Unit tests for DTO JSON unmarshalling and helper. |
| internal/controller/ws/v1/interface.go | Adds new methods to ws/v1 Feature interface. |
| internal/controller/openapi/devicemanagement.go | Declares new endpoints in Fuego/OpenAPI adapter. |
| internal/controller/httpapi/v1/wifiprofilesync.go | Adds Gin handlers for the new endpoints. |
| internal/controller/httpapi/v1/wifiprofilesync_test.go | Handler unit tests for the new routes. |
| internal/controller/httpapi/v1/devicemanagement.go | Registers new routes under /api/v1/amt/networkSettings/wireless/*. |
| integration-test/collections/console_mps_apis.postman_collection.json | Adds Postman requests for the new endpoints. |
Files not reviewed (3)
- internal/mocks/devicemanagement_mocks.go: Language not supported
- internal/mocks/wsman_mocks.go: Language not supported
- internal/mocks/wsv1_mocks.go: Language not supported
|
@shaoboon : This is how I'd shape these api's GET /api/v1/amt/networkSettings/wireless/profileSync/:guid POST /api/v1/amt/networkSettings/wireless/profileSync/:guid
|
cbd5345 to
35262b9
Compare
Add GET/POST endpoints to read and toggle AMT wireless profile
synchronization on a device:
GET/POST /api/v1/amt/networkSettings/wireless/profileSync/{guid}
The use case drives the WiFiPortConfigurationService over WSMAN,
reading current state and only issuing a PUT when the requested
value differs. UEFI sync is gated on the device's
UEFIWiFiCoExistenceAndProfileShare power capability so unsupported
hardware can't be enabled.
Wires the new methods through the devices.Feature and ws/v1.Feature
interfaces, regenerates mocks, declares the routes in the Fuego
OpenAPI adapter, and adds matching entries to the MPS Postman
collection. Covered by handler and use-case unit tests.
Resolves #835
|
Add GET/POST endpoints to read and toggle AMT wireless profile synchronization on a device:
GET/POST /api/v1/amt/networkSettings/wireless/profileSync/{guid}
The use case drives the WiFiPortConfigurationService over WSMAN, reading current state and only issuing a PUT when the requested value differs. UEFI sync is gated on the device's
UEFIWiFiCoExistenceAndProfileShare power capability so unsupported hardware can't be enabled.
Wires the new methods through the devices.Feature and ws/v1.Feature interfaces, regenerates mocks, declares the routes in the Fuego OpenAPI adapter, and adds matching entries to the MPS Postman collection. Covered by handler and use-case unit tests.
Resolves #835
NOTES:
On-target Functional Test
Functional Postman/Newman corpus for the WiFi Profile Sync feature in Console. The
objective is to exercise the behavior of the API (every logic branch in the use
case), not merely the request contract.
Files
Endpoints under test
/api/v1/amt/networkSettings/wireless/profileSync/{guid}/api/v1/amt/networkSettings/wireless/profileSync/{guid}Pre-requisites
How to run
Test cases
localProfileSyncas string{"localProfileSync":"yes"}uefiProfileSyncas number{"uefiProfileSync":1}{"localProfileSync":true}uefiProfileSyncSupported→uefiSupported{"localProfileSync":false}localProfileSync=falselocalProfileSync=false{"localProfileSync":true}localProfileSync=truelocalProfileSync=true{"uefiProfileSync":true}uefiProfileSync=trueifuefiSupported, else 409{"uefiProfileSync":false}uefiProfileSync=false{}{"localProfileSync":null,"uefiProfileSync":null}localProfileSync=true,uefiProfileSync=false