feat(identities): ldap auth, requested changes

This commit is contained in:
Daniel Hougaard
2025-05-08 08:14:29 +04:00
parent 5c91d380b8
commit 0b31d7f860
18 changed files with 44 additions and 35 deletions
@@ -241,6 +241,8 @@ export const identityLdapAuthServiceFactory = ({
return extractIPDetails(accessTokenTrustedIp.ipAddress);
});
if (allowedFields) AllowedFieldsSchema.array().parse(allowedFields);
const identityLdapAuth = await identityLdapAuthDAL.transaction(async (tx) => {
const { encryptor } = await kmsService.createCipherPairWithDataKey({
type: KmsDataKey.Organization,
@@ -264,8 +266,6 @@ export const identityLdapAuthServiceFactory = ({
plainText: Buffer.from(bindDN)
});
if (allowedFields) AllowedFieldsSchema.array().parse(allowedFields);
const isConnected = await testLDAPConfig({
bindDN,
bindPass,
@@ -374,6 +374,8 @@ export const identityLdapAuthServiceFactory = ({
return extractIPDetails(accessTokenTrustedIp.ipAddress);
});
if (allowedFields) AllowedFieldsSchema.array().parse(allowedFields);
const { encryptor } = await kmsService.createCipherPairWithDataKey({
type: KmsDataKey.Organization,
orgId: identityMembershipOrg.orgId
@@ -422,8 +424,6 @@ export const identityLdapAuthServiceFactory = ({
});
}
if (allowedFields) AllowedFieldsSchema.array().parse(allowedFields);
const updatedLdapAuth = await identityLdapAuthDAL.updateById(identityLdapAuth.id, {
url,
searchBase,