refactor: separate runtime and administration APIs - #271
Conversation
Includes branch changelog.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 685b1f7849
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * Runtime integrations should receive BPMNAPI so they cannot mutate models. | ||
| */ | ||
| class BPMNAdminAPI extends BPMNAPI { |
There was a problem hiding this comment.
Hide the server capability from the runtime API
When an unprivileged integration is given a BPMNAPI, it can still mutate definitions through api.server.definitions.save(...), deleteModel(...), or renameModel(...); those datastore methods are public on IBPMNServer and bypass the SecureUser checks in APIModel. Consequently, moving only model to this subclass does not establish the advertised administration boundary, so the runtime facade must not expose the underlying server or another route to its definitions datastore.
Useful? React with 👍 / 👎.
| "build": "tsc --build", | ||
| "clean": "rimraf dist" | ||
| "clean": "rimraf dist", | ||
| "test:boundary": "node --test api-boundary.test.mjs" |
There was a problem hiding this comment.
Build the distribution before running the boundary test
On a fresh checkout or after npm run clean, this script fails before collecting tests with ERR_MODULE_NOT_FOUND because api-boundary.test.mjs imports ./dist/index.js, while dist is ignored and this command does not build it. Prefix the test command with the build step (or execute the TypeScript source through the existing runner) so npm run test:boundary works independently.
Useful? React with 👍 / 👎.
Summary
Separates workflow execution from workflow-definition administration.
BPMNAPIBPMNAdminAPIsurface for model administrationCHANGELOG.mdStack
This is the server-side #2 foundation. The trusted-principal PR is stacked on this branch.
Validation