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:
cybermaggedon 2026-03-26 16:58:30 +00:00 committed by GitHub
parent 9c55a0a0ff
commit ea33620fb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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", []))