Skip to content

Task 10 - Supabase Edge Function Security #10

Description

@G-Jeffreys

10.1 Remove // @ts-nocheck and enable strict TS.
10.2 Validate request JSON with Zod; reject negative or NaN token counts.
10.3 Add OPTIONS handler with CORS headers restricting to your first-party origin.
10.4 Catch DB errors and respond 400/429 to stop infinite Stripe retries.
10.5 Store usage metrics in a dedicated usage table with CHECK (tokens_in >= 0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions