Skip to content

Action Flows: generic CrudState enforcement for any CrudRemoteAction #83

Description

@marioserrano09

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions