feat: improve the LDAP implementation (#615)

* feat(logging): add PV_LOG_LEVEL environment variable to set backend log level

* feat(ldap): Adding a more verbose logging output to debug LDAP issues

* fix(ldap): fixed user logins with special characters within the users dn by switching to ldapts

* feat(ldap): made the member of and email attribute names configurable

* fix(ldap): properly handle email like usernames and fixing #601

* Revert "fix: disable email login if ldap is enabled"

This reverts commit d9cfe697d6.

* feat(ldap): disable the ability for a user to change his email when it's a LDAP user

* feat(ldap): relaxed username pattern by allowing the @ character in usernames
This commit is contained in:
WolverinDEV
2024-09-27 16:02:49 +02:00
committed by GitHub
parent adc4af996d
commit 3310fe53b3
13 changed files with 271 additions and 213 deletions

View File

@@ -1,4 +1,5 @@
import {
Badge,
Button,
Center,
Container,
@@ -142,6 +143,9 @@ const Account = () => {
<Paper withBorder p="xl">
<Title order={5} mb="xs">
<FormattedMessage id="account.card.info.title" />
{user?.isLdap ? (
<Badge style={{ marginLeft: "1em" }}>LDAP</Badge>
) : null}
</Title>
<form
onSubmit={accountForm.onSubmit((values) =>
@@ -162,13 +166,16 @@ const Account = () => {
/>
<TextInput
label={t("account.card.info.email")}
disabled={user?.isLdap}
{...accountForm.getInputProps("email")}
/>
<Group position="right">
<Button type="submit">
<FormattedMessage id="common.button.save" />
</Button>
</Group>
{!user?.isLdap && (
<Group position="right">
<Button type="submit">
<FormattedMessage id="common.button.save" />
</Button>
</Group>
)}
</Stack>
</form>
</Paper>