TGViewer
Находки в опенсорсе: Python Находки в опенсорсе: Python @opensource_findings_python · 1.06K subscribers
Post #196 689
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 JWT token blacklist app: design conditional apps (#462)


We need to design how we can add conditional django apps that have models to the framework.
For example, right now we can add an app to blacklist some jwt tokens.

What's interesting about that?

1. We need to design this app in a way that it is not required by default, with no visible parts
2. We need to design it that it will be very easy to install and use. For example: it should provide a mixin class that can be used together with JWTSyncAuth / JWTAsyncAuth and a pre-existing common subclass

So, usage will look something like:

from django_modern_rest.some.place.for.app.models import BlacklistedJWTToken

class BlacklistMixin:
def check_auth(self, user: 'AbstractBaseUser', token: JWTToken) -> None:
super().check_user()
if BlacklistedJWTToken.objects.filter(jti=token.jti).exists():
# Token was blacklisted:
raise NotAuthenticatedError

We use jti to identify tokens, as other jwt's do.
It is now possible after #461

Sources of inspiration:

• https://github.com/jazzband/djangorestframework-simplejwt/blob/master/rest_framework_simplejwt/token_blacklist/models.py
• https://django-rest-framework-simplejwt.readthedocs.io/en/latest/blacklist_app.html

#enhancement #good_first_issue #help_wanted #django_modern_rest
sent via relator
More from @opensource_findings_python
  1. Sep 24, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Flaky `test_empty_valid…
  2. Sep 24, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `CookieJWT[A]syncAuth`…
  3. Sep 23, 2026🚀 New issue to ag2ai/faststream by @IvanKirpichnikov 📝 Feature: Implementation of the `A…
  4. Sep 22, 2026🚀 New issue to faststream-community/zMQTT by @borisalekseev 📝 Mark flaky Artemis test xf…
  5. Sep 17, 2026Помните про https://github.com/ozeranskii/httptap? Я писал о нем давно еще - > тут. Наклеп…
  6. Sep 15, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `test_custom_union_form…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →