From 133b7823892e9059258e8ce6389a2f1a93089df3 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 13 Dec 2025 05:21:38 -0500 Subject: [PATCH] fix: replace password in pool_config with removed atom in status --- src/pgo_connection.erl | 8 ++++++++ src/pgo_notifications.erl | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/pgo_connection.erl b/src/pgo_connection.erl index 565cc24..dae4bfb 100644 --- a/src/pgo_connection.erl +++ b/src/pgo_connection.erl @@ -18,6 +18,7 @@ disconnected/3, enqueued/3, dequeued/3, + format_status/1, terminate/3]). -include("pgo_internal.hrl"). @@ -188,6 +189,13 @@ handle_event(info, {'EXIT', _, _Reason}, _Data) -> handle_event(info, {ssl_closed, _}, _Data) -> keep_state_and_data. +format_status(Status) -> + maps:map(fun(data, Data=#data{pool_config=PoolConfig}) -> + Data#data{pool_config=PoolConfig#{password => "*"}}; + (_, Value) -> + Value + end, Status). + %% @private terminate(_Reason, _, #data{conn=undefined}) -> ok; diff --git a/src/pgo_notifications.erl b/src/pgo_notifications.erl index 77ac015..8702c1a 100644 --- a/src/pgo_notifications.erl +++ b/src/pgo_notifications.erl @@ -12,6 +12,7 @@ callback_mode/0, connected/3, disconnected/3, + format_status/1, terminate/3]). -include("pgo_internal.hrl"). @@ -171,6 +172,13 @@ handle_event(info, {ssl_closed, _}, _Data) -> handle_event(_, _, _) -> keep_state_and_data. +format_status(Status) -> + maps:map(fun(data, Data=#data{config=PoolConfig}) -> + Data#data{config=PoolConfig#{password => "*"}}; + (_, Value) -> + Value + end, Status). + terminate(_Reason, _, #data{conn=undefined}) -> ok; terminate(_Reason, _, #data{conn=Conn}) ->