-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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(ProvisioningApi): only return verified additional mails per user #44341
base: master
Are you sure you want to change the base?
Conversation
Integration tests fail, for no email verification was done there. That might be tricky. There is no way to modify it from outside, without exposing anything, so not the way to go. Maybe utilizing FakeSMTPHelper in the integration tests could help, did not have time for a closer look there yet (free time activity…). |
Can add any code directly to the |
It would not per se be bad to return all of them, however the meta data about the verified state is missing. Since the information may go out to connected clients, those may have wrong trust the returned email addresses. Email verification still works with this change. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
266a79a
to
35a0ee2
Compare
|
||
class MailVerificationTestController extends OCSController { | ||
public function __construct( | ||
$appName, |
Check notice
Code scanning / Psalm
MissingParamType Note test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$appName, | |
string $appName, |
|
||
public function verify(string $userId, string $email): DataResponse { | ||
$user = $this->userManager->get($userId); | ||
$userAccount = $this->accountManager->getAccount($user); |
Check notice
Code scanning / Psalm
PossiblyNullArgument Note test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$userAccount = $this->accountManager->getAccount($user); | |
if ($user === null) { | |
throw new InvalidArgumentException('User not available.'); | |
} | |
$userAccount = $this->accountManager->getAccount($user); |
@@ -0,0 +1,35 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs SPDX headers
|
||
class MailVerificationTestController extends OCSController { | ||
public function __construct( | ||
$appName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$appName, | |
string $appName, |
|
||
public function verify(string $userId, string $email): DataResponse { | ||
$user = $this->userManager->get($userId); | ||
$userAccount = $this->accountManager->getAccount($user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$userAccount = $this->accountManager->getAccount($user); | |
if ($user === null) { | |
throw new InvalidArgumentException('User not available.'); | |
} | |
$userAccount = $this->accountManager->getAccount($user); |
@@ -0,0 +1,35 @@ | |||
<?php | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declare(strict_types=1); | |
/** | |
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | |
* SPDX-License-Identifier: AGPL-3.0-or-later | |
*/ |
Summary
…it would not per se be bad to return all of them, however the meta data about the verified state is missing. Since the information may go out to connected clients, those may have wrong trust the returned email addresses.
Email verification still works with this change.
Checklist