emqx / emqx

The most scalable open-source MQTT broker for IoT, IIoT, and connected vehicles
https://www.emqx.com/
Other
13.53k stars 2.17k forks source link

feat: support bootstrap_file on authentication for build-in-database #13336

Closed zhongwencool closed 1 day ago

zhongwencool commented 3 days ago

Fixes https://emqx.atlassian.net/browse/EMQX-12593

close #8714, #9148 This feature needs to be used before enabling built_in_database authn, so it makes sense to add configuration items to it.

Use the same template for initialization as for importing users:

Import data only on build-in-dabase create.

Support for JSON, CSV files.

authentication = [
  {
    backend = built_in_database
    mechanism = password_based
    password_hash_algorithm {name = sha256, salt_position = suffix}
    user_id_type = username

    # new items
    bootstrap_file = "/opt/init_user.json"
    bootstrap_type = hash | plain
  }
]

Release version: v/e5.7.2

Summary

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

Checklist for CI (.github/workflows) changes