forked from mtusi2026/mtusi2026lab7
fix(pki): bind operator token cache to the active certificate
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user