Repository navigation
fix(share): set password expiration time on email share creation (#66177) - #66219
saiyyedfardeen wants to merge 2 commits into
Conversation
…tcloud#66177) Signed-off-by: Fardeen Saiyyed <fardinsaiyyed@hotmail.com>
| ->willReturnCallback(function (string $key, bool $default = false): bool { | ||
| if ($key === 'sharing.enable_share_mail') { | ||
| return true; | ||
| } | ||
| return $default; | ||
| }); |
There was a problem hiding this comment.
Please use willReturnMap instead.
There was a problem hiding this comment.
it is fixed now. Please check.
DerDreschner
left a comment
There was a problem hiding this comment.
Looks good, just the little willReturnMap change should be done before merging.
Additional context: Broken since #31965
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Assisted-by: Antigravity:Gemini-3.8-Flash Signed-off-by: Fardeen Saiyyed <fardinsaiyyed@hotmail.com>
Summary
When
'sharing.enable_mail_link_password_expiration'is enabled in configuration, creating an email share (IShare::TYPE_EMAIL) with a password resulted inpassword_expiration_timebeing stored asNULLin theoc_sharetable.Previously, expiration time calculation via
setSharePasswordExpirationTime()was only triggered during password updates inManager::updateSharePasswordIfNeeded(), and was missed in the initial share creation logic.Solution
lib/private/Share20/Manager.php::createShare(): Added a call to$this->setSharePasswordExpirationTime($share)inside the password hashing block forIShare::TYPE_EMAILshares, ensuring the expiration timestamp is computed and persisted on creation.tests/lib/Share20/ManagerTest.php: Added unit testtestCreateShareByMailWithPasswordSetsExpirationTime()to assert that newly created email shares with passwords obtain a valid\DateTimeInterfaceexpiration instance.Checklist
3. to review, feature component)stable32)AI (if applicable)