fix(backend): update API key references to keys from env
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit

This commit is contained in:
Steven Tischer
2026-06-02 13:50:54 +02:00
parent 275b1666f4
commit 595a967e2d
2 changed files with 6 additions and 6 deletions
@@ -11,7 +11,7 @@ def search(
) -> dict[str, Any]:
headers = {
"Authorization": f"ApiKey {config.settings.elasticsearch_api_key}",
"Authorization": f"ApiKey {config.settings.openalex_works_api_key}",
"Content-Type": "application/json"
}
payload = {
@@ -27,7 +27,7 @@ def search(
with httpx.Client() as client:
response = client.post(
f"{config.settings.elasticsearch_url}/{index}/_search",
f"{config.settings.openalex_works_search_base_url}/{index}/_search",
json=payload,
headers=headers
)
@@ -41,7 +41,7 @@ def get(
) -> dict[str, Any]:
headers = {
"Authorization": f"ApiKey {config.settings.elasticsearch_api_key}",
"Authorization": f"ApiKey {config.settings.openalex_works_api_key}",
"Content-Type": "application/json"
}
payload = body
@@ -49,7 +49,7 @@ def get(
# get document directly
with httpx.Client() as client:
response = client.get(
f"{config.settings.elasticsearch_url}/{index}/_doc/{doc_id}",
f"{config.settings.openalex_works_search_base_url}/{index}/_doc/{doc_id}",
json=payload,
headers=headers
)
+2 -2
View File
@@ -100,7 +100,7 @@ def build_topic_cache(page_size: int = 200,
"""
output_filename: str = "topic_hierarchy_cache.json"
headers = {
"Authorization": f"ApiKey {config.settings.elasticsearch_api_key}",
"Authorization": f"ApiKey {config.settings.openalex_works_api_key}",
"Content-Type": "application/json"
}
@@ -114,7 +114,7 @@ def build_topic_cache(page_size: int = 200,
"from": offset,
"size": page_size
}
response = client.post(config.settings.elasticsearch_url + '/openalex-topics/_search', json=payload, headers=headers)
response = client.post(config.settings.openalex_works_search_base_url + 'openalex-topics/_search', json=payload, headers=headers)
response.raise_for_status()
data = response.json()