mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: add better error on invalid LDIF
This commit is contained in:
@@ -90,7 +90,13 @@ export const LdapProvider = (): TDynamicProviderFns => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const executeLdif = async (client: ldapjs.Client, ldif_file: string) => {
|
const executeLdif = async (client: ldapjs.Client, ldif_file: string) => {
|
||||||
const parsedEntries: any = ldif.parse(ldif_file).entries as any[];
|
let parsedEntries;
|
||||||
|
try {
|
||||||
|
parsedEntries = ldif.parse(ldif_file).entries as any[];
|
||||||
|
} catch (err) {
|
||||||
|
throw new BadRequestError({ message: "Invalid LDIF, Please check LDIF entries section in the documentation." });
|
||||||
|
}
|
||||||
|
|
||||||
const dnArray: string[] = [];
|
const dnArray: string[] = [];
|
||||||
|
|
||||||
for (const entry of parsedEntries) {
|
for (const entry of parsedEntries) {
|
||||||
|
|||||||
Reference in New Issue
Block a user