<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> Resolves #44816. - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. - [X] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters. ## Testing - [X] Added/updated automated tests - [x] QA'd all new/changed functionality manually ## Summary by CodeRabbit * **Performance** * Improved device authentication efficiency by optimizing token resolution, reducing database load for both valid and invalid token scenarios in Fleet Desktop. * **Tests** * Added comprehensive test coverage for device authentication fast-fail scenarios, including handling of non-existent tokens, expired tokens, and edge cases. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Lucas Manuel Rodriguez <lucas@fleetdm.com>
2 lines
289 B
Plaintext
2 lines
289 B
Plaintext
- Reduced database load from `GET /api/latest/fleet/device/{token}/desktop` and other Fleet Desktop endpoints when invalid or expired device auth tokens are presented, by resolving the token to a host id with a single-table indexed lookup before running the multi-join host-details query.
|