Hussien Haider commited on
Commit
5d90003
·
1 Parent(s): 9d1b66a
Files changed (1) hide show
  1. app/core/module_router.py +6 -5
app/core/module_router.py CHANGED
@@ -10,12 +10,13 @@ from .constants import WEB_EXPLOIT_MODULES
10
  def challenge_type_for_module(module: str) -> str:
11
  """Return challenge type for a module name.
12
 
13
- Currently: ``"web"`` for the offensive web-exploitation set,
14
- ``"crypto"`` for the legacy crypto challenges. New challenge types
15
- are wired by extending this function — no caller change required.
16
  """
 
 
 
 
17
  if module in WEB_EXPLOIT_MODULES:
18
  return "web-exploitation"
19
- if module == "steganography":
20
- return "steganography"
21
  return "crypto"
 
10
  def challenge_type_for_module(module: str) -> str:
11
  """Return challenge type for a module name.
12
 
13
+ Supports canonical challenge types AND topic names. New challenge
14
+ types are wired by extending this function — no caller change required.
 
15
  """
16
+ # Canonical challenge types
17
+ if module in ("web-exploitation", "steganography"):
18
+ return module
19
+ # Topic names that map to web-exploitation
20
  if module in WEB_EXPLOIT_MODULES:
21
  return "web-exploitation"
 
 
22
  return "crypto"