4 from PLC.Parameter import Parameter
8 Base class for all API authentication methods, as well as a class
9 that can be used to represent all supported API authentication
13 def __init__(self, auth = None):
15 auth = {'AuthMethod': Parameter(str, "Authentication method to use", optional = False)}
16 Parameter.__init__(self, auth, "API authentication structure")
18 class PasswordAuth(Auth):
20 PlanetLab version 3.x password authentication structure.
25 'AuthMethod': Parameter(str, "Authentication method to use, always 'password' or 'capability'", optional = False),
26 'Username': Parameter(str, "Username, typically an e-mail address", optional = False),
27 'AuthString': Parameter(str, "Authentication string, typically a password", optional = False),
28 'Tenant': Parameter(str, "User Tenant", optional = False),
30 path = os.path.dirname(__file__) + "/Auth.d"
32 extensions = os.listdir(path)
35 for extension in extensions:
36 if extension.startswith("."):
38 if not extension.endswith(".py"):
40 execfile("%s/%s" % (path, extension))