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

Security Analysis    no request data  

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/SentinelGuard.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 Rojtjo\SentinelGuard;
4
5
use Illuminate\Auth\GuardHelpers;
6
use Illuminate\Contracts\Auth\Authenticatable;
7
use Illuminate\Contracts\Auth\StatefulGuard;
8
9
class SentinelGuard implements StatefulGuard
10
{
11
    use GuardHelpers;
12
13
    /**
14
     * @var Sentinel
15
     */
16
    private $sentinel;
17
18
    /**
19
     * @var bool
20
     */
21
    private $viaRemember = false;
22
23
    /**
24
     * @param GuardableSentinel $sentinel
25
     */
26 60
    public function __construct(GuardableSentinel $sentinel)
27
    {
28 60
        $this->sentinel = $sentinel;
0 ignored issues
show
Documentation Bug introduced by
It seems like $sentinel of type object<Rojtjo\SentinelGuard\GuardableSentinel> is incompatible with the declared type object<Rojtjo\SentinelGuard\Sentinel> of property $sentinel.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
29 60
    }
30
31
    /**
32
     * Determine if the current user is authenticated.
33
     *
34
     * @return bool
35
     */
36 3
    public function check()
37
    {
38 3
        if ($this->sentinel->getUser() !== null) {
39
            return true;
40
        }
41
42 3
        $persistences = $this->sentinel->getPersistenceRepository();
43 3
        if (! $code = $persistences->check()) {
44
            return false;
45
        }
46
47 3
        if (! $user = $persistences->findUserByPersistenceCode($code)) {
48
            return false;
49
        }
50
51 3
        $this->viaRemember = true;
52
53 3
        if (! $this->sentinel->doCycleCheckpoints('check', $user)) {
54
            return false;
55
        }
56
57 3
        $this->user = $user;
58
59 3
        return true;
60
    }
61
62
    /**
63
     * Determine if the current user is a guest.
64
     *
65
     * @return bool
66
     */
67 3
    public function guest()
68
    {
69 3
        return $this->sentinel->guest();
70
    }
71
72
    /**
73
     * Get the currently authenticated user.
74
     *
75
     * @return \Illuminate\Contracts\Auth\Authenticatable|null
76
     */
77 9
    public function user()
78
    {
79 9
        return $this->sentinel->getUser();
80
    }
81
82
    /**
83
     * Get the ID for the currently authenticated user.
84
     *
85
     * @return int|null
86
     */
87 6
    public function id()
88
    {
89 6
        $user = $this->user();
90
91 6
        return $user ? $user->getAuthIdentifier() : null;
92
    }
93
94
    /**
95
     * Validate a user's credentials.
96
     *
97
     * @param  array $credentials
98
     * @return bool
99
     */
100 6
    public function validate(array $credentials = [])
101
    {
102 6
        $users = $this->sentinel->getUserRepository();
103 6
        $user = $users->findByCredentials($credentials);
104
105 2
        return $user
106 5
            ? $users->validateCredentials($user, $credentials)
107 6
            : false;
108
    }
109
110
    /**
111
     * Set the current user.
112
     *
113
     * @param  \Illuminate\Contracts\Auth\Authenticatable $user
114
     * @return void
115
     */
116 3
    public function setUser(Authenticatable $user)
117
    {
118 3
        $this->sentinel->setUser($user);
119 3
    }
120
121
    /**
122
     * Attempt to authenticate a user using the given credentials.
123
     *
124
     * @param  array $credentials
125
     * @param  bool $remember
126
     * @return bool
127
     */
128 6
    public function attempt(array $credentials = [], $remember = false)
129
    {
130 6
        return (bool)$this->sentinel->authenticate($credentials, $remember);
131
    }
132
133
    /**
134
     * Log a user into the application without sessions or cookies.
135
     *
136
     * @param  array $credentials
137
     * @return bool
138
     */
139 3
    public function once(array $credentials = [])
140
    {
141 3
        return $this->sentinel->stateless($credentials);
142
    }
143
144
    /**
145
     * Log a user into the application.
146
     *
147
     * @param  \Illuminate\Contracts\Auth\Authenticatable $user
148
     * @param  bool $remember
149
     * @return void
150
     */
151 12
    public function login(Authenticatable $user, $remember = false)
152
    {
153 12
        $this->sentinel->login($user, $remember);
154 12
    }
155
156
    /**
157
     * Log the given user ID into the application.
158
     *
159
     * @param  mixed $id
160
     * @param  bool $remember
161
     * @return \Illuminate\Contracts\Auth\Authenticatable
162
     */
163 9
    public function loginUsingId($id, $remember = false)
164
    {
165 9
        $user = $this->sentinel->getUserRepository()->findById($id);
166 9
        if (! $user) {
167 3
            return false;
168
        }
169
170 6
        $this->login($user, $remember);
171
172 6
        return $user;
173
    }
174
175
    /**
176
     * Log the given user ID into the application without sessions or cookies.
177
     *
178
     * @param  mixed $id
179
     * @return bool
180
     */
181 6
    public function onceUsingId($id)
182
    {
183 6
        $user = $this->sentinel->getUserRepository()->findById($id);
184
185 2
        return $user
186 5
            ? (bool)$this->sentinel->stateless($user)
187 6
            : false;
188
    }
189
190
    /**
191
     * Determine if the user was authenticated via "remember me" cookie.
192
     *
193
     * @return bool
194
     */
195 6
    public function viaRemember()
196
    {
197 6
        return $this->viaRemember;
198
    }
199
200
    /**
201
     * Log the user out of the application.
202
     *
203
     * @return void
204
     */
205 3
    public function logout()
206
    {
207 3
        $this->sentinel->logout();
208 3
    }
209
}
210