From b285814e24686d6512ec9dc99a7c46346c476358 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 3 Oct 2021 00:30:35 +0200 Subject: [PATCH] sources/ldap: fix logic error in Active Directory account disabled status Signed-off-by: Jens Langhammer --- CONTRIBUTING.md | 2 +- Makefile | 6 +----- authentik/sources/ldap/sync/users.py | 2 +- pyproject.toml | 2 +- web/package-lock.json | 4 ++-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b7c42585..e9f4d9ea4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,7 +117,7 @@ This section guides you through submitting a bug report for authentik. Following Whenever authentik encounters an error, it will be logged as an Event with the type `system_exception`. This event type has a button to directly open a pre-filled GitHub issue form. -This form will have the full stack trace of the error that ocurred and shouldn't contain any sensitive data. +This form will have the full stack trace of the error that occurred and shouldn't contain any sensitive data. ### Suggesting Enhancements diff --git a/Makefile b/Makefile index 59b6159eb..373d2bfba 100644 --- a/Makefile +++ b/Makefile @@ -20,11 +20,7 @@ test: lint-fix: isort authentik tests lifecycle black authentik tests lifecycle - codespell -I .github/codespell-words.txt -w authentik - codespell -I .github/codespell-words.txt -w internal - codespell -I .github/codespell-words.txt -w cmd - codespell -I .github/codespell-words.txt -w web/src - codespell -I .github/codespell-words.txt -w website/src + codespell -I .github/codespell-words.txt -S 'web/src/locales/**' -w authentik internal cmd web/src website/src lint: pyright authentik tests lifecycle diff --git a/authentik/sources/ldap/sync/users.py b/authentik/sources/ldap/sync/users.py index 42b6a6f60..6a8aefb27 100644 --- a/authentik/sources/ldap/sync/users.py +++ b/authentik/sources/ldap/sync/users.py @@ -78,6 +78,6 @@ class UserLDAPSynchronizer(BaseLDAPSynchronizer): ak_user.save() if "userAccountControl" in attributes: uac = UserAccountControl(attributes.get("userAccountControl")) - ak_user.is_active = not uac.ACCOUNTDISABLE + ak_user.is_active = UserAccountControl.ACCOUNTDISABLE in uac ak_user.save() return user_count diff --git a/pyproject.toml b/pyproject.toml index 95e1750e1..f4709f32a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ disable = [ "cyclic-import", "protected-access", "raise-missing-from", - # To preverse django's translation function we need to use %-formatting + # To preserve django's translation function we need to use %-formatting "consider-using-f-string", ] diff --git a/web/package-lock.json b/web/package-lock.json index b4d3661a2..008b49638 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -6992,7 +6992,7 @@ "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/view==", "engines": { "node": ">=0.10.0" } @@ -13757,7 +13757,7 @@ "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/view==" }, "require-main-filename": { "version": "2.0.0",