Spaces:
Running
Running
Download app/utils/validators.py from Shoaib898/rankora-api: direct link, hf CLI and curl.
- Browser
- Download file 322 Bytes
-
https://huggingface.co/spaces/Shoaib898/rankora-api/resolve/main/app/utils/validators.py
- Command line
-
hf download hf://spaces/Shoaib898/rankora-api/app/utils/validators.py
-
curl -L -o validators.py https://huggingface.co/spaces/Shoaib898/rankora-api/resolve/main/app/utils/validators.py
322 Bytes
| """Input validation: SSTI, SQL/NoSQL injection probes, ReDoS-safe string handling.""" | |
| import re | |
| from fastapi import HTTPException | |
| from app.security.input_guard import normalize_asin_safe | |
| ASIN_PATTERN = re.compile(r"^[A-Z0-9]{10}$") | |
| def normalize_asin(asin: str) -> str: | |
| return normalize_asin_safe(asin) | |