@Transactional @Override public void before(final PropagationTask task, final ConnectorObject beforeObj) { if (task.getOperation() == ResourceOperation.DELETE || task.getOperation() == ResourceOperation.NONE) { return; } switch (task.getAnyTypeKind()) { case USER: setName(task); break; case GROUP: setName(task); break; default: LOG.debug("Not about user or group: not doing anything"); } }
@Transactional @Override public void before(final PropagationTask task, final ConnectorObject beforeObj) { if (task.getOperation() == ResourceOperation.DELETE || task.getOperation() == ResourceOperation.NONE) { return; } if (AnyTypeKind.USER != task.getAnyTypeKind()) { return; } Set<Attribute> attrs = new HashSet<>(task.getAttributes()); if (AttributeUtil.find(getEmailAttrName(), attrs) == null) { LOG.warn("Can't find {} attribute to set as __NAME__ attribute value, skipping...", getEmailAttrName()); return; } Name name = AttributeUtil.getNameFromAttributes(attrs); if (name != null) { attrs.remove(name); } attrs.add(new Name(AttributeUtil.find(getEmailAttrName(), attrs).getValue().get(0).toString())); task.setAttributes(attrs); } }
@Transactional(readOnly = true) @Override public void before(final PropagationTask task, final ConnectorObject beforeObj) { if (AnyTypeKind.USER == task.getAnyTypeKind()) { User user = userDAO.find(task.getEntityKey()); if (user != null && user.getPassword() != null) { Attribute missing = AttributeUtil.find( PropagationTaskExecutor.MANDATORY_MISSING_ATTR_NAME, task.getAttributes()); ConnInstance connInstance = task.getResource().getConnector(); String cipherAlgorithm = getCipherAlgorithm(connInstance); if (missing != null && missing.getValue() != null && missing.getValue().size() == 1 && missing.getValue().get(0).equals(OperationalAttributes.PASSWORD_NAME) && cipherAlgorithmMatches(getCipherAlgorithm(connInstance), user.getCipherAlgorithm())) { String password = user.getPassword().toLowerCase(); byte[] decodedPassword = DatatypeConverter.parseHexBinary(password); String base64EncodedPassword = Base64.getEncoder().encodeToString(decodedPassword); String cipherPlusPassword = ("{" + cipherAlgorithm.toLowerCase() + "}" + base64EncodedPassword); Attribute passwordAttribute = AttributeBuilder.buildPassword( new GuardedString(cipherPlusPassword.toCharArray())); Set<Attribute> attributes = new HashSet<>(task.getAttributes()); attributes.add(passwordAttribute); attributes.remove(missing); task.setAttributes(attributes); } } } }
public void before(final PropagationTask task, final ConnectorObject beforeObj) { Optional<? extends Provision> provision = task.getResource().getProvision(anyTypeDAO.findGroup()); if (AnyTypeKind.USER == task.getAnyTypeKind() && provision.isPresent() && provision.get().getMapping() != null && StringUtils.isNotBlank(provision.get().getMapping().getConnObjectLink())) {
anyUtilsFactory.getInstance(task.getAnyTypeKind()). addAttr(task.getEntityKey(), provision.getUidOnCreate(), result.getUidValue());
@Transactional(readOnly = true) @Override public void before(final PropagationTask task, final ConnectorObject beforeObj) { if (AnyTypeKind.USER == task.getAnyTypeKind()) { User user = userDAO.find(task.getEntityKey()); if (user != null && user.getPassword() != null) { Attribute missing = AttributeUtil.find( PropagationTaskExecutor.MANDATORY_MISSING_ATTR_NAME, task.getAttributes()); ConnInstance connInstance = task.getResource().getConnector(); if (missing != null && missing.getValue() != null && missing.getValue().size() == 1 && missing.getValue().get(0).equals(OperationalAttributes.PASSWORD_NAME) && cipherAlgorithmMatches(getCipherAlgorithm(connInstance), user.getCipherAlgorithm())) { Attribute passwordAttribute = AttributeBuilder.buildPassword( new GuardedString(user.getPassword().toCharArray())); Set<Attribute> attributes = new HashSet<>(task.getAttributes()); attributes.add(passwordAttribute); attributes.remove(missing); Attribute hashedPasswordAttribute = AttributeBuilder.build( AttributeUtil.createSpecialName("HASHED_PASSWORD"), Boolean.TRUE); attributes.add(hashedPasswordAttribute); task.setAttributes(attributes); } } } }
if (task.getEntityKey() != null && task.getAnyTypeKind() != null) { switch (task.getAnyTypeKind()) { case USER: try { if (task.getAnyTypeKind() == null || !resources.contains(task.getResource().getKey())) { LOG.debug("Delete {} on {}", beforeObj.getUid(), task.getResource().getKey());
String anyTypeKind = task.getAnyTypeKind() == null ? "realm" : task.getAnyTypeKind().name().toLowerCase(); String operation = task.getOperation().name().toLowerCase(); boolean notificationsAvailable = notificationManager.notificationsAvailable(
propagationTaskTO.setResource(propagationTask.getResource().getKey()); propagationTaskTO.setObjectClassName(propagationTask.getObjectClassName()); propagationTaskTO.setAnyTypeKind(propagationTask.getAnyTypeKind()); propagationTaskTO.setAnyType(propagationTask.getAnyType()); propagationTaskTO.setEntityKey(propagationTask.getEntityKey());