Resolves #2. Implemented authlib-injector support

This commit is contained in:
ErickSkrauch
2021-03-03 15:04:42 +01:00
parent 10ab237d1d
commit 4856695940
17 changed files with 505 additions and 87 deletions

View File

@@ -36,19 +36,31 @@ class SessionServerSteps extends FunctionalTester {
return [$username, $serverId];
}
public function canSeeValidTexturesResponse($expectedUsername, $expectedUuid) {
public function canSeeValidTexturesResponse(
string $expectedUsername,
string $expectedUuid,
bool $shouldBeSigned = false
) {
$this->seeResponseIsJson();
$this->canSeeResponseContainsJson([
'name' => $expectedUsername,
'id' => $expectedUuid,
'ely' => true,
'properties' => [
[
'name' => 'textures',
'signature' => 'Cg==',
],
[
'name' => 'ely',
'value' => 'but why are you asking?',
],
],
]);
if ($shouldBeSigned) {
$this->canSeeResponseJsonMatchesJsonPath('$.properties[?(@.name == "textures")].signature');
} else {
$this->cantSeeResponseJsonMatchesJsonPath('$.properties[?(@.name == "textures")].signature');
}
$this->canSeeResponseJsonMatchesJsonPath('$.properties[0].value');
$value = $this->grabDataFromResponseByJsonPath('$.properties[0].value')[0];
$decoded = json_decode(base64_decode($value), true);
@@ -56,7 +68,6 @@ class SessionServerSteps extends FunctionalTester {
$this->assertArrayHasKey('textures', $decoded);
$this->assertSame($expectedUuid, $decoded['profileId']);
$this->assertSame($expectedUsername, $decoded['profileName']);
$this->assertTrue($decoded['ely']);
$textures = $decoded['textures'];
$this->assertArrayHasKey('SKIN', $textures);
$skinTextures = $textures['SKIN'];