Issues (5)

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/Consent.php (2 issues)

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 TarfinLabs\Iys;
4
5
class Consent
6
{
7
    protected $endpoint;
8
    protected $config;
9
10
    public function __construct()
11
    {
12
        $this->config = config('laravel-iys');
13
        $this->endpoint = "/sps/{$this->config['iys_code']}/brands/{$this->config['brand_code']}/consents";
14
    }
15
16
    /**
17
     * Alıcıdan alınmış izinleri tekil olarak İYS'ye yükler.
18
     *
19
     * Doc: https://dev.iys.org.tr/api-metotlar/izin-yonetimi/tekil-izin-ekleme/
20
     *
21
     * @param array $params
22
     * @return array|mixed
23
     */
24
    public function create(array $params)
25
    {
26
        return app(Client::class)->postJson($this->endpoint, $params);
27
    }
28
29
    /**
30
     * Alıcıdan alınmış izinleri yığın olarak İYS'ye yükler.
31
     *
32
     * Doc: https://dev.iys.org.tr/api-metotlar/izin-yonetimi/asenkron-coklu-izin-ekleme/
33
     *
34
     * @param array $params
35
     * @return array|mixed
36
     */
37
    public function createMany(array $params)
38
    {
39
        return app(Client::class)->postJson($this->endpoint . '/request', $params);
40
    }
41
42
    /**
43
     * Hizmet sağlayıcıların İYS'de kayıtlı olan izinlerini tekil olarak listelemelerini sağlar.
44
     *
45
     * Doc: https://dev.iys.org.tr/api-metotlar/izin-yonetimi/tekil-izin-durumu-sorgulama/
46
     *
47
     * @param array $params
48
     * @return array|mixed
49
     */
50
    public function status(array $params)
51
    {
52
        return app(Client::class)->postJson($this->endpoint . '/status', $params);
53
    }
54
55
    /**
56
     * Asenkron çoklu izin ekleme işlemi sonunda dönen işlem sorgulama bilgisiyle
57
     * izin kayıt isteklerinin sonuçlarını sorgular.
58
     *
59
     * Doc: https://dev.iys.org.tr/api-metotlar/izin-yonetimi/coklu-izin-ekleme-istegi-sorgulama/
60
     *
61
     * @param string $requestId
62
     * @return array|mixed
63
     */
64
    public function statuses(string $requestId)
65
    {
66
        return app(Client::class)->getJson($this->endpoint . '/request/' . $requestId);
67
    }
68
69
    /**
70
     * Tekil iznin mevcut bayi izin erişimlerine, yeni bayilerin izin erişimini ekler.
71
     *
72
     * Doc: https://dev.iys.org.tr/api-metotlar/bayi-izin-yonetimi/bayi-izin-erisimi-ekleme/
73
     *
74
     * @param array $params
75
     * @return array|mixed
76
     */
77
    public function giveAccess(array $params)
78
    {
79
        return app(Client::class)->postJson($this->endpoint . '/retailers/access', $params);
80
    }
81
82
    /**
83
     * Birden fazla bayiye birden fazla izin için erişim verilmesini sağlar.
84
     *
85
     * Doc: https://dev.iys.org.tr/api-metotlar/bayi-izin-yonetimi/bayi-izin-erisimi-verme/
86
     *
87
     * @param array $params
88
     * @return array|mixed
89
     */
90
    public function giveManyAccess(array $params)
91
    {
92
        return app(Client::class)->putJson($this->endpoint . '/retailers/access', $params);
93
    }
94
95
    /**
96
     * Tekil iznin hangi bayilerle ilişkili olduğunu sorgular.
97
     *
98
     * Doc: https://dev.iys.org.tr/api-metotlar/bayi-izin-yonetimi/bayi-erisimi-sorgulama/
99
     *
100
     * @param array $params
101
     * @param int|null $offset
102
     * @param int|null $limit
103
     * @return array|mixed
104
     */
105
    public function accessList(array $params, int $offset = null, int $limit = null)
106
    {
107
        $query = '';
108
109
        if ($offset && $limit) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $offset of type null|integer is loosely compared to true; this is ambiguous if the integer can be zero. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For integer values, zero is a special case, in particular the following results might be unexpected:

0   == false // true
0   == null  // true
123 == false // false
123 == null  // false

// It is often better to use strict comparison
0 === false // false
0 === null  // false
Loading history...
Bug Best Practice introduced by
The expression $limit of type null|integer is loosely compared to true; this is ambiguous if the integer can be zero. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For integer values, zero is a special case, in particular the following results might be unexpected:

0   == false // true
0   == null  // true
123 == false // false
123 == null  // false

// It is often better to use strict comparison
0 === false // false
0 === null  // false
Loading history...
110
            $query = '?' . http_build_query([
111
                    'offset' => $offset,
112
                    'limit' => $limit,
113
                ]);
114
        }
115
116
        return app(Client::class)->postJson($this->endpoint . '/retailers/access/list' . $query, $params);
117
    }
118
119
    /**
120
     * Birden fazla bayinin birden fazla izin için erişimini siler.
121
     *
122
     * Doc: https://dev.iys.org.tr/api-metotlar/bayi-izin-yonetimi/coklu-bayi-erisimi-silme/
123
     *
124
     * @param array $params
125
     * @return array|mixed
126
     */
127
    public function deleteAccess(array $params)
128
    {
129
        return app(Client::class)->postJson($this->endpoint . '/retailer/access/remove', $params);
130
    }
131
132
    /**
133
     * Tüm bayilerin birden fazla izin için erişimini siler.
134
     *
135
     * Doc: https://dev.iys.org.tr/api-metotlar/bayi-izin-yonetimi/tum-bayilerin-izin-erisimlerini-silme/
136
     *
137
     * @param array $params
138
     * @return array|mixed
139
     */
140
    public function deleteAllAccess(array $params)
141
    {
142
        return app(Client::class)->postJson($this->endpoint . '/retailer/access/remove/all', $params);
143
    }
144
}
145