diff --git a/backend/src/ee/routes/v1/ldap-router.ts b/backend/src/ee/routes/v1/ldap-router.ts index 97527e783..de472ff29 100644 --- a/backend/src/ee/routes/v1/ldap-router.ts +++ b/backend/src/ee/routes/v1/ldap-router.ts @@ -164,15 +164,17 @@ export const registerLdapRouter = async (server: FastifyZodProvider) => { method: "PATCH", onRequest: verifyAuth([AuthMode.JWT]), schema: { - body: z.object({ - organizationId: z.string().trim(), - isActive: z.boolean().optional(), - url: z.string().trim().optional(), - bindDN: z.string().trim().optional(), - bindPass: z.string().trim().optional(), - searchBase: z.string().trim().optional(), - caCert: z.string().trim().optional() - }), + body: z + .object({ + isActive: z.boolean(), + url: z.string().trim(), + bindDN: z.string().trim(), + bindPass: z.string().trim(), + searchBase: z.string().trim(), + caCert: z.string().trim() + }) + .partial() + .merge(z.object({ organizationId: z.string() })), response: { 200: LdapConfigsSchema } diff --git a/backend/src/ee/services/ldap-config/ldap-config-service.ts b/backend/src/ee/services/ldap-config/ldap-config-service.ts index 37e1fb6f8..e9ae0264a 100644 --- a/backend/src/ee/services/ldap-config/ldap-config-service.ts +++ b/backend/src/ee/services/ldap-config/ldap-config-service.ts @@ -180,21 +180,21 @@ export const ldapConfigServiceFactory = ({ keyEncoding: orgBot.symmetricKeyKeyEncoding as SecretKeyEncoding }); - if (bindDN) { + if (bindDN !== undefined) { const { ciphertext: encryptedBindDN, iv: bindDNIV, tag: bindDNTag } = encryptSymmetric(bindDN, key); updateQuery.encryptedBindDN = encryptedBindDN; updateQuery.bindDNIV = bindDNIV; updateQuery.bindDNTag = bindDNTag; } - if (bindPass) { + if (bindPass !== undefined) { const { ciphertext: encryptedBindPass, iv: bindPassIV, tag: bindPassTag } = encryptSymmetric(bindPass, key); updateQuery.encryptedBindPass = encryptedBindPass; updateQuery.bindPassIV = bindPassIV; updateQuery.bindPassTag = bindPassTag; } - if (caCert) { + if (caCert !== undefined) { const { ciphertext: encryptedCACert, iv: caCertIV, tag: caCertTag } = encryptSymmetric(caCert, key); updateQuery.encryptedCACert = encryptedCACert; updateQuery.caCertIV = caCertIV; diff --git a/backend/src/ee/services/saml-config/saml-config-service.ts b/backend/src/ee/services/saml-config/saml-config-service.ts index d944803f8..e9249d4aa 100644 --- a/backend/src/ee/services/saml-config/saml-config-service.ts +++ b/backend/src/ee/services/saml-config/saml-config-service.ts @@ -172,7 +172,7 @@ export const samlConfigServiceFactory = ({ keyEncoding: orgBot.symmetricKeyKeyEncoding as SecretKeyEncoding }); - if (entryPoint) { + if (entryPoint !== undefined) { const { ciphertext: encryptedEntryPoint, iv: entryPointIV, @@ -182,18 +182,19 @@ export const samlConfigServiceFactory = ({ updateQuery.entryPointIV = entryPointIV; updateQuery.entryPointTag = entryPointTag; } - if (issuer) { + if (issuer !== undefined) { const { ciphertext: encryptedIssuer, iv: issuerIV, tag: issuerTag } = encryptSymmetric(issuer, key); updateQuery.encryptedIssuer = encryptedIssuer; updateQuery.issuerIV = issuerIV; updateQuery.issuerTag = issuerTag; } - if (cert) { + if (cert !== undefined) { const { ciphertext: encryptedCert, iv: certIV, tag: certTag } = encryptSymmetric(cert, key); updateQuery.encryptedCert = encryptedCert; updateQuery.certIV = certIV; updateQuery.certTag = certTag; } + const [ssoConfig] = await samlConfigDAL.update({ orgId }, updateQuery); await orgDAL.updateById(orgId, { authEnforced: false, scimEnabled: false }); diff --git a/docs/mint.json b/docs/mint.json index 4cfa3c8d3..74b56f3b0 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -159,14 +159,6 @@ "documentation/platform/ldap/general" ] }, - { - "group": "LDAP", - "pages": [ - "documentation/platform/ldap/overview", - "documentation/platform/ldap/jumpcloud", - "documentation/platform/ldap/general" - ] - }, { "group": "SCIM", "pages": [ diff --git a/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx b/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx index 29e4eaff5..8c9a64222 100644 --- a/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx +++ b/frontend/src/views/Settings/OrgSettingsPage/OrgSettingsPage.tsx @@ -7,7 +7,7 @@ export const OrgSettingsPage = () => { return (
{t("settings.org.title")}