From 4b68523825deb0500e827c36c87036ba4caa24aa Mon Sep 17 00:00:00 2001 From: "DESKTOP-TKLFCPR\\ython" Date: Mon, 8 Jun 2026 00:13:45 +0900 Subject: [PATCH] manual-deploy 2026-06-08 00:13 --- routers/upstage_ocr.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/routers/upstage_ocr.py b/routers/upstage_ocr.py index fed5e0a..b15a64a 100644 --- a/routers/upstage_ocr.py +++ b/routers/upstage_ocr.py @@ -200,7 +200,7 @@ async def get_ocr_config( cfg = row.scalar_one_or_none() if not cfg: return {"configured": False} - key = cfg.api_key_enc or "" + key = decrypt_secret(cfg.api_key_enc) or "" masked_key = f"{key[:6]}{'*' * (len(key) - 10)}{key[-4:]}" if len(key) > 10 else "***" return { "configured": True, @@ -232,7 +232,7 @@ async def parse_document( async with httpx.AsyncClient(timeout=120) as client: r = await client.post( f"{UPSTAGE_BASE}/document-digitization", - headers={"Authorization": f"Bearer {cfg.api_key_enc}"}, + headers={"Authorization": f"Bearer {decrypt_secret(cfg.api_key_enc)}"}, files={"document": (file.filename, file_bytes, mime)}, data={ "model": model or cfg.model, @@ -286,7 +286,7 @@ async def extract_information( async with httpx.AsyncClient(timeout=120) as client: r = await client.post( f"{UPSTAGE_BASE}/information-extraction", - headers={"Authorization": f"Bearer {cfg.api_key_enc}"}, + headers={"Authorization": f"Bearer {decrypt_secret(cfg.api_key_enc)}"}, files={"document": (file.filename, file_bytes, mime)}, data={"schema": json.dumps(schema_dict, ensure_ascii=False)} ) @@ -342,7 +342,7 @@ async def document_qa( async with httpx.AsyncClient(timeout=120) as client: r = await client.post( f"{UPSTAGE_BASE}/document-qa", - headers={"Authorization": f"Bearer {cfg.api_key_enc}"}, + headers={"Authorization": f"Bearer {decrypt_secret(cfg.api_key_enc)}"}, files={"document": (file.filename, file_bytes, mime)}, data={"question": question} ) @@ -386,14 +386,14 @@ async def batch_parse( if mode == "extract" and schema: r = await client.post( f"{UPSTAGE_BASE}/information-extraction", - headers={"Authorization": f"Bearer {cfg.api_key_enc}"}, + headers={"Authorization": f"Bearer {decrypt_secret(cfg.api_key_enc)}"}, files={"document": (file.filename, file_bytes, mime)}, data={"schema": schema} ) else: r = await client.post( f"{UPSTAGE_BASE}/document-digitization", - headers={"Authorization": f"Bearer {cfg.api_key_enc}"}, + headers={"Authorization": f"Bearer {decrypt_secret(cfg.api_key_enc)}"}, files={"document": (file.filename, file_bytes, mime)}, data={"model": cfg.model, "ocr": "auto", "output_formats": '["text"]'} )