T13.9 follow-up 2 fix: keep quote marks that belong to brace-less JWK fields (D23)

This commit is contained in:
2026-10-16 16:24:21 -07:00
parent 5f8ebab5b2
commit c75450a000

View File

@@ -179,7 +179,7 @@ def _load_jwk() -> dict:
raw = _key_raw()
if not raw:
raise _fail("OKTA_SYNC_PRIVATE_KEY is not set")
if len(raw) >= 2 and raw[0] == raw[-1] and raw[0] in "\"'":
if len(raw) >= 2 and raw[0] == raw[-1] and raw[0] in "\"'" and raw[0] not in raw[1:-1]:
raw = raw[1:-1].strip()
if raw.startswith(("{", '"', "-----BEGIN")):
text = raw