Merge branch 'develop' into v2

This commit is contained in:
Dane Everitt 2021-08-07 09:21:05 -07:00
commit 74a77a0e86
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -27,6 +27,18 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase
->assertJsonPath('errors.0.detail', 'You do not have permission to connect to this server\'s websocket.');
}
/**
* Confirm users cannot access the websocket for another user's server.
*/
public function testUserWithoutPermissionForServerReceivesError()
{
[, $server] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]);
[$user,] = $this->generateTestAccount([Permission::ACTION_WEBSOCKET_CONNECT]);
$this->actingAs($user)->getJson("/api/client/servers/{$server->uuid}/websocket")
->assertStatus(Response::HTTP_NOT_FOUND);
}
/**
* Test that the expected permissions are returned for the server owner and that the JWT is
* configured correctly.