Skip to content

Allowed statuses tenant configuration guard for deletion of actions - #3245

Open
strailov wants to merge 2 commits into
eclipse-hawkbit:masterfrom
boschglobal:feature/allowed_statuses_for_deletion_of_actions
Open

Allowed statuses tenant configuration guard for deletion of actions#3245
strailov wants to merge 2 commits into
eclipse-hawkbit:masterfrom
boschglobal:feature/allowed_statuses_for_deletion_of_actions

Conversation

@strailov

Copy link
Copy Markdown
Contributor

Summary

Action deletion via the Management API is now restricted to statuses the tenant explicitly
allows. Introduces the tenant configuration key action.delete.allowed.statuses
(default: CANCELED, ERROR, FINISHED). Deleting an action in any other status is rejected.

Changes

  • Eligibility guard on user-facing deletion paths in JpaDeploymentManagement:
    deleteAction, deleteActionsByIds, deleteActionsByRsql, deleteTargetActionsByIds.
    Ineligible actions raise DeleteActionNotAllowedException
    (SP_ACTION_NOT_DELETABLE → HTTP 405).
  • keepLast purge (deleteOldestTargetActions) now deletes only eligible actions among
    the oldest candidates (deleteOnlyEligible), filtering by status IN (...) in the native
    delete. Ineligible actions are skipped rather than rejected.

Behavior

Path Ineligible action
delete by id(s) / rsql request rejected (405)
delete by keepLast skipped, others deleted (204)

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>

@avgustinmm avgustinmm 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.

LGTM

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.

2 participants