def update(api_key, **kwargs):
    """
    Updates an api key.
    :param api_key:
    :param kwargs:
    :return:
    """
    for key, value in kwargs.items():
        setattr(api_key, key, value)

    log_service.audit_log("update_api_key", api_key.name, f"Update summary - {kwargs}")
    return database.update(api_key)

    Updates an api key.
    :param api_key:
    :param kwargs:
    :return:
    
lemur/api_keys/service.py