<s> """<STR_LIT>""" <EOL> import bcrypt <EOL> from eve import Eve <EOL> from eve . auth import BasicAuth <EOL> class BCryptAuth ( BasicAuth ) : <EOL> def check_auth ( self , username , password , allowed_roles ) : <EOL> accounts = app . data . driver . db [ '<STR_LIT>' ] <EOL> account = accounts . find_one ( { '<STR_LIT:username>' : username } ) <EOL> return account and bcrypt . hashpw ( password , account [ '<STR_LIT:password>' ] ) == account [ '<STR_LIT:password>' ] <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> app = Eve ( auth = BCryptAuth ) <EOL> app . run ( ) </s>
