Skip to content

Commit

Permalink
Merge pull request #10385 from zhongwencool/hide-conf
Browse files Browse the repository at this point in the history
feat: hide data items from configuration files and documentation.
  • Loading branch information
zhongwencool committed Apr 14, 2023
2 parents 835f66a + cbd2d90 commit 626e814
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions apps/emqx/src/emqx_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ roots(high) ->
{?EMQX_AUTHORIZATION_CONFIG_ROOT_NAME,
sc(
ref(?EMQX_AUTHORIZATION_CONFIG_ROOT_NAME),
#{}
#{importance => ?IMPORTANCE_HIDDEN}
)}
];
roots(medium) ->
Expand Down Expand Up @@ -2762,7 +2762,11 @@ authentication(Which) ->
Module ->
Module:root_type()
end,
hoconsc:mk(Type, #{desc => Desc, converter => fun ensure_array/2}).
hoconsc:mk(Type, #{
desc => Desc,
converter => fun ensure_array/2,
importance => ?IMPORTANCE_HIDDEN
}).

%% the older version schema allows individual element (instead of a chain) in config
ensure_array(undefined, _) -> undefined;
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_bridge/src/schema/emqx_bridge_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace() -> "bridge".
tags() ->
[<<"Bridge">>].

roots() -> [bridges].
roots() -> [{bridges, ?HOCON(?R_REF(bridges), #{importance => ?IMPORTANCE_HIDDEN})}].

fields(bridges) ->
[
Expand Down
5 changes: 4 additions & 1 deletion apps/emqx_conf/src/emqx_conf_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,10 @@ emqx_schema_high_prio_roots() ->
{"authorization",
sc(
?R_REF("authorization"),
#{desc => ?DESC(authorization)}
#{
desc => ?DESC(authorization),
importance => ?IMPORTANCE_HIDDEN
}
)},
lists:keyreplace("authorization", 1, Roots, Authz).

Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_rule_engine/src/emqx_rule_engine_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace() -> rule_engine.
tags() ->
[<<"Rule Engine">>].

roots() -> ["rule_engine"].
roots() -> [{"rule_engine", ?HOCON(?R_REF("rule_engine"), #{importance => ?IMPORTANCE_HIDDEN})}].

fields("rule_engine") ->
rule_engine_settings() ++
Expand Down
1 change: 1 addition & 0 deletions changes/ce/feat-10385.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hide data items(rule_engine/bridge/authz/authn) from configuration files and documentation.

0 comments on commit 626e814

Please sign in to comment.