vernemq / vernemq_dev Goto Github PK
View Code? Open in Web Editor NEWVerneMQ plugin development dependencies
License: Apache License 2.0
VerneMQ plugin development dependencies
License: Apache License 2.0
I'm trying to implement auth postgres but I can't authorized publishes.
In a desperate attempt I did this:
-- import default hooks and cache logic
require "auth/auth_commons"
-- import shared database query logic
require "auth/postgres_cockroach_commons"
function auth_on_register(reg)
return auth_on_register_common(postgres, reg)
end
function auth_on_pub(pub)
return true
end
pool = "auth_postgres"
config = {
pool_id = pool,
}
postgres.ensure_pool(config)
hooks = {
auth_on_register = auth_on_register,
auth_on_publish = auth_on_pub,
auth_on_subscribe = auth_on_pub,
on_unsubscribe = auth_on_pub,
on_client_gone = auth_on_pub,
on_client_offline = auth_on_pub,
on_session_expired = auth_on_pub,
auth_on_register_m5 = auth_on_pub,
auth_on_publish_m5 = auth_on_pub,
auth_on_subscribe_m5 = auth_on_pub,
}
but still I get
2021-04-14 11:41:59.467 [error] <0.2866.0>@vmq_mqtt_fsm:auth_on_publish:739 can't auth publish [<<"user2">>,{[],<<"b8:27:eb:09:b1:d3">>},1,[<<"devices">>,<<"B184">>,<<"616">>,<<"data">>],<<219,221,204,207,120,1,1,66,20,40,246>>,false] due to not_authorized
what am I missing? auth_on_register
works but the others don't.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.