Repository navigation
Conversation
This was referenced Nov 3, 2026
gricha
force-pushed
the
fix/data-export-requires-user
branch
from
November 3, 2026 04:03
250b3ae to
3bfabab
Compare
An export is emailed to and downloaded by its user. For an API key or org token, the endpoint created the export and scheduled its task, then returned 500 because the response serializer looks the user up. Each attempt left an export nobody could fetch, and the get_or_create on user_id=None matched other no-user callers' unfinished exports. require_user() refuses these callers up front (401; 403 for a service account), and data_export.py leaves the request.user allowlist.
gricha
force-pushed
the
fix/data-export-requires-user
branch
from
November 3, 2026 04:41
3bfabab to
8dccd62
Compare
This branch has not been deployed
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.
Data export POSTs from a caller with no user (a legacy API key or an org auth token) created an export nobody could get, then returned 500.
An export is emailed to and downloaded by its user. For a caller with no user the endpoint still ran
get_or_create(user_id=None, ...), scheduled the export task, and then crashed serializing the response, because the serializer looks the user up. Each attempt left an export that no one could download (the details endpoint needs a user since #129442). Theuser_id=Nonelookup also matched other no-user callers' unfinished exports with the same query.require_user()now refuses these callers before anything is created: 401 for API keys, 403user-requiredfor a service account. (Org auth tokens only carryorg:ci, so the permission check already returned 403.) Users are unaffected. Production had no export POST without a user in the last 30 days (0 of 3,968 sampled transactions), so no working integration relies on this.test_api_key_cannot_exportfails without the fix:With it,
test_data_export.pypasses:49 passed. Also dropsdata_export.pyfrom therequest.userallowlist (6 → 5).