streamWriter.writeCharacters("\n "); streamWriter.writeStartElement("attribute"); streamWriter.writeAttribute("name", entry.getKey()); streamWriter.writeAttribute("value", value); streamWriter.writeEndElement();
if (value != null) { if (attributes.containsKey(attributeMapper.getName())) { attributes.get(attributeMapper.getName()).add(value.toString()); } else { attributes.addFirst(attributeMapper.getName(), value.toString());
} else { BasicAttribute attribute = new BasicAttribute(mapping.getLdapName()); attributes.get(mapping.getName()).forEach(attribute::add); modItems.add(new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attribute)); if (identityMapping.attributes.stream().filter(mp -> mp.getName().equals(entry.getKey())).count() == 0) { throw log.ldapRealmCannotSetAttributeWithoutMapping(entry.getKey(), name);
streamWriter.writeCharacters("\n "); streamWriter.writeStartElement("attribute"); streamWriter.writeAttribute("name", entry.getKey()); streamWriter.writeAttribute("value", value); streamWriter.writeEndElement();
streamWriter.writeCharacters("\n "); streamWriter.writeStartElement("attribute"); streamWriter.writeAttribute("name", entry.getKey()); streamWriter.writeAttribute("value", value); streamWriter.writeEndElement();
streamWriter.writeCharacters("\n "); streamWriter.writeStartElement("attribute"); streamWriter.writeAttribute("name", entry.getKey()); streamWriter.writeAttribute("value", value); streamWriter.writeEndElement();
} else { BasicAttribute attribute = new BasicAttribute(mapping.getLdapName()); attributes.get(mapping.getName()).forEach(attribute::add); modItems.add(new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attribute)); if (identityMapping.attributes.stream().filter(mp -> mp.getName().equals(entry.getKey())).count() == 0) { throw log.ldapRealmCannotSetAttributeWithoutMapping(entry.getKey(), name);
} else { BasicAttribute attribute = new BasicAttribute(mapping.getLdapName()); attributes.get(mapping.getName()).forEach(attribute::add); modItems.add(new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attribute)); if (identityMapping.attributes.stream().filter(mp -> mp.getName().equals(entry.getKey())).count() == 0) { throw log.ldapRealmCannotSetAttributeWithoutMapping(entry.getKey(), name);
} else { BasicAttribute attribute = new BasicAttribute(mapping.getLdapName()); attributes.get(mapping.getName()).forEach(attribute::add); modItems.add(new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attribute)); if (identityMapping.attributes.stream().filter(mp -> mp.getName().equals(entry.getKey())).count() == 0) { throw log.ldapRealmCannotSetAttributeWithoutMapping(entry.getKey(), name);
if (value != null) { if (attributes.containsKey(attributeMapper.getName())) { attributes.get(attributeMapper.getName()).add(value.toString()); } else { attributes.addFirst(attributeMapper.getName(), value.toString());
if (value != null) { if (attributes.containsKey(attributeMapper.getName())) { attributes.get(attributeMapper.getName()).add(value.toString()); } else { attributes.addFirst(attributeMapper.getName(), value.toString());
if (value != null) { if (attributes.containsKey(attributeMapper.getName())) { attributes.get(attributeMapper.getName()).add(value.toString()); } else { attributes.addFirst(attributeMapper.getName(), value.toString());
ModelNode attributesModel = result.get(ATTRIBUTES); for (Attributes.Entry e : attributes.entries()) { ModelNode entry = attributesModel.get(e.getKey()); for (String s : e) { entry.add(s);
ModelNode attributesModel = result.get(ATTRIBUTES); for (Attributes.Entry e : attributes.entries()) { ModelNode entry = attributesModel.get(e.getKey()); for (String s : e) { entry.add(s);
ModelNode entryNode = attributesNode.get(entry.getKey()).setEmptyList(); for (String s : entry) { entryNode.add(s);
attributes.keySet().forEach(key -> { org.wildfly.security.authz.Attributes.Entry values = attributes.get(key); values.forEach(value -> log.debugf(" Attribute [%s] value [%s].", key, value)); });
attributes.keySet().forEach(key -> { org.wildfly.security.authz.Attributes.Entry values = attributes.get(key); values.forEach(value -> log.debugf(" Attribute [%s] value [%s].", key, value)); });
attributes.keySet().forEach(key -> { org.wildfly.security.authz.Attributes.Entry values = attributes.get(key); values.forEach(value -> log.debugf(" Attribute [%s] value [%s].", key, value)); });
@Override protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { String principalName = IDENTITY.resolveModelAttribute(context, operation).asString(); ModifiableRealmIdentity realmIdentity = getRealmIdentity(context, principalName); try { AuthorizationIdentity identity = realmIdentity.getAuthorizationIdentity(); ModelNode result = context.getResult(); result.get(ElytronDescriptionConstants.NAME).set(principalName); ModelNode attributesNode = result.get(ElytronDescriptionConstants.ATTRIBUTES); for (Attributes.Entry entry : identity.getAttributes().entries()) { ModelNode entryNode = attributesNode.get(entry.getKey()).setEmptyList(); for (String s : entry) { entryNode.add(s); } } } catch (RealmUnavailableException e) { throw ROOT_LOGGER.couldNotReadIdentity(principalName, e); } } }
/** * Construct a new instance copying mappings from an original attributes collection. * * @param original the original collection */ public MapAttributes(Attributes original) { Assert.checkNotNullParam("original", original); Map<String, EntriesList> map = new HashMap<>(original.size()); for (Entry entry : original.entries()) { final EntriesList entriesList = new EntriesList(entry); if (! entriesList.isEmpty()) map.put(entry.getKey(), entriesList); } this.map = map; }