xref: /plugin/pureldap/vendor/freedsx/ldap/src/FreeDSx/Ldap/ReferralChaserInterface.php (revision dad993c57a70866aa1db59c43f043769c2eb7ed0)
10b3fd2d3SAndreas Gohr<?php
2*dad993c5SAndreas Gohr
30b3fd2d3SAndreas Gohr/**
40b3fd2d3SAndreas Gohr * This file is part of the FreeDSx LDAP package.
50b3fd2d3SAndreas Gohr *
60b3fd2d3SAndreas Gohr * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
70b3fd2d3SAndreas Gohr *
80b3fd2d3SAndreas Gohr * For the full copyright and license information, please view the LICENSE
90b3fd2d3SAndreas Gohr * file that was distributed with this source code.
100b3fd2d3SAndreas Gohr */
110b3fd2d3SAndreas Gohr
120b3fd2d3SAndreas Gohrnamespace FreeDSx\Ldap;
130b3fd2d3SAndreas Gohr
140b3fd2d3SAndreas Gohruse FreeDSx\Ldap\Exception\SkipReferralException;
150b3fd2d3SAndreas Gohruse FreeDSx\Ldap\Operation\Request\BindRequest;
160b3fd2d3SAndreas Gohruse FreeDSx\Ldap\Protocol\LdapMessageRequest;
170b3fd2d3SAndreas Gohr
180b3fd2d3SAndreas Gohr/**
190b3fd2d3SAndreas Gohr * An interface for referral chasing.
200b3fd2d3SAndreas Gohr *
210b3fd2d3SAndreas Gohr * @author Chad Sikorra <Chad.Sikorra@gmail.com>
220b3fd2d3SAndreas Gohr */
230b3fd2d3SAndreas Gohrinterface ReferralChaserInterface
240b3fd2d3SAndreas Gohr{
250b3fd2d3SAndreas Gohr    /**
260b3fd2d3SAndreas Gohr     * Chase a referral for a request. Return a bind request to be used when chasing the referral. The $bind parameter
270b3fd2d3SAndreas Gohr     * is the bind request the original LDAP client bound with (which may be null). Return null and no bind will be done.
280b3fd2d3SAndreas Gohr     *
290b3fd2d3SAndreas Gohr     * To skip a referral throw the SkipReferralException.
300b3fd2d3SAndreas Gohr     *
310b3fd2d3SAndreas Gohr     * @param LdapMessageRequest $request
320b3fd2d3SAndreas Gohr     * @param LdapUrl $referral
330b3fd2d3SAndreas Gohr     * @param BindRequest|null $bind
340b3fd2d3SAndreas Gohr     * @throws SkipReferralException
350b3fd2d3SAndreas Gohr     * @return BindRequest|null
360b3fd2d3SAndreas Gohr     */
370b3fd2d3SAndreas Gohr    public function chase(LdapMessageRequest $request, LdapUrl $referral, ?BindRequest $bind): ?BindRequest;
380b3fd2d3SAndreas Gohr
390b3fd2d3SAndreas Gohr    /**
400b3fd2d3SAndreas Gohr     * Construct the LdapClient with the options you want, and perform other tasks (such as StartTLS)
410b3fd2d3SAndreas Gohr     *
420b3fd2d3SAndreas Gohr     * @param array $options
430b3fd2d3SAndreas Gohr     * @return LdapClient
440b3fd2d3SAndreas Gohr     */
450b3fd2d3SAndreas Gohr    public function client(array $options): LdapClient;
460b3fd2d3SAndreas Gohr}
47