CoreRestGuiceModule.java revision 3b9ac290688291dc5c5db6bd0a88107aff80ea4d
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
*/
/**
* Guice module for binding the core REST endpoints.
*
* @since 13.0.0
*/
public class CoreRestGuiceModule extends AbstractModule {
protected void configure() {
install(new FactoryModuleBuilder()
.build(SmsRequestHandlerFactory.class));
install(new FactoryModuleBuilder()
.build(SmsCollectionProviderFactory.class));
install(new FactoryModuleBuilder()
.build(SmsSingletonProviderFactory.class));
install(new FactoryModuleBuilder()
.build(SmsGlobalSingletonProviderFactory.class));
httpAccessAuditFilterMapBinder.addBinding(AUTHENTICATION).to(AuthenticationAccessAuditFilter.class);
}
@Named("AuthenticateHandler")
org.forgerock.http.routing.Router authenticateVersionRouter = new org.forgerock.http.routing.Router();
}
/**
* Returns the first path segment from a uri template. For example {@code /foo/bar} becomes {@code foo}.
*
* @param path the full uri template path.
* @return the first non-empty path segment.
* @throws IllegalArgumentException if the path contains no non-empty segments.
*/
return part;
}
}
}
@Named("UsersResource")
IdentityServicesImpl identityServices, CoreWrapper coreWrapper, RestSecurityProvider restSecurityProvider) {
return new IdentityResourceV1(IdentityResourceV1.USER_TYPE, mailServerLoader, identityServices, coreWrapper,
}
@Named("UsersResource")
return new IdentityResourceV2(IdentityResourceV2.USER_TYPE, mailServerLoader, identityServices, coreWrapper,
}
@Named("UsersResource")
IdentityServicesImpl identityServices, CoreWrapper coreWrapper, RestSecurityProvider restSecurityProvider,
return new IdentityResourceV3(IdentityResourceV2.USER_TYPE, mailServerLoader, identityServices, coreWrapper,
}
@Named("GroupsResource")
IdentityServicesImpl identityServices, CoreWrapper coreWrapper, RestSecurityProvider restSecurityProvider) {
return new IdentityResourceV1(IdentityResourceV1.GROUP_TYPE, mailServerLoader, identityServices, coreWrapper,
}
@Named("GroupsResource")
return new IdentityResourceV2(IdentityResourceV2.GROUP_TYPE, mailServerLoader, identityServices, coreWrapper,
}
@Named("GroupsResource")
}
@Named("AgentsResource")
IdentityServicesImpl identityServices, CoreWrapper coreWrapper, RestSecurityProvider restSecurityProvider) {
return new IdentityResourceV1(IdentityResourceV1.AGENT_TYPE, mailServerLoader, identityServices, coreWrapper,
}
@Named("AgentsResource")
return new IdentityResourceV2(IdentityResourceV2.AGENT_TYPE, mailServerLoader, identityServices, coreWrapper,
}
@Named("AgentsResource")
}
}
boolean coreTokenResourceEnabled = SystemProperties.getAsBoolean(Constants.CORE_TOKEN_RESOURCE_ENABLED);
}
@Named("ServerAttributeSyntax")
syntaxProperties.load(getClass().getClassLoader().getResourceAsStream("validserverconfig.properties"));
return syntaxProperties;
}
@Named("ServerAttributeTitles")
return titleProperties;
}
SessionResourceAuthzModule sessionResourceAuthzModule = new SessionResourceAuthzModule(ssoTokenManager);
return new AggregateAuthzModule(authzList);
}
}