Class SetupResource

java.lang.Object
org.operaton.bpm.webapp.neo.impl.web.SetupResource

@Path("/setup/{engine}") public class SetupResource extends Object

Jax RS resource allowing to perform the setup steps.

Ported from the legacy admin webapp so that a webapps-neo-only deployment can bootstrap its first administrator. Without it, a database with no admin user (anything not seeded through operaton.bpm.admin-user) leaves the SPA with no way in at all.

Both endpoints are reachable without authentication — they have to be, since by definition nobody can log in yet. ensureSetupAvailable(org.operaton.bpm.engine.ProcessEngine) is the guard: once any user belongs to Groups.OPERATON_ADMIN, or the identity provider is read-only, the resource closes itself permanently and answers FORBIDDEN.

  • Field Details

    • LOGGER

      protected static final WebappLogger LOGGER
    • providers

      @Context protected jakarta.ws.rs.ext.Providers providers
  • Constructor Details

    • SetupResource

      public SetupResource()
  • Method Details

    • isSetupAvailable

      @GET @Produces("application/json") public SetupResource.SetupAvailabilityDto isSetupAvailable(@PathParam("engine") String processEngineName) throws IOException, jakarta.servlet.ServletException
      Whether an initial user can still be created. The SPA calls this before showing its setup screen. The legacy webapp had no such endpoint: its ProcessEnginesFilter redirected the HTML request server-side, and its dev server fell back to POSTing an empty body and string-matching the error message. webapps-neo has no such filter, so it asks directly.
      Throws:
      IOException
      jakarta.servlet.ServletException
    • createInitialUser

      @Path("/user/create") @POST @Consumes("application/json") @Produces("application/json") public void createInitialUser(@PathParam("engine") String processEngineName, UserDto user) throws IOException, jakarta.servlet.ServletException
      Throws:
      IOException
      jakarta.servlet.ServletException
    • createInitialUserInternal

      protected void createInitialUserInternal(String processEngineName, UserDto user, ProcessEngine processEngine)
    • getObjectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • ensureOperatonAdminGroupExists

      protected void ensureOperatonAdminGroupExists(ProcessEngine processEngine)
    • isSetupAvailableInternal

      protected boolean isSetupAvailableInternal(ProcessEngine processEngine)
    • ensureSetupAvailable

      protected void ensureSetupAvailable(ProcessEngine processEngine)