Commit graph

232 commits

Author SHA1 Message Date
Roger A. Light
100fd31530 Refactor base_msg structs. 2023-01-16 10:21:12 +00:00
Roger A. Light
4199e7b2d3 Move control functions to common, and use in the broker. 2022-12-31 14:34:26 +00:00
Roger A. Light
611c43e537 Dynsec: Save file at end of command batch, not after each command 2022-12-27 08:16:41 +00:00
Norbert Heusser
ba5f8eb448 Cleanup of include guard defines
Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
2022-12-21 15:35:38 +00:00
Roger A. Light
9e9a4f836c Fix duplicate# 2022-12-19 13:13:10 +00:00
Roger A. Light
c6be853a7e Sync example with plugin interface 2022-12-19 13:10:44 +00:00
Roger A. Light
8cbfb59f66 Add mosquitto_plugin_cleanup() to examples for 2.0 compatibility 2022-12-19 13:08:01 +00:00
Roger A. Light
dae1073360 Add missing Makefile 2022-12-18 16:34:15 +00:00
Roger A. Light
be8cf754fb Move plugin to examples dir, plus some tweaks. 2022-12-16 16:38:46 +00:00
Frank Villaro-Dixon
cbbc4a0ea3 Auth: add authentication via env variable
This commit provides a "cloud-native" way of authenticating clients
by comparing the provided password to the MOSQUITTO_PASSWORD environment
variable.

This allows to quickly and easily adding authentication by simply
providing the password to the environment variable of the docker
container / kubernetes pod.

Signed-off-by: Frank Villaro-Dixon <frank@vi-di.fr>
2022-12-16 16:38:46 +00:00
Norbert Heusser
170cd85cec Add target test-compile to all Makefile to allow tests in plugin folders
Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
2022-12-09 18:03:54 +00:00
Norbert Heusser
e4c252b781 Don't install example plugin client-lifetime-stats
Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
2022-12-09 18:03:47 +00:00
Roger A. Light
54365ec53b Dynsec: Fix improbably out of memory case 2022-11-16 20:09:03 +00:00
Roger A. Light
7ebe148065 Dynsec: Simplify config load 2022-11-16 20:05:44 +00:00
Roger A. Light
a2e5bb5294 Merge branch 'fix-compiler-warnings' of https://github.com/buschulte/mosquitto into buschulte-fix-compiler-warnings 2022-11-03 21:33:40 +00:00
Roger A. Light
0503d5d35c Fix windows build 2022-11-03 16:20:30 +00:00
Kai Buschulte
e6f5633ff6 Fix some compiler warnings
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-11-03 10:55:37 +01:00
Kai Buschulte
9c5a5081df Fix CMake build
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-11-03 09:20:29 +01:00
Roger A. Light
4596cef734 Ban file should be appended. 2022-10-17 10:03:06 +01:00
Roger A. Light
6dc27d8214 Fix Coverity Scan 1499812, 1499810 2022-10-17 07:30:07 +01:00
Roger A. Light
7f0e5cd809 Tidy plugin directory 2022-10-17 07:25:37 +01:00
Roger A. Light
9aeb756dac Fix Coverity Scan 1499842 2022-10-16 23:28:02 +01:00
Roger A. Light
ae14eb34e1 Fix Coverity Scan 1499817 2022-10-16 23:23:43 +01:00
Roger A. Light
403f6443be Sqlite: Provide logs on restore errors 2022-10-16 21:23:15 +01:00
Roger A. Light
9bb389dda1 Avoid compile error.
"a label can only be part of a statement and a declaration is not a
statement"
2022-10-16 08:13:46 +01:00
Roger A. Light
1a5cd9e849 Fix Coverity Scan 1499794. 2022-10-16 07:39:50 +01:00
Roger A. Light
9c2d0ce401 Fix copy paste error.
Coverity Scan 1499794.
2022-10-16 07:29:50 +01:00
Roger A. Light
c5c7dd3f57 Fix payload check 2022-10-15 21:55:49 +01:00
Roger A. Light
65153eba45 Example plugin that bans based on payload 2022-10-15 20:41:51 +01:00
Roger A. Light
a872c0466f Fix leak 2022-10-13 20:41:01 +01:00
Roger A. Light
adf985bff8 Persistence: Store cmsg_id and sub id for client_msgs. 2022-10-11 21:51:43 +01:00
Roger A. Light
cfd4aa1c95 sqlite: Consistent naming 2022-10-11 21:50:03 +01:00
Roger A. Light
2bfb0dc022 sqlite: client_msgs are only ever all cleared 2022-10-11 21:49:33 +01:00
Roger A. Light
bdf8493e81 sqlite: base_msg can never have these properties 2022-10-11 21:48:51 +01:00
Roger A. Light
16feb14a57 Persistence interface updates and sqlite plugin fixes
The MOSQ_EVT_PERSIST_CLIENT_MSG_CLEAR event has been removed, due to
never being called. It is the responsibility of the plugin to remove
client subscriptions and client messages when the client is removed.

Lots of persist test improvements and additions - mostly checking item
counts.
2022-10-09 22:17:47 +01:00
Roger A. Light
d4960d0ead sqlite: Save/restore binary properties. 2022-10-09 22:02:59 +01:00
Roger A. Light
86b314c624 Remove unused defs 2022-09-30 19:26:54 +01:00
Roger A. Light
1d230bd255 dynsec: Fix listClients/getClient crashing if an anon user present
This only affects the unreleased `develop` branch.
2022-08-22 10:50:10 +01:00
Roger A. Light
fd68bf00c7 Merge branch 'master' into develop 2022-08-17 16:18:24 +01:00
Roger A. Light
ba13edc6a4 dynsec: Forbid deleting the anon group. 2022-08-17 12:10:24 +01:00
Roger A. Light
9d9469cbec Merge branch 'fixes' 2022-08-16 13:13:06 +01:00
Roger A. Light
4d1b587e29 dynsec: Forbid deleting the anon group. 2022-08-16 12:55:48 +01:00
Roger A. Light
df317ff71f Dynamic security: Fix the plugin being able to be loaded twice.
Currently only a single plugin can interact with a unique $CONTROL
topic. Using multiple instances of the plugin would produce duplicate
entries in the config file.

Closes #2601.
Closes #2470.
2022-08-16 01:27:55 +01:00
Roger A. Light
436f0b9348 dynsec: Fix modifyClient and modifyGroup commands
They will now not modify the client/group if a new group/client being
added is not valid, or on other failures.

Closes #2598. Thanks to Sebastian Szczepański.
2022-08-16 00:48:02 +01:00
Roger A. Light
b22df5140e Clear errno before check. 2022-08-16 00:23:06 +01:00
Roger A. Light
80c7726d5c Fix confusing error message when dynamic security config file was a directory.
Closes #2520. Thanks to sezanzeb
2022-08-12 08:34:56 +01:00
Roger A. Light
a2f91babdf Fix incorrect format specifier 2022-08-11 14:19:23 +01:00
Kai Buschulte
8b67883548 Remove old compatibility header support
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-08-08 09:25:16 +00:00
Roger A. Light
7794001ce2 Don't free arrays. 2022-08-07 08:24:34 +01:00
Roger A. Light
832e51cb57 dynsec: reduce memory allocations 2022-08-05 13:08:55 +01:00