Commit 984dbeea authored by Matthias's avatar Matthias
Browse files

change authorization for drupal

parent 43e752d2
......@@ -35,7 +35,6 @@ def create_app(test_config=None):
try:
app.config['import-api-url'] = os.environ['IMPORT_API_URL']
app.config['kafka-broker-url'] = os.environ['KAFKA_BOOTSTRAP_SERVERS']
app.config['drupal-cms-admin-key'] = os.environ['DRUPAL_CMS_ADMIN_KEY']
app.config['drupal-user'] = os.environ['DRUPAL_USERNAME']
app.config['drupal-password'] = os.environ['DRUPAL_PASSWORD']
app.config['drupal-api-url'] = os.environ['DRUPAL_API_URL']
......
......@@ -12,8 +12,7 @@ def write_results(job_drupal_uuid, job_log_drupal_uuid, status, report):
headers = {
'Content-Type': 'application/vnd.api+json',
'Accept': 'application/vnd.api+json',
'X-API-Key': current_app.config['drupal-cms-admin-key'],
'Authorization': 'Basic bWVtb2Jhc2U6MjAyMA=='
'X-API-Key': current_app.config['drupal-api-key']
}
calls = {}
......
......@@ -102,8 +102,7 @@ def write_results(job_drupal_uuid, job_log_drupal_uuid, status, report):
headers = {
'Content-Type': 'application/vnd.api+json',
'Accept': 'application/vnd.api+json',
'X-API-Key': current_app.config['drupal-cms-admin-key'],
'Authorization': 'Basic bWVtb2Jhc2U6MjAyMA=='
'X-API-Key': current_app.config['drupal-api-key']
}
calls = {}
......
......@@ -71,8 +71,7 @@ def get_node_id(memobase_id: str, node_type: str):
headers = {
'Content-Type': 'application/vnd.api+json',
'Accept': 'application/vnd.api+json',
'X-API-Key': current_app.config['drupal-cms-admin-key'],
'Authorization': 'Basic bWVtb2Jhc2U6MjAyMA=='
'X-API-Key': current_app.config['drupal-api-key']
}
url = f'{current_app.config["drupal-api-url"]}/jsonapi/node/{node_type}?filter['\
f'field_memobase_id]={memobase_id}'
......@@ -100,8 +99,7 @@ def write_results(node_type, identifier, status, report):
headers = {
'Content-Type': 'application/vnd.api+json',
'Accept': 'application/vnd.api+json',
'X-API-Key': current_app.config['drupal-cms-admin-key'],
'Authorization': 'Basic bWVtb2Jhc2U6MjAyMA=='
'X-API-Key': current_app.config['drupal-api-key']
}
drupal_type = ''
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment