|
@@ -91,7 +91,7 @@ instance exists")
|
91
|
91
|
#auth session
|
92
|
92
|
if len(args) != 0 or len(kwargs) != 0:
|
93
|
93
|
# security issue ?
|
94
|
|
- raise AuthenticationSecurityError(self)
|
|
94
|
+ raise AuthenticationSecurityError(cls.client())
|
95
|
95
|
else:
|
96
|
96
|
session = kwargs['token']
|
97
|
97
|
elif len(args) == 1:
|
|
@@ -109,10 +109,10 @@ instance exists")
|
109
|
109
|
if login_pass is None and token is None:
|
110
|
110
|
# bad arguments given. Security issue ?
|
111
|
111
|
raise AuthenticationSecurityError(cls.client())
|
112
|
|
- elif login is None:
|
|
112
|
+ elif login_pass is None:
|
113
|
113
|
cls.auth_session(token)
|
114
|
114
|
else:
|
115
|
|
- cls.auth_passwor(*login_pass)
|
|
115
|
+ cls.auth_password(*login_pass)
|
116
|
116
|
|
117
|
117
|
|
118
|
118
|
##@brief Singleton class that handles authentication on lodel2 instances
|
|
@@ -171,7 +171,7 @@ class Auth(object):
|
171
|
171
|
##@brief Instance destructor
|
172
|
172
|
def __del__(self):
|
173
|
173
|
self.__user_infos = LodelHook.call_hook('lodel2_session_destroy',
|
174
|
|
- caller = self, payload = token)
|
|
174
|
+ caller = self, payload = token) # TODO unresolved variable
|
175
|
175
|
pass
|
176
|
176
|
|
177
|
177
|
##@brief Raise exception because of authentication failure
|
|
@@ -186,7 +186,7 @@ class Auth(object):
|
186
|
186
|
|
187
|
187
|
##@brief Class method that fetches conf
|
188
|
188
|
@classmethod
|
189
|
|
- def fetch_settings(self):
|
|
189
|
+ def fetch_settings(cls):
|
190
|
190
|
from lodel import dyncode
|
191
|
191
|
if cls._infos_fields is None:
|
192
|
192
|
cls._infos_fields = list()
|
|
@@ -200,7 +200,7 @@ class Auth(object):
|
200
|
200
|
for clsname, fieldname in infos:
|
201
|
201
|
res_infos.append((
|
202
|
202
|
dyncode.lowername2class(infos[0]),
|
203
|
|
- dcls.field(infos[1])))
|
|
203
|
+ dcls.field(infos[1]))) # TODO cls.field ?
|
204
|
204
|
|
205
|
205
|
link_field = None
|
206
|
206
|
if res_infos[0][0] != res_infos[0][1]:
|