From bddb11d1b4373691792554ccbbb8a099a9a59407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Tue, 16 Jan 2024 19:49:56 +0100 Subject: [PATCH] update version to 2.0.0 --- .../migrations/98f2733bbe45_balance_initial.py | 1 + .../9d5bf89eb130_init_old_pricelist.py | 1 + .../migrations/e70508bd8cb4_init_events.py | 1 + flaschengeist/plugins/auth_ldap/cli.py | 18 +++++++++++++++--- setup.cfg | 5 +++-- 5 files changed, 21 insertions(+), 5 deletions(-) create mode 120000 flaschengeist/alembic/migrations/98f2733bbe45_balance_initial.py create mode 120000 flaschengeist/alembic/migrations/9d5bf89eb130_init_old_pricelist.py create mode 120000 flaschengeist/alembic/migrations/e70508bd8cb4_init_events.py diff --git a/flaschengeist/alembic/migrations/98f2733bbe45_balance_initial.py b/flaschengeist/alembic/migrations/98f2733bbe45_balance_initial.py new file mode 120000 index 0000000..5b2a4df --- /dev/null +++ b/flaschengeist/alembic/migrations/98f2733bbe45_balance_initial.py @@ -0,0 +1 @@ +/home/crimsen/git/flaschengeist/flaschengeist/flaschengeist/plugins/balance/migrations/98f2733bbe45_balance_initial.py \ No newline at end of file diff --git a/flaschengeist/alembic/migrations/9d5bf89eb130_init_old_pricelist.py b/flaschengeist/alembic/migrations/9d5bf89eb130_init_old_pricelist.py new file mode 120000 index 0000000..713ecd1 --- /dev/null +++ b/flaschengeist/alembic/migrations/9d5bf89eb130_init_old_pricelist.py @@ -0,0 +1 @@ +/home/crimsen/git/flaschengeist/flaschengeist-pricelist-old/backend/flaschengeist_pricelist_old/migrations/9d5bf89eb130_init_old_pricelist.py \ No newline at end of file diff --git a/flaschengeist/alembic/migrations/e70508bd8cb4_init_events.py b/flaschengeist/alembic/migrations/e70508bd8cb4_init_events.py new file mode 120000 index 0000000..7bbfcb3 --- /dev/null +++ b/flaschengeist/alembic/migrations/e70508bd8cb4_init_events.py @@ -0,0 +1 @@ +/home/crimsen/git/flaschengeist/flaschengeist-schedule/backend/flaschengeist_events/migrations/e70508bd8cb4_init_events.py \ No newline at end of file diff --git a/flaschengeist/plugins/auth_ldap/cli.py b/flaschengeist/plugins/auth_ldap/cli.py index e3d772f..e2c82aa 100644 --- a/flaschengeist/plugins/auth_ldap/cli.py +++ b/flaschengeist/plugins/auth_ldap/cli.py @@ -6,13 +6,15 @@ from werkzeug.exceptions import NotFound @click.command(no_args_is_help=True) @click.option("--sync", is_flag=True, default=False, help="Synchronize users from LDAP -> database") +@click.option("--sync-ldap", is_flag=True, default=False, help="Synchronize users from database -> LDAP") @with_appcontext @click.pass_context -def ldap(ctx, sync): +def ldap(ctx, sync, sync_ldap): """Tools for the LDAP authentification""" + from flaschengeist.controller import userController + from flaschengeist.plugins.auth_ldap import AuthLDAP if sync: - from flaschengeist.controller import userController - from flaschengeist.plugins.auth_ldap import AuthLDAP + click.echo("Synchronizing users from LDAP -> database") from ldap3 import SUBTREE from flaschengeist.models import User from flaschengeist.database import db @@ -33,3 +35,13 @@ def ldap(ctx, sync): user = User(userid=uid) db.session.add(user) userController.update_user(user, auth_ldap) + if sync_ldap: + click.echo("Synchronizing users from database -> LDAP") + + auth_ldap: AuthLDAP = current_app.config.get("FG_PLUGINS").get("auth_ldap") + if auth_ldap is None or not isinstance(auth_ldap, AuthLDAP): + ctx.fail("auth_ldap plugin not found or not enabled!") + users = userController.get_users() + for user in users: + userController.update_user(user, auth_ldap) + diff --git a/setup.cfg b/setup.cfg index fe404cd..9800361 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] license = MIT -version = 2.0.0.dev1 +version = 2.0.0 name = flaschengeist author = Tim Gröger author_email = flaschengeist@wu5.de @@ -22,7 +22,8 @@ include_package_data = True python_requires = >=3.10 packages = find: install_requires = - Flask>=2.2.2, <2.3 + #Flask>=2.2.2, <2.3 + Flask>=2.2.2 Pillow>=9.2 flask_cors flask_migrate>=3.1.0