Skip to content

[Backend] backend/src/config/sandbox.ts hardcodes sandbox mode defaults with no schema validation of the SANDBOX_MODE env var #1100

Description

@grantfox-oss

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

backend/src/config/sandbox.ts reads sandbox-related environment variables to decide default behavior. If SANDBOX_MODE (or similar) is set to an unexpected string like "TRUE" or "yes" instead of the expected value, silent truthy/falsy coercion could enable or disable sandbox mode unintentionally in production, which is a meaningful safety toggle given sandboxMiddleware trusts it.

Acceptance criteria

  • Add explicit, documented accepted values for sandbox-related env vars
  • Fail fast at startup with a clear error on an unrecognized value rather than silently coercing
  • Add a unit test for the parsing logic

Files to touch

  • backend/src/config/sandbox.ts

Out of scope

  • Changing sandbox middleware request-time behavior (tracked separately)
  • Adding new sandbox modes

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programbackendBackend related tasksgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions