@@ -26,20 +26,34 @@ class SysCallError(Exception):
26
26
27
27
import roundup .anypy .email_ # noqa: F401 -- patches for email library code
28
28
from roundup import hyperdb , rest , xmlrpc
29
+
29
30
# quality of random checked below
30
31
from roundup .anypy import http_ , random_ , urllib_ , xmlrpc_
31
32
from roundup .anypy .cgi_ import cgi
32
33
from roundup .anypy .cookie_ import BaseCookie , CookieError , SimpleCookie , get_cookie_date
33
34
from roundup .anypy .html import html_escape
34
35
from roundup .anypy .strings import b2s , bs2b , is_us , s2b , uchr
35
36
from roundup .cgi import TranslationService , accept_language , actions , cgitb , templating
36
- from roundup .cgi .exceptions import DetectorError , FormError , \
37
- IndexerQueryError , NotFound , NotModified , Redirect , SendFile , \
38
- SendStaticFile , SeriousError
39
-
37
+ from roundup .cgi .exceptions import (
38
+ DetectorError ,
39
+ FormError ,
40
+ IndexerQueryError ,
41
+ NotFound ,
42
+ NotModified ,
43
+ Redirect ,
44
+ SendFile ,
45
+ SendStaticFile ,
46
+ SeriousError ,
47
+ )
40
48
from roundup .cgi .form_parser import FormParser
41
- from roundup .exceptions import LoginError , RateLimitExceeded , Reject , \
42
- RejectRaw , Unauthorised , UsageError
49
+ from roundup .exceptions import (
50
+ LoginError ,
51
+ RateLimitExceeded ,
52
+ Reject ,
53
+ RejectRaw ,
54
+ Unauthorised ,
55
+ UsageError ,
56
+ )
43
57
from roundup .mailer import Mailer , MessageSendError
44
58
45
59
logger = logging .getLogger ('roundup' )
@@ -49,6 +63,7 @@ class SysCallError(Exception):
49
63
else :
50
64
logger .warning ("**SystemRandom not available. Using poor random generator" )
51
65
66
+
52
67
def initialiseSecurity (security ):
53
68
'''Create some Permissions and Roles on the security object
54
69
@@ -1130,7 +1145,6 @@ def authenticate_bearer_token(self, challenge):
1130
1145
self .setHeader ("WWW-Authenticate" , "Basic" )
1131
1146
raise LoginError ('Support for jwt disabled.' )
1132
1147
1133
-
1134
1148
# If first ',' separated token is < 32, jwt is disabled.
1135
1149
# If second or later tokens are < 32 chars, the config system
1136
1150
# stops the tracker from starting so insecure tokens can not
@@ -1166,7 +1180,6 @@ def authenticate_bearer_token(self, challenge):
1166
1180
self .make_user_anonymous ()
1167
1181
raise LoginError (last_error )
1168
1182
1169
-
1170
1183
def determine_user (self , is_api = False ):
1171
1184
"""Determine who the user is"""
1172
1185
self .opendb ('admin' )
0 commit comments