REST API
Every module exposes its functions as a REST API, documented in the OpenAPI format.
Getting the OpenAPI document
Once the launcher is running, the OpenAPI document is served at:
http://localhost:8090/q/openapi
It is generated in development mode only and is not served in production.
Documenting an endpoint
Each endpoint is documented in the code with the MicroProfile OpenAPI annotations:
modules/techniques/directory/src/main/java/fr/tech/openent/directory/resource/TenantResource.java
@POST
@Path("/tenant")
@Operation(summary = "Create a tenant", description = "Returns a created tenant.")
@APIResponses(value = {
@APIResponse(responseCode = "201", description = "Successful, returns a tenant"),
})
@SecuredAction("tenant.create")
@IgnoreCsrf
public Uni<Response> create(final HttpServerRequest request) {
return Uni.createFrom().emitter(emitter -> {
bodyToJson(request, DefaultResourcePath.DIRECTORY_HTTP_ROOT_PATH + "/createTenant", event -> {
tenantService.create(event, result -> {
if (result.isRight()) {
emitter.complete(Response.status(201).entity(result.isRight()).build());
} else {
emitter.fail(new RuntimeException("Failed to create tenant"));
}
});
});
});
}
@SecuredAction names the action that a role must hold to call the endpoint.
Module paths and ports
Each module is served under its own path. In development, everything is reached through port 8090 and forwarded to the module.
| Module | Path | Default port |
|---|---|---|
| Application registry | /appregistry | 8012 |
| Directory | /directory | 8003 |
| Administration console | /admin | 8089 |
| Portal | /themes | 8017 |
| Document space | /workspace | 8011 |
| Communication | /communication | 8015 |
The ports are the container defaults and may differ in your deployment.
Two modules also have their own administration screens:
| Module | Path |
|---|---|
| Application registry | /appregistry/admin-console |
| Directory | /directory/admin-console |
HTTP headers
| Header | Purpose |
|---|---|
X-ENT-Theme | Selects the theme for the request |
X-Forwarded-Host | Routing between modules, set by the HTTP proxy |
X-Forwarded-For | Routing between modules, set by the HTTP proxy |