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

DX-960: Update Deny List from SDK #112

Merged
merged 10 commits into from
Jun 13, 2024
Merged

DX-960: Update Deny List from SDK #112

merged 10 commits into from
Jun 13, 2024

Conversation

CahidArda
Copy link
Contributor

Previously, we were only planning to update the open source deny list from the console.

Now, we will do it in the sdk aswell. After updating the IP list, the list will be valid until 2 AM UTC which is a bit later than the usual update time of our data source. When the list becomes invalid, the first request sent with the sdk will update the ip list asynchronously.

in ip deny lists, we use an open source IP deny list aggregator as a source for blocking IP addresses automatically.

We keep a status flag at redis to denote the state. When the feature is disabled, flag is set to disabled with no expiry date. Otherwise, it's either set to a value with some expiry or expired.

We use these three states to define what we do:
- disabled with no ttl: don't do anything. use list of all deny lists it as it is (with values entered by the user)
- set with some ttl: don't do anything. use list of all deny lists it as it is (which includes user values and the ip list)
- deleted: this means the ip list must be updated. The result is returned to the user and an async is process is attached to the pending field in our response

Mind that the first two states are the same, but we differentiate them to explain what's going on.
Copy link

linear bot commented Jun 13, 2024

Copy link

vercel bot commented Jun 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ratelimit-with-vercel-kv ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 9:38am

src/deny-list/deny-list.ts Outdated Show resolved Hide resolved
src/deny-list/interation.test.ts Outdated Show resolved Hide resolved
src/deny-list/ip-deny-list.ts Show resolved Hide resolved
src/deny-list/ip-deny-list.ts Show resolved Hide resolved
src/deny-list/ip-deny-list.ts Show resolved Hide resolved
src/deny-list/ip-deny-list.ts Show resolved Hide resolved
src/deny-list/scripts.ts Show resolved Hide resolved
src/deny-list/time.ts Outdated Show resolved Hide resolved
@CahidArda CahidArda merged commit 0ff02ac into main Jun 13, 2024
2 of 3 checks passed
@CahidArda CahidArda deleted the DX-960 branch June 13, 2024 09:47
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.

None yet

2 participants