opendj3/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java
@@ -318,7 +318,7 @@ } // Parse the authentication configuration. final JsonValue configuration = new JsonValue(content); final JsonValue configuration = new JsonValue(content).recordKeyAccesses(); final JsonValue authnConfig = configuration.get("authenticationFilter"); if (!authnConfig.isNull()) { supportHTTPBasicAuthentication = @@ -373,6 +373,9 @@ bindLDAPConnectionFactory = Rest2LDAP.configureConnectionFactory(configuration.get( "ldapConnectionFactories").required(), ldapFactoryName); // we are now done reading the config, configuration.verifyAllKeysAccessed(); // Set the completion handler factory based on the Servlet API version. syncFactory = ServletApiVersionAdapter.getInstance(config.getServletContext()); opendj3/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPConnectionFactoryProvider.java
@@ -15,8 +15,8 @@ */ package org.forgerock.opendj.rest2ldap.servlet; import static org.forgerock.json.resource.Resources.newInternalConnectionFactory; import static org.forgerock.opendj.rest2ldap.Rest2LDAP.configureConnectionFactory; import static org.forgerock.json.resource.Resources.*; import static org.forgerock.opendj.rest2ldap.Rest2LDAP.*; import java.io.InputStream; import java.util.Map; @@ -38,6 +38,8 @@ import org.forgerock.opendj.rest2ldap.Rest2LDAP; import org.forgerock.opendj.rest2ldap.Rest2LDAP.Builder; import com.forgerock.opendj.util.StaticUtils; /** * The connection factory provider which is used by the OpenDJ Commons REST LDAP * Gateway. @@ -81,7 +83,7 @@ throw new ServletException("Servlet configuration file '" + configFileName + "' does not contain a valid JSON configuration"); } final JsonValue configuration = new JsonValue(content); final JsonValue configuration = new JsonValue(content).recordKeyAccesses(); // Parse the authorization configuration. final AuthorizationPolicy authzPolicy = @@ -113,6 +115,10 @@ .configureMapping(mapping).build(); router.addRoute(mappingUrl, provider); } // we are now done reading the config, configuration.verifyAllKeysAccessed(); final ConnectionFactory factory = newInternalConnectionFactory(router); if (ldapFactory != null) { /* @@ -147,11 +153,7 @@ throw new ServletException("Servlet configuration file '" + configFileName + "' could not be read: " + e.getMessage()); } finally { try { configFile.close(); } catch (final Exception e) { // Ignore. } StaticUtils.closeSilently(configFile); } } opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
@@ -16,9 +16,9 @@ package org.forgerock.opendj.rest2ldap; import static org.forgerock.opendj.ldap.requests.Requests.newSearchRequest; import static org.forgerock.opendj.ldap.schema.CoreSchema.getEntryUUIDAttributeType; import static org.forgerock.opendj.rest2ldap.ReadOnUpdatePolicy.CONTROLS; import static org.forgerock.opendj.ldap.requests.Requests.*; import static org.forgerock.opendj.ldap.schema.CoreSchema.*; import static org.forgerock.opendj.rest2ldap.ReadOnUpdatePolicy.*; import static org.forgerock.opendj.rest2ldap.Utils.ensureNotNull; import java.util.ArrayList; @@ -575,11 +575,16 @@ * @throws IllegalArgumentException * If the configuration is invalid. */ public static ConnectionFactory configureConnectionFactory(final JsonValue configuration, public static ConnectionFactory configureConnectionFactory(JsonValue configuration, final String name) { configuration = configuration.recordKeyAccesses(); final JsonValue normalizedConfiguration = normalizeConnectionFactory(configuration, name, 0); return configureConnectionFactory(normalizedConfiguration); final ConnectionFactory connectionFactory = configureConnectionFactory(normalizedConfiguration); // we are now done reading the config, configuration.verifyAllKeysAccessed(); return connectionFactory; } public static AttributeMapper constant(final Object value) {