acm-udayton / acm-udayton/ACM-Meeting-Records

[FEATURE] Add redis/celery task to regularly clear expired revoked tokens

Aperta
#156 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
backend devops enhancement
Lingua principale
Python
Stelle
7
Fork
2
Merge medio
4g 23h
PR unite (30g)
2

Descrizione

## Feature Description

Each day, Redis & Celery should automatically remove any expired tokens from the `revoked_jwts` table in the database.

## Why It's Worth Implementing

Without an automated system, we will quickly generate a rather large `revoked_jwts` table in the database. Since the tokens will already be specified to expire after 10 days (specified in #154), we can remove tokens older than that from the `revoked_jwts` table in the database automatically.

---

## Acceptance Criteria & Solution Requirements
*To close this issue, the following must be met (can be finalized in the comments):*
- [ ] 1. Application runs as expected with the new feature integrated seamlessly.
- [ ] 2. Code quality metrics are maintained, and linting has been considered in development.
- [ ] 3. Testing metrics are maintained, and tests have been updated/added wherever relevant during development.
- [ ] 4. Documentation has been updated to reflect the changes made during development.
- [ ] 5. Add Redis and Celery to the docker-compose.yml stack for the application.
- [ ] 6. Implement Redis and Celery within flask to automatically delete expired entries in `revoked_jwts` from the revoked tokens list once per day.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Look at the docker-compose.yml to see the current stack, then find where revoked_jwts are stored (likely a model or table). Research Celery periodic tasks in Flask (e.g., celery beat) to schedule a daily job. The task should query for tokens older than 10 days and delete them. Check for existing tests around token revocation to understand the data model and add tests for the new cleanup task.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, docker-compose, python, redis
Ambito
backend, database, devops
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
65/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.