@Override public String unlink(final UserPatch userPatch) { WorkflowResult<Pair<UserPatch, Boolean>> updated = uwfAdapter.update(userPatch); return updated.getResult().getLeft().getKey(); }
@Override public String link(final UserPatch userPatch) { return uwfAdapter.update(userPatch).getResult().getLeft().getKey(); }
@Override public String unlink(final UserPatch userPatch) { PollingConsumer pollingConsumer = getConsumer("direct:unlinkPort"); sendMessage("direct:unlinkUser", userPatch); Exchange exchange = pollingConsumer.receive(); if (exchange.getProperty(Exchange.EXCEPTION_CAUGHT) != null) { throw (RuntimeException) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); } return exchange.getIn().getBody(UserPatch.class).getKey(); }
@Override public String link(final UserPatch anyPatch) { PollingConsumer pollingConsumer = getConsumer("direct:linkPort"); sendMessage("direct:linkUser", anyPatch); Exchange exchange = pollingConsumer.receive(); if (exchange.getProperty(Exchange.EXCEPTION_CAUGHT) != null) { throw (RuntimeException) exchange.getProperty(Exchange.EXCEPTION_CAUGHT); } return exchange.getIn().getBody(UserPatch.class).getKey(); }
props.put("key", userPatch.getKey()); props.put("result", result); props.put("enabled", enabled);
protected ProvisioningResult<UserTO> doUpdate( final UserPatch userPatch, final boolean self, final boolean nullPriorityAsync) { UserTO userTO = binder.getUserTO(userPatch.getKey()); Set<String> dynRealmsBefore = new HashSet<>(userTO.getDynRealms()); Pair<UserPatch, List<LogicActions>> before = beforeUpdate(userPatch, userTO.getRealm()); boolean authDynRealms = false; if (!self && before.getLeft().getRealm() != null && StringUtils.isNotBlank(before.getLeft().getRealm().getValue())) { Set<String> effectiveRealms = RealmUtils.getEffective( AuthContextUtils.getAuthorizations().get(StandardEntitlement.USER_UPDATE), before.getLeft().getRealm().getValue()); authDynRealms = securityChecks(effectiveRealms, before.getLeft().getRealm().getValue(), before.getLeft().getKey()); } Pair<UserPatch, List<PropagationStatus>> updated = provisioningManager.update(before.getLeft(), nullPriorityAsync); return afterUpdate( binder.returnUserTO(binder.getUserTO(updated.getLeft().getKey())), updated.getRight(), before.getRight(), authDynRealms, dynRealmsBefore); }
key = ((UserTO) args[i]).getKey(); } else if (args[i] instanceof UserPatch) { key = ((UserPatch) args[i]).getKey(); } else if (args[i] instanceof StatusPatch) { key = ((StatusPatch) args[i]).getKey();
@Override public List<PropagationTaskInfo> getUserUpdateTasks( final WorkflowResult<Pair<UserPatch, Boolean>> wfResult, final boolean changePwd, final Collection<String> noPropResourceKeys) { return getUpdateTasks( userDAO.authFind(wfResult.getResult().getLeft().getKey()), wfResult.getResult().getKey().getPassword() == null ? null : wfResult.getResult().getKey().getPassword().getValue(), changePwd, wfResult.getResult().getValue(), wfResult.getPropByRes(), wfResult.getResult().getKey().getVirAttrs(), noPropResourceKeys); }
filter(patch -> user.equals(patch.getKey())).findFirst(). orElseGet(() -> { UserPatch patch = new UserPatch();
} catch (Exception e) { LOG.error("Update of user {} failed, trying to pull its status anyway (if configured)", userPatch.getKey(), e); User user = userDAO.find(userPatch.getKey()); enableUpdate = uwfAdapter.activate(userPatch.getKey(), null); } else if (enabled && user.isSuspended()) { enableUpdate = uwfAdapter.reactivate(userPatch.getKey()); } else if (!enabled && !user.isSuspended()) { enableUpdate = uwfAdapter.suspend(userPatch.getKey());
@Transactional(propagation = Propagation.REQUIRES_NEW) public String update(final String username, final OIDCProvider op, final OIDCLoginResponseTO responseTO) { UserTO userTO = binder.getUserTO(userDAO.findKey(username)); UserTO original = SerializationUtils.clone(userTO); fill(op, responseTO, userTO); UserPatch userPatch = AnyOperations.diff(userTO, original, true); List<OIDCProviderActions> actions = getActions(op); for (OIDCProviderActions action : actions) { userPatch = action.beforeUpdate(userPatch, responseTO); } Pair<UserPatch, List<PropagationStatus>> updated = provisioningManager.update(userPatch, false); userTO = binder.getUserTO(updated.getLeft().getKey()); for (OIDCProviderActions action : actions) { userTO = action.afterUpdate(userTO, responseTO); } return userTO.getUsername(); } }
@Transactional(propagation = Propagation.REQUIRES_NEW) public String update(final String username, final SAML2IdPEntity idp, final SAML2LoginResponseTO responseTO) { UserTO userTO = binder.getUserTO(userDAO.findKey(username)); UserTO original = SerializationUtils.clone(userTO); fill(idp.getKey(), responseTO, userTO); UserPatch userPatch = AnyOperations.diff(userTO, original, true); List<SAML2IdPActions> actions = getActions(idp); for (SAML2IdPActions action : actions) { userPatch = action.beforeUpdate(userPatch, responseTO); } Pair<UserPatch, List<PropagationStatus>> updated = provisioningManager.update(userPatch, false); userTO = binder.getUserTO(updated.getLeft().getKey()); for (SAML2IdPActions action : actions) { userTO = action.afterUpdate(userTO, responseTO); } return userTO.getUsername(); } }
Collection<String> allResourceNames = userDAO.findAllResourceKeys(userPatch.getKey()); pwdResourceNames.retainAll(allResourceNames);