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.

Issues (14)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

Ma27ApiKeyAuthenticationExtension.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Ma27\ApiKeyAuthenticationBundle\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\Alias;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
11
/**
12
 * This is the class that loads and manages your bundle configuration.
13
 *
14
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
15
 */
16
class Ma27ApiKeyAuthenticationExtension extends Extension
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21 7
    public function load(array $configs, ContainerBuilder $container)
22
    {
23 7
        $configuration = new Configuration();
24 7
        $config = $this->processConfiguration($configuration, $configs);
25
26 7
        $container->setParameter('ma27_api_key_authentication.key_header', $config['key_header']);
27 7
        $container->setParameter('ma27_api_key_authentication.response_values', $config['response']);
28
29 7
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
30
31 7
        $this->loadCore($container, $loader, $config['user']);
32 7
        $this->loadServices($loader);
33
34 7
        if ($this->isConfigEnabled($container, $config['api_key_purge'])) {
35 2
            $this->loadApiKeyPurger($container, $loader, $config['api_key_purge']);
36
        }
37
38 7
        $services = array_filter($config['services']);
39 7
        if (!empty($services)) {
40 1
            $this->overrideServices($container, $services);
41
        }
42
43 7
        if ($config['user']['metadata_cache']) {
44 2
            $cacheDir = $container->getParameter('kernel.cache_dir');
45
46 2
            $container->getDefinition('ma27_api_key_authentication.class_metadata_factory')
47 2
                ->replaceArgument(3, sprintf('%s/ma27_api_key_authentication/metadata_dump', $cacheDir));
48
        }
49 7
    }
50
51
    /**
52
     * Loads the user and core related stuff of the bundle.
53
     *
54
     * @param ContainerBuilder      $container
55
     * @param Loader\YamlFileLoader $loader
56
     * @param array                 $config
57
     */
58 7
    private function loadCore(ContainerBuilder $container, Loader\YamlFileLoader $loader, $config)
59
    {
60 7
        $isCacheEnabled = $config['metadata_cache'];
61
62 7
        $container->setParameter('ma27_api_key_authentication.model_name', $config['model_name']);
63 7
        $container->setParameter('ma27_api_key_authentication.object_manager', $config['object_manager']);
64 7
        $container->setParameter('ma27_api_key_authentication.property.apiKeyLength', $config['api_key_length']);
65 7
        $container->setParameter('ma27_api_key_authentication.metadata_cache_enabled', $isCacheEnabled);
66
67 7
        if ($isCacheEnabled) {
68 2
            $loader->load('metadata_cache_warmer.yml');
69
        }
70
71 7
        $this->loadPassword($container, $config['password'], $loader);
72 7
    }
73
74
    /**
75
     * Loads the password strategy.
76
     *
77
     * @param ContainerBuilder      $container
78
     * @param string                $passwordConfig
79
     * @param Loader\YamlFileLoader $loader
80
     */
81 7
    private function loadPassword(ContainerBuilder $container, $passwordConfig, Loader\YamlFileLoader $loader)
82
    {
83 7
        $container->setParameter('ma27_api_key_authentication.password_hashing_service', $passwordConfig['strategy']);
84 7
        $container->setParameter('ma27_api_key_authentication.password_hasher.phpass.iteration_length', 8);
85 7
        $container->setParameter('ma27_api_key_authentication.password_hasher.php55.cost', 12);
86
87 7
        $loader->load('hashers.yml');
88 7
    }
89
90
    /**
91
     * Loads all internal services.
92
     *
93
     * @param Loader\YamlFileLoader $loader
94
     */
95 7
    private function loadServices(Loader\YamlFileLoader $loader)
96
    {
97 7
        foreach (array('security_key', 'authentication', 'security', 'annotation') as $file) {
98 7
            $loader->load(sprintf('%s.yml', $file));
99
        }
100 7
    }
101
102
    /**
103
     * Loads the purger job command into the container.
104
     *
105
     * @param ContainerBuilder      $container
106
     * @param Loader\YamlFileLoader $loader
107
     * @param string[]              $purgerConfig
108
     */
109 2
    private function loadApiKeyPurger(ContainerBuilder $container, Loader\YamlFileLoader $loader, array $purgerConfig)
110
    {
111 2
        $container->setParameter('ma27_api_key_authentication.cleanup_command.date_time_rule', $purgerConfig['outdated_rule']);
112 2
        $loader->load('session_cleanup.yml');
113
114 2
        if ($this->isConfigEnabled($container, $purgerConfig['last_action_listener'])) {
0 ignored issues
show
$purgerConfig['last_action_listener'] is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
115 2
            $loader->load('last_action_listener.yml');
116
        }
117 2
    }
118
119
    /**
120
     * Processes the service override configuration into the container.
121
     *
122
     * @param ContainerBuilder $container
123
     * @param array            $services
124
     */
125 1
    private function overrideServices(ContainerBuilder $container, array $services)
126
    {
127
        $serviceConfig = array(
128 1
            'auth_handler' => 'ma27_api_key_authentication.auth_handler',
129
            'key_factory'  => 'ma27_api_key_authentication.key_factory',
130
        );
131
132 1
        foreach ($serviceConfig as $configIndex => $replaceableServiceId) {
133 1
            if (!isset($services[$configIndex]) || null === $serviceId = $services[$configIndex]) {
134 1
                continue;
135
            }
136
137 1
            $container->removeDefinition($replaceableServiceId);
138 1
            $container->setAlias($replaceableServiceId, new Alias($serviceId));
139
        }
140 1
    }
141
}
142