All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.continual.iam.apiserver.IamHttpApiService Maven / Gradle / Ivy

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" )
				)
		);
	}
}