Skip to content

Commit

Permalink
Rename scenarios and event name
Browse files Browse the repository at this point in the history
  • Loading branch information
AnjanaSamindraPerera committed Mar 13, 2024
1 parent 52828fc commit 977ec0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ public User updateUser(User user, Map<String, Boolean> requiredAttributes) throw
// If password is updated, set it separately.
if (user.getPassword() != null) {
carbonUM.updateCredentialByAdminWithID(user.getId(), user.getPassword());
publishEvent(user, IdentityEventConstants.Event.POST_UPDATE_CREDENTIAL_BY_SCIM, false);
publishEvent(user, IdentityEventConstants.Event.POST_UPDATE_CREDENTIAL, false);
}

updateUserClaims(user, oldClaimList, claimValuesInLocalDialect);
Expand Down Expand Up @@ -1303,7 +1303,7 @@ public User updateUser(User user, Map<String, Boolean> requiredAttributes,
// If password is updated, set it separately.
if (user.getPassword() != null) {
carbonUM.updateCredentialByAdminWithID(user.getId(), user.getPassword());
publishEvent(user, IdentityEventConstants.Event.POST_UPDATE_CREDENTIAL_BY_SCIM, true);
publishEvent(user, IdentityEventConstants.Event.POST_UPDATE_CREDENTIAL, true);
}

updateUserClaims(user, oldClaimList, claimValuesInLocalDialect, allSimpleMultiValuedClaimsList);
Expand Down Expand Up @@ -6301,10 +6301,10 @@ private void publishEvent(User user, String eventName, boolean isAdminUpdate)
properties.put(IdentityEventConstants.EventProperty.CREDENTIAL, user.getPassword());
if (isAdminUpdate) {
properties.put(IdentityEventConstants.EventProperty.SCENARIO,
Scenarios.CREDENTIAL_UPDATE_BY_ADMIN_VIA_CONSOLE.name());
Scenarios.ADMIN_UPDATED.name());
} else {
properties.put(IdentityEventConstants.EventProperty.SCENARIO,
Scenarios.CREDENTIAL_UPDATE_BY_USER_VIA_MY_ACCOUNT.name());
Scenarios.SELF_UPDATED.name());
}

Event identityMgtEvent = new Event(eventName, properties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
*/
public enum Scenarios {

CREDENTIAL_UPDATE_BY_ADMIN_VIA_CONSOLE,
CREDENTIAL_UPDATE_BY_USER_VIA_MY_ACCOUNT;
ADMIN_UPDATED,
SELF_UPDATED;

/**
* Get scenario which matches the given scenario name.
Expand All @@ -39,7 +39,7 @@ public enum Scenarios {
public static Scenarios getScenario(String scenarioName) throws IdentitySCIMException {

Scenarios[] scenarios = {
CREDENTIAL_UPDATE_BY_ADMIN_VIA_CONSOLE, CREDENTIAL_UPDATE_BY_USER_VIA_MY_ACCOUNT
ADMIN_UPDATED, SELF_UPDATED
};
if (StringUtils.isNotEmpty(scenarioName)) {
for (Scenarios scenario : scenarios) {
Expand Down

0 comments on commit 977ec0c

Please sign in to comment.