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 (152)

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.

src/OpenStack.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 declare(strict_types=1);
2
3
namespace OpenStack;
4
5
use GuzzleHttp\Client;
6
use GuzzleHttp\HandlerStack;
7
use GuzzleHttp\Middleware as GuzzleMiddleware;
8
use OpenStack\Common\Service\Builder;
9
use OpenStack\Common\Transport\Utils;
10
use OpenStack\Identity\v3\Service;
11
12
/**
13
 * This class is the primary entry point for working with the SDK. It allows for the easy creation
14
 * of OpenStack services.
15
 *
16
 * @package OpenStack
17
 */
18
class OpenStack
19
{
20
    /** @var Builder */
21
    private $builder;
22
23
    /**
24
     * @param array    $options User-defined options
25
     *
26
     * $options['username']         = (string)            Your OpenStack username        [REQUIRED]
27
     *         ['password']         = (string)            Your OpenStack password        [REQUIRED]
28 7
     *         ['tenantId']         = (string)            Your tenant ID                 [REQUIRED if tenantName omitted]
29
     *         ['tenantName']       = (string)            Your tenant name               [REQUIRED if tenantId omitted]
30 7
     *         ['authUrl']          = (string)            The Keystone URL               [REQUIRED]
31 7
     *         ['debugLog']         = (bool)              Whether to enable HTTP logging [OPTIONAL]
32
     *         ['logger']           = (LoggerInterface)   Must set if debugLog is true   [OPTIONAL]
33
     *         ['messageFormatter'] = (MessageFormatter)  Must set if debugLog is true   [OPTIONAL]
34
     *         ['requestOptions']   = (array)             Guzzle Http request options    [OPTIONAL]
35
     *         ['cachedToken']      = (array)             Cached token credential        [OPTIONAL]
36
     *
37
     * @param Builder $builder
38
     */
39
    public function __construct(array $options = [], Builder $builder = null)
40 1
    {
41
        if (!isset($options['identityService'])) {
42 1
            $options['identityService'] = $this->getDefaultIdentityService($options);
43 1
        }
44
45
        $this->builder = $builder ?: new Builder($options, 'OpenStack');
46
    }
47
48
    /**
49
     * @param array $options
50
     *
51
     * @return Service
52
     */
53 1
    private function getDefaultIdentityService(array $options): Service
54
    {
55 1
        if (!isset($options['authUrl'])) {
56 1
            throw new \InvalidArgumentException("'authUrl' is a required option");
57
        }
58
59
        $stack = HandlerStack::create();
60
61 View Code Duplication
        if (!empty($options['debugLog'])
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
62
            && !empty($options['logger'])
63
            && !empty($options['messageFormatter'])
64
        ) {
65
            $stack->push(GuzzleMiddleware::log($options['logger'], $options['messageFormatter']));
66 1
        }
67
68 1
        $clientOptions = [
69 1
            'base_uri' => Utils::normalizeUrl($options['authUrl']),
70
            'handler'  => $stack,
71
        ];
72
73
        if (isset($options['requestOptions'])) {
74
            $clientOptions = array_merge($options['requestOptions'], $clientOptions);
75
        }
76
77
        return Service::factory(new Client($clientOptions));
78
    }
79 1
80
    /**
81 1
     * Creates a new Compute v2 service.
82 1
     *
83
     * @param array $options Options that will be used in configuring the service.
84
     *
85
     * @return \OpenStack\Compute\v2\Service
86
     */
87
    public function computeV2(array $options = []): \OpenStack\Compute\v2\Service
88
    {
89
        $defaults = ['catalogName' => 'nova', 'catalogType' => 'compute'];
90
        return $this->builder->createService('Compute\\v2', array_merge($defaults, $options));
91
    }
92 1
93
    /**
94 1
     * Creates a new Networking v2 service.
95 1
     *
96
     * @param array $options Options that will be used in configuring the service.
97
     *
98
     * @return \OpenStack\Networking\v2\Service
99
     */
100
    public function networkingV2(array $options = []): \OpenStack\Networking\v2\Service
101
    {
102
        $defaults = ['catalogName' => 'neutron', 'catalogType' => 'network'];
103
        return $this->builder->createService('Networking\\v2', array_merge($defaults, $options));
104
    }
105 1
106
    /**
107 1
     * Creates a new Networking v2 Layer 3 service.
108 1
     *
109
     * @param array $options Options that will be used in configuring the service.
110
     *
111
     * @return \OpenStack\Networking\v2\Extensions\Layer3\Service
112
     */
113
    public function networkingV2ExtLayer3(array $options = []): \OpenStack\Networking\v2\Extensions\Layer3\Service
114
    {
115
        $defaults = ['catalogName' => 'neutron', 'catalogType' => 'network'];
116
        return $this->builder->createService('Networking\\v2\\Extensions\\Layer3', array_merge($defaults, $options));
117
    }
118 1
119
    /**
120 1
     * Creates a new Networking v2 Layer 3 service.
121 1
     *
122
     * @param array $options Options that will be used in configuring the service.
123
     *
124
     * @return \OpenStack\Networking\v2\Extensions\SecurityGroups\Service
125
     */
126
    public function networkingV2ExtSecGroups(array $options = []): \OpenStack\Networking\v2\Extensions\SecurityGroups\Service
127
    {
128
        $defaults = ['catalogName' => 'neutron', 'catalogType' => 'network'];
129
        return $this->builder->createService('Networking\\v2\\Extensions\\SecurityGroups', array_merge($defaults, $options));
130
    }
131
132
    /**
133
     * Creates a new Identity v2 service.
134
     *
135
     * @param array $options Options that will be used in configuring the service.
136
     *
137
     * @return \OpenStack\Identity\v2\Service
138
     */
139
    public function identityV2(array $options = []): \OpenStack\Identity\v2\Service
140
    {
141
        $defaults = ['catalogName' => 'keystone', 'catalogType' => 'identity'];
142
        return $this->builder->createService('Identity\\v2', array_merge($defaults, $options));
143
    }
144
145
    /**
146
     * Creates a new Identity v3 service.
147
     *
148
     * @param array $options Options that will be used in configuring the service.
149
     *
150
     * @return \OpenStack\Identity\v3\Service
151
     */
152
    public function identityV3(array $options = []): \OpenStack\Identity\v3\Service
153
    {
154
        $defaults = ['catalogName' => 'keystone', 'catalogType' => 'identity'];
155
        return $this->builder->createService('Identity\\v3', array_merge($defaults, $options));
156
    }
157
158
    /**
159
     * Creates a new Object Store v1 service.
160
     *
161
     * @param array $options Options that will be used in configuring the service.
162
     *
163
     * @return \OpenStack\ObjectStore\v1\Service
164
     */
165
    public function objectStoreV1(array $options = []): \OpenStack\ObjectStore\v1\Service
166
    {
167
        $defaults = ['catalogName' => 'swift', 'catalogType' => 'object-store'];
168
        return $this->builder->createService('ObjectStore\\v1', array_merge($defaults, $options));
169
    }
170
171
    /**
172
     * Creates a new Block Storage v2 service.
173
     *
174
     * @param array $options Options that will be used in configuring the service.
175
     *
176
     * @return \OpenStack\BlockStorage\v2\Service
177
     */
178
    public function blockStorageV2(array $options = []): \OpenStack\BlockStorage\v2\Service
179
    {
180
        $defaults = ['catalogName' => 'cinderv2', 'catalogType' => 'volumev2'];
181
        return $this->builder->createService('BlockStorage\\v2', array_merge($defaults, $options));
182
    }
183
184
    /**
185
     * Creates a new Images v2 service.
186
     *
187
     * @param array $options Options that will be used in configuring the service.
188
     *
189
     * @return \OpenStack\Images\v2\Service
190
     */
191
    public function imagesV2(array $options = []): \OpenStack\Images\v2\Service
192
    {
193
        $defaults = ['catalogName' => 'glance', 'catalogType' => 'image'];
194
        return $this->builder->createService('Images\\v2', array_merge($defaults, $options));
195
    }
196
197
    /**
198
     * Creates a new Gnocchi Metric service v1
199
     *
200
     * @param array $options
201
     *
202
     * @return \OpenStack\Metric\v1\Gnocchi\Service
203
     */
204
    public function metricGnocchiV1(array $options = []): \OpenStack\Metric\v1\Gnocchi\Service
205
    {
206
        $defaults = ['catalogName' => 'gnocchi', 'catalogType' => 'metric'];
207
208
        return $this->builder->createService('Metric\\v1\\Gnocchi', array_merge($defaults, $options));
209
    }
210
}
211