SudoSOS Back-end API / internal/ldap-sync-service / LdapSyncService
Class: LdapSyncService ​
UserSyncService interface.
Specific sync service for users.
Extends ​
Constructors ​
Constructor ​
new LdapSyncService(
roleManager,
adService?,
manager?): LdapSyncService;Parameters ​
| Parameter | Type |
|---|---|
roleManager | RoleManager |
adService? | ADService |
manager? | EntityManager |
Returns ​
LdapSyncService
Overrides ​
Properties ​
| Property | Modifier | Type | Overrides | Inherited from |
|---|---|---|---|---|
manager | protected | EntityManager | - | UserSyncService.manager |
targets | public | UserType[] | UserSyncService.targets | - |
Methods ​
down() ​
down(user, isDryRun?): Promise<void>;Removes the LDAPAuthenticator for the given user.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
user | User | undefined | - |
isDryRun | boolean | false | Whether this is a dry run (no actual changes) |
Returns ​
Promise<void>
Overrides ​
fetch() ​
fetch(): Promise<void>;LDAP fetch retrieves organs, service accounts, and user roles from AD.
Returns ​
Promise<void>
Overrides ​
guard() ​
guard(user): Promise<boolean>;Guard determines whether the entity should be synced using this sync service.
Not passing the guard will result in the user being skipped. A skipped sync does not count as a failure.
Parameters ​
| Parameter | Type |
|---|---|
user | User |
Returns ​
Promise<boolean>
True if the entity should be synced, false otherwise.
Overrides ​
post() ​
post(): Promise<void>;Called after a sync batch is finished.
Returns ​
Promise<void>
Overrides ​
pre() ​
pre(): Promise<void>;Called before a sync batch is started.
Returns ​
Promise<void>
Overrides ​
sync() ​
sync(user, isDryRun?): Promise<boolean>;Sync user based on LDAPAuthenticator. Only organs are actually updated.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
user | User | undefined | - |
isDryRun | boolean | false | Whether this is a dry run (no actual changes) |
Returns ​
Promise<boolean>
Overrides ​
up() ​
up(entity, isDryRun?): Promise<SyncResult>;Up is a wrapper around sync that handles the guard.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
entity | User | undefined | - |
isDryRun | boolean | false | Whether this is a dry run (no actual changes) |
Returns ​
Promise<SyncResult>
The result of the sync.