From d185e2e69461615b2a164e289e8e0d2db4e5742b Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Mon, 17 Jul 2023 00:40:29 +0200 Subject: [PATCH] refactor: rename HD_AUTH_LDAPS to HD_AUTH_LDAP_SERVERS This was done as LDAPS us both the plural of LDAP and the common abbreviation for secure LDAP connections. Fixes #4460 Signed-off-by: Philip Molares --- backend/src/config/auth.config.spec.ts | 4 ++-- backend/src/config/auth.config.ts | 8 ++++---- docs/content/config/index.md | 4 ++-- docs/content/dev/auth/ldap.md | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/src/config/auth.config.spec.ts b/backend/src/config/auth.config.spec.ts index 650a5c157..4654dfb38 100644 --- a/backend/src/config/auth.config.spec.ts +++ b/backend/src/config/auth.config.spec.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -169,7 +169,7 @@ describe('authConfig', () => { const tlsCaContent = ['test-cert\n']; const completeLdapConfig = { /* eslint-disable @typescript-eslint/naming-convention */ - HD_AUTH_LDAPS: ldapNames.join(','), + HD_AUTH_LDAP_SERVERS: ldapNames.join(','), HD_AUTH_LDAP_FUTURAMA_PROVIDER_NAME: providerName, HD_AUTH_LDAP_FUTURAMA_URL: url, HD_AUTH_LDAP_FUTURAMA_SEARCH_BASE: searchBase, diff --git a/backend/src/config/auth.config.ts b/backend/src/config/auth.config.ts index 65269c039..6aef3b705 100644 --- a/backend/src/config/auth.config.ts +++ b/backend/src/config/auth.config.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -253,9 +253,9 @@ export default registerAs('authConfig', () => { const gitlabNames = ( toArrayConfig(process.env.HD_AUTH_GITLABS, ',') ?? [] ).map((name) => name.toUpperCase()); - const ldapNames = (toArrayConfig(process.env.HD_AUTH_LDAPS, ',') ?? []).map( - (name) => name.toUpperCase(), - ); + const ldapNames = ( + toArrayConfig(process.env.HD_AUTH_LDAP_SERVERS, ',') ?? [] + ).map((name) => name.toUpperCase()); const samlNames = (toArrayConfig(process.env.HD_AUTH_SAMLS, ',') ?? []).map( (name) => name.toUpperCase(), ); diff --git a/docs/content/config/index.md b/docs/content/config/index.md index b1c700a26..70df3e586 100644 --- a/docs/content/config/index.md +++ b/docs/content/config/index.md @@ -93,7 +93,7 @@ The password score is calculated with [zxcvbn-ts][zxcvbn-ts-score]. ### LDAP HedgeDoc can use one or multiple LDAP servers to authenticate users. To do this, -you first need to tell HedgeDoc the names of servers you want to use (`HD_AUTH_LDAPS`), +you first need to tell HedgeDoc the names of servers you want to use (`HD_AUTH_LDAP_SERVERS`), and then you need to provide the configuration for those LDAP servers depending on how you want to use them. Each of those variables will contain the given name for this LDAP server. @@ -102,7 +102,7 @@ will start with `HD_AUTH_LDAP_MY_LDAP`. | environment variable | default | example | description | | ------------------------------------------ | -------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `HD_AUTH_LDAPS` | - | `MY_LDAP` | A comma-seperated list of names of LDAP servers HedgeDoc should use. | +| `HD_AUTH_LDAP_SERVERS` | - | `MY_LDAP` | A comma-seperated list of names of LDAP servers HedgeDoc should use. | | `HD_AUTH_LDAP_$NAME_PROVIDER_NAME` | `LDAP` | `My LDAP` | The display name for the LDAP server, that is shown in the UI of HegdeDoc. | | `HD_AUTH_LDAP_$NAME_URL` | - | `ldaps://ldap.example.com` | The url with which the LDAP server can be accessed. | | `HD_AUTH_LDAP_$NAME_SEARCH_BASE` | - | `ou=users,dc=LDAP,dc=example,dc=com` | The LDAP search base which contains the user accounts on the LDAP server. | diff --git a/docs/content/dev/auth/ldap.md b/docs/content/dev/auth/ldap.md index 379db3180..e040b620f 100644 --- a/docs/content/dev/auth/ldap.md +++ b/docs/content/dev/auth/ldap.md @@ -12,7 +12,7 @@ docker run --rm -p 10389:10389 -p 10636:10636 rroemhild/test-openldap and add the following to the `.env` file before starting the backend. ```dotenv -HD_AUTH_LDAPS="FUTURAMA" +HD_AUTH_LDAP_SERVERS="FUTURAMA" HD_AUTH_LDAP_FUTURAMA_PROVIDER_NAME="Futurama LDAP" HD_AUTH_LDAP_FUTURAMA_URL="ldap://localhost:10389" HD_AUTH_LDAP_FUTURAMA_SEARCH_BASE="ou=people,dc=planetexpress,dc=com"