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.
Completed
Push — master ( b27ab7...dbf5c5 )
by François
03:09
created

ServerClient::instanceConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 *  Copyright (C) 2016 SURFnet.
4
 *
5
 *  This program is free software: you can redistribute it and/or modify
6
 *  it under the terms of the GNU Affero General Public License as
7
 *  published by the Free Software Foundation, either version 3 of the
8
 *  License, or (at your option) any later version.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU Affero General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU Affero General Public License
16
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
namespace SURFnet\VPN\Common\HttpClient;
19
20
class ServerClient extends BaseClient
21
{
22
    public function __construct(HttpClientInterface $httpClient, $baseUri)
23
    {
24
        parent::__construct($httpClient, $baseUri);
25
    }
26
27
    public function clientConnections()
28
    {
29
        return $this->get('client_connections');
30
    }
31
32
    public function log($dateTime, $ipAddress)
33
    {
34
        return $this->get(
35
            'log',
36
            [
37
                'date_time' => $dateTime,
38
                'ip_address' => $ipAddress,
39
            ]
40
        );
41
    }
42
43
    public function stats()
44
    {
45
        return $this->get('stats');
46
    }
47
48
    public function disabledUsers()
49
    {
50
        return $this->get('disabled_users');
51
    }
52
53
    public function isDisabledUser($userId)
54
    {
55
        return $this->get('is_disabled_user', ['user_id' => $userId]);
56
    }
57
58
    public function enableUser($userId)
59
    {
60
        return $this->post('enable_user', ['user_id' => $userId]);
61
    }
62
63
    public function disableUser($userId)
64
    {
65
        return $this->post('disable_user', ['user_id' => $userId]);
66
    }
67
68
    public function hasOtpSecret($userId)
69
    {
70
        return $this->get('has_otp_secret', ['user_id' => $userId]);
71
    }
72
73
    public function disabledCommonNames()
74
    {
75
        return $this->get('disabled_common_names');
76
    }
77
78
    public function isDisabledCommonName($commonName)
79
    {
80
        return $this->get('is_disabled_common_name', ['common_name' => $commonName]);
81
    }
82
83
    public function disableCommonName($commonName)
84
    {
85
        return $this->post('disable_common_name', ['common_name' => $commonName]);
86
    }
87
88
    public function enableCommonName($commonName)
89
    {
90
        return $this->post('enable_common_name', ['common_name' => $commonName]);
91
    }
92
93
    public function killClient($commonName)
94
    {
95
        return $this->post('kill_client', ['common_name' => $commonName]);
96
    }
97
98
    public function serverPool($poolId)
99
    {
100
        return $this->get('server_pool', ['pool_id' => $poolId]);
101
    }
102
103
    public function instanceConfig()
104
    {
105
        return $this->get('instance_config');
106
    }
107
108
    public function userGroups($userId)
109
    {
110
        return $this->get('user_groups', ['user_id' => $userId]);
111
    }
112
113
    public function hasVootToken($userId)
114
    {
115
        return $this->get('has_voot_token', ['user_id' => $userId]);
116
    }
117
118
    public function setVootToken($userId, $vootToken)
119
    {
120
        return $this->post(
121
            'set_voot_token',
122
            [
123
                'user_id' => $userId,
124
                'voot_token' => $vootToken,
125
            ]
126
        );
127
    }
128
129
    public function deleteOtpSecret($userId)
130
    {
131
        return $this->post('delete_otp_secret', ['user_id' => $userId]);
132
    }
133
134
    public function setOtpSecret($userId, $otpSecret, $otpKey)
135
    {
136
        return $this->post(
137
            'set_otp_secret',
138
            [
139
                'user_id' => $userId,
140
                'otp_secret' => $otpSecret,
141
                'otp_key' => $otpKey,
142
            ]
143
        );
144
    }
145
146
    public function verifyOtpKey($userId, $otpKey)
147
    {
148
        return $this->post(
149
            'verify_otp_key',
150
            [
151
                'user_id' => $userId,
152
                'otp_key' => $otpKey,
153
            ]
154
        );
155
    }
156
}
157