Class SetupResource
java.lang.Object
org.operaton.bpm.webapp.neo.impl.web.SetupResource
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResponse ofisSetupAvailable(java.lang.String). -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final WebappLoggerprotected jakarta.ws.rs.ext.Providers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateInitialUser(String processEngineName, UserDto user) protected voidcreateInitialUserInternal(String processEngineName, UserDto user, ProcessEngine processEngine) protected voidensureOperatonAdminGroupExists(ProcessEngine processEngine) protected voidensureSetupAvailable(ProcessEngine processEngine) protected com.fasterxml.jackson.databind.ObjectMapperisSetupAvailable(String processEngineName) Whether an initial user can still be created.protected booleanisSetupAvailableInternal(ProcessEngine processEngine)
-
Field Details
-
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: itsProcessEnginesFilterredirected 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:
IOExceptionjakarta.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:
IOExceptionjakarta.servlet.ServletException
-
createInitialUserInternal
protected void createInitialUserInternal(String processEngineName, UserDto user, ProcessEngine processEngine) -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
ensureOperatonAdminGroupExists
-
isSetupAvailableInternal
-
ensureSetupAvailable
-