Wykres commitów

1000 Commity (7cc746e48328c10e7785c526cecdf25eae28c366)

Autor SHA1 Wiadomość Data
Marius Kriegerowski 8961b8fff5 fix poetry path 2022-01-11 12:55:04 +01:00
Marius Kriegerowski 3467f710b4 install poetry from python-poetry.org 2022-01-11 12:55:04 +01:00
Florian Ludwig 87524cf6bb run CI with python 3.10 2022-01-11 12:55:04 +01:00
Florian Ludwig 9628a1ce3e remove deprecated loop parameter from tests 2022-01-11 12:55:04 +01:00
Florian Ludwig 035cd6267b run black 2022-01-11 12:55:04 +01:00
Jonatan Olofsson 5d3691454d Remove loop parameter 2022-01-11 12:55:04 +01:00
Marius Kriegerowski 855f57bee9 upgrade black 20->21 2021-11-10 20:43:57 +01:00
Marius Kriegerowski 76646d745d upgrade websocket to >= 9 2021-11-10 20:43:57 +01:00
Florian Ludwig 4beb912c2a remove legacy cli test 2021-08-17 17:01:58 +02:00
Florian Ludwig f0cf7be59f rename HBMQTT base exception to AMQTT 2021-08-17 17:01:58 +02:00
Florian Ludwig 4faf762292 update broker script to new module name 2021-08-17 17:01:58 +02:00
Florian Ludwig 992786735e hbmqtt folder does not exist anymore 2021-08-17 17:01:58 +02:00
Florian Ludwig 1cbad5bc3a update docs to reflect new name 2021-08-17 17:01:58 +02:00
Florian Ludwig 86cec6d2a5 remove hbmqtt plugin namespace compatibility 2021-08-17 17:01:58 +02:00
Florian Ludwig b958b6b29c change name in CLI docs 2021-08-17 17:01:58 +02:00
Florian Ludwig 635ab039e7 remove hbmqtt* CLI scripts 2021-08-17 17:01:58 +02:00
Florian Ludwig 8c8c28d47f remove hbmqtt files 2021-08-17 17:01:58 +02:00
Stuart Longland 5315e2d865 broker tests: Fix reference to TimeoutError.
Seems Python 3.8+ moved it, and I took the reference from there.
2021-08-17 16:20:27 +02:00
Stuart Longland 3b793a706b broker tests: Clean up flake8 warnings 2021-08-17 16:20:27 +02:00
Stuart Longland fed6d2c31c plugins.topic_checking tests: Fix issues identified by flake8 2021-08-17 16:20:27 +02:00
Stuart Longland bf5279911b Pass code through `black` formatter 2021-08-17 16:20:27 +02:00
Stuart Longland 29854264e3 broker tests: Change passwords for user[1…3]
As pointed out, it's possible to accidentally mix them up if the
passwords are the same.  Obviously, the passwords used for these tests
should _NOT_ be used in production.
2021-08-17 16:20:27 +02:00
Stuart Longland 744a6868fe plugins.topic_checking: De-indent logging checks
As pointed out, the `logdog` docs do the checks outside of the context
manager scope, so we should do so as well.
2021-08-17 16:20:27 +02:00
Stuart Longland 1f31e1668a broker: Pass through enum values not strings. 2021-08-17 16:20:27 +02:00
Stuart Longland 2e52b22c2c plugins.topic_checking tests: Run code formatting tool. 2021-08-17 16:20:27 +02:00
Stuart Longland 0760bd7613 plugins.topic_checking tests: Replace DummyLogger with `logdog` plug-in. 2021-08-17 16:20:27 +02:00
Stuart Longland 5ad48d9129 test config: Enable `pytest_logdog` plug-in 2021-08-17 16:20:27 +02:00
Stuart Longland fc69d203db poetry/pyproject: Pull in pytest-logdog
This is a `py.test` plug-in that allows us to test logging in test
cases.  Seems like an ideal candidate for a logger fixture.
2021-08-17 16:20:27 +02:00
Stuart Longland 73db6a3536 plugins.topic_checking tests: Fix tests broken by Enum change. 2021-08-17 16:20:27 +02:00
Stuart Longland e80f4f27e0 amqtt.broker: Use Enum for topic checking action 2021-08-17 16:20:27 +02:00
Stuart Longland 100ca6e67a plugins.topic_checking tests: Clean up `assert`/`await` calls 2021-08-17 16:20:27 +02:00
Stuart Longland b33fb05991 plugins.topic_checking tests: Add tests for enabled=False 2021-08-17 16:20:27 +02:00
Stuart Longland db5e886c7e broker tests: Add system test for publish authorisation 2021-08-17 16:20:27 +02:00
Stuart Longland 653b6cd89c plugins.topic_checking tests: Drop copyright header 2021-08-17 16:20:27 +02:00
Stuart Longland 9efd152c1b plugins.topic_checking tests: Fix comment statement 2021-08-17 16:20:27 +02:00
Stuart Longland 0d0108638e plugins.topic_checking: Clean up brackets.
As per review comments.
2021-08-17 16:20:27 +02:00
Stuart Longland 33531c2f23 test cases: Add fixture for ACL-enabled test server
This uses the real plug-ins to test the broker correctly responds to the
return values when publishing and subscribing.

The plug-ins themselves are tested elsewhere.
2021-08-17 16:20:27 +02:00
Stuart Longland f30aa9245d test password file: Add some more users 2021-08-17 16:20:27 +02:00
Stuart Longland 66568122c5 plugin.topic_checking tests: Fix code formatting.
Yes, too lazy to hold down shift when hitting the `'` key.
2021-08-17 16:20:27 +02:00
Stuart Longland 18cf5cdd1e plugins.topic_checking: Add remaining tests. 2021-08-17 16:20:27 +02:00
Stuart Longland 4e16c5de5a plugins.topic_checking: Return False if superclass refuses.
If `BaseTopicPlugin` returns `False`, we should propagate that failed
response in `TopicAccessControlListPlugin`.
2021-08-17 16:20:27 +02:00
Stuart Longland 8daf173a75 plugins.topic_checking: Test topic_ac static method 2021-08-17 16:20:27 +02:00
Stuart Longland 480a944282 plugins.topic_checking tests: Throw test suite at `black`.
Clean up the coding style a bit.
2021-08-17 16:20:27 +02:00
Stuart Longland 0cfce9fd84 plugins.test_topic tests: Add tests for TopicTabooPlugin.
This is more of a "demo" plug-in, but let's test it anyway.
2021-08-17 16:20:27 +02:00
Stuart Longland 75b8c33263 plugins.topic_checking tests: Test BaseTopicPlugin. 2021-08-17 16:20:27 +02:00
Stuart Longland 81646ef024 plugins.topic_checking: Initialise topic_config to None if not present.
If the user forgets to provide a `topic-check` key, we need to
initialise `topic_config` to some value or else `topic_filtering` will
fail with an `AttributeError`.
2021-08-17 16:20:27 +02:00
Stuart Longland ed11f7cb9c plugins.topic_checking: Check the `action` in `topic_acl`.
We maintain backward compatibility with older configurations by assuming
all `PUBLISH` actions are permitted if no ACL is present.  Otherwise, we
follow the same rules as for `SUBSCRIBE`, with the exception that we
read the ACL from the `publish-acl` property instead of `acl`.
2021-08-17 16:20:27 +02:00
Stuart Longland 3e18828f49 broker: Check ACL on publish for permissions 2021-08-17 16:20:27 +02:00
Stuart Longland 90c31901cd broker: Pass action=subscribe when checking topics 2021-08-17 16:20:27 +02:00
Stuart Longland 75257cb69a broker: Pass current action to topic filter.
This will allow a topic filter to act on both subscription requests and
publishing.
2021-08-17 16:20:27 +02:00