silinternational/idp-pw-api-personnel-multiple

该软件包已被废弃,不再维护。未建议替代包。

用于使用多个后端的IdP PW API的人员组件。

1.0.0 2017-11-01 18:04 UTC

This package is auto-updated.

Last update: 2022-09-30 12:36:51 UTC


README

用于使用多个后端的IdP PW API的人员后端组件。

示例用法

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',
        ],
    ],
]);

定义人员后端顺序很重要

在遍历人员后端时,每个后续后端将覆盖从先前后端找到的PersonnelUser属性。

如果用户在任何后端中找不到,将抛出NotFoundException。

如果用户在多个后端中找到,但员工ID不匹配,将抛出异常。