@authenticator
def api_key(request, response, verify_user, **kwargs):
 api_key = request.get_header('X-Api-Key')
 if api_key:
  user = verify_user(api_key)
  if user:
   return user
  else:
   return False
 else:
  return None

@ authenticator def api_key ( request , response , verify_user , ** kwargs ) : api_key = request . get_header ( 'X-Api-Key' ) if api_key : user = verify_user ( api_key ) if user : return user else : return False else : return None
api key header authentication the verify_user function passed in to ths authenticator shall receive an api key as input .