if (conf.getUserConf() != null) { if (conf.getUserConf().getName() != null) { for (Map.Entry<String, String> entry : conf.getUserConf().getName().asMap().entrySet()) { if (schemaEquals(Resource.User, "name." + entry.getKey(), schema)) { attributeCond = new AttributeCond(); for (Map.Entry<String, String> entry : conf.getUserConf().asMap().entrySet()) { if (schemaEquals(Resource.User, entry.getKey(), schema)) { attributeCond = new AttributeCond(); for (SCIMUserAddressConf address : conf.getUserConf().getAddresses()) { for (Map.Entry<String, String> entry : address.asMap().entrySet()) { if (schemaEquals(Resource.User, "addresses." + entry.getKey(), schema)) { if (conf.getEnterpriseUserConf() != null) { for (Map.Entry<String, String> entry : conf.getEnterpriseUserConf().asMap().entrySet()) { if (schemaEquals(Resource.EnterpriseUser, entry.getKey(), schema)) { attributeCond = new AttributeCond(); if (conf.getEnterpriseUserConf().getManager() != null && conf.getEnterpriseUserConf().getManager().getKey() != null) { attributeCond.setSchema(conf.getEnterpriseUserConf().getManager().getKey());
@PreAuthorize("hasRole('" + SCIMEntitlement.SCIM_CONF_SET + "')") public void set(final SCIMConf conf) { try { schemaLogic.read(SchemaType.PLAIN, SCIMConf.KEY); } catch (NotFoundException e) { PlainSchemaTO scimConf = new PlainSchemaTO(); scimConf.setKey(SCIMConf.KEY); scimConf.setType(AttrSchemaType.Binary); scimConf.setMimeType(MediaType.APPLICATION_JSON); schemaLogic.create(SchemaType.PLAIN, scimConf); } conf.setGeneralConf(new SCIMGeneralConf()); conf.getGeneralConf().setLastChangeDate(new Date()); configurationLogic.set(new AttrTO.Builder(). schema(SCIMConf.KEY). value(Base64.getEncoder().encodeToString(POJOHelper.serialize(conf).getBytes())). build()); } }
@PreAuthorize("hasRole('" + SCIMEntitlement.SCIM_CONF_GET + "')") public SCIMConf get() { AttrTO confTO = null; try { confTO = configurationLogic.get(SCIMConf.KEY); } catch (Exception e) { LOG.error("{} not found, reverting to default", SCIMConf.KEY); } SCIMConf conf = null; if (confTO != null) { try { conf = POJOHelper.deserialize( new String(Base64.getDecoder().decode(confTO.getValues().get(0))), SCIMConf.class); } catch (Exception e) { LOG.error("Could not deserialize, reverting to default", e); } } if (conf == null) { conf = new SCIMConf(); set(conf); } return conf; }
super(id, scimConf); if (scimConf.getEnterpriseUserConf() == null) { scimConf.setEnterpriseUserConf(new SCIMEnterpriseUserConf()); if (scimConf.getEnterpriseUserConf().getManager() == null) { scimConf.getEnterpriseUserConf().setManager(new SCIMManagerConf()); scimEnterpriseUserConf = scimConf.getEnterpriseUserConf();
if (conf.getUserConf() == null) { throw new IllegalArgumentException("No " + SCIMUserConf.class.getName() + " provided, cannot continue"); result = complex(operator, left, right, conf.getUserConf().getEmails()); break; result = complex(operator, left, right, conf.getUserConf().getPhoneNumbers()); break; result = complex(operator, left, right, conf.getUserConf().getIms()); break; result = complex(operator, left, right, conf.getUserConf().getPhotos()); break; result = addresses(operator, left, right, conf.getUserConf().getAddresses()); break;
public SCIMConfUserPanel(final String id, final SCIMConf scimConf) { super(id, scimConf); if (scimConf.getUserConf() == null) { scimConf.setUserConf(new SCIMUserConf()); if (scimConf.getUserConf().getName() == null) { scimConf.getUserConf().setName(new SCIMUserNameConf()); scimUserConf = scimConf.getUserConf();
new Meta( Resource.ServiceProviderConfig, conf.getGeneralConf().getCreationDate(), conf.getGeneralConf().getLastChangeDate(), conf.getGeneralConf().getETagValue(), uriBuilder.build().toASCIIString()), new ConfigurationOption(false), new BulkConfigurationOption(false, conf.getGeneralConf().getBulkMaxOperations(), conf.getGeneralConf().getBulkMaxPayloadSize()), new FilterConfigurationOption(true, conf.getGeneralConf().getFilterMaxResults()), new ConfigurationOption(true), new ConfigurationOption(true),
private <E extends Enum<?>> SearchCond complex( final String operator, final String left, final String right, final List<SCIMComplexConf<E>> items) { if (left.endsWith(".type")) { Optional<SCIMComplexConf<E>> item = items.stream(). filter(object -> object.getType().name().equals(StringUtils.strip(right, "\""))).findFirst(); if (item.isPresent()) { AttributeCond attributeCond = new AttributeCond(); attributeCond.setSchema(item.get().getValue()); attributeCond.setType(AttributeCond.Type.ISNOTNULL); return SearchCond.getLeafCond(attributeCond); } } else if (!conf.getUserConf().getEmails().isEmpty() && (MULTIVALUE.contains(left) || left.endsWith(".value"))) { List<SearchCond> orConds = new ArrayList<>(); items.forEach(item -> { AttributeCond cond = new AttributeCond(); cond.setSchema(item.getValue()); cond.setExpression(StringUtils.strip(right, "\"")); orConds.add(setOperator(cond, operator)); }); if (!orConds.isEmpty()) { return SearchCond.getOrCond(orConds); } } return null; }
super(id, scimConf); final SCIMGeneralConf scimGeneralConf = scimConf.getGeneralConf();
if (conf.getEnterpriseUserConf() != null) { schemas.add(Resource.EnterpriseUser.schema()); if (conf.getUserConf() != null) { if (output(attributes, excludedAttributes, "name") && conf.getUserConf().getName() != null) { SCIMUserName name = new SCIMUserName(); if (conf.getUserConf().getName().getFamilyName() != null && attrs.containsKey(conf.getUserConf().getName().getFamilyName())) { name.setFamilyName(attrs.get(conf.getUserConf().getName().getFamilyName()).getValues().get(0)); if (conf.getUserConf().getName().getFormatted() != null && attrs.containsKey(conf.getUserConf().getName().getFormatted())) { name.setFormatted(attrs.get(conf.getUserConf().getName().getFormatted()).getValues().get(0)); if (conf.getUserConf().getName().getGivenName() != null && attrs.containsKey(conf.getUserConf().getName().getGivenName())) { name.setGivenName(attrs.get(conf.getUserConf().getName().getGivenName()).getValues().get(0)); if (conf.getUserConf().getName().getHonorificPrefix() != null && attrs.containsKey(conf.getUserConf().getName().getHonorificPrefix())) { attrs.get(conf.getUserConf().getName().getHonorificPrefix()).getValues().get(0)); if (conf.getUserConf().getName().getHonorificSuffix() != null && attrs.containsKey(conf.getUserConf().getName().getHonorificSuffix())) {
private SearchCond addresses( final String operator, final String left, final String right, final List<SCIMUserAddressConf> items) { if (left.endsWith(".type") && "eq".equals(operator)) { Optional<SCIMUserAddressConf> item = items.stream(). filter(object -> object.getType().name().equals(StringUtils.strip(right, "\""))).findFirst(); if (item.isPresent()) { AttributeCond attributeCond = new AttributeCond(); attributeCond.setSchema(item.get().getFormatted()); attributeCond.setType(AttributeCond.Type.ISNOTNULL); return SearchCond.getLeafCond(attributeCond); } } else if (!conf.getUserConf().getEmails().isEmpty() && (MULTIVALUE.contains(left) || left.endsWith(".value"))) { List<SearchCond> orConds = new ArrayList<>(); items.forEach(item -> { AttributeCond cond = new AttributeCond(); cond.setSchema(item.getFormatted()); cond.setExpression(StringUtils.strip(right, "\"")); orConds.add(setOperator(cond, operator)); }); if (!orConds.isEmpty()) { return SearchCond.getOrCond(orConds); } } return null; }
if (conf.getUserConf() != null) { if (conf.getUserConf().getName() != null && user.getName() != null) { if (conf.getUserConf().getName().getFamilyName() != null && user.getName().getFamilyName() != null) { setAttribute(userTO, conf.getUserConf().getName().getFamilyName(), user.getName().getFamilyName()); if (conf.getUserConf().getName().getFormatted() != null && user.getName().getFormatted() != null) { setAttribute(userTO, conf.getUserConf().getName().getFormatted(), user.getName().getFormatted()); if (conf.getUserConf().getName().getGivenName() != null && user.getName().getGivenName() != null) { setAttribute(userTO, conf.getUserConf().getName().getGivenName(), user.getName().getGivenName()); if (conf.getUserConf().getName().getHonorificPrefix() != null && user.getName().getHonorificPrefix() != null) { setAttribute(userTO, conf.getUserConf().getName().getHonorificPrefix(), user.getName().getHonorificPrefix()); if (conf.getUserConf().getName().getHonorificSuffix() != null && user.getName().getHonorificSuffix() != null) {