837f0fa63f
Close deployment IDOR and gate stub payment endpoints, add production secret validation, health probes, Redis-backed build progress, GitHub Actions CI, expanded tests, billing/k8s refactors, and ops runbooks. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
460 B
TypeScript
15 lines
460 B
TypeScript
import { ForbiddenException } from '@nestjs/common';
|
|
|
|
/**
|
|
* Stub gateway endpoints auto-approve payments without a real provider.
|
|
* Disabled in production unless PAYMENT_GATEWAY_STUB_ENABLED=true (staging only).
|
|
*/
|
|
export function assertStubGatewayAllowed(): void {
|
|
if (
|
|
process.env.NODE_ENV === 'production' &&
|
|
process.env.PAYMENT_GATEWAY_STUB_ENABLED !== 'true'
|
|
) {
|
|
throw new ForbiddenException('Payment gateway is not configured');
|
|
}
|
|
}
|