Skip to content

Commit 5ca269f

Browse files
come-ncbackportbot[bot]
authored andcommitted
fix: Add missing PasswordConfirmationRequired attributes
fix: Add missing PasswordConfirmationRequired attributes Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com> [skip ci]
1 parent 807a3cc commit 5ca269f

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

apps/oauth2/lib/Controller/SettingsController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use OCA\OAuth2\Db\ClientMapper;
3636
use OCP\AppFramework\Controller;
3737
use OCP\AppFramework\Http;
38+
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
3839
use OCP\AppFramework\Http\JSONResponse;
3940
use OCP\Authentication\Token\IProvider as IAuthTokenProvider;
4041
use OCP\IL10N;
@@ -62,6 +63,7 @@ public function __construct(
6263
parent::__construct($appName, $request);
6364
}
6465

66+
#[PasswordConfirmationRequired(strict: true)]
6567
public function addClient(string $name,
6668
string $redirectUri): JSONResponse {
6769
if (filter_var($redirectUri, FILTER_VALIDATE_URL) === false) {
@@ -88,6 +90,7 @@ public function addClient(string $name,
8890
return new JSONResponse($result);
8991
}
9092

93+
#[PasswordConfirmationRequired]
9194
public function deleteClient(int $id): JSONResponse {
9295
$client = $this->clientMapper->getByUid($id);
9396

apps/settings/lib/Controller/AuthorizedGroupController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use OCA\Settings\Service\AuthorizedGroupService;
2828
use OCA\Settings\Service\NotFoundException;
2929
use OCP\AppFramework\Controller;
30+
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
3031
use OCP\AppFramework\Http\DataResponse;
3132
use OCP\DB\Exception;
3233
use OCP\IRequest;
@@ -44,6 +45,7 @@ public function __construct(string $AppName, IRequest $request, AuthorizedGroupS
4445
* @throws NotFoundException
4546
* @throws Exception
4647
*/
48+
#[PasswordConfirmationRequired(strict: true)]
4749
public function saveSettings(array $newGroups, string $class): DataResponse {
4850
$currentGroups = $this->authorizedGroupService->findExistingGroupsForClass($class);
4951

apps/settings/lib/Controller/TwoFactorSettingsController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use OC\Authentication\TwoFactorAuth\EnforcementState;
2929
use OC\Authentication\TwoFactorAuth\MandatoryTwoFactor;
3030
use OCP\AppFramework\Controller;
31+
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
3132
use OCP\AppFramework\Http\JSONResponse;
3233
use OCP\IRequest;
3334

@@ -48,6 +49,7 @@ public function index(): JSONResponse {
4849
return new JSONResponse($this->mandatoryTwoFactor->getState());
4950
}
5051

52+
#[PasswordConfirmationRequired(strict: true)]
5153
public function update(bool $enforced, array $enforcedGroups = [], array $excludedGroups = []): JSONResponse {
5254
$this->mandatoryTwoFactor->setState(
5355
new EnforcementState($enforced, $enforcedGroups, $excludedGroups)

0 commit comments

Comments
 (0)