Migrating apacheds.properties to apacheds.xml.
Starting from 0.9.4 Penrose uses XML configuration for ApacheDS. If you have made any modification to the apacheds.properties, make sure you migrate the changes to apacheds.xml. See the following "example" partition:
<bean id="examplePartitionConfiguration" class="org.apache.ldap.server.configuration.MutableContextPartitionConfiguration"> <property name="name"><value>example</value></property> <property name="suffix"><value>dc=example,dc=com</value></property> <property name="contextPartition"> <bean class="org.safehaus.penrose.apacheds.PenrosePartition"> <property name="penrose"> <ref bean="penrose"/> </property> </bean> </property> <property name="indexedAttributes"> <set> <value>objectClass</value> <value>ou</value> <value>uid</value> </set> </property> <property name="contextEntry"> <value> objectClass: top objectClass: domain objectClass: extensibleObject dc: example </value> </property> </bean>
The "example" partition needs to be added to the ApacheDS' configuration:
<bean id="configuration" class="org.apache.ldap.server.configuration.MutableServerStartupConfiguration"> <property name="workingDirectory"><value>var/data</value></property> <property name="allowAnonymousAccess"><value>true</value></property> <property name="ldapPort"><value>10389</value></property> <property name="authenticatorConfigurations"> <set> <ref bean="penroseAuthenticatorConfiguration"/> </set> </property> <property name="contextPartitionConfigurations"> <set> <ref bean="examplePartitionConfiguration"/> </set> </property> ... </bean>
Migrating sources.xml
The each source definition in sources.xml need to be moved inside the connection that it uses. Also remove the <connection-name>...</connection-name> element from the source definition.
<connection name="MySQL"> <adapter-name>JDBC</adapter-name> <parameter> <param-name>driver</param-name> <param-value>com.mysql.jdbc.Driver</param-value> </parameter> <parameter> <param-name>url</param-name> <param-value>jdbc:mysql://localhost/penrose_demo?autoReconnect=true</param-value> </parameter> <parameter> <param-name>user</param-name> <param-value>penrose</param-value> </parameter> <parameter> <param-name>password</param-name> <param-value>penrose</param-value> </parameter> <source name="users"> <field name="username" primaryKey="true" /> <field name="firstName" /> <field name="lastName" /> <field name="password" /> <parameter> <param-name>tableName</param-name> <param-value>users</param-value> </parameter> </source> </connection>
Migrating mapping.xml
Penrose now supports ACL. By default the directory is protected. Add the following ACI at the root entry to allow anybody to read and search the directory:
<entry dn="dc=example,dc=com">
...
<aci>
<permission>rs</permission>
</aci>
</entry>
You need to add the connection name in the entry's source definitions. See the following:
<entry dn="uid=...,ou=users,dc=example,dc=com"> ... <source name="u"> <source-name>users</source-name> <connection-name>MySQL</connection-name> ... </source> </entry>
Removing old library files
Remove the following files from the lib directory:
- penrose-0.9.3.jar
- apacheds-main-0.9-SNAPSHOT.jar
- commons-collections-3.1.jar
- log4j-1.2.8.jar
- ldap-common-0.8.jar