Skip to content

Emit a warning when database URL is pasted directly into the schema #17640

@millsp

Description

@millsp

Problem

It should generally be considered a bad practice to paste a private database URL into the schema directly. If the user commits that schema by accident somewhere, or deploys it somewhere, they will be exposed to a security risk.

Suggested solution

I suggest that we emit a warning on prisma generate (maybe others too?) when we detect any URL that isn't pointing to localhost or 127.0.0.1 is pasted in the schema. This way, we can raise awareness around security and suggest users to either use .env or environment variables.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions