mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Fix missing auth header in verify_system_status (#724)
Fix missing auth header in verify_system_status processor check
The check_processors function received the token parameter but
did not include it in the Authorization header when calling the
metrics endpoint, causing 401 errors when gateway auth is enabled.
This commit is contained in:
parent
9c55a0a0ff
commit
ea33620fb2
1 changed files with 5 additions and 1 deletions
|
|
@ -178,7 +178,11 @@ def check_processors(url: str, min_processors: int, timeout: int, token: Optiona
|
||||||
url += '/'
|
url += '/'
|
||||||
metrics_url = f"{url}api/metrics/query?query=processor_info"
|
metrics_url = f"{url}api/metrics/query?query=processor_info"
|
||||||
|
|
||||||
resp = requests.get(metrics_url, timeout=timeout)
|
headers = {}
|
||||||
|
if token:
|
||||||
|
headers["Authorization"] = f"Bearer {token}"
|
||||||
|
|
||||||
|
resp = requests.get(metrics_url, timeout=timeout, headers=headers)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
processor_count = len(data.get("data", {}).get("result", []))
|
processor_count = len(data.get("data", {}).get("result", []))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue