Merge pull request #27798 from veenarm/feat-add-lldap-config

Add LLDAP Vendor implementation for ldap org ingestion
This commit is contained in:
Fredrik Adelöw
2024-11-26 10:25:15 +01:00
committed by GitHub
3 changed files with 18 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-ldap': minor
---
Add new ldap vendor config 'LLDAP'
@@ -26,6 +26,7 @@ import {
ActiveDirectoryVendor,
DefaultLdapVendor,
GoogleLdapVendor,
LLDAPVendor,
FreeIpaVendor,
LdapVendor,
} from './vendors';
@@ -248,6 +249,8 @@ export class LdapClient {
return AEDirVendor;
} else if (clientHost === 'ldap.google.com') {
return GoogleLdapVendor;
} else if (root && root.raw?.vendorName?.toString() === 'LLDAP') {
return LLDAPVendor;
}
return DefaultLdapVendor;
})
@@ -94,6 +94,16 @@ export const GoogleLdapVendor: LdapVendor = {
},
};
export const LLDAPVendor: LdapVendor = {
dnAttributeName: 'dn',
uuidAttributeName: 'entryuuid',
decodeStringAttribute: (entry, name) => {
return decode(entry, name.toLocaleLowerCase('en-US'), value => {
return value.toString();
});
},
};
// Decode an attribute to a consumer
function decode(
entry: SearchEntry,