aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/lib/Controller/WebAuthnController.php
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-07-25 13:14:49 +0200
committerprovokateurin <kate@provokateurin.de>2024-07-27 22:49:43 +0200
commitf012c996ee378fac2238d9ca7ada378d20e03723 (patch)
tree7ec27fda6c12e1e3f6e6bf4b7637bafe6d7527c5 /apps/settings/lib/Controller/WebAuthnController.php
parent212a621697cd32b65ea78fa90015cec9d9d1dfe3 (diff)
downloadnextcloud-server-f012c996ee378fac2238d9ca7ada378d20e03723.tar.gz
nextcloud-server-f012c996ee378fac2238d9ca7ada378d20e03723.zip
refactor(settings): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/settings/lib/Controller/WebAuthnController.php')
-rw-r--r--apps/settings/lib/Controller/WebAuthnController.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/apps/settings/lib/Controller/WebAuthnController.php b/apps/settings/lib/Controller/WebAuthnController.php
index 56bc0aa4a05..495b58e6a4b 100644
--- a/apps/settings/lib/Controller/WebAuthnController.php
+++ b/apps/settings/lib/Controller/WebAuthnController.php
@@ -12,7 +12,11 @@ use OC\Authentication\WebAuthn\Manager;
use OCA\Settings\AppInfo\Application;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\NoAdminRequired;
+use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use OCP\AppFramework\Http\Attribute\OpenAPI;
+use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
+use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\ISession;
@@ -35,12 +39,12 @@ class WebAuthnController extends Controller {
}
/**
- * @NoAdminRequired
* @NoSubAdminRequired
- * @PasswordConfirmationRequired
- * @UseSession
- * @NoCSRFRequired
*/
+ #[NoAdminRequired]
+ #[PasswordConfirmationRequired]
+ #[UseSession]
+ #[NoCSRFRequired]
public function startRegistration(): JSONResponse {
$this->logger->debug('Starting WebAuthn registration');
@@ -53,11 +57,11 @@ class WebAuthnController extends Controller {
}
/**
- * @NoAdminRequired
* @NoSubAdminRequired
- * @PasswordConfirmationRequired
- * @UseSession
*/
+ #[NoAdminRequired]
+ #[PasswordConfirmationRequired]
+ #[UseSession]
public function finishRegistration(string $name, string $data): JSONResponse {
$this->logger->debug('Finishing WebAuthn registration');
@@ -75,10 +79,10 @@ class WebAuthnController extends Controller {
}
/**
- * @NoAdminRequired
* @NoSubAdminRequired
- * @PasswordConfirmationRequired
*/
+ #[NoAdminRequired]
+ #[PasswordConfirmationRequired]
public function deleteRegistration(int $id): JSONResponse {
$this->logger->debug('Finishing WebAuthn registration');