@staticmethod
PYL-R0201109 return output
110 return http_context.fallthrough(self.invalid)
111
112 def respond_error(self, http_context, exception):113 http_context.respond_server_error()
114 stack = traceback.format_exc()
115 traceback.print_exc()
245 def __init__(self, context):
246 self.context = context
247
248 def provide(self):249 return []
250
251
235 self.context.worker.demote(uid, gid)
236 self.context.identity = username
237
238 def prepare_session_redirect(self, http_context, username, auth_info):239 http_context.add_header('X-Session-Redirect', username)
240 http_context.add_header('X-Auth-Info', auth_info)
241
205 raise SudoError((o + e).decode('utf-8').splitlines()[-1].strip())
206 return True
207
208 def client_certificate_callback(self, connection, x509, errno, depth, result):209 if depth == 0 and (errno == 9 or errno == 10):
210 return False # expired / not yet valid
211 if not aj.config.data['ssl']['client_auth']['force']:
191 def check_password(self, username, password):
192 return self.get_provider().authenticate(username, password)
193
194 def check_sudo_password(self, username, password):195 if not aj.config.data['auth'].get('allow_sudo', False):
196 return False
197 sudo = subprocess.Popen(
The method doesn't use its bound instance. Decorate this method with @staticmethod
decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.