Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add api_token to livestream jwt claims #23082

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Conversation

frankh
Copy link
Contributor

@frankh frankh commented Jun 19, 2024

Problem

currently livestream has a dependency on postgres, but this is literally only used to fetch the api_token for a team.

include the token with jwt claim so we can kill this dependency

also:

  • removed tls (when we deploy to k8s we don't need this)
  • allow jwt.secret to be set from env var

Changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

@frankh frankh requested review from fuziontech and Twixes June 19, 2024 10:35
this will allow us to drop the postgres dependency soon
@frankh frankh force-pushed the frank/livestream-api-claim branch from 51f91ce to 93a326f Compare June 19, 2024 10:41
@@ -199,7 +199,7 @@ def get_groups_on_events_querying_enabled(self, team: Team) -> bool:

def get_live_events_token(self, team: Team) -> Optional[str]:
return encode_jwt(
{"team_id": team.id},
{"team_id": team.id, "api_token": team.api_token},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@frankh frankh merged commit be51489 into master Jun 19, 2024
84 checks passed
@frankh frankh deleted the frank/livestream-api-claim branch June 19, 2024 12:25
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.

2 participants