Spaces:
Sleeping
Sleeping
Download app/core/module_router.py from Alpha-Team/CyberArena: direct link, hf CLI and curl.
- Browser
- Download file 731 Bytes
-
https://huggingface.co/spaces/Alpha-Team/CyberArena/resolve/main/app/core/module_router.py
- Command line
-
hf download hf://spaces/Alpha-Team/CyberArena/app/core/module_router.py
-
curl -L -o module_router.py https://huggingface.co/spaces/Alpha-Team/CyberArena/resolve/main/app/core/module_router.py
731 Bytes
| """Map module names to challenge types and back. | |
| The frontend uses ``module`` to route a row to the right editor. | |
| We keep two parallel maps and a single function for clarity. | |
| """ | |
| from .constants import WEB_EXPLOIT_MODULES | |
| def challenge_type_for_module(module: str) -> str: | |
| """Return challenge type for a module name. | |
| Supports canonical challenge types AND topic names. New challenge | |
| types are wired by extending this function — no caller change required. | |
| """ | |
| # Canonical challenge types | |
| if module in ("web-exploitation", "steganography"): | |
| return module | |
| # Topic names that map to web-exploitation | |
| if module in WEB_EXPLOIT_MODULES: | |
| return "web-exploitation" | |
| return "crypto" | |