committed by
GitHub
15 changed files with 643 additions and 52 deletions
-
2appinfo/info.xml
-
9appinfo/routes.php
-
7css/style.css
-
23docs/api-v1.md
-
48js/signaling.js
-
56js/views/roomlistview.js
-
61lib/Controller/CallController.php
-
113lib/Controller/RoomController.php
-
27lib/Exceptions/InvalidPasswordException.php
-
14lib/Manager.php
-
53lib/Migration/Version2001Date20170921145301.php
-
56lib/Room.php
-
26tests/integration/features/bootstrap/FeatureContext.php
-
130tests/integration/features/callapi/password.feature
-
70tests/integration/features/set-password.feature
@ -0,0 +1,27 @@ |
|||
<?php |
|||
/** |
|||
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
|
|||
namespace OCA\Spreed\Exceptions; |
|||
|
|||
class InvalidPasswordException extends \Exception { |
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
<?php |
|||
/** |
|||
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @author Joas Schilling <coding@schilljs.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
namespace OCA\Spreed\Migration; |
|||
|
|||
use Doctrine\DBAL\Schema\Schema; |
|||
use Doctrine\DBAL\Types\Type; |
|||
use OCP\Migration\SimpleMigrationStep; |
|||
use OCP\Migration\IOutput; |
|||
|
|||
class Version2001Date20170921145301 extends SimpleMigrationStep { |
|||
|
|||
/** |
|||
* @param IOutput $output |
|||
* @param \Closure $schemaClosure The `\Closure` returns a `Schema` |
|||
* @param array $options |
|||
* @return null|Schema |
|||
* @since 13.0.0 |
|||
*/ |
|||
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|||
/** @var Schema $schema */ |
|||
$schema = $schemaClosure(); |
|||
|
|||
$table = $schema->getTable('spreedme_rooms'); |
|||
$table->addColumn('password', Type::STRING, [ |
|||
'notnull' => false, |
|||
'length' => 255, |
|||
'default' => '', |
|||
]); |
|||
|
|||
return $schema; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,130 @@ |
|||
Feature: callapi/public |
|||
Background: |
|||
Given user "participant1" exists |
|||
And user "participant2" exists |
|||
And user "participant3" exists |
|||
|
|||
Scenario: User has no rooms |
|||
Then user "participant1" is participant of the following rooms |
|||
Then user "participant2" is participant of the following rooms |
|||
Then user "participant3" is participant of the following rooms |
|||
|
|||
Scenario: User1 invites user2 to a public room and they can do everything |
|||
When user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" sets password "foobar" for room "room" with 200 |
|||
And user "participant1" adds "participant2" to room "room" with 200 |
|||
Then user "participant1" is participant of room "room" |
|||
And user "participant2" is participant of room "room" |
|||
Then user "participant1" sees 0 peers in call "room" with 200 |
|||
And user "participant2" sees 0 peers in call "room" with 200 |
|||
Then user "participant1" joins call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "participant2" sees 1 peers in call "room" with 200 |
|||
And user "participant2" joins call "room" with 200 |
|||
Then user "participant1" sees 2 peers in call "room" with 200 |
|||
And user "participant2" sees 2 peers in call "room" with 200 |
|||
Then user "participant1" pings call "room" with 200 |
|||
And user "participant2" pings call "room" with 200 |
|||
Then user "participant1" leaves call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "participant2" sees 1 peers in call "room" with 200 |
|||
Then user "participant2" leaves call "room" with 200 |
|||
Then user "participant1" sees 0 peers in call "room" with 200 |
|||
And user "participant2" sees 0 peers in call "room" with 200 |
|||
|
|||
Scenario: User1 invites user2 to a public room and user3 can not join without password |
|||
When user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" sets password "foobar" for room "room" with 200 |
|||
And user "participant1" adds "participant2" to room "room" with 200 |
|||
Then user "participant1" is participant of room "room" |
|||
Then user "participant3" is not participant of room "room" |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
Then user "participant1" joins call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
And user "participant3" joins call "room" with 403 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
And user "participant3" pings call "room" with 404 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
Then user "participant3" leaves call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
Then user "participant1" leaves call "room" with 200 |
|||
Then user "participant1" sees 0 peers in call "room" with 200 |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
|
|||
Scenario: User1 invites user2 to a public room and user3 can join with password |
|||
When user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" sets password "foobar" for room "room" with 200 |
|||
And user "participant1" adds "participant2" to room "room" with 200 |
|||
Then user "participant1" is participant of room "room" |
|||
Then user "participant3" is not participant of room "room" |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
Then user "participant1" joins call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
And user "participant3" joins call "room" with 200 |
|||
| password | foobar | |
|||
Then user "participant1" sees 2 peers in call "room" with 200 |
|||
And user "participant3" sees 2 peers in call "room" with 200 |
|||
And user "participant3" pings call "room" with 200 |
|||
Then user "participant1" sees 2 peers in call "room" with 200 |
|||
And user "participant3" sees 2 peers in call "room" with 200 |
|||
Then user "participant3" leaves call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
Then user "participant1" leaves call "room" with 200 |
|||
Then user "participant1" sees 0 peers in call "room" with 200 |
|||
And user "participant3" sees 0 peers in call "room" with 404 |
|||
|
|||
Scenario: User1 invites user2 to a public room and guest can not join without password |
|||
When user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" sets password "foobar" for room "room" with 200 |
|||
And user "participant1" adds "participant2" to room "room" with 200 |
|||
Then user "participant1" is participant of room "room" |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
Then user "participant1" joins call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
And user "guest" joins call "room" with 403 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
And user "guest" pings call "room" with 404 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
Then user "guest" leaves call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
Then user "participant1" leaves call "room" with 200 |
|||
Then user "participant1" sees 0 peers in call "room" with 200 |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
|
|||
Scenario: User1 invites user2 to a public room and guest can join with password |
|||
When user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" sets password "foobar" for room "room" with 200 |
|||
And user "participant1" adds "participant2" to room "room" with 200 |
|||
Then user "participant1" is participant of room "room" |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
Then user "participant1" joins call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
And user "guest" joins call "room" with 200 |
|||
| password | foobar | |
|||
Then user "participant1" sees 2 peers in call "room" with 200 |
|||
And user "guest" sees 2 peers in call "room" with 200 |
|||
And user "guest" pings call "room" with 200 |
|||
Then user "participant1" sees 2 peers in call "room" with 200 |
|||
And user "guest" sees 2 peers in call "room" with 200 |
|||
Then user "guest" leaves call "room" with 200 |
|||
Then user "participant1" sees 1 peers in call "room" with 200 |
|||
And user "guest" sees 0 peers in call "room" with 404 |
|||
Then user "participant1" leaves call "room" with 200 |
|||
Then user "participant1" sees 0 peers in call "room" with 200 |
|||
And user "guest" sees 0 peers in call "room" with 404 |
@ -0,0 +1,70 @@ |
|||
Feature: public |
|||
Background: |
|||
Given user "participant1" exists |
|||
Given user "participant2" exists |
|||
Given user "participant3" exists |
|||
|
|||
Scenario: Owner sets a room password |
|||
Given user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" is participant of the following rooms |
|||
| id | type | participantType | participants | |
|||
| room | 3 | 1 | participant1-displayname | |
|||
When user "participant1" sets password "foobar" for room "room" with 200 |
|||
Then user "participant3" joins call "room" with 403 |
|||
Then user "participant3" joins call "room" with 200 |
|||
| password | foobar | |
|||
And user "participant3" leaves call "room" with 200 |
|||
When user "participant1" sets password "" for room "room" with 200 |
|||
Then user "participant3" joins call "room" with 200 |
|||
|
|||
Scenario: Moderator sets a room password |
|||
Given user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" is participant of the following rooms |
|||
| id | type | participantType | participants | |
|||
| room | 3 | 1 | participant1-displayname | |
|||
And user "participant1" adds "participant2" to room "room" with 200 |
|||
And user "participant1" promotes "participant2" in room "room" with 200 |
|||
When user "participant2" sets password "foobar" for room "room" with 200 |
|||
Then user "participant3" joins call "room" with 403 |
|||
Then user "participant3" joins call "room" with 200 |
|||
| password | foobar | |
|||
And user "participant3" leaves call "room" with 200 |
|||
When user "participant2" sets password "" for room "room" with 200 |
|||
Then user "participant3" joins call "room" with 200 |
|||
|
|||
Scenario: User sets a room password |
|||
Given user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" is participant of the following rooms |
|||
| id | type | participantType | participants | |
|||
| room | 3 | 1 | participant1-displayname | |
|||
And user "participant1" adds "participant2" to room "room" with 200 |
|||
When user "participant2" sets password "foobar" for room "room" with 403 |
|||
Then user "participant3" joins call "room" with 200 |
|||
And user "participant3" leaves call "room" with 200 |
|||
When user "participant1" sets password "foobar" for room "room" with 200 |
|||
Then user "participant3" joins call "room" with 403 |
|||
Then user "participant3" joins call "room" with 200 |
|||
| password | foobar | |
|||
And user "participant3" leaves call "room" with 200 |
|||
When user "participant2" sets password "" for room "room" with 403 |
|||
Then user "participant3" joins call "room" with 403 |
|||
|
|||
Scenario: Stranger sets a room password |
|||
Given user "participant1" creates room "room" |
|||
| roomType | 3 | |
|||
And user "participant1" is participant of the following rooms |
|||
| id | type | participantType | participants | |
|||
| room | 3 | 1 | participant1-displayname | |
|||
When user "participant2" sets password "foobar" for room "room" with 404 |
|||
Then user "participant3" joins call "room" with 200 |
|||
And user "participant3" leaves call "room" with 200 |
|||
When user "participant1" sets password "foobar" for room "room" with 200 |
|||
Then user "participant3" joins call "room" with 403 |
|||
Then user "participant3" joins call "room" with 200 |
|||
| password | foobar | |
|||
And user "participant3" leaves call "room" with 200 |
|||
When user "participant2" sets password "" for room "room" with 404 |
|||
Then user "participant3" joins call "room" with 403 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue