0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
Commit Graph

8 Commits

Author SHA1 Message Date
Ben White
732e68a459
fix: Reset cached is_cloud on each test (#12337) 2022-10-19 11:57:47 +00:00
Ben White
683a4aab1a
fix: Check for active subscription to determine billing version (#12330) 2022-10-19 10:28:26 +00:00
Ben White
b4a401d532
feat: Billing V2 (#11986) 2022-10-19 08:58:36 +02:00
Karl-Aksel Puulmann
20bc4cab01
fix: Revert "chore(api): meter rate limit on team" (#12316)
Revert "chore(api): meter rate limit on team (#12006)"

This reverts commit 258cd32f54.
2022-10-18 14:19:57 +03:00
Rick Marron
258cd32f54
chore(api): meter rate limit on team (#12006)
## Problem

Take 2 on [this PR](https://github.com/PostHog/posthog/pull/11993#event-7470261128). The problem is that our rate limits should be based on `team_id` instead of an API key, and the last PR didn't handle views that didn't have a `team_id`.

## Changes

* Moves the rate_limit to be based on the `team_id` when possible
* Handles views that don't have a team_id
* Ensures the enabling/disabling of rate limits applies to all rate_limit classes (it used to only apply to the default classes)

and

* moves enabling the rate limit to an instance setting
* and adds a team id allow list for bypassing the rate limit
* and a simple cache which I think stops us hammering the reading of the infrequently changing settings

👉 *Stay up-to-date with [PostHog coding conventions](https://posthog.com/docs/contribute/coding-conventions) for a smoother review.*

## How did you test this code?

Added tests for the new cases:
* Rate limit works across a team - not just on an individual user.
* Rate limits work on views without a `team_id`
* Disabling the rate limits works


Co-authored-by: Paul D'Ambra <paul@posthog.com>
2022-10-18 09:01:07 +01:00
Michael Matloka
5d2ad6c7bb
chore(deps): Update black to 22.8.0 (#11596)
* chore(deps): Update `black` to `22.8.0`

* Format
2022-09-05 14:38:54 +02:00
Alex Gyujin Kim
a9ad5a437d
fix: uniqueness constraint on Tagged Items (#8824) 2022-03-09 09:46:21 -08:00
Alex Gyujin Kim
459d304e95
Part 1: Make everything taggable Backend (starting with Actions) (#8528) 2022-02-13 22:19:53 -08:00