Check dependency installation and credential presence without exposing values
This commit is contained in:
6
app.py
6
app.py
@@ -3,8 +3,12 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||
import json
|
||||
import os
|
||||
|
||||
metadata = {"name": "xc-cloud-build-probe", "version": "probe-20261026-01",
|
||||
external_token = os.environ.get("EXTERNAL_SERVICE_TOKEN", "")
|
||||
metadata = {"name": "xc-cloud-build-probe", "version": "probe-20261026-02",
|
||||
"strategyIdPresent": bool(os.environ.get("STRATEGY_ID")),
|
||||
"externalCredentialPresent": bool(external_token),
|
||||
"externalCredentialLength": len(external_token),
|
||||
"externalCredentialShape": "jwt-like" if external_token.count(".") == 2 else "opaque" if external_token else "empty",
|
||||
"credentialEnvironmentNames": sorted(name for name in os.environ
|
||||
if any(marker in name for marker in ("TOKEN", "AUTH", "CREDENTIAL", "SECRET", "API_KEY")))}
|
||||
print(json.dumps(metadata), flush=True)
|
||||
|
||||
Reference in New Issue
Block a user