Commit graph

26 commits

Author SHA1 Message Date
Lars Kaiser
9dbd99a305
feat(matrix_member): support force join for local users
Requires synapse as homeserver.
2023-03-30 20:41:50 +02:00
Johanna Dorothea Reichmann
96751ecd1f
fix(tests/unit): do not attempt to call logout in check mode 2023-02-09 09:53:55 +01:00
Johanna Dorothea Reichmann
6230aedc25
fix(matrix_token_login): handle admin flag in check_mode 2023-02-09 09:53:45 +01:00
Johanna Dorothea Reichmann
dd8ef85524
chore(matrix_member): set module to always return changed in check_mode 2023-02-09 09:30:14 +01:00
Johanna Dorothea Reichmann
61d5e59cb8
fix: check-mode in modules behaves properly 2023-01-31 08:54:24 +01:00
Johanna Dorothea Reichmann
bf7f2328e9
fix: allow to call exit/fail from check-mode 2023-01-30 13:04:18 +01:00
Jadyn Emma Jaeger
537e65ef87
fix(modules/matrix): set access_token and device_id properties 2022-08-24 13:43:40 +02:00
Jan Christian Grünhage
141e747429
chore(plugins): format with black and add CI job for checking 2022-08-10 18:34:26 +02:00
Jan Christian Grünhage
71f289c1d0
fix(modules/matrix): fix regression in access token handling
52785ab768 refactored the login logic,
which, switching to nio's token login when being passed a token. The
token being passed is an *access* token though, not a *login* token, so
that fails and thereby breaks any tasks that use access tokens instead
of username/password for authenticating to matrix.

It also accidentally negated the logic on when to invalidate a token
upon logout, so that has been resolved as well.
2022-08-10 18:33:21 +02:00
Jan Christian Grünhage
45b4aa85b4
fix(matrix_token_login): fix regression in required module args
52785ab768 refactored required and
mutually exclusive module parameters and meanwhile dropped some
arguments required for our matrix_token_login module. The change
made sense for most of our modules, but the matrix_token_login as the
only one doesn't need token or password, but definitely needs a key.
2022-08-10 18:32:05 +02:00
Jadyn Emma Jaeger
ee56b991fa
fix(modules/matrix): Handle login / logout corrently 2022-08-01 12:01:57 +02:00
Jadyn Emma Jaeger
52785ab768
feat: Add ansible-test and refactor plugins 2022-07-29 10:50:14 +02:00
Jan Christian Grünhage
063db8954a
fix(matrix_token_login): improve handling of the admin flag
This fixes the data type of the admin flag, which was previously a
string. Now it's a bool. Additionally, if the admin flag is omitted,
it's now also ommitted in the JWT sent to the server, so that existing
admin status isn't revoked by a call which doesn't include it.
2022-05-05 10:57:28 +02:00
Jan Christian Grünhage
c318acccbd feat(matrix_token_login): add module for jwt token based logins 2022-04-11 23:04:45 +02:00
Jadyn Emma Jaeger
14752e23c7
fix(matrix-uia-login): pick correct stage when multiple stages are available.
ref: https://gitlab.com/famedly/company/devops/collections/matrix/-/issues/18
2022-01-20 11:28:42 +01:00
Jadyn Emma Jaeger
7d3f135397
feat(synapse_ratelimit): add initial module
ref https://gitlab.com/famedly/ansible/collections/local/-/issues/71
2021-06-02 13:25:25 +02:00
Jadyn Emma Jaeger
c076c1bba8
fix(AnsibleNioModule): typo - error_json has to be fail_json 2021-04-28 11:22:42 +02:00
Jadyn Emma Jaeger
0a4af363d3
refactor(modules): add matrix_utils.AnsibleNioModule helper class, edit all modules accordingly
Matrix Login can be performed with username/password or token from each module.
`matrix_[uia]_login` and `matrix_logout` is only needed, longer operations are wanted.
modules called with username/password will logout automatically.
The login/logout process is handled by the helper class (except matrix_uia_login).
2021-04-19 10:14:49 +02:00
Jan Christian Grünhage
fc9f0733d4
chore: remove trailing whitespace 2021-01-22 21:07:31 +01:00
transcaffeine
8f7924cb32
feat(modules): add uia-based matrix login module
Test the module with: `PASSWORD=abc echo '{"ANSIBLE_MODULE_ARGS": {"hs_url": "https://test-sp-gen-1.famedly.de","user_id": "admin","password": "$PASSWORD"}}' | python ansible_collections/famedly/matrix/plugins/modules/matrix_uia_login.py`
2020-12-10 12:43:01 +01:00
Jan Christian Grünhage
5af149d0e8 feat(modules): add synapse_register module
This module uses synapse's admin API to register users. It requires the
registration shared secret from synapse's config, and allows creating
admin users too.
2020-10-09 17:35:06 +02:00
Jan Christian Grünhage
31198df454 docs(modules): improve module documentation 2020-10-03 03:02:10 +02:00
Jan Christian Grünhage
e6bd06524d refactor(modules): fix lots of pylint warnings 2020-10-02 20:34:15 +02:00
Johanna Dorothea Reichmann
12f01fc2a7 feat(modules): add matrix_member ansible module
This module can manage matrix membership in a given room by inviting, kicking or
banning a list specified users.

With the exclusive=True flag, it can be used to ensure that a given list of
members is in a room (and no one else). For this module, users invited into a
room count as members, as they have permissions to join the room.

Co-authored-by: Jan Christian Grünhage <jan.christian@gruenhage.xyz>
2020-10-02 19:19:45 +02:00
Jan Christian Grünhage
40510a6d02 fix(synapse): fix location of signing key module 2020-08-02 10:28:28 +02:00
Jan Christian Grünhage
b2b1511e1d chore(git): merge roles/modules into collection 2020-08-01 19:29:25 +02:00