Fix auth extensibility.
authorDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Sat, 16 Oct 2010 22:39:31 +0000 (18:39 -0400)
committerDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Sat, 16 Oct 2010 22:39:31 +0000 (18:39 -0400)
PLC/Auth.py

index 80db3e7..0ef2942 100644 (file)
@@ -26,14 +26,6 @@ from PLC.Sessions import Session, Sessions
 from PLC.Peers import Peer, Peers
 from PLC.Boot import notify_owners
 
-auth_methods = {'session': SessionAuth,
-                'password': PasswordAuth,
-                'capability': PasswordAuth,
-                'gpg': GPGAuth,
-                'hmac': BootAuth,
-                'hmac_dummybox': BootAuth,
-                'anonymous': AnonymousAuth}
-
 class Auth(Parameter):
     """
     Base class for all API authentication methods, as well as a class
@@ -339,6 +331,14 @@ class PasswordAuth(Auth):
 
         method.caller = person
 
+auth_methods = {'session': SessionAuth,
+                'password': PasswordAuth,
+                'capability': PasswordAuth,
+                'gpg': GPGAuth,
+                'hmac': BootAuth,
+                'hmac_dummybox': BootAuth,
+                'anonymous': AnonymousAuth}
+
 path = os.path.dirname(__file__) + "/Auth.d"
 try:
     extensions = os.listdir(path)