io.continual.iam.apiserver.IamHttpApiService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of continualIamApiService Show documentation
Show all versions of continualIamApiService Show documentation
An API server for the Continual IAM library
The newest version!
package io.continual.iam.apiserver;
import org.json.JSONObject;
import io.continual.builder.Builder.BuildFailure;
import io.continual.http.app.servers.routeInstallers.TypicalApiServiceRouteInstaller;
import io.continual.http.service.framework.CHttpService;
import io.continual.http.service.framework.routing.playish.CHttpPlayishStaticEntryPointRoutingSource;
import io.continual.iam.apiserver.endpoints.AuthApiHandler;
import io.continual.iam.apiserver.endpoints.IamApiHandler;
import io.continual.iam.identity.Identity;
import io.continual.services.ServiceContainer;
import io.continual.services.SimpleService;
public class IamHttpApiService extends SimpleService
{
public IamHttpApiService ( ServiceContainer sc, JSONObject config ) throws BuildFailure
{
final CHttpService http = sc.getReqd ( config.getString ( "httpService" ), CHttpService.class );
http.addRouteInstaller (
new TypicalApiServiceRouteInstaller ()
.registerRoutes ( "authRoutes.conf", new AuthApiHandler ( sc, config ) )
.registerRoutes ( "iamRoutes.conf", new IamApiHandler ( sc, config ) )
.registerRouteSource (
new CHttpPlayishStaticEntryPointRoutingSource ()
.addRoute ( "GET", "/guide", "staticDir:com/rathravane/labels/guide;index.html" )
)
);
}
}