silinternational/idp-pw-api-personnel-multiple

Personnel component for IdP PW API for using multiple backends.

1.0.0 2017-11-01 18:04 UTC

This package is auto-updated.

Last update: 2022-08-30 12:25:21 UTC


README

Personnel backend component for IdP PW API for using multiple backends.

Example Usage

use Sil\IdpPw\Common\Personnel\IdBroker;
use Sil\IdpPw\Common\Personnel\Insite;
use Sil\IdpPw\Common\Personnel\Multiple\Multiple;

// ...

$multiple = new Multiple([
    'personnelBackendConfig' => [
        [
            'class'                 => IdBroker::class,
            'baseUrl'               => 'https://broker.url',
            'accessToken'           => 'abc123',
            'assertValidBrokerIp'   => true,
            'validIpRanges'         => ['10.0.20.0/16'],
        ],
        [
            'class' => Insite::class,
            'insitePeopleSearchBaseUrl'     => 'https://search.url',
            'insitePeopleSearchApiKey'      => 'abc123',
            'insitePeopleSearchApiSecret'   => 'abc123',
        ],
    ],
]);

It Matters Which order you define Personnel Backends

When iterating through personnel backends, each subsequent backend will override the PersonnelUser attributes found from previous backends.

If a user is not found in any one of the backends a NotFoundException is thrown.

If a user is found in multiple backends but the employeeId does not match for them an Exception is thrown.