Commit 164535be by Tim Babych

improved docstring for HasAccessToken Permission class

parent aa3c503d
...@@ -13,6 +13,20 @@ class TokenWrongIssuer(Exception): ...@@ -13,6 +13,20 @@ class TokenWrongIssuer(Exception):
class HasAccessToken(BasePermission): class HasAccessToken(BasePermission):
""" """
Allow requests having valid ID Token. Allow requests having valid ID Token.
https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-31
Expected Token:
Header {
"alg": "HS256",
"typ": "JWT"
}
Claims {
"sub": "<USER_ID>",
"exp": <EXPIRATION TIMESTAMP>,
"iat": <ISSUED TIMESTAMP>,
"aud": "<CLIENT ID"
}
Should be signed with CLIENT_SECRET
""" """
def has_permission(self, request, view): def has_permission(self, request, view):
if getattr(settings, 'DISABLE_TOKEN_CHECK', False): if getattr(settings, 'DISABLE_TOKEN_CHECK', False):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment