linkorb/org-sync

Organization sync library

v1.1.0 2019-08-12 13:56 UTC

This package is auto-updated.

Last update: 2024-10-22 23:51:42 UTC


README

Load an organizational structure (users + groups) from array. Push this data to multiple adapters

"Push" in this case means "Create or Update or Remove". When a User or Group is present in the backend service, but not in the local Organization object, the object should also be removed on the remote service.

List of adapters:

Installation

Install the latest version with:

$ composer require linkorb/org-sync

Usage

LinkORB\OrgSync\SynchronizationMediator\SynchronizationMediator performs basic syncing operations such as:

  • sync organization
  • sync user
  • sync group
  • set password
  • pull organization (planned)
$organization = $this->synchronizationMediator->initialize(
    $targetsArray,
    $organizationArray
);

$this->synchronizationMediator->pushOrganization($organization);

Examples

Organization structure:
Array
(
    [name] => Organization name
    [users] => Array
        (
            [username] => Array
                (
                    [email] => user@email
                    [displayName] => User Name
                    [avatar] => https://example.com/user_avatar.gif
                    [properties] => Array
                        (
                            [key] => value
                        )
                )
        )
    [groups] => Array
        (
            [group name] => Array
                    [parent] => parent group name
                    [displayName] => Group
                    [avatar] => https://example.com/team_avatar.png
                    [members] => Array
                        (
                            [0] => member1
                            [1] => member2
                        )
                    [properties] => Array
                        (
                            [key] => value
                        )
                    [targets] => Array
                        (
                            [0] => target name
                        )
                )
        )
)

Empty members and/or targets section under groups means all members and/or targets for that group.

Targets structure:
Array
(
    [targetName] => Array
        (
            [type] => targetType
            [baseUrl] => http://172.17.0.1:8080/engine-rest/
        )
)

Integrations