def _secret_for_graph(secrets, graph):
    """
    returns the first available secret for graph `graph`, or None
    """
    for k, v in secrets.items():
        if v["graph"] == graph:
            return k