easyapi-django 0.2__tar.gz → 0.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {easyapi_django-0.2/easyapi_django.egg-info → easyapi_django-0.21}/PKG-INFO +1 -1
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/base.py +3 -3
- {easyapi_django-0.2 → easyapi_django-0.21/easyapi_django.egg-info}/PKG-INFO +1 -1
- {easyapi_django-0.2 → easyapi_django-0.21}/pyproject.toml +1 -1
- {easyapi_django-0.2 → easyapi_django-0.21}/LICENSE +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/README.md +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/__init__.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/calc.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/calc_resource.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/constants.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/dates.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/exception.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/filters.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/middleware.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/orm/__init__.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/rate_limit.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/routes.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/tenant/__init__.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/tenant/db_router.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/tenant/tenant.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi/util.py +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi_django.egg-info/SOURCES.txt +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi_django.egg-info/dependency_links.txt +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/easyapi_django.egg-info/top_level.txt +0 -0
- {easyapi_django-0.2 → easyapi_django-0.21}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easyapi_django
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.21
|
|
4
4
|
Summary: A simple rest api generator for django based on models
|
|
5
5
|
Author-email: Stamatios Stamou Jr <bushier.outsets.0c@icloud.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/ssjunior/easyapi-django
|
|
@@ -334,7 +334,7 @@ class BaseResource(View):
|
|
|
334
334
|
await redis.expire(f'{PREFIX}rate_limit:blocked:{identifier}', 86400)
|
|
335
335
|
await redis.close()
|
|
336
336
|
await redis.connection_pool.disconnect()
|
|
337
|
-
raise HTTPException(403, '
|
|
337
|
+
raise HTTPException(403, 'Blocked due to misbehavior')
|
|
338
338
|
|
|
339
339
|
async def check_is_blocked(self, identifier):
|
|
340
340
|
redis = await aioredis.Redis(
|
|
@@ -347,7 +347,7 @@ class BaseResource(View):
|
|
|
347
347
|
await redis.close()
|
|
348
348
|
await redis.connection_pool.disconnect()
|
|
349
349
|
if blocked:
|
|
350
|
-
raise HTTPException(403, '
|
|
350
|
+
raise HTTPException(403, 'Blocked due to misbehavior')
|
|
351
351
|
|
|
352
352
|
async def dispatch(self, request, *args, **kwargs) -> None:
|
|
353
353
|
self.identifier = request.META.get('HTTP_X_REAL_IP', request.META['REMOTE_ADDR'])
|
|
@@ -365,7 +365,7 @@ class BaseResource(View):
|
|
|
365
365
|
await self.block(self.identifier)
|
|
366
366
|
|
|
367
367
|
if result['rate_limited']:
|
|
368
|
-
raise HTTPException(429, '
|
|
368
|
+
raise HTTPException(429, 'Slow down, too many requests. You will be blocked.')
|
|
369
369
|
|
|
370
370
|
session = None
|
|
371
371
|
if request.headers.get('X-Api-Key'):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easyapi_django
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.21
|
|
4
4
|
Summary: A simple rest api generator for django based on models
|
|
5
5
|
Author-email: Stamatios Stamou Jr <bushier.outsets.0c@icloud.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/ssjunior/easyapi-django
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|