Completed
Push — master ( c06d7d...864e1b )
by Charles
02:18
created
api/actions/ActivationAction.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use app\forms\Activation;
6 6
 use yrc\rest\Action as RestAction;
7
-
8 7
 use yii\web\HttpException;
9 8
 use Yii;
10 9
 
Please login to merge, or discard this patch.
api/actions/AuthenticationAction.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use app\forms\Login;
6 6
 use app\models\Token;
7 7
 use yrc\rest\Action as RestAction;
8
-
9 8
 use yii\web\UnauthorizedHttpException;
10 9
 use Yii;
11 10
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
     /**
40 40
      * Deauthenticates a user
41
-     * @return mixed
41
+     * @return boolean
42 42
      */
43 43
     public function delete($params)
44 44
     {
Please login to merge, or discard this patch.
api/actions/OTPAction.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use app\models\User;
6 6
 use yrc\rest\Action as RestAction;
7
-
8 7
 use yii\web\HttpException;
9 8
 use Yii;
10 9
 
Please login to merge, or discard this patch.
api/models/User.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@
 block discarded – undo
224 224
     
225 225
     /**
226 226
      * Provisions TOTP for the account
227
-     * @return boolean|string
227
+     * @return false|string
228 228
      */
229 229
     public function provisionOTP()
230 230
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
         $totp = new TOTP(
248 248
             $this->username,
249 249
             $encodedSecret,
250
-            30,             // 30 second window
251
-            'sha256',       // SHA256 for the hashing algorithm
250
+            30, // 30 second window
251
+            'sha256', // SHA256 for the hashing algorithm
252 252
             6               // 6 digits
253 253
         );
254 254
 
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
         $totp = new TOTP(
303 303
             $this->username,
304 304
             $this->otp_secret,
305
-            30,             // 30 second window
306
-            'sha256',       // SHA256 for the hashing algorithm
305
+            30, // 30 second window
306
+            'sha256', // SHA256 for the hashing algorithm
307 307
             6               // 6 digits
308 308
         );
309 309
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Base32\Base32;
6 6
 use OTPHP\TOTP;
7
-
8 7
 use yii\behaviors\TimestampBehavior;
9 8
 use yii\db\ActiveRecord;
10 9
 use yii\filters\RateLimitInterface;
Please login to merge, or discard this patch.
filters/auth/HMACSignatureAuth.php 4 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -129,9 +129,9 @@
 block discarded – undo
129 129
 
130 130
         // Calculate the signature string
131 131
         $signatureString = hash('sha256', $body) . "\n" .
132
-                           $request->method . "+" . $request->getUrl() . "\n" .
133
-                           $request->getHeaders()->get(self::DATE_HEADER) . "\n" .
134
-                           \base64_encode($salt);
132
+                            $request->method . "+" . $request->getUrl() . "\n" .
133
+                            $request->getHeaders()->get(self::DATE_HEADER) . "\n" .
134
+                            \base64_encode($salt);
135 135
        
136 136
         // Calculate the HMAC
137 137
         $selfHMAC = \base64_encode(\hash_hmac('sha256', $signatureString, $hkdf, true));
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
     private function isHMACSignatureValid($accessToken, $ikm, $salt, $request, $hmac = null)
93 93
     {
94 94
         static $selfHMAC = null;
95
-        static $hkdf   = null;
95
+        static $hkdf = null;
96 96
         
97 97
         // Null check the HMAC string
98 98
         if (empty($hmac) || $hmac === null) {
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,6 +87,7 @@  discard block
 block discarded – undo
87 87
      * @param string $accessToken
88 88
      * @param string $salt
89 89
      * @param \yii\web\request $request
90
+     * @param string $ikm
90 91
      * @return bool
91 92
      */
92 93
     private function isHMACSignatureValid($accessToken, $ikm, $salt, $request, $hmac = null)
@@ -152,7 +153,7 @@  discard block
 block discarded – undo
152 153
     
153 154
     /**
154 155
      * Gets the datetime drift that has occured since the request was sent
155
-     * @param yii\web\Request $request
156
+     * @param \yii\web\Request $request
156 157
      * @return int
157 158
      */
158 159
     private function getTimeDrift($request)
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,10 +3,7 @@
 block discarded – undo
3 3
 namespace yrc\filters\auth;
4 4
 
5 5
 use app\models\Token;
6
-
7
-use yii\helpers\Json;
8 6
 use yii\filters\auth\AuthMethod;
9
-
10 7
 use Yii;
11 8
 
12 9
 /**
Please login to merge, or discard this patch.
api/forms/Login.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace yrc\api\forms;
4 4
 
5 5
 use app\models\Token;
6
-use yii\web\UnauthorizedHttpException;
7 6
 use Yii;
8 7
 
9 8
 /**
Please login to merge, or discard this patch.
api/forms/ChangeEmail.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace yrc\api\forms;
4 4
 
5
-use Base32\Base32;
6 5
 use Yii;
7 6
 
8 7
 /**
Please login to merge, or discard this patch.
api/actions/ResetPasswordAction.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use app\forms\ResetPassword;
6 6
 use yrc\rest\Action as RestAction;
7
-use yrc\api\models\Code;
8
-
9 7
 use yii\web\HttpException;
10 8
 use Yii;
11 9
 
Please login to merge, or discard this patch.
api/forms/Activation.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace yrc\api\forms;
4 4
 
5
-use Base32\Base32;
6 5
 use Yii;
7
-
8 6
 use yrc\api\models\Code;
9 7
 
10 8
 /**
Please login to merge, or discard this patch.