feat: enforce import provenance exposure policy (#2)
Merge BAT-017 / REQ-021 implementation after delivery-runner implementation, independent QC, and passing GitHub Actions CI.
This commit is contained in:
@@ -9,6 +9,8 @@ from typing import Any
|
||||
|
||||
import fitz
|
||||
|
||||
from .provenance_policy import allowlisted_json_payload
|
||||
|
||||
DATE_RE = re.compile(r"^\d{4}\.\d{2}\.\d{2}$")
|
||||
FOOTER_RE = re.compile(r"^\d+\s*/\s*\d+$")
|
||||
NUM_RE = re.compile(r"^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?$|^-?\d+(?:\.\d+)?$")
|
||||
@@ -105,7 +107,7 @@ class TossSecuritiesTransaction:
|
||||
return "tosssec:" + hashlib.sha256(raw.encode("utf-8")).hexdigest()
|
||||
|
||||
def raw_payload(self) -> str:
|
||||
return json.dumps(
|
||||
return allowlisted_json_payload(
|
||||
{
|
||||
"row_index": self.row_index,
|
||||
"section": self.section,
|
||||
@@ -123,7 +125,7 @@ class TossSecuritiesTransaction:
|
||||
"raw_numbers": self.raw_numbers,
|
||||
"raw_block": self.raw_block,
|
||||
},
|
||||
ensure_ascii=False,
|
||||
allowed_keys=("row_index", "section", "quantity", "unit_price", "fee", "tax"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user