68 lines
2.1 KiB
Plaintext
68 lines
2.1 KiB
Plaintext
authorization {
|
|
sources = [
|
|
# {
|
|
# type: http
|
|
# url: "https://emqx.com"
|
|
# headers: {
|
|
# Accept: "application/json"
|
|
# Content-Type: "application/json"
|
|
# }
|
|
# },
|
|
# {
|
|
# type: mysql
|
|
# server: "127.0.0.1:3306"
|
|
# database: mqtt
|
|
# pool_size: 1
|
|
# username: root
|
|
# password: public
|
|
# auto_reconnect: true
|
|
# ssl: {
|
|
# enable: true
|
|
# cacertfile: "{{ platform_etc_dir }}/certs/cacert.pem"
|
|
# certfile: "{{ platform_etc_dir }}/certs/client-cert.pem"
|
|
# keyfile: "{{ platform_etc_dir }}/certs/client-key.pem"
|
|
# }
|
|
# query: "select ipaddress, username, clientid, action, permission, topic from mqtt_authz where ipaddr = '%a' or username = '%u' or clientid = '%c'"
|
|
# },
|
|
# {
|
|
# type: postgresql
|
|
# server: "127.0.0.1:5432"
|
|
# database: mqtt
|
|
# pool_size: 1
|
|
# username: root
|
|
# password: public
|
|
# auto_reconnect: true
|
|
# ssl: {enable: false}
|
|
# query: "select ipaddress, username, clientid, action, permission, topic from mqtt_authz where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c'"
|
|
# },
|
|
# {
|
|
# type: redis
|
|
# server: "127.0.0.1:6379"
|
|
# database: 0
|
|
# pool_size: 1
|
|
# password: public
|
|
# auto_reconnect: true
|
|
# ssl: {enable: false}
|
|
# cmd: "HGETALL mqtt_authz:%u"
|
|
# },
|
|
# {
|
|
# type: mongodb
|
|
# mongo_type: single
|
|
# server: "127.0.0.1:27017"
|
|
# pool_size: 1
|
|
# database: mqtt
|
|
# ssl: {enable: false}
|
|
# collection: mqtt_authz
|
|
# selector: { "$or": [ { "username": "%u" }, { "clientid": "%c" } ] }
|
|
# },
|
|
{
|
|
type: built-in-database
|
|
}
|
|
{
|
|
type: file
|
|
# file is loaded into cache
|
|
path: "{{ platform_etc_dir }}/acl.conf"
|
|
}
|
|
]
|
|
}
|