Skip to content

Commit

Permalink
fix:typos (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasztur authored Jan 30, 2023
1 parent 0ac21bb commit 5454b4d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public String getUserName() {
}

public void setUserName(String userName) {
return userName;
this.userName = userName;
}

public String getToken() {
Expand All @@ -55,18 +55,17 @@ public boolean equals(Object o) {
LegacyFederatedIdentity legacyFederatedIdentity = (LegacyFederatedIdentity) o;

return Objects.equals(identityProvider, legacyFederatedIdentity.identityProvider)
&& Objects.equals(userId, legacyFederatedIdentity.userId)
&& Objects.equals(userName, legacyFederatedIdentity.userName)
&& Objects.equals(token, legacyFederatedIdentity.token)
&& Objects.equals(userId, legacyFederatedIdentity.userId)
&& Objects.equals(userName, legacyFederatedIdentity.userName)
&& Objects.equals(token, legacyFederatedIdentity.token);
}

@Override
public int hashCode() {
return Objects.hash(
identityProvider,
userId,
userName,
token
);
identityProvider,
userId,
userName,
token);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public boolean equals(Object o) {
Objects.equals(attributes, legacyUser.attributes) &&
Objects.equals(roles, legacyUser.roles) &&
Objects.equals(groups, legacyUser.groups) &&
Objects.equals(requiredActions, legacyUser.requiredActions)
Objects.equals(requiredActions, legacyUser.requiredActions) &&
Objects.equals(federatedIdentities, legacyUser.federatedIdentities);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public UserModel create(LegacyUser legacyUser, RealmModel realm) {
legacyUser.getId(),
legacyUser.getUsername(),
true,
false
);
false);
}

validateUsernamesEqual(legacyUser, userModel);
Expand All @@ -91,12 +90,12 @@ public UserModel create(LegacyUser legacyUser, RealmModel realm) {

if (legacyUser.getRequiredActions() != null) {
legacyUser.getRequiredActions()
.forEach(userModel::addRequiredAction);
.forEach(userModel::addRequiredAction);
}

if (legacyUser.getFederatedIdentities() != null) {
legacyUser.getFederatedIdentities()
.forEach(fi -> userProvider.addFederatedIdentity(realm, userModel, mapFederatedIdentity(fi)))
.forEach(fi -> userProvider.addFederatedIdentity(realm, userModel, mapFederatedIdentity(fi)));
}

return userModel;
Expand All @@ -122,8 +121,8 @@ private Stream<RoleModel> getRoleModels(LegacyUser legacyUser, RealmModel realm)

/**
* @return A {@link RoleModel} for this role in the realm.
* Created if not found in the realm or in any of the realm's clients.
* Migrated only if present in the map or config enables this.
* Created if not found in the realm or in any of the realm's clients.
* Migrated only if present in the map or config enables this.
* @see ConfigurationProperties#MIGRATE_UNMAPPED_ROLES_PROPERTY
*/
private Optional<RoleModel> getRoleModel(RealmModel realm, String role) {
Expand Down Expand Up @@ -196,10 +195,9 @@ private Optional<GroupModel> getGroupModel(RealmModel realm, String groupName) {

private FederatedIdentityModel mapFederatedIdentity(LegacyFederatedIdentity legacyFederatedIdentity) {
return new FederatedIdentityModel(
legacyFederatedIdentity.getIdentityProvider(),
legacyFederatedIdentity.getUserId(),
legacyFederatedIdentity.getUserName(),
legacyFederatedIdentity.getToken(),
);
legacyFederatedIdentity.getIdentityProvider(),
legacyFederatedIdentity.getUserId(),
legacyFederatedIdentity.getUserName(),
legacyFederatedIdentity.getToken());
}
}

0 comments on commit 5454b4d

Please sign in to comment.