Skip to content

feat: Add Endpoints Required to Support a Web Administrator (#335) - #336

Open
gibson9583 wants to merge 8 commits into
OpenIntegrationEngine:mainfrom
gibson9583:feat/web-support
Open

feat: Add Endpoints Required to Support a Web Administrator (#335)#336
gibson9583 wants to merge 8 commits into
OpenIntegrationEngine:mainfrom
gibson9583:feat/web-support

Conversation

@gibson9583

@gibson9583 gibson9583 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Add engine REST support so a standalone web administrator can run fully against the engine by serving plugin UIs, exact serialization, and script tooling with no local JVM sidecar or shared filesystem.

Endpoints (all session-authed, no extra permission, auditable=false):

  • GET /api/webplugins — enabled extensions that ship a webadmin/ UI
  • GET /api/webplugins/{extensionPath}/{file} — serve an extension's webadmin/ assets
  • POST /api/javascript/_validate — validate JS (Rhino compiler)
  • POST /api/datatypes/_serialize — serialize a message via a data type (message trees)

Supporting changes:

  • RequestedWithFilter: exempt read-only GET /api/webplugins/* from the X-Requested-With CSRF requirement (browser module/script loads can't set headers).
  • DataTypeServerPlugin: add getVocabulary(version, type); override in HL7v2, EDI, NCPDP, and DICOM so /api/datatypes/_serialize returns element descriptions.

New servlets auto-register via the existing package scan. No wiring changes.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Test Results

699 tests  +24   699 ✅ +24   1m 47s ⏱️ +53s
116 suites + 2     0 💤 ± 0 
116 files   + 2     0 ❌ ± 0 

Results for commit baa511d. ± Comparison against base commit 423df18.

♻️ This comment has been updated with latest results.

Comment thread server/src/com/mirth/connect/server/api/servlets/DataTypeServlet.java Outdated

@pacmano1 pacmano1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are on Gradle now, please rebase.

Needs tests. RequestedWithFilterTest already exists and you added a branch to it without adding a case. The traversal guard in getWebPluginResource is the one I actually care about.

Headers got deleted instead of replaced, so six files ship with no license at all. Add the SPDX pair like AbstractXMLReader.java.

Add engine REST support so the standalone web administrator can run fully
against the engine — serving plugin UIs, exact serialization, and script
tooling — with no local JVM sidecar or shared filesystem.

Endpoints (all session-authed, no extra permission, auditable=false):
- GET  /api/webplugins                          — enabled extensions that ship a webadmin/ UI
- GET  /api/webplugins/{extensionPath}/{file}   — serve an extension's webadmin/ assets
- POST /api/javascript/_validate                — validate JS (Rhino compiler)
- POST /api/javascript/_prettyPrint             — format JS (Rhino-AST formatter)
- POST /api/datatypes/_serialize                — serialize a message via a data type (message trees)

Supporting changes:
- RequestedWithFilter: exempt read-only GET /api/webplugins/* from the
  X-Requested-With CSRF requirement (browser module/script loads can't set headers).
- DataTypeServerPlugin: add getVocabulary(version, type); override in HL7v2, EDI,
  NCPDP, and DICOM so /api/datatypes/_serialize returns element descriptions.

New servlets auto-register via the existing package scan; no wiring changes.

Signed-off-by: gibson9583 <cgibson@outlook.com>
Not need - this just uses JS Beautify

Signed-off-by: gibson9583 <cgibson@outlook.com>
Signed-off-by: gibson9583 <cgibson@outlook.com>
Signed-off-by: gibson9583 <cgibson@outlook.com>
Signed-off-by: gibson9583 <cgibson@outlook.com>
The header-strip commit left the six new files with no license. Add the
MPL-2.0 SPDX pair used elsewhere in the tree.

Signed-off-by: gibson9583 <cgibson@outlook.com>
Match DataTypeServlet and drop the hand-rolled escaper.

Signed-off-by: gibson9583 <cgibson@outlook.com>
RequestedWithFilterTest: the GET-only exemption for /webplugins/ assets
by path info and by request URI; POST, the discovery list, and other GETs
still need the header.

WebPluginServletTest: discovery lists only enabled extensions with a
manifest; asset serving rejects parent, nested, cross-extension,
absolute, unsafe-segment, and symlink escapes.

JavaScriptServletTest: response shape and JSON validity.
Signed-off-by: gibson9583 <cgibson@outlook.com>
@gibson9583
gibson9583 requested review from a team, kayyagari and pacmano1 September 4, 2026 15:59
@mgaffigan

Copy link
Copy Markdown
Contributor

I agree with adding the support endpoints (vocabulary, validate, ...). Should you wish to reduce this PR to those only, I am happy to approve as is.

I do not understand the goal of avoiding WAR files. WAR is the format for shipping static files. This seems to be re-inventing a plugin-specific file serving concept.

I would agree with having a way for plugins to deliver a manifest via API - that should be aggregated into a single merged document, though, not N requests to arbitrary URL's, though.

Should we have to serve static resources from plugin jars, then I would say that should be via #176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants