Passed
Push — master ( e9c9be...dec7df )
by Derek Stephen
03:02
created

ResourceServerController::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 10
ccs 0
cts 10
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Controller;
4
5
use Del\Common\ContainerService;
6
use League\OAuth2\Server\ResourceServer;
7
8
class ResourceServerController extends BaseController
9
{
10
    /**
11
     * @throws \League\OAuth2\Server\Exception\OAuthServerException
12
     */
13
    public function init()
14
    {
15
        $container = ContainerService::getInstance()->getContainer();
16
        $accessTokenRepository = $container['repository.AccessToken'];
17
        $publicKeyPath = 'file://'.APPLICATION_PATH.'/data/keys/public.key';
18
        $server = new ResourceServer(
19
            $accessTokenRepository,
20
            $publicKeyPath
21
        );
22
        $server->validateAuthenticatedRequest($this->getRequest());
23
    }
24
25
}