Skip to content

SudoSOS Back-end API / internal/ldap-sync-service / LdapSyncService

Class: LdapSyncService ​

UserSyncService interface.

Specific sync service for users.

Extends ​

Constructors ​

Constructor ​

ts
new LdapSyncService(
   roleManager, 
   adService?, 
   manager?): LdapSyncService;

Parameters ​

ParameterType
roleManagerRoleManager
adService?ADService
manager?EntityManager

Returns ​

LdapSyncService

Overrides ​

UserSyncService.constructor

Properties ​

PropertyModifierTypeOverridesInherited from
managerprotectedEntityManager-UserSyncService.manager
targetspublicUserType[]UserSyncService.targets-

Methods ​

down() ​

ts
down(user, isDryRun?): Promise<void>;

Removes the LDAPAuthenticator for the given user.

Parameters ​

ParameterTypeDefault valueDescription
userUserundefined-
isDryRunbooleanfalseWhether this is a dry run (no actual changes)

Returns ​

Promise<void>

Overrides ​

UserSyncService.down


fetch() ​

ts
fetch(): Promise<void>;

LDAP fetch retrieves organs, service accounts, and user roles from AD.

Returns ​

Promise<void>

Overrides ​

UserSyncService.fetch


guard() ​

ts
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 ​

ParameterType
userUser

Returns ​

Promise<boolean>

True if the entity should be synced, false otherwise.

Overrides ​

UserSyncService.guard


post() ​

ts
post(): Promise<void>;

Called after a sync batch is finished.

Returns ​

Promise<void>

Overrides ​

UserSyncService.post


pre() ​

ts
pre(): Promise<void>;

Called before a sync batch is started.

Returns ​

Promise<void>

Overrides ​

UserSyncService.pre


sync() ​

ts
sync(user, isDryRun?): Promise<boolean>;

Sync user based on LDAPAuthenticator. Only organs are actually updated.

Parameters ​

ParameterTypeDefault valueDescription
userUserundefined-
isDryRunbooleanfalseWhether this is a dry run (no actual changes)

Returns ​

Promise<boolean>

Overrides ​

UserSyncService.sync


up() ​

ts
up(entity, isDryRun?): Promise<SyncResult>;

Up is a wrapper around sync that handles the guard.

Parameters ​

ParameterTypeDefault valueDescription
entityUserundefined-
isDryRunbooleanfalseWhether this is a dry run (no actual changes)

Returns ​

Promise<SyncResult>

The result of the sync.

Inherited from ​

UserSyncService.up