[ENG-2145] Add Policy conditional dependencies
Ticket ENG-2145
Description Of Changes
🎯 As a Privacy Admin, I want to create conditions that map request attributes to DSR policies, so that incoming privacy requests are automatically assigned the correct policy based on their characteristics.
Details
Policy conditions define when a specific DSR policy should be assigned to a privacy request. Each condition set is associated with a single policy and contains one or more rules that evaluate request data. Conditions can be simple (single field check) or complex (multiple fields with AND/OR logic).
This PR moves policy.py into a policy dir and adds src/fides/api/models/policy/conditional_dependency.py along with the alembic migration and tests. This follows the pattern established for both digest and manual tasks.
Code Changes
- moved
src/fides/api/models/policy.pyinto new policy dir - added new
src/fides/api/models/policy/conditional_dependency.py - created migration
- added tests
Steps to Confirm
- All current policy related things should not change with the file move.
- All tests should pass.
Pre-Merge Checklist
- [ ] Issue requirements met
- [ ] All CI pipelines succeeded
- [ ]
CHANGELOG.mdupdated- [ ] Add a https://github.com/ethyca/fides/labels/db-migration label to the entry if your change includes a DB migration
- [ ] Add a https://github.com/ethyca/fides/labels/high-risk label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
- [ ] Updates unreleased work already in Changelog, no new entry necessary
- UX feedback:
- [ ] All UX related changes have been reviewed by a designer
- [ ] No UX review needed
- Followup issues:
- [ ] Followup issues created
- [ ] No followup issues
- Database migrations:
- [ ] Ensure that your downrev is up to date with the latest revision on
main - [ ] Ensure that your
downgrade()migration is correct and works- [ ] If a downgrade migration is not possible for this change, please call this out in the PR description!
- [ ] No migrations
- [ ] Ensure that your downrev is up to date with the latest revision on
- Documentation:
- [ ] Documentation complete, PR opened in fidesdocs
- [ ] Documentation issue created in fidesdocs
- [ ] If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
- [ ] No documentation updates required