feat(preprod): Add org-scoped build-details endpoint and auto-resolve project#109111
feat(preprod): Add org-scoped build-details endpoint and auto-resolve project#109111NicoHinderling wants to merge 1 commit intomasterfrom
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
src/sentry/preprod/api/endpoints/organization_preprod_build_details.py
Outdated
Show resolved
Hide resolved
src/sentry/preprod/api/endpoints/organization_preprod_build_details.py
Outdated
Show resolved
Hide resolved
11d3577 to
15af452
Compare
15af452 to
c97117e
Compare
c97117e to
6a65e58
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| ).get( | ||
| id=int(artifact_id), | ||
| project__organization_id=organization.id, | ||
| ) |
There was a problem hiding this comment.
Org build details bypasses project access
High Severity
OrganizationPreprodBuildDetailsEndpoint fetches PreprodArtifact by project__organization_id only and never scopes to projects the requester can access. An org member without access to a given project could retrieve build details for that project if they know/guess the artifact_id, leaking project_id, project_slug, and build metadata.
There was a problem hiding this comment.
i think thats not a real concern
6a65e58 to
4c347e9
Compare
4c347e9 to
828775b
Compare



Add a new organization-scoped build-details API endpoint at
/organizations/{org}/preprodartifacts/{artifactId}/build-details/that returns build details including
project_idandproject_slugwithout requiring the project slug in the URL path.
This enables preprod URLs like
/preprod/size/12345/to work withoutrequiring
?project=upfront, improving UX for shared links. When auser opens a link without the project query param, the frontend fetches
build details from the org-scoped endpoint, extracts the project ID
from the response, and automatically adds it to the URL via a
useResolveProjectFromArtifacthook.OrganizationPreprodBuildDetailsEndpointwith IDOR protection(scopes artifact lookup by
project__organization_id)