diff --git a/rel/i18n/emqx_authn_mnesia_schema.hocon b/rel/i18n/emqx_authn_mnesia_schema.hocon index ad4082a13..5ebfeaf38 100644 --- a/rel/i18n/emqx_authn_mnesia_schema.hocon +++ b/rel/i18n/emqx_authn_mnesia_schema.hocon @@ -19,22 +19,24 @@ bootstrap_file.label: """Bootstrap File Path""" bootstrap_type.desc: -"""- **`plain`**: - - Format: `{user_id},{password},{is_superuser}` - - `user_id`: Can be `clientid` or `username`, based on `user_id_type`. - - `password`: User's plaintext password. - - `is_superuser`: Boolean, user's administrative status. +"""Specify which type of content the bootstrap file has. - - **`hash`**: - - Format: `{user_id},{password_hash},{salt},{is_superuser}` - - Definitions similar to `plain` type, with `password_hash` and `salt` added for security. +- **`plain`**: + - Expected data fields: `user_id`, `password`, `is_superuser` + - `user_id`: Can be Client ID or username, depending on built-in database authentication's `user_id_type` config. + - `password`: User's plaintext password. + - `is_superuser`: Boolean, user's administrative status. -All file format support is the same as `authentication/password_based:built_in_database/import_users` API. -Json file plain format example:`[{"user_id": "my_user","password": "s3cr3tp@ssw0rd","is_superuser": true}]`. -CSV file hash format example :`user_id,password_hash,salt,is_superuser\nmy_user,b6c743545a7817ae8c8f624371d5f5f0373234bb0ff36b8ffbf19bce0e06ab75,de1024f462fb83910fd13151bd4bd235,true` +- **`hash`**: + - Expected data fields: `user_id`,`password_hash`,`salt`,`is_superuser` + - Definitions similar to `plain` type, with `password_hash` and `salt` added for security. -Formula for `password_hash`: -If configured as `password_hash_algorithm {name = sha256, salt_position = suffix}`, -the Python code to calculate the `password_hash` is `hashlib.sha256(password + salt).hexdigest()`.""" +The content can be either in CSV, or JSON format. + +Here is a CSV example: `user_id,password_hash,salt,is_superuser\nmy_user,b6c743545a7817ae8c8f624371d5f5f0373234bb0ff36b8ffbf19bce0e06ab75,de1024f462fb83910fd13151bd4bd235,true` + +And JSON content should be decoded into an array of objects, for example: `[{"user_id": "my_user","password": "s3cr3tp@ssw0rd","is_superuser": true}]`. + +The hash string for password_hash depends on how password_hash_algorithm is configured for the built-in database authentication mechanism. For example, if it's configured as `password_hash_algorithm {name = sha256, salt_position = suffix}`, then the salt is appended to the password before hashed. Here is the equivalent Python expression: `hashlib.sha256(password + salt).hexdigest()`.""" }