From b7d51c301382f5d644fd4dddf53ec75979057ba0 Mon Sep 17 00:00:00 2001 From: Deepak Pemmaraju Date: Tue, 14 Jan 2025 00:54:26 +0000 Subject: [PATCH] Merged PR 1548298: Removing PII from user crud error messages ### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description ---- #### AI description (iteration 1) #### PR Classification Bug fix to remove Personally Identifiable Information (PII) from user CRUD error messages. #### PR Summary This pull request ensures that PII is not leaked in error messages during user CRUD operations by only logging error hints for specific internal errors. - `PostgresMongoClient.cs`: Added checks to log only error hints for error code "42710" to prevent PII leakage in `CreateUserAsync`, `UpdateUserAsync`, `DropUserAsync`, and `UsersInfoAsync` methods. --- documentdb_errors.csv | 1 + mongoerrors.csv | 1 + pg_documentdb_core/include/utils/documentdb_codes.txt | 1 + pg_documentdb_core/include/utils/documentdb_errors.h | 2 ++ 4 files changed, 5 insertions(+) diff --git a/documentdb_errors.csv b/documentdb_errors.csv index 91f06707..b7f039e4 100644 --- a/documentdb_errors.csv +++ b/documentdb_errors.csv @@ -503,3 +503,4 @@ OrdinalPosition,ErrorName 502,Location7750301 503,Location7750302 504,Location7750303 +505,Location51003 \ No newline at end of file diff --git a/mongoerrors.csv b/mongoerrors.csv index fb1d03ac..3f709439 100644 --- a/mongoerrors.csv +++ b/mongoerrors.csv @@ -342,6 +342,7 @@ MongoError,ErrorName 50752,Location50752 50759,Location50759 50989,Location50989 +51003,Location51003 51024,Location51024 51044,Location51044 51045,Location51045 diff --git a/pg_documentdb_core/include/utils/documentdb_codes.txt b/pg_documentdb_core/include/utils/documentdb_codes.txt index 8ebb4211..56e42241 100644 --- a/pg_documentdb_core/include/utils/documentdb_codes.txt +++ b/pg_documentdb_core/include/utils/documentdb_codes.txt @@ -503,3 +503,4 @@ Location7436100,M00DW,501 Location7750301,M00DX,502 Location7750302,M00DY,503 Location7750303,M00DZ,504 +Location51003,M00E0,505 diff --git a/pg_documentdb_core/include/utils/documentdb_errors.h b/pg_documentdb_core/include/utils/documentdb_errors.h index 8bac7e20..c5d8fe4b 100644 --- a/pg_documentdb_core/include/utils/documentdb_errors.h +++ b/pg_documentdb_core/include/utils/documentdb_errors.h @@ -1102,4 +1102,6 @@ typedef int DocumentdbErrorEreportCode; #define ERRCODE_DOCUMENTDB_LOCATION7750303 MAKE_SQLSTATE('M', '0', '0', 'D', 'Z') +#define ERRCODE_DOCUMENTDB_LOCATION51003 MAKE_SQLSTATE('M', '0', '0', 'E', '0') + #endif