From def0585bba79df3a09ce523d384af09aad809fa7 Mon Sep 17 00:00:00 2001 From: Marta Carbone Date: Fri, 17 Apr 2009 08:43:52 +0000 Subject: [PATCH] Added authentication for dummynet boxes. --- PLC/Auth.py | 5 +++-- PLC/Methods/GetDummyBoxUsers.py | 2 +- PLC/Methods/__init__.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/PLC/Auth.py b/PLC/Auth.py index e4a5a11..3b005b6 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 d3a8fe8..d3236e7 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 0414099..489684b 100644 --- a/PLC/Methods/__init__.py +++ b/PLC/Methods/__init__.py @@ -126,6 +126,7 @@ GetSliceTicket GetSlices GetSlivers GetTagTypes +GetDummyBoxUsers GetWhitelist NotifyPersons NotifySupport -- 2.43.0