Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: redact the password to ****** in API examples #10323

Merged
merged 3 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/emqx_authn/src/emqx_authn.app.src
@@ -1,7 +1,7 @@
%% -*- mode: erlang -*-
{application, emqx_authn, [
{description, "EMQX Authentication"},
{vsn, "0.1.15"},
{vsn, "0.1.16"},
{modules, []},
{registered, [emqx_authn_sup, emqx_authn_registry]},
{applications, [kernel, stdlib, emqx_resource, emqx_connector, ehttpc, epgsql, mysql, jose]},
Expand Down
8 changes: 4 additions & 4 deletions apps/emqx_authn/src/emqx_authn_api.erl
Expand Up @@ -1419,14 +1419,14 @@ request_user_create_examples() ->
summary => <<"Regular user">>,
value => #{
user_id => <<"user1">>,
password => <<"secret">>
password => <<"******">>
}
},
super_user => #{
summary => <<"Superuser">>,
value => #{
user_id => <<"user2">>,
password => <<"secret">>,
password => <<"******">>,
is_superuser => true
}
}
Expand All @@ -1437,13 +1437,13 @@ request_user_update_examples() ->
regular_user => #{
summary => <<"Update regular user">>,
value => #{
password => <<"newsecret">>
password => <<"******">>
}
},
super_user => #{
summary => <<"Update user and promote to superuser">>,
value => #{
password => <<"newsecret">>,
password => <<"******">>,
is_superuser => true
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_bridge/src/emqx_bridge_api.erl
Expand Up @@ -235,7 +235,7 @@ mqtt_main_example() ->
server => <<"127.0.0.1:1883">>,
proto_ver => <<"v4">>,
username => <<"foo">>,
password => <<"bar">>,
password => <<"******">>,
clean_start => true,
keepalive => <<"300s">>,
retry_interval => <<"15s">>,
Expand Down
2 changes: 2 additions & 0 deletions changes/ce/fix-10323.en.md
@@ -0,0 +1,2 @@
For security reasons, the value of the `password` field in the API examples is replaced with `******`.

2 changes: 2 additions & 0 deletions changes/ce/fix-10323.zh.md
@@ -0,0 +1,2 @@
出于安全原因,将 API 示例中 `password` 字段的值,统一更换为 `******`。

2 changes: 1 addition & 1 deletion lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_clickhouse.erl
Expand Up @@ -50,7 +50,7 @@ values(_Method, Type) ->
database => <<"mqtt">>,
pool_size => 8,
username => <<"default">>,
password => <<"public">>,
password => <<"******">>,
sql => ?DEFAULT_SQL,
batch_value_separator => ?DEFAULT_BATCH_VALUE_SEPARATOR,
local_topic => <<"local/topic/#">>,
Expand Down
2 changes: 1 addition & 1 deletion lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_dynamo.erl
Expand Up @@ -46,7 +46,7 @@ values(_Method) ->
database => <<"mqtt">>,
pool_size => 8,
username => <<"root">>,
password => <<"public">>,
password => <<"******">>,
template => ?DEFAULT_TEMPLATE,
local_topic => <<"local/topic/#">>,
resource_opts => #{
Expand Down
2 changes: 1 addition & 1 deletion lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_influxdb.erl
Expand Up @@ -61,7 +61,7 @@ values("influxdb_api_v1", post) ->
TypeOpts = #{
database => <<"example_database">>,
username => <<"example_username">>,
password => <<"examlpe_password">>,
password => <<"******">>,
server => <<"127.0.0.1:8086">>
},
values(common, "influxdb_api_v1", SupportUint, TypeOpts);
Expand Down
2 changes: 1 addition & 1 deletion lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_kafka.erl
Expand Up @@ -64,7 +64,7 @@ values(common_config) ->
authentication => #{
mechanism => <<"plain">>,
username => <<"username">>,
password => <<"password">>
password => <<"******">>
},
bootstrap_hosts => <<"localhost:9092">>,
connect_timeout => <<"5s">>,
Expand Down
2 changes: 1 addition & 1 deletion lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_mongodb.erl
Expand Up @@ -149,7 +149,7 @@ values(common, MongoType, Method, TypeOpts) ->
srv_record => false,
pool_size => 8,
username => <<"myuser">>,
password => <<"mypass">>
password => <<"******">>
},
MethodVals = method_values(MongoType, Method),
Vals0 = maps:merge(MethodVals, Common),
Expand Down
2 changes: 1 addition & 1 deletion lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_mysql.erl
Expand Up @@ -47,7 +47,7 @@ values(_Method) ->
database => <<"test">>,
pool_size => 8,
username => <<"root">>,
password => <<"">>,
password => <<"******">>,
sql => ?DEFAULT_SQL,
local_topic => <<"local/topic/#">>,
resource_opts => #{
Expand Down
2 changes: 1 addition & 1 deletion lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_pgsql.erl
Expand Up @@ -49,7 +49,7 @@ values(_Method, Type) ->
database => <<"mqtt">>,
pool_size => 8,
username => <<"root">>,
password => <<"public">>,
password => <<"******">>,
sql => ?DEFAULT_SQL,
local_topic => <<"local/topic/#">>,
resource_opts => #{
Expand Down
2 changes: 1 addition & 1 deletion lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_redis.erl
Expand Up @@ -77,7 +77,7 @@ values(common, RedisType, SpecificOpts) ->
enable => true,
local_topic => <<"local/topic/#">>,
pool_size => 8,
password => <<"secret">>,
password => <<"******">>,
command_template => [<<"LPUSH">>, <<"MSGS">>, <<"${payload}">>],
resource_opts => values(resource_opts, RedisType, #{}),
ssl => #{enable => false}
Expand Down