aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2024-08-01 09:56:19 +0200
committerGitHub <noreply@github.com>2024-08-01 09:56:19 +0200
commitc52b7e5ebc6736de2d9991af379e4ed9885aab7b (patch)
treea5a6fd11826affa217f039085150359038f29018 /apps/encryption
parent553224b0a22756cb6b32ed967aa6385f0fe07202 (diff)
parent4016aace04936059b860026ef9f21b3ff596f1b5 (diff)
downloadnextcloud-server-c52b7e5ebc6736de2d9991af379e4ed9885aab7b.tar.gz
nextcloud-server-c52b7e5ebc6736de2d9991af379e4ed9885aab7b.zip
Merge pull request #46804 from nextcloud/refactor/encryption/security-attributes
Diffstat (limited to 'apps/encryption')
-rw-r--r--apps/encryption/lib/Controller/RecoveryController.php4
-rw-r--r--apps/encryption/lib/Controller/SettingsController.php10
-rw-r--r--apps/encryption/lib/Controller/StatusController.php3
3 files changed, 9 insertions, 8 deletions
diff --git a/apps/encryption/lib/Controller/RecoveryController.php b/apps/encryption/lib/Controller/RecoveryController.php
index 3f39b0d929f..66011fe2439 100644
--- a/apps/encryption/lib/Controller/RecoveryController.php
+++ b/apps/encryption/lib/Controller/RecoveryController.php
@@ -10,6 +10,7 @@ namespace OCA\Encryption\Controller;
use OCA\Encryption\Recovery;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\IConfig;
use OCP\IL10N;
@@ -136,11 +137,10 @@ class RecoveryController extends Controller {
}
/**
- * @NoAdminRequired
- *
* @param string $userEnableRecovery
* @return DataResponse
*/
+ #[NoAdminRequired]
public function userSetRecovery($userEnableRecovery) {
if ($userEnableRecovery === '0' || $userEnableRecovery === '1') {
$result = $this->recovery->setRecoveryForUser($userEnableRecovery);
diff --git a/apps/encryption/lib/Controller/SettingsController.php b/apps/encryption/lib/Controller/SettingsController.php
index a28f2a11af2..b21cdb0aacd 100644
--- a/apps/encryption/lib/Controller/SettingsController.php
+++ b/apps/encryption/lib/Controller/SettingsController.php
@@ -13,6 +13,8 @@ use OCA\Encryption\Session;
use OCA\Encryption\Util;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\NoAdminRequired;
+use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Http\DataResponse;
use OCP\IL10N;
use OCP\IRequest;
@@ -82,13 +84,12 @@ class SettingsController extends Controller {
/**
- * @NoAdminRequired
- * @UseSession
- *
* @param string $oldPassword
* @param string $newPassword
* @return DataResponse
*/
+ #[NoAdminRequired]
+ #[UseSession]
public function updatePrivateKeyPassword($oldPassword, $newPassword) {
$result = false;
$uid = $this->userSession->getUser()->getUID();
@@ -137,11 +138,10 @@ class SettingsController extends Controller {
}
/**
- * @UseSession
- *
* @param bool $encryptHomeStorage
* @return DataResponse
*/
+ #[UseSession]
public function setEncryptHomeStorage($encryptHomeStorage) {
$this->util->setEncryptHomeStorage($encryptHomeStorage);
return new DataResponse();
diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php
index 8f2732477a7..b5b54ee2f6d 100644
--- a/apps/encryption/lib/Controller/StatusController.php
+++ b/apps/encryption/lib/Controller/StatusController.php
@@ -9,6 +9,7 @@ namespace OCA\Encryption\Controller;
use OCA\Encryption\Session;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\Encryption\IManager;
use OCP\IL10N;
@@ -45,9 +46,9 @@ class StatusController extends Controller {
}
/**
- * @NoAdminRequired
* @return DataResponse
*/
+ #[NoAdminRequired]
public function getStatus() {
$status = 'error';
$message = 'no valid init status';