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 :
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4127bbba120e2c50e0ab4b6e6c8d3a63ce561c64e850f4dcc41bb1873b0cda74 |
|
MD5 | 175ffa7efbfa6b3e2a733c8a9f021ac4 |
|
BLAKE2b-256 | a48223da705da14f41304891d1bc05c628398f99d85f40d29ef8e0f92d349266 |
Close
Hashes for djangorestframework_api_key_allowbynames-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11efb23b547f57bbf5475fc60ef5a259b513d6244c64c47847f697cdb11ce376 |
|
MD5 | 9b98f0ac2727793ccd020902c8dce61c |
|
BLAKE2b-256 | 857b6b41670fc51fc85c2322da3af7402016030c069a6e3a8fc0d4082be7ad48 |