Repository navigation
fix(locations): name the endpoint by the id /api/v2/endpoints/ lists in /api/v2/endpoint_status/ - #16409
Merged
Conversation
…in /api/v2/endpoint_status/ The endpoint field returned the Location id while the ?endpoint= filter read a reference id; it now returns the reference id for the finding's product, from one authorized subquery instead of a query per row. The filter matches only that product's findings, as an Endpoint_Status always belonged to its endpoint's product. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first request warms per-request caches, so comparing it with a later one counted the warm-up, not the rows. The test now warms up first and names any query that grows with rows. location_id is read from the column, so a row's Location is never loaded just for its id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Maffooch
approved these changes
Oct 19, 2026
devGregA
approved these changes
Oct 19, 2026
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.
Description
With Locations enabled,
/api/v2/endpoints/lists Asset References of URL Locations: a row'sidis the reference's id, andlocation_idnames the Location./api/v2/endpoint_status/should point at those same ids, and its?endpoint=filter did, but itsendpointfield returned the Location id instead. The two ids often coincide, so it mostly looked right; where they differ, an id copied fromendpoint_statusnamed the wrong endpoint or none.endpointnow carries the reference id/api/v2/endpoints/lists for the Finding's Asset, read through one authorized subquery in the viewset's queryset instead of one query per row. It is null when the Finding's Asset has no reference to the Location, or the caller cannot view it.?endpoint=<id>returns only the statuses of Findings on that reference's Asset, as a legacy Endpoint_Status always belonged to its Endpoint's Asset. It used to include Findings on other Assets sharing the URL. An id the caller cannot view matches nothing.endpointfield note on the migration page, and an upgrade note for 3.4.300.Test results
New
unittests/test_v3_endpoint_status_reference_id.py(Locations on): a Location referenced by two Assets with padded reference ids, so reference and Location ids differ. It checks thatendpointequals the id/api/v2/endpoints/lists for each Finding's Asset (list and detail), that?endpoint=returns only that Asset's status, that an unknown id matches nothing, that a Finding with no reference names no endpoint, and that the list's query count does not grow with rows. Three of the five fail ondevand all five pass with the change.ruff check(ruff 0.16.10,ruff.toml) is clean on the changed files.