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