From 7e343d24dce35e22385f6df4ac90424d1ea8432f Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Mon, 29 Aug 2022 08:15:49 +0200 Subject: [PATCH] Disable proper (but now unsupported) auth, go ENV variable This is sad, but this change makes things workable again. Users must now provide a suitable token via the environment variable `DATALAD_ebrains_token`. At the moment, this software does not provide any means to obtain such a token. Users would need to, for example, log into https://query.kg.ebrains.eu and copy the presented token from the context menu. Closes datalad/datalad-ebrains#26 --- datalad_ebrains/kg_query.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/datalad_ebrains/kg_query.py b/datalad_ebrains/kg_query.py index c40ab40..8cc4041 100644 --- a/datalad_ebrains/kg_query.py +++ b/datalad_ebrains/kg_query.py @@ -1,5 +1,6 @@ import json import logging +import os from pathlib import Path import requests from urllib.parse import quote as urlquote @@ -95,6 +96,8 @@ def query_kg4dataset(auth_token, dataset_id): def get_token(credential, allow_interactive=True): + return os.environ['DATALAD_ebrains_token'] + # we ultimately want a token, but it is only valid for a short amount of # time, and it has to be obtained via user/pass credentials each time user_auth = UserPassword(