Skip to content

Commit 364756e

Browse files
committed
fix: Add missing PasswordConfirmationRequired attributes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 10d1cec commit 364756e

5 files changed

Lines changed: 9 additions & 2 deletions

File tree

apps/oauth2/lib/Controller/SettingsController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use OCA\OAuth2\Db\ClientMapper;
1414
use OCP\AppFramework\Controller;
1515
use OCP\AppFramework\Http;
16+
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
1617
use OCP\AppFramework\Http\JSONResponse;
1718
use OCP\Authentication\Token\IProvider as IAuthTokenProvider;
1819
use OCP\IL10N;
@@ -40,6 +41,7 @@ public function __construct(
4041
parent::__construct($appName, $request);
4142
}
4243

44+
#[PasswordConfirmationRequired(strict: true)]
4345
public function addClient(string $name,
4446
string $redirectUri): JSONResponse {
4547
if (filter_var($redirectUri, FILTER_VALIDATE_URL) === false) {
@@ -66,6 +68,7 @@ public function addClient(string $name,
6668
return new JSONResponse($result);
6769
}
6870

71+
#[PasswordConfirmationRequired]
6972
public function deleteClient(int $id): JSONResponse {
7073
$client = $this->clientMapper->getByUid($id);
7174

apps/provisioning_api/lib/Controller/AppsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getAppInfo(string $app): DataResponse {
9393
*
9494
* 200: App enabled successfully
9595
*/
96-
#[PasswordConfirmationRequired]
96+
#[PasswordConfirmationRequired(strict: true)]
9797
public function enable(string $app): DataResponse {
9898
try {
9999
$this->appManager->enableApp($app);

apps/settings/lib/Controller/AppSettingsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public function enableApp(string $appId, array $groups = []): JSONResponse {
556556
* @param array $groups
557557
* @return JSONResponse
558558
*/
559-
#[PasswordConfirmationRequired]
559+
#[PasswordConfirmationRequired(strict: true)]
560560
public function enableApps(array $appIds, array $groups = []): JSONResponse {
561561
try {
562562
$updateRequired = false;

apps/settings/lib/Controller/AuthorizedGroupController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use OCA\Settings\Service\AuthorizedGroupService;
1111
use OCA\Settings\Service\NotFoundException;
1212
use OCP\AppFramework\Controller;
13+
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
1314
use OCP\AppFramework\Http\DataResponse;
1415
use OCP\DB\Exception;
1516
use OCP\IRequest;
@@ -27,6 +28,7 @@ public function __construct(string $AppName, IRequest $request, AuthorizedGroupS
2728
* @throws NotFoundException
2829
* @throws Exception
2930
*/
31+
#[PasswordConfirmationRequired(strict: true)]
3032
public function saveSettings(array $newGroups, string $class): DataResponse {
3133
$currentGroups = $this->authorizedGroupService->findExistingGroupsForClass($class);
3234

apps/settings/lib/Controller/TwoFactorSettingsController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use OC\Authentication\TwoFactorAuth\EnforcementState;
1212
use OC\Authentication\TwoFactorAuth\MandatoryTwoFactor;
1313
use OCP\AppFramework\Controller;
14+
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
1415
use OCP\AppFramework\Http\JSONResponse;
1516
use OCP\IRequest;
1617

@@ -31,6 +32,7 @@ public function index(): JSONResponse {
3132
return new JSONResponse($this->mandatoryTwoFactor->getState());
3233
}
3334

35+
#[PasswordConfirmationRequired(strict: true)]
3436
public function update(bool $enforced, array $enforcedGroups = [], array $excludedGroups = []): JSONResponse {
3537
$this->mandatoryTwoFactor->setState(
3638
new EnforcementState($enforced, $enforcedGroups, $excludedGroups)

0 commit comments

Comments
 (0)