Archived
Moves create member to separate resource.
* Adds CORS support Tests are failing
This commit is contained in:
1 parent
cacc1b1b94
commit
7bba5770e8
8 files changed
+136
-36
No files matched your search
@@ -1,6 +1,8 @@
|
||||
from tastypie.authentication import ApiKeyAuthentication
|
||||
from tastypie.authentication import ApiKeyAuthentication, Authentication
|
||||
from tastypie.http import HttpUnauthorized
|
||||
|
||||
# TODO replace with Oauth2 http://django-tastypie.readthedocs.org/en/latest/cookbook.html#creating-a-full-oauth-2-0-api
|
||||
|
||||
class MyApiKeyAuthentication(ApiKeyAuthentication):
|
||||
"""
|
||||
Override method below to use our custom User model
|
||||
@@ -40,3 +42,14 @@ class MyApiKeyAuthentication(ApiKeyAuthentication):
|
||||
request.user = user
|
||||
|
||||
return key_auth_check
|
||||
|
||||
|
||||
class ServiceAuthentication(Authentication):
|
||||
pass
|
||||
#
|
||||
# TODO auth for services
|
||||
#
|
||||
#def is_authenticated(self, request, **kwargs):
|
||||
# return True
|
||||
# return False
|
||||
|
||||
Reference in new issue
Block a user