jpmens / mosquitto-auth-plug

Authentication plugin for Mosquitto with multiple back-ends (MySQL, Redis, CDB, SQLite3)
Other
824 stars 496 forks source link

Fact that a user is superuser is not cached #394

Closed duststorm closed 5 years ago

duststorm commented 5 years ago

If a back-end test for superuser is succesful, the fact that the user is a superuser is not stored. Instead, a cache entry is added for the specific topic, user and acc type combination is stored. This can cause a lot of unneeded back-end calls. Much like static superuser checks, a lot of ACL checking could be skipped if there was a cache for superusers.

duststorm commented 5 years ago

If there is a superuser cache, the superuser check might even be moved directly after an auth check is successful. This would again cause a big reduction in the number of back-end calls, as every ACL check will no longer be preceeded by a superuser check.