Cap and throttle channel tokens on the public v1 channel list
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Start with contentcuration/kolibri_public/views_v1.py, especially _get_channel_list_v1 and get_public_channel_lookup, then inspect the project’s DRF throttling configuration and tests for these endpoints. Check how cache_page affects list throttling. Done means requests with 51 tokens return 400, each endpoint limits anonymous requests to 60 per minute per IP, and tests cover the 50/51 token boundary and rate limits.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Overview
/api/public/v1/channels accepts any number of channel tokens in its tokens parameter, with no login and no rate limit, and reports which tokens matched. The v1 lookup endpoint checks one token per request, also without a rate limit. Unlisted channel tokens come from a space of 2^32 values, so a client can test hundreds of guesses per request without limit.
Complexity: Low
Target branch: hotfixes
Context
_get_channel_list_v1splitstokenson commas with no limit, and matches them against secret tokens.get_public_channel_lookup(/api/public/v1/channels/lookup/<token>) also matches one token per request, anonymously and without a rate limit.- Studio configures no DRF throttling. The channel list is wrapped in
cache_page, so a repeated identical URL is served from cache before any DRF throttle runs.
The Change
tokensshould accept at most 50 tokens per request.- The v1 channel list and the v1 channel lookup should each be throttled to 60 anonymous requests per minute per IP, using DRF throttling.
Acceptance Criteria
General
- A request with more than 50 tokens returns 400.
- The 61st channel list request from one IP within a minute, each with a different
tokensvalue, returns 429. - The 61st channel lookup request from one IP within a minute returns 429.
- Requests with up to 50 tokens and within the rate return the same response as before.
Testing
- Tests cover 50 and 51 tokens, and requests over the rate on both endpoints.
AI usage
I set the token cap and the rate. Claude Code found this gap and drafted this issue.
- Lingua principale
- Python
- Stelle
- 212
- Fork
- 321
- Merge medio
- 1g 7h
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di learningequality/studio
-
Community library status changes don't update `date_updated`Forse già presa @ArpitaSamanta10 l’ha presa oggi. Apertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
learningequality/studio#6414 · 8 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
learningequality/studio#6410 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
learningequality/studio#6409 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6407 ·
I maintainer di solito rispondono entro 1 giorno
-
Stripe webhook accepts events when no webhook secret is configuredForse già presa @adibmbrk l’ha presa oggi. Apertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6404 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di learningequality/studio
Issue simili
-
area: ci bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
hffgzktbcc-blip/ounce-core#484 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
ranxianglei/billion-context#7063 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
MakazhanAlpamys/Soup#2971 ·
I maintainer di solito rispondono entro 1 giorno