def matches(task, config):
    """Check if a task matches a configured filter."""
    if "labels" in config["filter"].keys():
        for label in config["filter"]["labels"]:
            if label["id"] not in task["labels"]:
                return False
    if "project" in config["filter"].keys():
        if config["filter"]["project"]["id"] != task["project_id"]:
            return False
    return True