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

docs(authn): use a string alias for user_id_type

Zaiming (Stone) Shi 3 лет назад
Родитель
Сommit
57c1c418d6

+ 6 - 6
apps/emqx_authn/i18n/emqx_authn_mnesia_i18n.conf

@@ -1,20 +1,20 @@
 emqx_authn_mnesia {
   authentication {
     desc {
-      en: """Configuration of authenticator using built-in database as authentication data source."""
+      en: """Configuration of authenticator using built-in database as data source."""
       zh: """使用内置数据库作为认证数据源的认证器的配置项。"""
     }
   }
 
   user_id_type {
     desc {
-      en: """Specify whether to use ClientID or Username as User ID for authentication."""
-      zh: """指定使用 ClientID 还是 Username 作为 User ID 进行认证。"""
+      en: """Specify whether to use `clientid` or `username` for authentication."""
+      zh: """指定使用客户端ID `clientid` 还是用户名 `username` 进行认证。"""
     }
-    
+
     label: {
-      en: """User ID Type"""
-      zh: """用户 ID 类型"""
+      en: """Authentication ID Type"""
+      zh: """认证 ID 类型"""
     }
   }
 

+ 1 - 1
apps/emqx_authn/src/simple_authn/emqx_authn_mnesia.erl

@@ -115,7 +115,7 @@ desc(?CONF_NS) ->
 desc(_) ->
     undefined.
 
-user_id_type(type) -> user_id_type();
+user_id_type(type) -> typerefl:alias("string", user_id_type());
 user_id_type(desc) -> ?DESC(?FUNCTION_NAME);
 user_id_type(default) -> <<"username">>;
 user_id_type(required) -> true;