device_token endpoint improvements (#15849)

Fixed badly formatted error messages in /api/fleet/orbit/device_token
endpoint and others.
In /api/fleet/orbit/device_token:
- Added token validation -- empty token not allowed
- Replaced 500 error with 409 when token conflicts with another host

#15832 

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Added/updated tests
- [x] Manual QA
This commit is contained in:
Victor Lyuboslavsky
2023-12-28 14:20:36 -06:00
committed by GitHub
parent 02dea5ac9d
commit ebf1650671
9 changed files with 85 additions and 9 deletions
+4
View File
@@ -0,0 +1,4 @@
Fixed badly formatted error message in /api/fleet/orbit/device_token endpoint and others.
In /api/fleet/orbit/device_token:
- Added token validation -- empty token not allowed
- Replaced 500 error with 409 when token conflicts with another host