@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace yrc\forms; |
4 | 4 | |
5 | -use Base32\Base32; |
|
6 | 5 | use Yii; |
7 | 6 | |
8 | 7 | /** |
@@ -94,6 +94,8 @@ |
||
94 | 94 | /** |
95 | 95 | * Validates the users OTP code, if they provided |
96 | 96 | * @inheritdoc |
97 | + * @param string $attributes |
|
98 | + * @param string $params |
|
97 | 99 | */ |
98 | 100 | public function validateOTP($attributes, $params) |
99 | 101 | { |
@@ -4,7 +4,6 @@ |
||
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; |
@@ -273,8 +273,8 @@ discard block |
||
273 | 273 | $encodedSecret = Base32::encode($secret); |
274 | 274 | $totp = TOTP::create( |
275 | 275 | $encodedSecret, |
276 | - 30, // 30 second window |
|
277 | - 'sha256', // SHA256 for the hashing algorithm |
|
276 | + 30, // 30 second window |
|
277 | + 'sha256', // SHA256 for the hashing algorithm |
|
278 | 278 | 6 // 6 digits |
279 | 279 | ); |
280 | 280 | $totp->setLabel($this->username); |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | { |
329 | 329 | $totp = TOTP::create( |
330 | 330 | $this->otp_secret, |
331 | - 30, // 30 second window |
|
332 | - 'sha256', // SHA256 for the hashing algorithm |
|
331 | + 30, // 30 second window |
|
332 | + 'sha256', // SHA256 for the hashing algorithm |
|
333 | 333 | 6 // 6 digits |
334 | 334 | ); |
335 | 335 |
@@ -72,7 +72,7 @@ |
||
72 | 72 | $token->user_id = $userId; |
73 | 73 | $token->access_token = \str_replace('=', '', Base32::encode(\random_bytes(32))); |
74 | 74 | $token->refresh_token = \str_replace('=', '', Base32::encode(\random_bytes(32))); |
75 | - $token->ikm = \base64_encode(\random_bytes(32)); |
|
75 | + $token->ikm = \base64_encode(\random_bytes(32)); |
|
76 | 76 | $token->secret_sign_kp = \base64_encode(sodium_crypto_sign_secretkey($signKp)); |
77 | 77 | $token->expires_at = \strtotime(static::TOKEN_EXPIRATION_TIME); |
78 | 78 |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace yrc\models\redis; |
4 | 4 | |
5 | 5 | use Base32\Base32; |
6 | -use yrc\models\TokenKeyPair; |
|
7 | 6 | use Yii; |
8 | 7 | |
9 | 8 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * @return sodium_crypto_sign_publickey |
|
48 | + * @return string |
|
49 | 49 | */ |
50 | 50 | public function getSignPublicKey() |
51 | 51 | { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * Generates a new auth and refresh token pair |
57 | 57 | * @param int $userId |
58 | - * @return array |
|
58 | + * @return Token |
|
59 | 59 | */ |
60 | 60 | public static function generate($userId = null) |
61 | 61 | { |
@@ -2,9 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace yrc\forms; |
4 | 4 | |
5 | -use Base32\Base32; |
|
6 | 5 | use Yii; |
7 | - |
|
8 | 6 | use yrc\models\redis\Code; |
9 | 7 | |
10 | 8 | /** |
@@ -4,8 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use app\forms\ResetPassword; |
6 | 6 | use yrc\rest\Action as RestAction; |
7 | -use yrc\models\redis\Code; |
|
8 | - |
|
9 | 7 | use yii\web\HttpException; |
10 | 8 | use Yii; |
11 | 9 |
@@ -2,10 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace yrc\components; |
4 | 4 | |
5 | -use Redis; |
|
6 | -use RPQ\Client; |
|
5 | +use Redis; |
|
6 | +use RPQ\Client; |
|
7 | 7 | use yii\base\BaseObject; |
8 | -use Yii; |
|
9 | 8 | |
10 | 9 | final class RPQComponent extends BaseObject |
11 | 10 | { |
@@ -23,7 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * Command line options |
25 | 25 | * @param string $actionID |
26 | - * @return array |
|
26 | + * @return string[] |
|
27 | 27 | */ |
28 | 28 | public function options($actionID) |
29 | 29 | { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace yrc\commands; |
4 | 4 | |
5 | -use Exception; |
|
6 | -use yii\console\Controller; |
|
5 | +use Exception; |
|
6 | +use yii\console\Controller; |
|
7 | 7 | use Yii; |
8 | 8 | |
9 | 9 | class WorkerController extends Controller |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace yrc\commands; |
4 | 4 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Model attributes |
18 | - * @return array |
|
18 | + * @return string[] |
|
19 | 19 | */ |
20 | 20 | public function attributes() |
21 | 21 | { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * @return sodium_crypto_box_publickey |
|
31 | + * @return string |
|
32 | 32 | */ |
33 | 33 | public function getBoxPublicKey() |
34 | 34 | { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Ramsey\Uuid\Uuid; |
6 | 6 | use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; |
7 | - |
|
8 | 7 | use yrc\redis\ActiveRecord; |
9 | 8 | use Yii; |
10 | 9 |