Skip to content

Commit

Permalink
Fix connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
SandGrainOne committed Oct 14, 2024
1 parent 71e5c7c commit 3398e40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace Altinn.Profile.Integrations.Extensions;
/// </summary>
public static class ConfigurationExtensions
{
private const string ProfileDbAdminUserNameKey = "PostgreSqlSettings--ProfileDbAdminUserName";
private const string ProfileDbAdminPasswordKey = "PostgreSqlSettings--ProfileDbAdminPassword";
private const string ProfileDbConnectionStringKey = "PostgreSqlSettings--ProfileDbConnectionString";
private const string ProfileDbAdminUserNameKey = "PostgreSqlSettings:ProfileDbAdminUserName";
private const string ProfileDbAdminPasswordKey = "PostgreSqlSettings:ProfileDbAdminPassword";
private const string ProfileDbConnectionStringKey = "PostgreSqlSettings:ProfileDbConnectionString";

/// <summary>
/// Retrieves the database connection string from the configuration.
Expand Down
5 changes: 5 additions & 0 deletions src/Altinn.Profile/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@
},
"CoreSettings": {
"ProfileCacheLifetimeSeconds": 600
},
"PostgreSqlSettings": {
"ProfileDbAdminUserName": "from keyvault",
"ProfileDbAdminPassword": "from keyvault",

Check warning on line 14 in src/Altinn.Profile/appsettings.json

View workflow job for this annotation

GitHub Actions / Build, test & analyze

"password" detected here, make sure this is not a hard-coded credential. (https://rules.sonarsource.com/csharp/RSPEC-2068)
"ProfileDbConnectionString": "Host=localhost;Port=5432;Database=profiledb;Username={0};Password={1};"
}
}

0 comments on commit 3398e40

Please sign in to comment.