Summary
Part of #79.
CrudState (the entity's CREATE/UPDATE/READ/... lifecycle state) is only enforced server-side inside SaveSupport.persist for SaveRemoteAction/SaveFlowRemoteAction. It is not enforced generically in ApplicationMetadataController.executeAction(...) for any CrudRemoteAction.
Problem
A hand-crafted request against a CrudRemoteAction that doesn't go through SaveSupport (any future action beyond the two shipped in Phase 4) can still invoke server-side mutation logic while the action's declared applicableStates says it shouldn't apply — the original latent bug (§7.6 point 2) is only partially fixed.
Proposed work
- Add a cheap, generic
CrudRemoteAction.getApplicableStates() check in ApplicationMetadataController.executeAction(...) (or a shared dispatch helper), so every current and future CrudRemoteAction gets this for free instead of each implementation having to remember to check it itself.
- Add a regression test that a request against a declared-inapplicable state is rejected before the action's
execute()/start() runs.
References
platform/core/crud/.../actions/remote/SaveSupport.java
ApplicationMetadataController.executeAction
docs/design/SERVER_DRIVEN_ACTION_FLOWS.md §7.6 point 2
Summary
Part of #79.
CrudState(the entity'sCREATE/UPDATE/READ/... lifecycle state) is only enforced server-side insideSaveSupport.persistforSaveRemoteAction/SaveFlowRemoteAction. It is not enforced generically inApplicationMetadataController.executeAction(...)for anyCrudRemoteAction.Problem
A hand-crafted request against a
CrudRemoteActionthat doesn't go throughSaveSupport(any future action beyond the two shipped in Phase 4) can still invoke server-side mutation logic while the action's declaredapplicableStatessays it shouldn't apply — the original latent bug (§7.6 point 2) is only partially fixed.Proposed work
CrudRemoteAction.getApplicableStates()check inApplicationMetadataController.executeAction(...)(or a shared dispatch helper), so every current and futureCrudRemoteActiongets this for free instead of each implementation having to remember to check it itself.execute()/start()runs.References
platform/core/crud/.../actions/remote/SaveSupport.javaApplicationMetadataController.executeActiondocs/design/SERVER_DRIVEN_ACTION_FLOWS.md§7.6 point 2