CyberArena / app /generators /__init__.py
Hussien Haider
H
cb16781
Raw
History Blame Contribute Delete
1.46 kB
"""Per-challenge-type pool generators.
Each module here owns ONE challenge table and exposes the same public API
that :func:`app.main.populate_pool_background` consumes:
POOL_TARGET / POOL_THRESHOLD / POOL_BATCH (module-level constants)
async get_pool_count(team_role) -> int
async refill_pool(team_role, count) -> int
async start_pool_watcher(team_role) # long-running coroutine
The four generators currently registered are: crypto, code-fixing,
log-analysis, and vulnerability-hunter.
"""
from . import crypto
from . import code_fixing
from . import log_analysis
from . import vulnerability_hunter
from . import steganography
from . import web_exploitation
# The orchestrator in app.main iterates this registry. A new challenge
# type is added by appending a tuple below (and a matching table in
# app.services.supabase_service.scenario_table).
REGISTRY = [
# (slug, module, list_of_teams)
("crypto", crypto, ["red"]),
("code-fixing", code_fixing, ["blue"]),
("log-analysis", log_analysis, ["blue"]),
("vulnerability-hunter", vulnerability_hunter, ["blue"]),
("steganography", steganography, ["red"]),
("web-exploitation", web_exploitation, ["red"]),
]
__all__ = [
"crypto",
"code_fixing",
"log_analysis",
"vulnerability_hunter",
"steganography",
"web_exploitation",
"REGISTRY",
]