Package org.forgerock.opendj.rest2ldap
Class Rest2LdapHttpApplication
java.lang.Object
org.forgerock.opendj.rest2ldap.Rest2LdapHttpApplication
- All Implemented Interfaces:
org.forgerock.http.DescribedHttpApplication
,org.forgerock.http.HttpApplication
public class Rest2LdapHttpApplication
extends Object
implements org.forgerock.http.DescribedHttpApplication
Rest2ldap HTTP application.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefault constructor called by the HTTP Framework which will use the default configuration directory.Rest2LdapHttpApplication
(File configDirectory, Schema schema) Creates a new Rest2LDAP HTTP application using the provided configuration directory. -
Method Summary
Modifier and TypeMethodDescriptionorg.forgerock.http.ApiProducer<io.swagger.models.Swagger>
Factory<org.forgerock.http.io.Buffer>
protected LdapClient
getLdapClient
(String name) Gets aLdapClient
from its name.protected ConditionalFilters.ConditionalFilter
newAnonymousFilter
(LdapClient ldapClient) protected ConditionalFilters.ConditionalFilter
newBasicAuthenticationFilter
(AuthenticationStrategy authenticationStrategy, Function<org.forgerock.http.protocol.Headers, Pair<String, String>, NeverThrowsException> credentialsExtractor) Gets aFilter
in charge of performing the HTTP-Basic Authentication.protected org.forgerock.http.Filter
newProxyAuthzFilter
(LdapClient ldapClient) Creates a newFilter
in charge of injectingLdapClientContext
.final org.forgerock.http.Handler
start()
void
stop()
-
Field Details
-
configDirectory
The name of the JSON configuration directory in which config.json and rest2ldap/rest2ldap.json are located. -
schema
Schema used to perform DN validations.
-
-
Constructor Details
-
Rest2LdapHttpApplication
public Rest2LdapHttpApplication()Default constructor called by the HTTP Framework which will use the default configuration directory. -
Rest2LdapHttpApplication
Creates a new Rest2LDAP HTTP application using the provided configuration directory.- Parameters:
configDirectory
- The name of the JSON configuration directory in which config.json and rest2ldap/rest2ldap.json are located.schema
- TheSchema
used to perform DN validations
-
-
Method Details
-
start
public final org.forgerock.http.Handler start() throws org.forgerock.http.HttpApplicationException- Specified by:
start
in interfaceorg.forgerock.http.HttpApplication
- Throws:
org.forgerock.http.HttpApplicationException
-
getBufferFactory
- Specified by:
getBufferFactory
in interfaceorg.forgerock.http.HttpApplication
-
stop
public void stop()- Specified by:
stop
in interfaceorg.forgerock.http.HttpApplication
-
newProxyAuthzFilter
Creates a newFilter
in charge of injectingLdapClientContext
.- Parameters:
ldapClient
- TheLdapClient
providing theLdapClientSocket
injected asLdapClientContext
- Returns:
- a newly created
Filter
-
newAnonymousFilter
- Parameters:
ldapClient
- TheLdapClient
used to get theLdapClientSocket
- Returns:
- a newly created
Filter
-
getLdapClient
Gets aLdapClient
from its name.- Parameters:
name
- Name of theLdapClient
as specified in the configuration- Returns:
- The associated
LdapClient
or null if none can be found
-
newBasicAuthenticationFilter
protected ConditionalFilters.ConditionalFilter newBasicAuthenticationFilter(AuthenticationStrategy authenticationStrategy, Function<org.forgerock.http.protocol.Headers, Pair<String, String>, NeverThrowsException> credentialsExtractor) Gets aFilter
in charge of performing the HTTP-Basic Authentication. This filter create aSecurityContext
reflecting the authenticated users.- Parameters:
authenticationStrategy
- TheAuthenticationStrategy
to use to authenticate the user.credentialsExtractor
- Extract the user's credentials from theHeaders
.- Returns:
- A new
Filter
-
getApiProducer
public org.forgerock.http.ApiProducer<io.swagger.models.Swagger> getApiProducer()- Specified by:
getApiProducer
in interfaceorg.forgerock.http.DescribedHttpApplication
-