Просмотр исходного кода

refactor: set authz config at 'high' importance level

and authorization.sources at 'low' level
prior to this commit, the root was set to 'hidden'
which is not ideal because some may still want to configure
the sources from files
Zaiming (Stone) Shi 2 лет назад
Родитель
Сommit
4d67312bab

+ 4 - 1
apps/emqx_authz/src/emqx_authz_schema.erl

@@ -494,7 +494,10 @@ authz_fields() ->
                     default => [],
                     desc => ?DESC(sources),
                     %% doc_lift is force a root level reference instead of nesting sub-structs
-                    extra => #{doc_lift => true}
+                    extra => #{doc_lift => true},
+                    %% it is recommended to configure authz sources from dashboard
+                    %% hance the importance level for config is low
+                    importance => ?IMPORTANCE_LOW
                 }
             )}
     ].

+ 1 - 1
apps/emqx_conf/src/emqx_conf_schema.erl

@@ -1288,7 +1288,7 @@ emqx_schema_high_prio_roots() ->
                 ?R_REF("authorization"),
                 #{
                     desc => ?DESC(authorization),
-                    importance => ?IMPORTANCE_HIDDEN
+                    importance => ?IMPORTANCE_HIGH
                 }
             )},
     lists:keyreplace("authorization", 1, Roots, Authz).