mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Rework tests structure. Upgrade codeception to 2.5.3. Merge params configuration into app configuration.
This commit is contained in:
26
api/config/config-test.php
Normal file
26
api/config/config-test.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
return [
|
||||
'components' => [
|
||||
'user' => [
|
||||
'secret' => 'tests-secret-key',
|
||||
],
|
||||
'reCaptcha' => [
|
||||
'public' => 'public-key',
|
||||
'secret' => 'private-key',
|
||||
],
|
||||
],
|
||||
'params' => [
|
||||
'authserverHost' => 'localhost',
|
||||
],
|
||||
'container' => [
|
||||
'definitions' => [
|
||||
api\components\ReCaptcha\Validator::class => function() {
|
||||
return new class(new GuzzleHttp\Client()) extends api\components\ReCaptcha\Validator {
|
||||
protected function validateValue($value) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
},
|
||||
],
|
||||
],
|
||||
];
|
@@ -1,15 +1,12 @@
|
||||
<?php
|
||||
$params = array_merge(
|
||||
require __DIR__ . '/../../common/config/params.php',
|
||||
require __DIR__ . '/params.php'
|
||||
);
|
||||
|
||||
return [
|
||||
'id' => 'accounts-site-api',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'bootstrap' => ['log', 'authserver', 'internal'],
|
||||
'bootstrap' => ['log', 'authserver', 'internal', 'mojang'],
|
||||
'controllerNamespace' => 'api\controllers',
|
||||
'params' => $params,
|
||||
'params' => [
|
||||
'authserverHost' => getenv('AUTHSERVER_HOST'),
|
||||
],
|
||||
'components' => [
|
||||
'user' => [
|
||||
'class' => api\components\User\Component::class,
|
||||
@@ -79,10 +76,7 @@ return [
|
||||
],
|
||||
],
|
||||
'modules' => [
|
||||
'authserver' => [
|
||||
'class' => api\modules\authserver\Module::class,
|
||||
'host' => $params['authserverHost'],
|
||||
],
|
||||
'authserver' => api\modules\authserver\Module::class,
|
||||
'session' => api\modules\session\Module::class,
|
||||
'mojang' => api\modules\mojang\Module::class,
|
||||
'internal' => api\modules\internal\Module::class,
|
||||
|
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
return [
|
||||
'authserverHost' => getenv('AUTHSERVER_HOST'),
|
||||
];
|
@@ -1,7 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* @var array $params
|
||||
*/
|
||||
return [
|
||||
// Oauth module routes
|
||||
'/oauth2/v1/<action>' => 'oauth/authorization/<action>',
|
||||
@@ -46,8 +43,4 @@ return [
|
||||
'/mojang/profiles/<username>' => 'mojang/api/uuid-by-username',
|
||||
'/mojang/profiles/<uuid>/names' => 'mojang/api/usernames-by-uuid',
|
||||
'POST /mojang/profiles' => 'mojang/api/uuids-by-usernames',
|
||||
|
||||
"//{$params['authserverHost']}/mojang/api/users/profiles/minecraft/<username>" => 'mojang/api/uuid-by-username',
|
||||
"//{$params['authserverHost']}/mojang/api/user/profiles/<uuid>/names" => 'mojang/api/usernames-by-uuid',
|
||||
"POST //{$params['authserverHost']}/mojang/api/profiles/minecraft" => 'mojang/api/uuids-by-usernames',
|
||||
];
|
||||
|
Reference in New Issue
Block a user