feat(backend): refactor/fix group management for admins (#838)

* fix(frontend): 🐛 update dialog implementation to simplify state management

* test(backend):  refactor test fixtures + admin group tests

* chore(backend): 🔨 add launcher.json for python debugging (tests)

* fix typing

* feat(backend):  refactor/fix group management for admins

* feat(frontend):  add/fix admin group management

* add LDAP checker

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-11-25 14:17:02 -09:00
committed by GitHub
parent 0db8a58963
commit 791aa8c610
52 changed files with 881 additions and 331 deletions

View File

@@ -16,7 +16,7 @@ pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
ALGORITHM = "HS256"
def create_access_token(data: dict(), expires_delta: timedelta = None) -> str:
def create_access_token(data: dict, expires_delta: timedelta = None) -> str:
settings = get_app_settings()
to_encode = data.copy()
@@ -78,7 +78,7 @@ def user_from_ldap(db: Database, session, username: str, password: str) -> Priva
return user
def authenticate_user(session, email: str, password: str) -> PrivateUser | False:
def authenticate_user(session, email: str, password: str) -> PrivateUser | bool:
settings = get_app_settings()
db = get_database(session)

View File

@@ -99,8 +99,8 @@ class AppSettings(BaseSettings):
self.LDAP_BIND_TEMPLATE,
self.LDAP_ADMIN_FILTER,
}
return "" not in required and None not in required and self.LDAP_AUTH_ENABLED
not_none = None not in required
return self.LDAP_AUTH_ENABLED and not_none
class Config:
arbitrary_types_allowed = True