fix(pki): bind operator token cache to the active certificate

This commit is contained in:
2026-11-20 20:35:01 +03:00
parent bd44b6003a
commit f3fd46b064
4 changed files with 89 additions and 2 deletions
+11
View File
@@ -16,6 +16,17 @@ ENDPOINTS = {
def fetch(service, path, *, params=None, json_result=True):
if service == "otel":
from scripts.bootstrap_security import OPERATOR, SECRET, write_private
# Operator credentials can change during CA rollover; never keep a
# stale copied certificate for the collector health probe.
for name in ["cert.pem", "key.pem"]:
write_private(
SECRET / "probe/operator" / name,
(OPERATOR / "client" / name).read_bytes(),
mode=0o644,
)
url = ENDPOINTS[service] + path
if params:
url += "?" + urlencode(params, doseq=True)