A djangorestframework-api-key decorator to allow access by key names
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for djangorestframework-api-key-allowbynames-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f4e2895bd81b588fa1292bf6647638c46d14978b68bb64903d47e242c116978 |
|
MD5 | 194798cb3d8087741f69863eb2533965 |
|
BLAKE2b-256 | 16d4a5947f56f6509589f77e37696ddb368fc9bfa7e7377992b93a567bb061ef |
Close
Hashes for djangorestframework_api_key_allowbynames-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89faef90a6d4c9de7308937204680d2dd2b2f3962bcc2ecd875f6b6abd3320e5 |
|
MD5 | 688e34ab9131a0500f2f8e4e5c68a86e |
|
BLAKE2b-256 | 68a46e950658ca04c112f15dcff5e2a992baf5f0e18c21fc206df827bf25923a |