xref: /plugin/pureldap/vendor/freedsx/ldap/src/FreeDSx/Ldap/Server/RequestContext.php (revision 1078ec268114f0851ebf8a4280d0599a5fccb7d5)
1<?php
2/**
3 * This file is part of the FreeDSx LDAP package.
4 *
5 * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11namespace FreeDSx\Ldap\Server;
12
13use FreeDSx\Ldap\Control\ControlBag;
14use FreeDSx\Ldap\Server\Token\TokenInterface;
15
16/**
17 * Represents the context of a server request. This includes any controls associated with the request and the token for
18 * authentication details.
19 *
20 * @author Chad Sikorra <Chad.Sikorra@gmail.com>
21 */
22class RequestContext
23{
24    /**
25     * @var ControlBag
26     */
27    protected $controls;
28
29    /**
30     * @var TokenInterface
31     */
32    protected $token;
33
34    /**
35     * @param ControlBag $controls
36     * @param TokenInterface $token
37     */
38    public function __construct(ControlBag $controls, TokenInterface $token)
39    {
40        $this->controls = $controls;
41        $this->token = $token;
42    }
43
44    /**
45     * @return ControlBag
46     */
47    public function controls()
48    {
49        return $this->controls;
50    }
51
52    /**
53     * @return TokenInterface
54     */
55    public function token()
56    {
57        return $this->token;
58    }
59}
60