-
-
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
refactor(encryption): Migrate from hooks to events #48332
Conversation
f32d12e
to
dbf60ac
Compare
93dea23
to
09afc2d
Compare
a080187
to
e392348
Compare
if ($passPhrase === null) { | ||
$this->logger->warning('Master key is disabled but not passphrase provided.'); | ||
return false; | ||
} |
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.
Looks like a change not entirely related to the refactor and it should also be backported?
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.
This was a psalm error that was ignored before as it could be possible that null is passed (e.g. with master key) this was simply ignored before.
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.
Not sure I like the getUid thing, especially since it uses a different casing than the method from IUser.
Otherwise, great work!
@@ -34,6 +34,13 @@ public function getUser(): IUser { | |||
return $this->user; | |||
} | |||
|
|||
/** | |||
* @since 31.0.0 |
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.
Any chance of moving these events to OCP without creating a mess?
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.
IIRC the event name is the class string of the event, meaning we can not move without also emitting the old event until it is deprecated enough.
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.
So I would say this makes sense, but please in a follow up
The IUser one is quite old, older than our naming guidelines that prefer Uid over UID (or Url over URL). |
c9eaac9
to
fa428fb
Compare
$this->onPasswordUpdated($event->getUid(), $event->getPassword(), $event->getRecoveryPassword()); | ||
} elseif($event instanceof BeforePasswordResetEvent) { | ||
$this->onBeforePasswordReset($event->getUid()); | ||
} elseif($event instanceof PasswordResetEvent) { |
Check notice
Code scanning / Psalm
RedundantConditionGivenDocblockType
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.
All good apart from the catch Throwable thing.
6654d12
to
4582d30
Compare
0be66d1
to
bcd59f4
Compare
Co-authored-by: Ferdinand Thiessen <[email protected]> Co-authored-by: Louis <[email protected]> Co-authored-by: Côme Chilliet <[email protected]> Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
bcd59f4
to
b4ec7ca
Compare
Summary
Migrate code from hooks to typed events, also unify the user events as some had already a
getUid
method -> now all provide this convenient helper.Checklist