Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backend] Add Systems Applicable Filter to Privacy Experience List #3654

Merged

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Jun 22, 2023

Closes #959

Description Of Changes

If there are no systems in Fides with data uses that are mapped to privacy notices, then those notices shouldn't show up in the experiences.

Adds a ?systems_applicable query param to Privacy Experience List (GET {{host}}/privacy-experience/?systems_applicable=True)

We have this filter on GET Privacy Notices but not on experiences themselves.

Note that the experiences themselves still show up if they exist. If you don't want to see the experience either, use the separate existing flag, ?has_notices=True

Code Changes

  • If systems_applicable query param is passed to the GET PrivacyExperienceList endpoint, pass that filter onto the embedded privacy notices to only return notices whose data use corresponds to a system.

Steps to Confirm

  • Verify that you have some privacy notices whose data uses match a system's data use and some that don't
  • Compare results of GET {{host}}/privacy-experience/ and GET {{host}}/privacy-experience/?systems_applicable=True
    • Note: data uses "match" if they are either an exact match, or the privacy notice's data use is a parent of the system's data use. For example, if the privacy notice has a data use of marketing and the system has a data use of marketing.advertising - that is considered to match. The system's data use is under the scope of a privacy notice. The reverse case is not considered a match.

Pre-Merge Checklist

… endpoint. if systems_applicable=True, then notices embedded in the response must match a data use on the system. (note that the data use hierarchy is taken into account here too). In other words, if a privacy notice data use matches a system data use, or a privacy notice data use is a parent of the system data use, this is a match, but not if a system data use is a parent of a privacy notice data use
@cypress
Copy link

cypress bot commented Jun 22, 2023

Passing run #2956 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge 11b9372 into 65a72ff...
Project: fides Commit: 6f324b16a6 ℹ️
Status: Passed Duration: 00:45 💡
Started: Jun 28, 2023 7:32 PM Ended: Jun 28, 2023 7:33 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (65a72ff) 87.10% compared to head (11b9372) 87.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3654      +/-   ##
==========================================
- Coverage   87.10%   87.09%   -0.01%     
==========================================
  Files         310      310              
  Lines       19048    19052       +4     
  Branches     2438     2439       +1     
==========================================
+ Hits        16592    16594       +2     
- Misses       2028     2029       +1     
- Partials      428      429       +1     
Impacted Files Coverage Δ
...i/api/v1/endpoints/privacy_experience_endpoints.py 91.80% <ø> (ø)
src/fides/api/models/privacy_experience.py 99.42% <100.00%> (+0.01%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pattisdr
Copy link
Contributor Author

@allisonking when you have time could you take a look and add the corresponding frontend to this? There's just a new systems_applicable filter for experiences, not just notices!

@pattisdr pattisdr merged commit d300f8c into main Jun 28, 2023
@pattisdr pattisdr deleted the fidesplus_959_privacy_experience_systems_applicable_filter branch June 28, 2023 21:21
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