mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Implemented device code grant
This commit is contained in:
@@ -51,6 +51,7 @@ class FixtureHelper extends Module {
|
||||
'usernamesHistory' => fixtures\UsernameHistoryFixture::class,
|
||||
'oauthClients' => fixtures\OauthClientFixture::class,
|
||||
'oauthSessions' => fixtures\OauthSessionFixture::class,
|
||||
'oauthDeviceCodes' => fixtures\OauthDeviceCodeFixture::class,
|
||||
'legacyOauthSessionsScopes' => fixtures\LegacyOauthSessionScopeFixtures::class,
|
||||
'legacyOauthAccessTokens' => fixtures\LegacyOauthAccessTokenFixture::class,
|
||||
'legacyOauthAccessTokensScopes' => fixtures\LegacyOauthAccessTokenScopeFixture::class,
|
||||
|
20
common/tests/fixtures/OauthDeviceCodeFixture.php
vendored
Normal file
20
common/tests/fixtures/OauthDeviceCodeFixture.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace common\tests\fixtures;
|
||||
|
||||
use common\models\OauthDeviceCode;
|
||||
use yii\test\ActiveFixture;
|
||||
|
||||
final class OauthDeviceCodeFixture extends ActiveFixture {
|
||||
|
||||
public $modelClass = OauthDeviceCode::class;
|
||||
|
||||
public $dataFile = '@root/common/tests/fixtures/data/oauth-device-codes.php';
|
||||
|
||||
public $depends = [
|
||||
OauthClientFixture::class,
|
||||
AccountFixture::class,
|
||||
];
|
||||
|
||||
}
|
15
common/tests/fixtures/data/oauth-device-codes.php
vendored
Normal file
15
common/tests/fixtures/data/oauth-device-codes.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
[
|
||||
'device_code' => 'nKuYFfwckZywqU8iUKv3ek4VtiMiMCkiC0YTZFPbWycSxdRpHiYP2wnv3S0KHBgYky8fRDqfhhCqzke7',
|
||||
'user_code' => 'AAAABBBB',
|
||||
'client_id' => 'ely',
|
||||
'scopes' => ['minecraft_server_session', 'account_info'],
|
||||
'account_id' => null,
|
||||
'is_approved' => null,
|
||||
'last_polled_at' => null,
|
||||
'expires_at' => time() + 1800,
|
||||
],
|
||||
];
|
Reference in New Issue
Block a user