Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
matrix:
test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4']
php-versions: ['8.3']
server-versions: ['master']
server-versions: ['feat/appframework/route-attribute']
guests-versions: ['master']
call-summary-bot-versions: ['main']
notifications-versions: ['master']
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.2']
server-versions: ['master']
server-versions: ['feat/appframework/route-attribute']

services:
postgres:
Expand Down
2 changes: 0 additions & 2 deletions appinfo/routes/routesPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
['name' => 'Page#notFound', 'url' => '/not-found', 'verb' => 'GET'],
/** @see \OCA\Talk\Controller\PageController::duplicateSession() */
['name' => 'Page#duplicateSession', 'url' => '/duplicate-session', 'verb' => 'GET'],
/** @see \OCA\Talk\Controller\PageController::showCall() */
['name' => 'Page#showCall', 'url' => '/call/{token}', 'root' => '', 'verb' => 'GET', 'requirements' => $requirements],
/** @see \OCA\Talk\Controller\PageController::authenticatePassword() */
['name' => 'Page#authenticatePassword', 'url' => '/call/{token}', 'root' => '', 'verb' => 'POST', 'requirements' => $requirements],
/** @see \OCA\Talk\Controller\PageController::recording() */
Expand Down
2 changes: 0 additions & 2 deletions appinfo/routes/routesPollController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
'ocs' => [
/** @see \OCA\Talk\Controller\PollController::createPoll() */
['name' => 'Poll#createPoll', 'url' => '/api/{apiVersion}/poll/{token}', 'verb' => 'POST', 'requirements' => $requirements],
/** @see \OCA\Talk\Controller\PollController::showPoll() */
['name' => 'Poll#showPoll', 'url' => '/api/{apiVersion}/poll/{token}/{pollId}', 'verb' => 'GET', 'requirements' => $requirementsWithPollId],
/** @see \OCA\Talk\Controller\PollController::votePoll() */
['name' => 'Poll#votePoll', 'url' => '/api/{apiVersion}/poll/{token}/{pollId}', 'verb' => 'POST', 'requirements' => $requirementsWithPollId],
/** @see \OCA\Talk\Controller\PollController::closePoll() */
Expand Down
2 changes: 2 additions & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\BruteForceProtection;
use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Attribute\PublicPage;
Expand Down Expand Up @@ -114,6 +115,7 @@ public function __construct(
#[PublicPage]
#[UseSession]
#[BruteForceProtection(action: 'talkRoomToken')]
#[FrontpageRoute(verb: 'GET', url: '/call/{token}', requirements: ['token' => '[a-z0-9]{4,30}'], root: '')]
public function showCall(string $token): Response {
// This is the entry point from the `/call/{token}` URL which is hardcoded in the server.
return $this->index($token);
Expand Down
2 changes: 2 additions & 0 deletions lib/Controller/PollController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use OCA\Talk\Service\PollService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\Attribute\PublicPage;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Utility\ITimeFactory;
Expand Down Expand Up @@ -143,6 +144,7 @@ public function createPoll(string $question, array $options, int $resultMode, in
#[PublicPage]
#[RequireModeratorOrNoLobby]
#[RequireParticipant]
#[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/poll/{token}/{pollId}', requirements: ['apiVersion' => '(v1)', 'token' => '[a-z0-9]{4,30}', 'pollId' => '\d+'])]
public function showPoll(int $pollId): DataResponse {
try {
$poll = $this->pollService->getPoll($this->room->getId(), $pollId);
Expand Down
220 changes: 110 additions & 110 deletions openapi-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -7885,9 +7885,9 @@
}
},
"/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}": {
"get": {
"operationId": "poll-show-poll",
"summary": "Get a poll",
"post": {
"operationId": "poll-vote-poll",
"summary": "Vote on a poll",
"tags": [
"poll"
],
Expand All @@ -7901,6 +7901,19 @@
}
],
"parameters": [
{
"name": "optionIds[]",
"in": "query",
"description": "IDs of the selected options",
"schema": {
"type": "array",
"default": [],
"items": {
"type": "integer",
"format": "int64"
}
}
},
{
"name": "apiVersion",
"in": "path",
Expand Down Expand Up @@ -7946,7 +7959,7 @@
],
"responses": {
"200": {
"description": "Poll returned",
"description": "Voted successfully",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -7975,6 +7988,34 @@
}
}
},
"400": {
"description": "Voting is not possible",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
},
"404": {
"description": "Poll not found",
"content": {
Expand Down Expand Up @@ -8005,9 +8046,9 @@
}
}
},
"post": {
"operationId": "poll-vote-poll",
"summary": "Vote on a poll",
"delete": {
"operationId": "poll-close-poll",
"summary": "Close a poll",
"tags": [
"poll"
],
Expand All @@ -8021,19 +8062,6 @@
}
],
"parameters": [
{
"name": "optionIds[]",
"in": "query",
"description": "IDs of the selected options",
"schema": {
"type": "array",
"default": [],
"items": {
"type": "integer",
"format": "int64"
}
}
},
{
"name": "apiVersion",
"in": "path",
Expand Down Expand Up @@ -8079,7 +8107,7 @@
],
"responses": {
"200": {
"description": "Voted successfully",
"description": "Poll closed successfully",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -8109,7 +8137,35 @@
}
},
"400": {
"description": "Voting is not possible",
"description": "Poll already closed",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
},
"403": {
"description": "Missing permissions to close poll",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -8163,12 +8219,40 @@
}
}
}
},
"500": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
},
"delete": {
"operationId": "poll-close-poll",
"summary": "Close a poll",
"get": {
"operationId": "poll-show-poll",
"summary": "Get a poll",
"tags": [
"poll"
],
Expand Down Expand Up @@ -8227,7 +8311,7 @@
],
"responses": {
"200": {
"description": "Poll closed successfully",
"description": "Poll returned",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -8256,62 +8340,6 @@
}
}
},
"400": {
"description": "Poll already closed",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
},
"403": {
"description": "Missing permissions to close poll",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
},
"404": {
"description": "Poll not found",
"content": {
Expand Down Expand Up @@ -8339,34 +8367,6 @@
}
}
}
},
"500": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {}
}
}
}
}
}
}
}
}
}
Expand Down
Loading