fix(cli): 🐛 fix nRF93M1 onboarding issue#86
Closed
noahp wants to merge 1 commit into
Closed
Conversation
### Summary
The new `nrf93_onboard.py` JWT-based onboarding flow was hitting
`POST /v1/devices/{deviceId}` with a JSON body, but that endpoint doesn't
exist. The `OnboardDevices` operation is `POST /v1/devices` and takes a
**CSV text body** - same as cert-based onboarding, just with the certificate
column left empty and the JWT in the `onboardingToken` column:
```
deviceId,subType,tags,supportedFirmwareTypes,,onboardingToken
```
The script was also treating any 2xx as success and not polling for the async
result. `POST /v1/devices` returns 202 + `bulkOpsRequestId`, so we now poll
`GET /v1/bulk-ops-requests/{id}` until `SUCCEEDED` (or fail), same as the
old cert-based script.
### Test Plan
- updated unit test
- manual verification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The new
nrf93_onboard.pyJWT-based onboarding flow was hittingPOST /v1/devices/{deviceId}with a JSON body, but that endpoint doesn'texist. The
OnboardDevicesoperation isPOST /v1/devicesand takes aCSV text body - same as cert-based onboarding, just with the certificate
column left empty and the JWT in the
onboardingTokencolumn:The script was also treating any 2xx as success and not polling for the async
result.
POST /v1/devicesreturns 202 +bulkOpsRequestId, so we now pollGET /v1/bulk-ops-requests/{id}untilSUCCEEDED(or fail), same as theold cert-based script.
Test Plan