From 34e4f22012ccade35f11ef08aa5f279f89a3333b Mon Sep 17 00:00:00 2001 From: Jean Gatto Date: Tue, 29 Jul 2025 07:53:13 -0300 Subject: [PATCH] refactor: update sensitive information handling in configuration and logging --- docker-compose.yml | 4 ++-- src/Shop.PublicApi/appsettings.Docker.json | 4 ++-- src/Shop.Query/Data/Context/NoSqlDbContext.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6ffa876..b255803 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,7 @@ services: - "1433:1433" environment: - ACCEPT_EULA=Y - - MSSQL_SA_PASSWORD=pMA63033n6tF + - MSSQL_SA_PASSWORD=${MSSQL_SA_PASSWORD} - MSSQL_PID=Developer - MSSQL_COLLATION=Latin1_General_CI_AI networks: @@ -61,7 +61,7 @@ services: shop-redis: image: redis:latest container_name: shop-redis - command: redis-server --requirepass pMA63033n6tF + command: redis-server --requirepass ${REDIS_PASSWORD} restart: always expose: - 6379 diff --git a/src/Shop.PublicApi/appsettings.Docker.json b/src/Shop.PublicApi/appsettings.Docker.json index 4af45fe..0a38eab 100644 --- a/src/Shop.PublicApi/appsettings.Docker.json +++ b/src/Shop.PublicApi/appsettings.Docker.json @@ -10,9 +10,9 @@ } }, "ConnectionStrings": { - "SqlConnection": "Server=shop-sql-server;Integrated Security=true;Initial Catalog=ShopContext;User Id=sa;Password=pMA63033n6tF;Trusted_Connection=False;TrustServerCertificate=True;", + "SqlConnection": "Server=shop-sql-server;Integrated Security=true;Initial Catalog=ShopContext;User Id=sa;Password=;Trusted_Connection=False;TrustServerCertificate=True;", "NoSqlConnection": "mongodb://shop-mongo-server", - "CacheConnection": "shop-redis:6379,password=pMA63033n6tF,abortConnect=false" + "CacheConnection": "shop-redis:6379,password=,abortConnect=false" }, "CacheOptions": { "AbsoluteExpirationInHours": 2, diff --git a/src/Shop.Query/Data/Context/NoSqlDbContext.cs b/src/Shop.Query/Data/Context/NoSqlDbContext.cs index 7198c89..7467c76 100644 --- a/src/Shop.Query/Data/Context/NoSqlDbContext.cs +++ b/src/Shop.Query/Data/Context/NoSqlDbContext.cs @@ -98,7 +98,7 @@ public sealed class NoSqlDbContext : IReadDbContext, ISynchronizeDb var indexName = await collection.Indexes.CreateOneAsync(indexModel); - _logger.LogInformation("----- MongoDB: indexes successfully created - {indexName}", indexName); + _logger.LogInformation("----- MongoDB: indexes successfully created - {IndexName}", indexName); } private static List GetCollectionNamesFromAssembly() =>