Skip to content

Add environment-specific validation modes #93

Description

@therealjhay

Description: Some validation rules should differ between development and production. For example, HTTPS requirement for webhook URLs is critical in production but annoying in development.

Requirements:

  • Add an isProduction flag or accept NODE_ENV in validation context
  • Make security-critical validations conditional on the environment
  • Document which rules are environment-specific

Suggested execution steps:

  1. Create an EnvAwareSchema factory that accepts NODE_ENV
  2. Use .superRefine() or conditional .refine() based on the env
  3. Apply to webhook URL, CORS origins, and other security schemas

Example commit message:

feat(validation): add environment-aware validation modes

Security validations (HTTPS, CORS) are now conditional on NODE_ENV,
allowing relaxed rules in development while enforcing them in production.

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions