Skip to content

Conversation

IanWoodard
Copy link
Member

Adds backend helpers for generating Conduit authentication credentials. Conduit is Sentry's real-time delivery platform that enables scalable streaming from backend services to frontend clients.

This PR provides the foundational utilities needed for API endpoints to generate Conduit credentials (JWT tokens and channel IDs) that the conduit-client will use to establish streaming connections.

Changes

  • New utilities in src/sentry/conduit/auth.py

    • generate_channel_id(): UUID4 generation for stream identifiers
    • generate_conduit_token(): RS256 signed JWT with org_id, channel_id, and 10 minute expiration
    • get_conduit_credentials(): Returns {url, token, channel_id} dict for the client
  • Configuration src/sentry/conf/server.py

    • CONDUIT_PRIVATE_KEY (required): RSA private key for JWT signing
    • CONDUIT_GATEWAY_URL: Gateway base URL
    • CONDUIT_JWT_ISSUER / CONDUIT_JWT_AUDIENCE: JWT claims

Note: Requires CONDUIT_PRIVATE_KEY environment variable to be set before use.

Copy link

linear bot commented Oct 17, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 17, 2025
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/conf/server.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #101729      +/-   ##
===========================================
+ Coverage   80.97%    80.98%   +0.01%     
===========================================
  Files        8700      8705       +5     
  Lines      386852    387374     +522     
  Branches    24514     24514              
===========================================
+ Hits       313236    313719     +483     
- Misses      73268     73307      +39     
  Partials      348       348              

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

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant