Merge pull request #10741 from paulozulato/fix-oracle-passwd-leaking

fix(oracle): hide password on stacktrace
This commit is contained in:
Paulo Zulato 2023-05-24 15:31:00 -03:00 committed by GitHub
commit 50ff6c4aa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,7 @@
%% -*- mode: erlang; -*-
{erl_opts, [debug_info]}.
{deps, [ {jamdb_oracle, {git, "https://github.com/emqx/jamdb_oracle", {tag, "0.4.9.4"}}}
{deps, [ {jamdb_oracle, {git, "https://github.com/emqx/jamdb_oracle", {tag, "0.4.9.5"}}}
, {emqx_connector, {path, "../../apps/emqx_connector"}}
, {emqx_resource, {path, "../../apps/emqx_resource"}}
]}.

View File

@ -1,6 +1,6 @@
{application, emqx_oracle, [
{description, "EMQX Enterprise Oracle Database Connector"},
{vsn, "0.1.0"},
{vsn, "0.1.1"},
{registered, []},
{applications, [
kernel,

View File

@ -96,7 +96,7 @@ on_start(
{host, Host},
{port, Port},
{user, emqx_plugin_libs_rule:str(User)},
{password, emqx_secret:wrap(maps:get(password, Config, ""))},
{password, jamdb_secret:wrap(maps:get(password, Config, ""))},
{sid, emqx_plugin_libs_rule:str(Sid)},
{service_name, emqx_plugin_libs_rule:str(ServiceName)},
{database, DB},
@ -258,9 +258,7 @@ oracle_host_options() ->
?ORACLE_HOST_OPTIONS.
connect(Opts) ->
Password = emqx_secret:unwrap(proplists:get_value(password, Opts)),
NewOpts = lists:keyreplace(password, 1, Opts, {password, Password}),
jamdb_oracle:start_link(NewOpts).
jamdb_oracle:start_link(Opts).
sql_query_to_str(SqlQuery) ->
emqx_plugin_libs_rule:str(SqlQuery).

View File

@ -0,0 +1 @@
Fix password leaking on stacktrace for Oracle Database.