Skip to content

Comments

feat: Recovery/custom question types 20260224#355

Open
najuna-brian wants to merge 8 commits intoOpenDataEnsemble:devfrom
najuna-brian:recovery/custom_question_types-20260224
Open

feat: Recovery/custom question types 20260224#355
najuna-brian wants to merge 8 commits intoOpenDataEnsemble:devfrom
najuna-brian:recovery/custom_question_types-20260224

Conversation

@najuna-brian
Copy link
Contributor

Recovery/custom question types 20260224

Jexsie and others added 8 commits February 19, 2026 14:44
Signed-off-by: Jessie Ssebuliba <jessiessebuliba@gmail.com>
Replace dynamic import() of file:// URIs with a sandboxed evaluation
approach for custom question type modules.

Security:
- Add CustomQuestionTypeScanner (RN side) that reads index.js files as
  strings and screens them against a blocklist (fetch, XMLHttpRequest,
  eval, document.cookie, localStorage, etc.)
- Rewrite CustomQuestionTypeLoader (WebView side) to evaluate source
  in a scoped sandbox via new Function(), exposing only React and MUI
- Manifest shape changed from { modulePath: string } to { source: string }

New files:
- formulus/src/services/CustomQuestionTypeScanner.ts
- formulus-formplayer/src/services/CustomQuestionTypeLoader.ts (rewritten)
- formulus-formplayer/src/services/CustomQuestionTypeRegistry.ts
- formulus-formplayer/src/renderers/CustomQuestionTypeAdapter.tsx
- formulus-formplayer/src/types/CustomQuestionTypeContract.ts
- formulus-formplayer/docs/custom-question-types-architecture.md

Modified files:
- formulus/src/components/FormplayerModal.tsx (calls scanner)
- FormulusInterfaceDefinition.ts (both projects, modulePath → source)
- formulus-formplayer/src/App.tsx (orchestration)

Signed-off-by: Jessie Ssebuliba <jessiessebuliba@gmail.com>
@najuna-brian najuna-brian changed the title Recovery/custom question types 20260224 feat: Recovery/custom question types 20260224 Feb 24, 2026
@Jexsie
Copy link
Collaborator

Jexsie commented Feb 25, 2026

@najuna-brian ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants