Skip to content

Commit 8a4996d

Browse files
Remove sensitive options before calling after_connect (#336)
1 parent 33f67eb commit 8a4996d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/db_connection/connection.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ defmodule DBConnection.Connection do
99
alias DBConnection.Util
1010

1111
@timeout 15_000
12+
@sensitive_opts [:parameters, :hostname, :port, :username, :password, :database]
1213

1314
@doc false
1415
def start_link(mod, opts, pool, tag) do
@@ -234,6 +235,7 @@ defmodule DBConnection.Connection do
234235
case apply(mod, :checkout, [state]) do
235236
{:ok, state} ->
236237
opts = [timeout: timeout] ++ opts
238+
opts = Keyword.drop(opts, @sensitive_opts)
237239
{pid, ref} = DBConnection.Task.run_child(mod, state, after_connect, opts)
238240
timer = start_timer(pid, timeout)
239241
s = %{s | client: {ref, :after_connect}, timer: timer, state: state}

0 commit comments

Comments
 (0)