mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
18.45.2013 4bad095093d7c8177160a9f938279e0606ceacd3
OPENDJ-993 Unexpected error during validation of the servlet configuration file (default conf file)
OPENDJ-960 Rest2LDAP - Validate http-config.json file

Review: Matthew Swift

Undoing r8998 and r8999 because it is creating issues we do not have time to fix right now.
3 files modified
20 ■■■■ changed files
opendj3/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPAuthnFilter.java 5 ●●●● patch | view | raw | blame | history
opendj3/opendj-rest2ldap-servlet/src/main/java/org/forgerock/opendj/rest2ldap/servlet/Rest2LDAPConnectionFactoryProvider.java 6 ●●●● patch | view | raw | blame | history
opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java 9 ●●●● patch | view | raw | blame | history
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).recordKeyAccesses();
            final JsonValue configuration = new JsonValue(content);
            final JsonValue authnConfig = configuration.get("authenticationFilter");
            if (!authnConfig.isNull()) {
                supportHTTPBasicAuthentication =
@@ -373,9 +373,6 @@
                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
@@ -83,7 +83,7 @@
                throw new ServletException("Servlet configuration file '" + configFileName
                        + "' does not contain a valid JSON configuration");
            }
            final JsonValue configuration = new JsonValue(content).recordKeyAccesses();
            final JsonValue configuration = new JsonValue(content);
            // Parse the authorization configuration.
            final AuthorizationPolicy authzPolicy =
@@ -115,10 +115,6 @@
                                .configureMapping(mapping).build();
                router.addRoute(mappingUrl, provider);
            }
            // we are now done reading the config
            configuration.verifyAllKeysAccessed();
            final ConnectionFactory factory = newInternalConnectionFactory(router);
            if (ldapFactory != null) {
                /*
opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
@@ -575,16 +575,11 @@
     * @throws IllegalArgumentException
     *             If the configuration is invalid.
     */
    public static ConnectionFactory configureConnectionFactory(JsonValue configuration,
    public static ConnectionFactory configureConnectionFactory(final JsonValue configuration,
            final String name) {
        configuration = configuration.recordKeyAccesses();
        final JsonValue normalizedConfiguration =
                normalizeConnectionFactory(configuration, name, 0);
        final ConnectionFactory connectionFactory =
            configureConnectionFactory(normalizedConfiguration);
        // we are now done reading the config
        configuration.verifyAllKeysAccessed();
        return connectionFactory;
        return configureConnectionFactory(normalizedConfiguration);
    }
    public static AttributeMapper constant(final Object value) {