Commits

Jesper Nøhr committed 6acc5f8

moving NoAuthentication to authentication.py, thanks david, fixes #21

Comments (0)

Files changed (2)

piston/authentication.py

 import oauth
 from store import DataStore
 
+class NoAuthentication(object):
+    """
+    Authentication handler that always returns
+    True, so no authentication is needed, nor
+    initiated (`challenge` is missing.)
+    """
+    def is_authenticated(self, request):
+        return True
+
 def django_auth(username, password):
     """
     Basic callback for `HttpBasicAuthentication`

piston/resource.py

 from emitters import Emitter
 from handler import typemapper
 from doc import HandlerMethod
+from authentication import NoAuthentication
 from utils import coerce_put_post, FormValidationError, HttpStatusCode
 from utils import rc, format_error, translate_mime
 
-class NoAuthentication(object):
-    """
-    Authentication handler that always returns
-    True, so no authentication is needed, nor
-    initiated (`challenge` is missing.)
-    """
-    def is_authenticated(self, request):
-        return True
-
 class Resource(object):
     """
     Resource. Create one for your URL mappings, just