-
Notifications
You must be signed in to change notification settings - Fork 72
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
#177 Add organizations user events #185
Conversation
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 good. A few comments about imports and using snake_case for event details.
README.md
Outdated
@@ -26,6 +26,7 @@ The extensions herein are used in the [Phase Two](https://phasetwo.io) cloud off | |||
- [Resources](#resources) | |||
- [Mappers](#mappers) | |||
- [Admin Events](#admin-events) | |||
- [User Events](#user-events) |
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 is getting big for the README. Can you create a page docs/events.md
and put both the admin and user events in that page? Then you can link from the section below.
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.
Done
@@ -16,6 +13,10 @@ | |||
import org.keycloak.models.RealmModel; | |||
import org.keycloak.provider.ProviderEvent; | |||
|
|||
import java.util.Map; |
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.
Need to run mvn fmt:format
before commit to keep imports consistent
@@ -61,6 +62,10 @@ private void addUser(AuthenticationFlowContext context) { | |||
org.getName(), context.getUser().getUsername()); | |||
org.grantMembership(context.getUser()); | |||
// TODO default roles from config?? | |||
context.getEvent() | |||
.user(context.getUser()) | |||
.detail("joinedOrganization", org.getId()) |
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.
Keys are snake_case
in details. Change to joined_organization
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.
Done
event.clone() | ||
.event(CUSTOM_REQUIRED_ACTION) | ||
.user(user) | ||
.detail("orgId", i.getOrganization().getId()) |
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.
snake_case
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.
Done
// todo future tell the inviter they rejected | ||
event.clone() | ||
.event(CUSTOM_REQUIRED_ACTION) | ||
.detail("orgId", i.getOrganization().getId()) |
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.
snake_case
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.
Done
event | ||
.event(UPDATE_PROFILE) | ||
.user(user) | ||
.detail("removedActiveOrganizationId", activeOrganizationUtil.getActiveOrganization().getId()) |
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.
snake_case
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.
Done
event | ||
.event(UPDATE_PROFILE) | ||
.user(user) | ||
.detail("newActiveOrganizationId", body.getId()) |
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.
snake_case
No description provided.