diff --git a/lib/ecto/repo/supervisor.ex b/lib/ecto/repo/supervisor.ex index bda7a38cc1..dd5552ceeb 100644 --- a/lib/ecto/repo/supervisor.ex +++ b/lib/ecto/repo/supervisor.ex @@ -1,3 +1,9 @@ +defmodule Ecto.Repo.SensitiveData do + @moduledoc false + @derive {Inspect, only: []} + defstruct [:data] +end + defmodule Ecto.Repo.Supervisor do @moduledoc false use Supervisor @@ -209,6 +215,10 @@ defmodule Ecto.Repo.Supervisor do end end + def start_child(%Ecto.Repo.SensitiveData{data: {mod, fun, args}}, name, adapter, meta) do + start_child({mod, fun, args}, name, adapter, meta) + end + def start_child({mod, fun, args}, name, adapter, meta) do case apply(mod, fun, args) do {:ok, pid} -> @@ -222,6 +232,6 @@ defmodule Ecto.Repo.Supervisor do end defp wrap_child_spec(%{start: start} = spec, args) do - %{spec | start: {__MODULE__, :start_child, [start | args]}} + %{spec | start: {__MODULE__, :start_child, [%Ecto.Repo.SensitiveData{data: start} | args]}} end end