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.

AuthnRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 25
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 21 3
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 2
                $sig
37
            );
38
39 2
            $authnRequest->validate($signingKey);
40
        }
41
42 2
        return true;
43
    }
44
}
45