From ec50f6635e438bce8df691bd854d19c11368c2e7 Mon Sep 17 00:00:00 2001 From: Arnaud Dartois Date: Mon, 27 Jul 2026 18:37:54 +0000 Subject: [PATCH] fix: remove hardcoded DB password from AppDbContextFactory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fallback connection string included 'Password=heimdall' as a literal. Remove the password — the fallback is only for local dev where PostgreSQL trust authentication is typically used. Production deployments must set the DATABASE_URL environment variable. --- src/Heimdall.Infrastructure/Data/AppDbContextFactory.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Heimdall.Infrastructure/Data/AppDbContextFactory.cs b/src/Heimdall.Infrastructure/Data/AppDbContextFactory.cs index 9fba9ff..0a82a29 100644 --- a/src/Heimdall.Infrastructure/Data/AppDbContextFactory.cs +++ b/src/Heimdall.Infrastructure/Data/AppDbContextFactory.cs @@ -1,4 +1,3 @@ - using Heimdall.Infrastructure.Data.Interceptors; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; @@ -16,7 +15,7 @@ public class AppDbContextFactory : IDesignTimeDbContextFactory var optionsBuilder = new DbContextOptionsBuilder(); var connectionString = Environment.GetEnvironmentVariable("DATABASE_URL") - ?? "Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall"; + ?? "Host=localhost;Port=5432;Database=heimdall;Username=heimdall"; optionsBuilder.UseNpgsql(connectionString, npgsql => npgsql.MigrationsHistoryTable("__EFMigrationsHistory", "public"));