GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 4d285c...edf968 )
by Damien
03:23
created

AuthnRequest::isValid()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 20
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 8
nc 2
nop 2
dl 0
loc 20
ccs 8
cts 8
cp 1
crap 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: dsmrt
5
 * Date: 1/10/18
6
 * Time: 11:23 AM
7
 */
8
9
namespace flipbox\saml\idp\services\messages;
10
11
use craft\base\Component;
12
use flipbox\saml\core\exceptions\InvalidMessage;
13
use flipbox\saml\core\helpers\MessageHelper;
14
use flipbox\saml\core\records\AbstractProvider;
15
use flipbox\saml\idp\records\ProviderRecord;
16
use flipbox\saml\idp\Saml;
17
use SAML2\AuthnRequest as SamlAuthnRequest;
18
use SAML2\Utils;
19
20
class AuthnRequest extends Component
21
{
22
23 2
    public function isValid(SamlAuthnRequest $authnRequest, AbstractProvider $serviceProvider)
24
    {
25
        //TODO validate Destination
26
27
        // Validate Signature
28 2
        $signingKey = $serviceProvider->signingXMLSecurityKey();
29
30 2
        if ($signingKey && ($sig = Utils::validateElement($authnRequest->toSignedXML()))) {
31 2
            $authnRequest->addValidator(
32
                [
33 2
                    Utils::class,
34
                    'validateSignature',
35
                ],
36 1
                $sig
37
            );
38
39 2
            $authnRequest->validate($signingKey);
40
        }
41
42 2
        return true;
43
    }
44
}
45