djangorestframework-api-key-allowbynames-1.0.2
توضیحات
A djangorestframework-api-key decorator to allow access by key names
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | djangorestframework-api-key-allowbynames-1.0.2 |
| نام | djangorestframework-api-key-allowbynames |
| نسخه کتابخانه | 1.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | mneitsabes |
| ایمیل نویسنده | mneitsabes@nulloz.be |
| آدرس صفحه اصلی | https://github.com/mneitsabes/djangorestframework-api-key-allowbynames |
| آدرس اینترنتی | https://pypi.org/project/djangorestframework-api-key-allowbynames/ |
| مجوز | - |
# Django RESTframework-api key - Allow by key names
Decorator working with `djangorestframework-api-key` allowing to restrict access to a method according to the key
presented.
# Usage
Use `@allow_only_apikey()` with a list of key names as the first parameter :
from rest_framework_api_key_allowbynames.decorator import allow_only_apikey
class TelegramMemberCheck(APIView):
permission_classes = [HasAPIKey]
@allow_only_apikey(['TelegramBot'])
def get(self, request, format=None):
pass
If the key does not match, an `AuthenticationFailed` is returned.
نیازمندی
| مقدار | نام |
|---|---|
| - | djangorestframework |
| - | djangorestframework-api-key |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl djangorestframework-api-key-allowbynames-1.0.2:
pip install djangorestframework-api-key-allowbynames-1.0.2.whl
نصب پکیج tar.gz djangorestframework-api-key-allowbynames-1.0.2:
pip install djangorestframework-api-key-allowbynames-1.0.2.tar.gz