#NEWLINE# def client_key_loader( self , f ) : #NEWLINE# #INDENT# "Registers a function to be called to find a client key.\n\n        Function you set has to take a client id and return a client key::\n\n            @hawk.client_key_loader\n            def get_client_key(client_id):\n                if client_id == 'Alice':\n                    return 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn'\n                else:\n                    raise LookupError()\n\n        :param f: The callback for retrieving a client key.\n\n        " #NEWLINE# @ wraps ( f ) #NEWLINE# def wrapped_f( client_id ) : #NEWLINE# #INDENT# client_key = f ( client_id ) #NEWLINE# return { #NEWLINE# #INDENT# 'id' : client_id , #NEWLINE# 'key' : client_key , #NEWLINE# 'algorithm' : current_app . config [ 'HAWK_ALGORITHM' ] , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# self . _client_key_loader_func = wrapped_f #NEWLINE# return f