Validate operation route parameters and enforce age-appropriate topics

オープン
#4 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

@jd5073356-max がすでに取り組んでいます。

2026年8月19日 から。

評価

この issue はまだ評価されていません。

説明

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.
主要言語
TypeScript
スター
1
フォーク
8
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DogStark/mathbloc のほかの issue

DogStark/mathbloc の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。