-
Notifications
You must be signed in to change notification settings - Fork 0
🔒 Remove hardcoded database connection string #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |||||
| }, | ||||||
|
|
||||||
| "ConnectionStrings": { | ||||||
| "DefaultConnection": "Server=localhost,1433;Database=pds;User Id=sa;Password=AnyTngDocker123!;Encrypt=False;" | ||||||
| "DefaultConnection": "" | ||||||
|
||||||
| "DefaultConnection": "" | |
| "DefaultConnection": "" |
Copilot
AI
Apr 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This config file still contains other hardcoded secrets (e.g., JwtSettings:Secret, Stripe SecretKey/WebhookSecret, and EmailSettings:Password). If the intent is to remove sensitive credentials from source control, these values should also be moved to environment variables/user-secrets (and the exposed secrets rotated), otherwise the repo remains a high-risk secret leak.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting DefaultConnection to an empty string can lead to a less actionable failure mode: Program.cs uses this value directly for EF Core and Hangfire SQL Server storage, so if an env var/user secret isn’t provided, the app will start with an empty connection string and throw later. Prefer removing the key entirely (so it’s clearly missing) and/or adding an explicit startup validation that throws a clear exception when the connection string is null/empty.