Skip to content

feat(starlite,litestar): Gate user info behind data_collection config#6875

Open
ericapisani wants to merge 1 commit into
py-2583-aiohttpfrom
py-2583-starlite-and-litestar
Open

feat(starlite,litestar): Gate user info behind data_collection config#6875
ericapisani wants to merge 1 commit into
py-2583-aiohttpfrom
py-2583-starlite-and-litestar

Conversation

@ericapisani

@ericapisani ericapisani commented Jul 23, 2026

Copy link
Copy Markdown
Member

Apply the data_collection.user_info setting to the Starlite and Litestar integrations' user info collection on exception events, giving it precedence over the legacy send_default_pii boolean when explicitly configured. This gates the retrieve_user_from_scope call in each integration's exception handler, mirroring the behavior already shipped for Flask, WSGI, ASGI, Django, Sanic, Tornado, Pyramid, and aiohttp.

The scope user exception event tests in both suites are reparametrized with the shared DATA_COLLECTION_USER_INFO_CASES matrix from tests/integrations/utils.py.

Refs PY-2583
Refs #6746

Apply the data_collection.user_info setting to the Starlite and Litestar integrations' user info collection on exception events, giving it precedence over the legacy send_default_pii boolean when explicitly configured. This gates the retrieve_user_from_scope call in each integration's exception handler, mirroring the behavior already shipped for Flask, WSGI, ASGI, Django, Sanic, Tornado, Pyramid, and aiohttp.

The scope user exception event tests in both suites are reparametrized with the shared DATA_COLLECTION_USER_INFO_CASES matrix from tests/integrations/utils.py.

Refs PY-2583
@linear-code

linear-code Bot commented Jul 23, 2026

Copy link
Copy Markdown

PY-2583

@ericapisani
ericapisani marked this pull request as ready for review July 23, 2026 19:27
@ericapisani
ericapisani requested a review from a team as a code owner July 23, 2026 19:27
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

96862 passed | ⏭️ 6410 skipped | Total: 103272 | Pass Rate: 93.79% | Execution Time: 350m 6s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +1002
Passed Tests 📈 +932
Failed Tests
Skipped Tests 📈 +70

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2521 uncovered lines.
❌ Project coverage is 89.66%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    89.67%    89.66%    -0.01%
==========================================
  Files          193       193         —
  Lines        24321     24383       +62
  Branches      8572      8636       +64
==========================================
+ Hits         21809     21862       +53
- Misses        2512      2521        +9
- Partials      1397      1401        +4

Generated by Codecov Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant