2016-01-02 16:43:18 +03:00
< ? php
2016-05-30 02:44:17 +03:00
return [
'components' => [
2019-08-01 12:17:12 +03:00
'tokens' => [
'hmacKey' => 'tests-secret-key' ,
'privateKeyPath' => codecept_data_dir ( 'certs/private.pem' ),
'privateKeyPass' => null ,
'publicKeyPath' => codecept_data_dir ( 'certs/public.pem' ),
2019-12-05 19:37:46 +03:00
'encryptionKey' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,
2016-05-30 02:44:17 +03:00
],
2016-08-03 15:56:08 +03:00
'reCaptcha' => [
'public' => 'public-key' ,
'secret' => 'private-key' ,
],
2016-05-30 02:44:17 +03:00
],
2016-09-08 19:06:44 +03:00
'params' => [
2019-02-20 22:58:52 +03:00
'authserverHost' => 'localhost' ,
2016-09-08 19:06:44 +03:00
],
2017-05-18 02:09:26 +03:00
'container' => [
2021-03-03 15:04:42 +01:00
'singletons' => [
2019-02-20 22:58:52 +03:00
api\components\ReCaptcha\Validator :: class => function () {
return new class ( new GuzzleHttp\Client ()) extends api\components\ReCaptcha\Validator {
2017-05-18 02:09:26 +03:00
protected function validateValue ( $value ) {
return null ;
}
};
},
2019-12-29 17:55:21 +03:00
common\components\SkinsSystemApi :: class => function () {
2021-03-04 05:58:07 +01:00
return new class ( 'http://chrly.ely.by' ) extends common\components\SkinsSystemApi {
2019-05-13 19:39:11 +03:00
public function textures ( string $username ) : ? array {
return [
'SKIN' => [
'url' => 'http://localhost/skin.png' ,
],
];
}
2021-03-03 15:04:42 +01:00
public function profile ( string $username , bool $signed = false ) : ? array {
2022-12-05 22:50:22 +01:00
if ( $username === 'NotSynchronized' ) {
return null ;
}
2021-03-03 15:04:42 +01:00
$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 19:39:11 +03:00
};
},
2017-05-18 02:09:26 +03:00
],
],
2016-05-30 02:44:17 +03:00
];