feat: test if specific user can be managed in MagicLinkResource#154
feat: test if specific user can be managed in MagicLinkResource#154jungm wants to merge 4 commits intop2-inc:mainfrom
Conversation
| updateProfile, | ||
| updatePassword, | ||
| MagicLink.registerEvent(event, MAGIC_LINK)); | ||
| UserModel user = MagicLink.getOrCreate(session, realm, emailOrUsername, false, |
There was a problem hiding this comment.
Thank you for doing this change @jungm . It looks good.
Could you please create a separate method for findUser encapsulating the following logic
// username or email is required, if not provided or empty, exit early and return null
if (trimToNull(emailOrUsername) == null) {
return null;
}
UserModel user = findUserByNameOrEmail(session, realm, emailOrUsername);
We need to refactor the getOrCreate in a near future . It becomes to difficult to use
There was a problem hiding this comment.
@rtufisi can you take another quick look? id really appreciate to get this merged so we can just use the upstream of this plugin and don't need to keep our fork
There was a problem hiding this comment.
hello @jungm . Apologies for the delay.We added a policy of testing in the new code mergea. We will need this PR to be acompanied by a IT test which will cover the use case you added. Please use the existing functionality as a base example. Thank you!
There was a problem hiding this comment.
@rtufisi sorry for the delay on my side as well, added an integration test for my change now
See also #145, this makes the REST endpoint respect fine grained authz