chain of responsibility pattern at index we will then send this to simple function that returns user objectwhich we just construct inline for the sake of this examplebut you are welcome to plug in your function that gets user from your local sqlite database user_aware_server py import base class user(object)def __init__(selfusernamepasswordnameemail)self username username self password password self name name self email email @classmethod def get_verified_user(clsusernamepassword)return userusernamepasswordusername"{}@demo comformat(usernamedef application(envstart_response)authorization_header env["http_authorization"header_array authorization_header split(encoded_string header_array[ decoded_string base decode(encoded_stringdecode('utf- 'usernamepassword decoded_string split(":"user user get_verified_user(usernamepasswordstart_response(' ok'[('content-type''text/html')]response "hello {}!format(user namereturn [response encode('utf- ')