From a70930fed04b721e2c1c5e1753de5ea319ff377d Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Thu, 13 Apr 2023 09:26:16 +0800 Subject: [PATCH 1/4] feat: hiden auto_subscribe conf --- .../src/emqx_auto_subscribe.app.src | 2 +- .../src/emqx_auto_subscribe_schema.erl | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/emqx_auto_subscribe/src/emqx_auto_subscribe.app.src b/apps/emqx_auto_subscribe/src/emqx_auto_subscribe.app.src index a273face1..d6f6f4058 100644 --- a/apps/emqx_auto_subscribe/src/emqx_auto_subscribe.app.src +++ b/apps/emqx_auto_subscribe/src/emqx_auto_subscribe.app.src @@ -1,7 +1,7 @@ %% -*- mode: erlang -*- {application, emqx_auto_subscribe, [ {description, "Auto subscribe Application"}, - {vsn, "0.1.3"}, + {vsn, "0.1.4"}, {registered, []}, {mod, {emqx_auto_subscribe_app, []}}, {applications, [ diff --git a/apps/emqx_auto_subscribe/src/emqx_auto_subscribe_schema.erl b/apps/emqx_auto_subscribe/src/emqx_auto_subscribe_schema.erl index a01e17c1f..e6eea2b74 100644 --- a/apps/emqx_auto_subscribe/src/emqx_auto_subscribe_schema.erl +++ b/apps/emqx_auto_subscribe/src/emqx_auto_subscribe_schema.erl @@ -31,14 +31,18 @@ namespace() -> "auto_subscribe". roots() -> - ["auto_subscribe"]. + [{"auto_subscribe", ?HOCON(?R_REF("auto_subscribe"), #{importance => ?IMPORTANCE_HIDDEN})}]. fields("auto_subscribe") -> [ {topics, ?HOCON( ?ARRAY(?R_REF("topic")), - #{desc => ?DESC(auto_subscribe), default => []} + #{ + desc => ?DESC(auto_subscribe), + default => [], + importance => ?IMPORTANCE_HIDDEN + } )} ]; fields("topic") -> @@ -47,26 +51,31 @@ fields("topic") -> ?HOCON(binary(), #{ required => true, example => topic_example(), + importance => ?IMPORTANCE_HIDDEN, desc => ?DESC("topic") })}, {qos, ?HOCON(emqx_schema:qos(), #{ default => 0, + importance => ?IMPORTANCE_HIDDEN, desc => ?DESC("qos") })}, {rh, ?HOCON(range(0, 2), #{ default => 0, + importance => ?IMPORTANCE_HIDDEN, desc => ?DESC("rh") })}, {rap, ?HOCON(range(0, 1), #{ default => 0, + importance => ?IMPORTANCE_HIDDEN, desc => ?DESC("rap") })}, {nl, ?HOCON(range(0, 1), #{ default => 0, + importance => ?IMPORTANCE_HIDDEN, desc => ?DESC(nl) })} ]. From 48600cbc8e502a7e363cf3b08409950cbb6ccc29 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Thu, 13 Apr 2023 09:50:11 +0800 Subject: [PATCH 2/4] chore: add auto_subscribe changelog --- changes/ce/feat-10381.en.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/ce/feat-10381.en.md diff --git a/changes/ce/feat-10381.en.md b/changes/ce/feat-10381.en.md new file mode 100644 index 000000000..355839db9 --- /dev/null +++ b/changes/ce/feat-10381.en.md @@ -0,0 +1 @@ +Hide the auto_subscribe configuration item so that it can be modified later only through the HTTP API. From 17b2a622462418b2068b52086b14a104cbaeb79a Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Thu, 13 Apr 2023 11:02:10 +0800 Subject: [PATCH 3/4] chore: update changes/ce/feat-10381.en.md Co-authored-by: JianBo He --- changes/ce/feat-10381.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes/ce/feat-10381.en.md b/changes/ce/feat-10381.en.md index 355839db9..3ea11188f 100644 --- a/changes/ce/feat-10381.en.md +++ b/changes/ce/feat-10381.en.md @@ -1 +1 @@ -Hide the auto_subscribe configuration item so that it can be modified later only through the HTTP API. +Hide the `auto_subscribe` configuration items so that they can be modified later only through the HTTP API. From 4ba4c6bf6219f419941b18961aebbcffca633946 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Thu, 13 Apr 2023 14:22:13 +0800 Subject: [PATCH 4/4] chore: only hiden root keys --- .../src/emqx_auto_subscribe_schema.erl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/emqx_auto_subscribe/src/emqx_auto_subscribe_schema.erl b/apps/emqx_auto_subscribe/src/emqx_auto_subscribe_schema.erl index e6eea2b74..98f32c8a4 100644 --- a/apps/emqx_auto_subscribe/src/emqx_auto_subscribe_schema.erl +++ b/apps/emqx_auto_subscribe/src/emqx_auto_subscribe_schema.erl @@ -40,8 +40,7 @@ fields("auto_subscribe") -> ?ARRAY(?R_REF("topic")), #{ desc => ?DESC(auto_subscribe), - default => [], - importance => ?IMPORTANCE_HIDDEN + default => [] } )} ]; @@ -51,31 +50,26 @@ fields("topic") -> ?HOCON(binary(), #{ required => true, example => topic_example(), - importance => ?IMPORTANCE_HIDDEN, desc => ?DESC("topic") })}, {qos, ?HOCON(emqx_schema:qos(), #{ default => 0, - importance => ?IMPORTANCE_HIDDEN, desc => ?DESC("qos") })}, {rh, ?HOCON(range(0, 2), #{ default => 0, - importance => ?IMPORTANCE_HIDDEN, desc => ?DESC("rh") })}, {rap, ?HOCON(range(0, 1), #{ default => 0, - importance => ?IMPORTANCE_HIDDEN, desc => ?DESC("rap") })}, {nl, ?HOCON(range(0, 1), #{ default => 0, - importance => ?IMPORTANCE_HIDDEN, desc => ?DESC(nl) })} ].