Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files_sharing): rate limit share creation 10 times per 10 minutes #50905

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@
* 200: Share created
*/
#[NoAdminRequired]
#[UserRateLimit(limit: 10, duration: 600)]

Check failure on line 560 in apps/files_sharing/lib/Controller/ShareAPIController.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

InvalidNamedArgument

apps/files_sharing/lib/Controller/ShareAPIController.php:560:29: InvalidNamedArgument: Parameter $duration does not exist on function OCP\AppFramework\Http\Attribute\UserRateLimit::__construct (see https://psalm.dev/238)
public function createShare(
?string $path = null,
?int $permissions = null,
Expand Down Expand Up @@ -2146,7 +2147,7 @@
* 200: The email notification was sent successfully
*/
#[NoAdminRequired]
#[UserRateLimit(limit: 5, period: 120)]
#[UserRateLimit(limit: 10, period: 600)]
public function sendShareEmail(string $id, $password = ''): DataResponse {
try {
$share = $this->getShareById($id);
Expand Down
Loading