feat(conduit): Add conduit auth functions #101729
Open
+285
−0
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.
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 identifiersgenerate_conduit_token()
: RS256 signed JWT with org_id, channel_id, and 10 minute expirationget_conduit_credentials()
: Returns{url, token, channel_id}
dict for the clientConfiguration
src/sentry/conf/server.py
CONDUIT_PRIVATE_KEY
(required): RSA private key for JWT signingCONDUIT_GATEWAY_URL
: Gateway base URLCONDUIT_JWT_ISSUER
/CONDUIT_JWT_AUDIENCE
: JWT claimsNote: Requires
CONDUIT_PRIVATE_KEY
environment variable to be set before use.