Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Revoke a Pending Privacy Request [#525] #592

Merged
merged 18 commits into from
Jun 23, 2022

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Jun 3, 2022

❗ Contains a migration; verify downrev before merging

Purpose

Add the ability to cancel a privacy request that has not started processing.

Changes

  • Send a POST to /api/v1/drp/revoke
  • Request body should contain request_id and an optional reason:
{
    "request_id": "pri_fc899dd5-36fc-4cee-a1e3-39a5857c1a4c",
    "reason": "Accidentally submitted"
}
  • Add canceled request status
  • Additionally track the cancel reason and cancel datetime on the privacy request.
  • Added Canceled option to dropdown for filtering and added formatting for canceled icon
  • Note: Revoking specifically from the front end not implemented here

Screen Shot 2022-06-03 at 11 02 13 AM

Screen Shot 2022-06-03 at 11 02 05 AM

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #418
Fixes #525

@pattisdr
Copy link
Contributor Author

pattisdr commented Jun 3, 2022

@ethyca/docs-authors small addition to drp docs added here

@pattisdr pattisdr force-pushed the fidesops_525_cancel_a_request branch from 25c6702 to c442245 Compare June 3, 2022 17:05
@pattisdr pattisdr changed the title Revoke a Pending Privacy Request [#525] [Blocked by Celery] Revoke a Pending Privacy Request [#525] Jun 10, 2022
# Conflicts:
#	clients/admin-ui/src/features/privacy-requests/RequestBadge.tsx
…execution. This is really our last chance to check before we start executing the graph in dask. The use case here might be it was canceled shortly after it was approved.
@pattisdr pattisdr changed the title [Blocked by Celery] Revoke a Pending Privacy Request [#525] Revoke a Pending Privacy Request [#525] Jun 23, 2022
…sk with a cancelled task id doesn't do anything and how you can't approve a canceled privacy request.
@pattisdr pattisdr marked this pull request as ready for review June 23, 2022 11:52
Copy link
Contributor

@seanpreston seanpreston left a comment

Choose a reason for hiding this comment

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

Thanks @pattisdr — couple of optional changes to follow-up here or we can ticket them and ship 1.6.0

@seanpreston seanpreston self-assigned this Jun 23, 2022
@pattisdr
Copy link
Contributor Author

I'll take care of them now thanks @seanpreston

@seanpreston seanpreston merged commit 04f9d70 into main Jun 23, 2022
@seanpreston seanpreston deleted the fidesops_525_cancel_a_request branch June 23, 2022 18:19
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* Add the ability to cancel a pending task.  The celery task is not actually cancelled yet.

- Track cancel reason, datetime cancelled, and add a new cancelled status.

* Add drp revoke request to postman collection.

* Add drp revoke docs.

* Update down_rev after rebase.

* Fix incorrect check.

* Restore new canceled state.

* Check that the privacy request is not canceled right before starting execution.  This is really our last chance to check before we start executing the graph in dask.    The use case here might be it was canceled shortly after it was approved.

* Attempt to revoke a queued celery task if we cancel it before it starts executing.

* Prettier.

* Changelog updated.

* Add a few unit tests around how triggering the run_privacy_request_task with a cancelled task id doesn't do anything and how you can't approve a canceled privacy request.

* Fix SQLAlchemy logging to console - logging in migration propagates to the rest of the application.

* Refresh session instead of creating a new one.

* Add 200 character limit.

* Add some assertions that db.refresh is doing what we think it's doing.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to revoke/cancel a request [DRP] Add support for POST /revoke
2 participants