SudoSOS Back-end API / internal/ldap / ADService
Class: ADService ​
Extends ​
Constructors ​
Constructor ​
new ADService(manager?): ADService;Parameters ​
| Parameter | Type |
|---|---|
manager? | EntityManager |
Returns ​
ADService
Inherited from ​
Properties ​
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
manager | protected | EntityManager | WithManager.manager |
Methods ​
createAccountIfNew() ​
createAccountIfNew(ldapUsers): Promise<void>;Creates an account for all new GUIDs
Parameters ​
| Parameter | Type | Description |
|---|---|---|
ldapUsers | LDAPUser[] | - |
Returns ​
Promise<void>
filterUnboundGUID() ​
filterUnboundGUID(ldapResponses): Promise<LDAPResponse[]>;Returns all objects with a GUID that is not in the LDAPAuthenticator table.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
ldapResponses | LDAPResponse[] | Array to filter. |
Returns ​
Promise<LDAPResponse[]>
getLDAPGroupMembers() ​
getLDAPGroupMembers(client, dn): Promise<Pick<SearchResult, "searchReferences"> & object>;Gets all LDAP Users in the DN group
Parameters ​
| Parameter | Type | Description |
|---|---|---|
client | Client | The LDAP Connection |
dn | string | DN Of the group to get members of |
Returns ​
Promise<Pick<SearchResult, "searchReferences"> & object>
getLDAPGroups() ​
getLDAPGroups<T>(client, baseDN): Promise<T[]>;Gets all LDAP Groups in the given baseDN
Type Parameters ​
| Type Parameter |
|---|
T |
Parameters ​
| Parameter | Type | Description |
|---|---|---|
client | Client | The LDAP Connection |
baseDN | string | Base DN to search in |
Returns ​
Promise<T[]>
getLDAPResponseFromGUID() ​
getLDAPResponseFromGUID(client, guid): Promise<LDAPUser>;Retrieves the LDAP entry matching the provided GUID, or undefined if there is none.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
client | Client | - |
guid | Buffer | - |
Returns ​
Promise<LDAPUser>
getUsers() ​
getUsers(ldapUsers, createIfNew?): Promise<User[]>;This function returns all user objects related to the provided ldapUsers If createIfNew is true it will create users for all unbounded ldapUsers.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
ldapUsers | LDAPUser[] | undefined | LDAP user object to get users for. |
createIfNew | boolean | false | Boolean if unknown users should be created. |
Returns ​
Promise<User[]>
toServiceAccount() ​
toServiceAccount(serviceAccount): Promise<User>;Create a new user account for the given service account.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
serviceAccount | LDAPUser | - |
Returns ​
Promise<User>
toSharedUser() ​
toSharedUser(sharedUser): Promise<User>;Creates and binds a Shared (Organ) group to an actual User
Parameters ​
| Parameter | Type | Description |
|---|---|---|
sharedUser | LDAPGroup | The group that needs an account. |
Returns ​
Promise<User>
updateRoleMembership() ​
updateRoleMembership(
client,
ldapRole,
roleManager): Promise<void>;Gives Users the correct role. Note that this creates Users if they do not exists in the LDAPAuth. table.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
client | Client | - |
ldapRole | LDAPGroup | the AD entry linked to this role. |
roleManager | RoleManager | Reference to the application role manager |
Returns ​
Promise<void>
updateSharedAccountMembership() ​
updateSharedAccountMembership(client, sharedAccount): Promise<void>;Handles and updates a shared group Gives authentications to the members of the shared group
Parameters ​
| Parameter | Type | Description |
|---|---|---|
client | Client | The LDAP client |
sharedAccount | LDAPGroup | Account to give access |
Returns ​
Promise<void>