2016-01-02 19:13:18 +05:30
< ? php
2016-05-30 05:14:17 +05:30
return [
'components' => [
2019-08-01 14:47:12 +05:30
'tokens' => [
'hmacKey' => 'tests-secret-key' ,
'privateKeyPath' => codecept_data_dir ( 'certs/private.pem' ),
'privateKeyPass' => null ,
'publicKeyPath' => codecept_data_dir ( 'certs/public.pem' ),
2019-12-05 22:07:46 +05:30
'encryptionKey' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,
2016-05-30 05:14:17 +05:30
],
2016-08-03 18:26:08 +05:30
'reCaptcha' => [
'public' => 'public-key' ,
'secret' => 'private-key' ,
],
2016-05-30 05:14:17 +05:30
],
2016-09-08 21:36:44 +05:30
'params' => [
2019-02-21 01:28:52 +05:30
'authserverHost' => 'localhost' ,
2016-09-08 21:36:44 +05:30
],
2017-05-18 04:39:26 +05:30
'container' => [
2021-03-03 19:34:42 +05:30
'singletons' => [
2019-02-21 01:28:52 +05:30
api\components\ReCaptcha\Validator :: class => function () {
return new class ( new GuzzleHttp\Client ()) extends api\components\ReCaptcha\Validator {
2017-05-18 04:39:26 +05:30
protected function validateValue ( $value ) {
return null ;
}
};
},
2019-12-29 20:25:21 +05:30
common\components\SkinsSystemApi :: class => function () {
2021-03-04 10:28:07 +05:30
return new class ( 'http://chrly.ely.by' ) extends common\components\SkinsSystemApi {
2019-05-13 22:09:11 +05:30
public function textures ( string $username ) : ? array {
return [
'SKIN' => [
'url' => 'http://localhost/skin.png' ,
],
];
}
2021-03-03 19:34:42 +05:30
public function profile ( string $username , bool $signed = false ) : ? array {
2022-12-06 03:20:22 +05:30
if ( $username === 'NotSynchronized' ) {
return null ;
}
2021-03-03 19:34:42 +05:30
$account = common\models\Account :: findOne ([ 'username' => $username ]);
$uuid = $account ? str_replace ( '-' , '' , $account -> uuid ) : '00000000000000000000000000000000' ;
$profile = [
'name' => $username ,
'id' => $uuid ,
'properties' => [
[
'name' => 'textures' ,
'value' => base64_encode ( json_encode ([
'timestamp' => Carbon\Carbon :: now () -> getPreciseTimestamp ( 3 ),
'profileId' => $uuid ,
'profileName' => $username ,
'textures' => [
'SKIN' => [
'url' => 'http://ely.by/skin.png' ,
],
],
])),
],
[
'name' => 'ely' ,
'value' => 'but why are you asking?' ,
],
],
];
if ( $signed ) {
$profile [ 'properties' ][ 0 ][ 'signature' ] = 'signature' ;
}
return $profile ;
}
public function getSignatureVerificationKey ( string $format = 'pem' ) : string {
return " -----BEGIN PUBLIC KEY----- \n MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANbUpVCZkMKpfvYZ08W3lumdAaYxLBnm \n UDlzHBQH3DpYef5WCO32TDU6feIJ58A0lAywgtZ4wwi2dGHOz/1hAvcCAwEAAQ== \n -----END PUBLIC KEY----- " ;
}
2019-05-13 22:09:11 +05:30
};
},
2017-05-18 04:39:26 +05:30
],
],
2016-05-30 05:14:17 +05:30
];