Comments (6)
Nice idea, but hard to do because it would mean a table scan over the database to find all possible combinations. In short: no. ;-)
Unless, that is, you have some clever way of doing this.
from mosquitto-auth-plug.
I do not mean that %u and %c is used in the SQL query that retrieve topics, but they could be interpreted once retrieved by the query. For example, in the dafult query
SELECT topic FROM acls WHERE (username = '%s') AND (rw >= %d)
returned topics could be:
/foo
/foo/%u/#
/foo/%c/+
then, if the user 'joe' is trying to subscribe /foo/joe/score, it will be feasible due to /foo/%u/#
Allowing the use of %c and %u in the query itself, of course, will be hard to do.
from mosquitto-auth-plug.
You can solve using something like:
auth_opt_aclquery SET @username = '%s'; SET @rw = %d; SELECT CONCAT(topic,'/',@username,'/+') FROM acls WHERE (username = @username) AND (rw >= @rw)
from mosquitto-auth-plug.
That is very clever. ;-)
I will, nevertheless, revisit this in the coming weeks; maybe we can do
something along the lines of what OP requested.
from mosquitto-auth-plug.
Hi JPMens, gallog,
a clever solution, indeed. However it is not completely suitable for me. Maybe the substitution of %s instead of %u is valid for me. But what I need is that mosquitto-auth-plug supports the same substitution patterns that Mosquitto uses.
http://mosquitto.org/man/mosquitto-conf-5.html (the acl_file file option)
So, I need %c (for client ID substitution) and %u (for username substitution). As %s in mosquitto-auth-plug is the same than %u in mosquitto, your solution could be interesting. But what about %c? %d (in mosquitto-auth-plug) is not the same that %c (in mosquitto).
Well.... unless %c and %u are present in the context of mosquitto-auth-plug. If they are present (I did not try it) then I could use them in the way you have suggested. However, I thing this should be a temporary solution and mosquitto-auth-plug should maintaint the same ACL features that Mosquitto (I know... this is opensource so I could do it myself; do not flame me :-)). So, ACL management will be done only using our management UI, that configures them directly to the database. Using your suggestion requires the modification of mosquitto.conf in all the mosquitto bridges and restarting the mosquitto itself. :-(
Thanks both for your replies. Regards.
from mosquitto-auth-plug.
Great!! Many, many thanks... very useful. I'll try it in a few hours.
Regards.
from mosquitto-auth-plug.
Related Issues (20)
- ACL issue with JWT backend HOT 2
- Inconsistencies between HTTP and JWT code & configuration HOT 3
- Merge be-http and be-jwt into one
- conf->hostname might be uninitialized in be_jwt_init() HOT 2
- ACL issue with %d placeholder - MySQL backend HOT 4
- Compilation Error HOT 1
- Compilation Error config.h: No such file or directory HOT 19
- problem with sizeof HOT 1
- Compile error with Mosquitto 1.5.5 and latest Auth-plug version HOT 2
- Websocket error: connection was lost (verbose output) HOT 4
- given the current vesion of Auth-plug, what version of mosquitto and libwebsockets should I install? HOT 1
- Fact that a user is superuser is not cached HOT 1
- mysql problem acl SUB/PUB HOT 1
- Cannot Load Auth plug-Error HOT 8
- mosquitto_client_id: symbol not found HOT 5
- Failed to create file named auth-plug.so
- Segmentation fault with BE_PSK and postgres backend HOT 1
- HTTP backend doesn't connect, instead rejects subscriptions HOT 1
- HTTP backend not calling api HOT 1
- Issue subscribing with wildcard in MongoDB and maybe MySQL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mosquitto-auth-plug.