Validate operation route parameters and enforce age-appropriate topics

Abierto
#4 2 comentarios 0 reacciones 1 asignado Ver en GitHub

@jd5073356-max ya está trabajando en esto.

Desde el 19/8/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

GrantFox OSS Maybe Rewarded Third Campaign

Problem

Practice and challenge cast the raw ?op= query string to Operation without runtime validation. Visiting /game/practice?op=anything passes an unsupported value into generateQuestion(), whose switch has no default, so it returns undefined and the game crashes. Valid but age-inappropriate operations can also bypass the game hub by editing the URL.

Proposed scope

  • Add a shared runtime parser/type guard for operations.
  • Validate the requested operation against the active profile's age-group allowlist.
  • Choose a predictable failure path: safe default with notice, or redirect to topic selection.
  • Make generateQuestion() fail explicitly for invalid input rather than returning implicitly.
  • Apply the same validation at every route/session entry boundary.

Acceptance criteria

  • Missing, malformed, repeated, URL-encoded, and unsupported op values never crash rendering.
  • Direct URLs cannot start an age-inappropriate topic without an explicit product-approved override.
  • Valid operations continue to deep-link correctly.
  • TypeScript enforces an exhaustive generator switch.
  • Route/component tests cover all six operations and invalid inputs.
Lenguaje dominante
TypeScript
Estrellas
1
Forks
8
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DogStark/mathbloc

Todos los issues de DogStark/mathbloc

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.