From: Marta Carbone Date: Fri, 17 Apr 2009 08:43:52 +0000 (+0000) Subject: Added authentication for dummynet boxes. X-Git-Tag: PLCAPI-4.3-7~2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=def0585bba79df3a09ce523d384af09aad809fa7;p=plcapi.git Added authentication for dummynet boxes. --- diff --git a/PLC/Auth.py b/PLC/Auth.py index e4a5a11f..3b005b6c 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -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) diff --git a/PLC/Methods/GetDummyBoxUsers.py b/PLC/Methods/GetDummyBoxUsers.py index d3a8fe82..d3236e78 100644 --- a/PLC/Methods/GetDummyBoxUsers.py +++ b/PLC/Methods/GetDummyBoxUsers.py @@ -37,7 +37,7 @@ class GetDummyBoxUsers(Method): Return keys, 0 if there are no users. """ - roles = ['admin', 'pi'] + roles = ['admin', 'pi', 'node'] accepts = [ Auth(), diff --git a/PLC/Methods/__init__.py b/PLC/Methods/__init__.py index 04140996..489684b0 100644 --- a/PLC/Methods/__init__.py +++ b/PLC/Methods/__init__.py @@ -126,6 +126,7 @@ GetSliceTicket GetSlices GetSlivers GetTagTypes +GetDummyBoxUsers GetWhitelist NotifyPersons NotifySupport