Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 2 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 03, 2012
@henrik242 henrik242 Base64 encode values in ExtensibleAttribute.
Exotic values (such as binary content) from LDAP or AD would make Mule fail miserably.
Base64 encoding values internally in ExtensibleAttribute fixes this.
58081d9
@henrik242 henrik242 Remove duplicate ExtensibleAttribute 1f0f2b8
View
4 idm/idm-connector-core/src/main/java/org/openiam/spml2/spi/ldap/LdapLookupCommand.java
@@ -93,10 +93,6 @@ public LookupResponseType lookup(LookupRequestType reqType) {
ExtensibleAttribute extAttr = new ExtensibleAttribute();
Attribute attr = (Attribute) ae.next();
- if ("objectguid".equalsIgnoreCase(attr.getID()) || "objectsid".equalsIgnoreCase(attr.getID())) {
- continue;
- }
-
boolean addToList = false;
extAttr.setName(attr.getID());
View
5 idm/openiam-idm-intf/pom.xml
@@ -54,6 +54,11 @@
</exclusions>
</dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.6</version>
+ </dependency>
<dependency>
<groupId>aopalliance</groupId>
View
147 idm/openiam-idm-intf/src/main/java/org/openiam/provision/type/ExtensibleAttribute.java
@@ -16,21 +16,20 @@
* along with OpenIAM. If not, see <http://www.gnu.org/licenses/>. *
*/
-/**
- *
- */
package org.openiam.provision.type;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import java.io.Serializable;
-import java.util.List;
-
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.commons.codec.binary.Base64.decodeBase64;
+import static org.apache.commons.codec.binary.Base64.encodeBase64String;
/**
* The content carried by the most SPML requests includes an Extensible type to all
@@ -38,7 +37,6 @@
* attribute model to capture a wide variety of data.
*
* @author Suneet Shah
- *
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ExtensibleAttribute", propOrder = {
@@ -53,12 +51,10 @@
})
public class ExtensibleAttribute implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = 8402148961330001942L;
- protected String name;
- protected String value;
+
+ private static final long serialVersionUID = 8402148961330001942L;
+ protected String name;
+ protected String value;
protected String metadataElementId;
protected int operation;
protected boolean multivalued = false;
@@ -68,60 +64,67 @@
protected static final Log log = LogFactory.getLog(ExtensibleAttribute.class);
-
- public ExtensibleAttribute() {
-
- }
- public ExtensibleAttribute(String name, String value) {
- this.name = name;
- this.value = value;
- operation = ModificationAttribute.add;
- }
- public ExtensibleAttribute(String name, String value, String metadataElementId) {
- this.name = name;
- this.value = value;
- this.metadataElementId = metadataElementId;
- operation = ModificationAttribute.add;
- }
-
- public ExtensibleAttribute(String name, String value, int operation, String dataType) {
- super();
- this.name = name;
- this.operation = operation;
- this.value = value;
+
+ public ExtensibleAttribute() {
+
+ }
+ public ExtensibleAttribute(String name, String value) {
+ this.name = name;
+ setValue(value);
+ operation = ModificationAttribute.add;
+ }
+ public ExtensibleAttribute(String name, String value, String metadataElementId) {
+ this.name = name;
+ setValue(value);
+ this.metadataElementId = metadataElementId;
+ operation = ModificationAttribute.add;
+ }
+
+ public ExtensibleAttribute(String name, String value, int operation, String dataType) {
+ super();
+ this.name = name;
+ this.operation = operation;
+ setValue(value);
this.dataType = dataType;
- }
+ }
public ExtensibleAttribute(String name, List<String> val, int operation, String dataType) {
- super();
- this.name = name;
- this.operation = operation;
- this.valueList = val;
+ super();
+ this.name = name;
+ this.operation = operation;
+ setValueList(val);
multivalued = true;
this.dataType = dataType;
log.debug("Extensible attribute created: multivalue");
- }
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getValue() {
- return value;
- }
- public void setValue(String value) {
- this.value = value;
- }
- public int getOperation() {
- return operation;
- }
- public void setOperation(int operation) {
- this.operation = operation;
- }
+ }
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getValue() {
+ if (value == null) {
+ return null;
+ }
+ return new String(decodeBase64(value));
+ }
+ public void setValue(String value) {
+ if (value == null) {
+ this.value = null;
+ } else {
+ this.value = encodeBase64String(value.getBytes());
+ }
+ }
+ public int getOperation() {
+ return operation;
+ }
+ public void setOperation(int operation) {
+ this.operation = operation;
+ }
public boolean isMultivalued() {
@@ -133,11 +136,25 @@ public void setMultivalued(boolean multivalued) {
}
public List<String> getValueList() {
- return valueList;
+ if (valueList == null) {
+ return null;
+ }
+ List<String> list = new ArrayList<String>();
+ for (String val : valueList) {
+ list.add(new String(decodeBase64(val)));
+ }
+ return list;
}
- public void setValueList(List<String> valueList) {
- this.valueList = valueList;
+ public void setValueList(List<String> list) {
+ if (list == null) {
+ valueList = null;
+ } else {
+ valueList = new ArrayList<String>();
+ for (String val : list) {
+ valueList.add(encodeBase64String(val.getBytes()));
+ }
+ }
}
public String getDataType() {
@@ -160,11 +177,11 @@ public void setObjectType(String objectType) {
public String toString() {
return "ExtensibleAttribute{" +
"name='" + name + '\'' +
- ", value='" + value + '\'' +
+ ", value='" + getValue() + '\'' +
", metadataElementId='" + metadataElementId + '\'' +
", operation=" + operation +
", multivalued=" + multivalued +
- ", valueList=" + valueList +
+ ", valueList=" + getValueList() +
", dataType='" + dataType + '\'' +
'}';
}
View
143 idm/openiam-idm-intf/src/main/java/org/openiam/spml2/msg/ExtensibleAttribute.java
@@ -1,143 +0,0 @@
-/*
- * Copyright 2009, OpenIAM LLC
- * This file is part of the OpenIAM Identity and Access Management Suite
- *
- * OpenIAM Identity and Access Management Suite is free software:
- * you can redistribute it and/or modify
- * it under the terms of the GNU General Public License
- * version 3 as published by the Free Software Foundation.
- *
- * OpenIAM is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Lesser GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenIAM. If not, see <http://www.gnu.org/licenses/>. *
- */
-
-/**
- *
- */
-package org.openiam.spml2.msg;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlSeeAlso;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.openiam.provision.type.ModificationAttribute;
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * The content carried by the most SPML requests includes an Extensible type to all
- * for flexibility in carrying the data. ExtensibleAttribute provides an
- * attribute model to capture a wide variety of data.
- *
- * @author Suneet Shah
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "ExtensibleAttribute", propOrder = {
- "name",
- "value",
- "operation",
- "multivalued",
- "valueList",
- "dataType"
-})
-@XmlSeeAlso({
- ArrayList.class
-})
-public class ExtensibleAttribute implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = 3737506396547959336L;
- String name;
- String value;
- int operation;
- boolean multivalued = false;
- List<String> valueList;
- DataType dataType;
-
- protected static final Log log = LogFactory.getLog(ExtensibleAttribute.class);
-
- public ExtensibleAttribute() {
-
- }
- public ExtensibleAttribute(String name, String value) {
- this.name = name;
- this.value = value;
- operation = ModificationAttribute.add;
- }
-
- public ExtensibleAttribute(String name, String value, int operation) {
- super();
- this.name = name;
- this.operation = operation;
- this.value = value;
-
- log.debug("Extensible attribute created: singlevalue");
- }
-
- public ExtensibleAttribute(String name, List<String> val, int operation) {
- super();
- this.name = name;
- this.operation = operation;
- this.valueList = val;
- multivalued = true;
-
- log.debug("Extensible attribute created: multivalue");
-
- }
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getValue() {
- return value;
- }
- public void setValue(String value) {
- this.value = value;
- }
- public int getOperation() {
- return operation;
- }
- public void setOperation(int operation) {
- this.operation = operation;
- }
-
-
- public boolean isMultivalued() {
- return multivalued;
- }
-
- public void setMultivalued(boolean multivalued) {
- this.multivalued = multivalued;
- }
-
- public List<String> getValueList() {
- return valueList;
- }
-
- public void setValueList(List<String> valueList) {
- this.valueList = valueList;
- }
-
- public DataType getDataType() {
- return dataType;
- }
-
- public void setDataType(DataType dataType) {
- this.dataType = dataType;
- }
-}
View
4 idm/openiam-idm-intf/src/main/java/org/openiam/spml2/msg/LookupResponseType.java
@@ -1,13 +1,11 @@
package org.openiam.spml2.msg;
-import org.openiam.provision.type.*;
-
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import java.util.List;
-
+import org.openiam.provision.type.ExtensibleAttribute;
/**
* <p>Java class for LookupResponseType complex type.
View
8 idm/openiam-idm-services/src/main/java/org/openiam/provision/service/ModifyUser.java
@@ -36,8 +36,8 @@
import org.openiam.idm.srvc.user.dto.UserAttribute;
import org.openiam.idm.srvc.user.service.UserDataService;
import org.openiam.provision.dto.ProvisionUser;
+import org.openiam.provision.type.ExtensibleAttribute;
import org.openiam.provision.type.ExtensibleUser;
-import org.openiam.spml2.msg.ExtensibleAttribute;
/**
* Helper class for the modifyUser operation in the Provisioning Service.
@@ -1008,7 +1008,7 @@ public ExtensibleUser updateAttributeList(org.openiam.provision.type.ExtensibleU
log.debug("updateAttributeList: Current attributeMap = " + currentValueMap);
- List<org.openiam.provision.type.ExtensibleAttribute> extAttrList = extUser.getAttributes();
+ List<ExtensibleAttribute> extAttrList = extUser.getAttributes();
if (extAttrList == null) {
log.debug("Extended user attributes is null");
@@ -1018,12 +1018,12 @@ public ExtensibleUser updateAttributeList(org.openiam.provision.type.ExtensibleU
log.debug("updateAttributeList: New Attribute List = " + extAttrList);
if ( extAttrList != null && currentValueMap == null) {
- for (org.openiam.provision.type.ExtensibleAttribute attr : extAttrList) {
+ for (ExtensibleAttribute attr : extAttrList) {
attr.setOperation(1);
}
}else {
- for (org.openiam.provision.type.ExtensibleAttribute attr : extAttrList) {
+ for (ExtensibleAttribute attr : extAttrList) {
String nm = attr.getName();
if (currentValueMap == null) {
attr.setOperation(1);
View
77 ...iam-selfservice/src/main/java/org/openiam/selfsrvc/prov/ChangeAccessWizardController.java
@@ -1,69 +1,35 @@
package org.openiam.selfsrvc.prov;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Date;
-import java.util.Map;
-import java.util.Set;
-import java.text.SimpleDateFormat;
-
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.springframework.validation.BindException;
-import org.springframework.validation.Errors;
-import org.springframework.web.bind.ServletRequestDataBinder;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.mvc.AbstractWizardFormController;
-import org.springframework.beans.propertyeditors.CustomDateEditor;
-
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.openiam.idm.srvc.continfo.dto.Address;
-import org.openiam.idm.srvc.continfo.dto.ContactConstants;
-import org.openiam.idm.srvc.continfo.dto.EmailAddress;
-import org.openiam.idm.srvc.continfo.dto.Phone;
-import org.openiam.idm.srvc.user.dto.User;
-import org.openiam.idm.srvc.user.dto.UserAttribute;
-import org.openiam.idm.srvc.user.dto.UserStatusEnum;
-import org.openiam.idm.srvc.user.service.UserDataService;
-import org.openiam.idm.srvc.user.ws.UserDataWebService;
-import org.openiam.idm.srvc.user.dto.Supervisor;
-import org.openiam.idm.srvc.auth.dto.LoginId;
-import org.openiam.idm.srvc.auth.dto.Login;
-import org.openiam.idm.srvc.auth.login.LoginDataService;
import org.openiam.idm.srvc.grp.dto.Group;
-import org.openiam.idm.srvc.grp.service.GroupDataService;
import org.openiam.idm.srvc.grp.ws.GroupDataWebService;
import org.openiam.idm.srvc.org.dto.Organization;
import org.openiam.idm.srvc.org.service.OrganizationDataService;
-import org.openiam.idm.srvc.prov.request.dto.ProvisionRequest;
-import org.openiam.idm.srvc.prov.request.dto.ProvisioningConstants;
-import org.openiam.idm.srvc.prov.request.dto.RequestUser;
-import org.openiam.idm.srvc.prov.request.service.RequestDataService;
import org.openiam.idm.srvc.res.dto.Resource;
import org.openiam.idm.srvc.res.service.ResourceDataService;
import org.openiam.idm.srvc.role.dto.Role;
-import org.openiam.idm.srvc.role.service.RoleDataService;
import org.openiam.idm.srvc.role.ws.RoleDataWebService;
-import org.openiam.idm.srvc.secdomain.dto.SecurityDomain;
-import org.openiam.idm.srvc.loc.dto.Location;
-import org.openiam.idm.srvc.loc.service.LocationDataService;
-import org.openiam.idm.srvc.menu.dto.Menu;
-import org.openiam.idm.srvc.menu.service.NavigatorDataService;
-import org.openiam.idm.srvc.mngsys.service.ConnectorDataService;
-import org.openiam.idm.srvc.msg.service.MailService;
+import org.openiam.idm.srvc.user.dto.User;
+import org.openiam.idm.srvc.user.ws.UserDataWebService;
import org.openiam.provision.service.ProvisionService;
-import org.openiam.provision.type.ExtensibleUser;
import org.openiam.selfsrvc.pswd.PasswordConfiguration;
-import org.openiam.spml2.interf.ConnectorService;
-import org.openiam.spml2.msg.AddRequestType;
-import org.openiam.spml2.msg.ExtensibleAttribute;
-import org.openiam.spml2.msg.PSOIdentifierType;
+import org.springframework.beans.propertyeditors.CustomDateEditor;
+import org.springframework.validation.BindException;
+import org.springframework.validation.Errors;
+import org.springframework.web.bind.ServletRequestDataBinder;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.AbstractWizardFormController;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* Controller for the new hire form.
@@ -285,13 +251,4 @@ public OrganizationDataService getOrgManager() {
public void setOrgManager(OrganizationDataService orgManager) {
this.orgManager = orgManager;
}
-
-
-
-
-
-
-
-
-
}

No commit comments for this range

Something went wrong with that request. Please try again.