@@ -26,20 +26,34 @@ class SysCallError(Exception):
2626
2727import roundup .anypy .email_ # noqa: F401 -- patches for email library code
2828from roundup import hyperdb , rest , xmlrpc
29+
2930# quality of random checked below
3031from roundup .anypy import http_ , random_ , urllib_ , xmlrpc_
3132from roundup .anypy .cgi_ import cgi
3233from roundup .anypy .cookie_ import BaseCookie , CookieError , SimpleCookie , get_cookie_date
3334from roundup .anypy .html import html_escape
3435from roundup .anypy .strings import b2s , bs2b , is_us , s2b , uchr
3536from 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+ )
4048from 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+ )
4357from roundup .mailer import Mailer , MessageSendError
4458
4559logger = logging .getLogger ('roundup' )
@@ -49,6 +63,7 @@ class SysCallError(Exception):
4963else :
5064 logger .warning ("**SystemRandom not available. Using poor random generator" )
5165
66+
5267def initialiseSecurity (security ):
5368 '''Create some Permissions and Roles on the security object
5469
@@ -1130,7 +1145,6 @@ def authenticate_bearer_token(self, challenge):
11301145 self .setHeader ("WWW-Authenticate" , "Basic" )
11311146 raise LoginError ('Support for jwt disabled.' )
11321147
1133-
11341148 # If first ',' separated token is < 32, jwt is disabled.
11351149 # If second or later tokens are < 32 chars, the config system
11361150 # stops the tracker from starting so insecure tokens can not
@@ -1166,7 +1180,6 @@ def authenticate_bearer_token(self, challenge):
11661180 self .make_user_anonymous ()
11671181 raise LoginError (last_error )
11681182
1169-
11701183 def determine_user (self , is_api = False ):
11711184 """Determine who the user is"""
11721185 self .opendb ('admin' )
0 commit comments