Added authentication for dummynet boxes.
authorMarta Carbone <marta@prova.iet.unipi.it>
Fri, 17 Apr 2009 08:43:52 +0000 (08:43 +0000)
committerMarta Carbone <marta@prova.iet.unipi.it>
Fri, 17 Apr 2009 08:43:52 +0000 (08:43 +0000)
PLC/Auth.py
PLC/Methods/GetDummyBoxUsers.py
PLC/Methods/__init__.py

index e4a5a11..3b005b6 100644 (file)
@@ -45,12 +45,13 @@ class Auth(Parameter):
             expected = PasswordAuth()
         elif auth['AuthMethod'] == "gpg":
             expected = GPGAuth()
-        elif auth['AuthMethod'] == "hmac":
+        elif auth['AuthMethod'] == "hmac" or \
+             auth['AuthMethod'] == "hmac_dummybox":
             expected = BootAuth()
         elif auth['AuthMethod'] == "anonymous":
             expected = AnonymousAuth()
         else:
-            raise PLCInvalidArgument("must be 'session', 'password', 'gpg', 'hmac', or 'anonymous'", "AuthMethod")
+            raise PLCInvalidArgument("must be 'session', 'password', 'gpg', 'hmac', 'hmac_dummybox', or 'anonymous'", "AuthMethod")
 
         # Re-check using the specified authentication method
         method.type_check("auth", auth, expected, (auth,) + args)
index d3a8fe8..d3236e7 100644 (file)
@@ -37,7 +37,7 @@ class GetDummyBoxUsers(Method):
        Return keys, 0 if there are no users.
        """
 
-       roles = ['admin', 'pi']
+       roles = ['admin', 'pi', 'node']
 
        accepts = [
                Auth(),
index 0414099..489684b 100644 (file)
@@ -126,6 +126,7 @@ GetSliceTicket
 GetSlices
 GetSlivers
 GetTagTypes
+GetDummyBoxUsers
 GetWhitelist
 NotifyPersons
 NotifySupport