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

Restrict TCF Privacy Experience Config if TCF Disabled #4348

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Oct 26, 2023

Closes https://ethyca.atlassian.net/browse/PROD-1273

Description Of Changes

We have an endpoint that retrieves the Privacy Experience Config resources, which contain the language or the copy used for each experience type. This is the endpoint that is queried on the "Privacy Experience" page. TCF copy returns, regardless of whether TCF is enabled.

Code Changes

  • Backend: Excluded returning TCF Experience Config copy if TCF is disabled
  • Frontend: Added handling for tcf_overlay component type in the Privacy Experience Admin UI

Steps to Confirm

  • Make sure TCF is disabled
  • nox -s dev -- shell
  • GET Privacy Experience config: http://localhost:8080/api/v1/experience-config?show_disabled=true&page=1&size=50
  • Note that there are two Experience Configs returned, and the tcf_overlay isn't there.
  • Stop the fides webserver, enable TCF, and run nox -s dev -- shell again
  • GET Privacy Experience config again, note that three Experience Configs are returned, including the TCF Overlay

Also adds this casing change:
Screenshot 2023-10-26 at 11 47 18 AM

Pre-Merge Checklist

@pattisdr pattisdr changed the title Restrict Privacy Experience Config Restrict TCF Privacy Experience Config if TCF Disabled Oct 26, 2023
@cypress
Copy link

cypress bot commented Oct 26, 2023

Passing run #4873 ↗︎

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 9bd87ec into d85fd43...
Project: fides Commit: f31f3f045d ℹ️
Status: Passed Duration: 01:26 💡
Started: Oct 26, 2023 7:43 PM Ended: Oct 26, 2023 7:44 PM

Review all test suite changes for PR #4348 ↗︎

@@ -1,6 +1,7 @@
export const COMPONENT_MAP = new Map([
["overlay", "Overlay"],
["privacy_center", "Privacy center"],
["tcf_overlay", "TCF overlay"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't break the cypress tests with this did I? I think I see those same failures on main?

Copy link
Contributor

Choose a reason for hiding this comment

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

yup no worries—we know about the failures on main and are working on it separately! thanks for updating this 👍

Comment on lines +90 to +94
if not CONFIG.consent.tcf_enabled:
privacy_experience_config_query = privacy_experience_config_query.filter(
PrivacyExperienceConfig.component != ComponentType.tcf_overlay
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the primary change of this PR!

Copy link
Contributor

@allisonking allisonking left a comment

Choose a reason for hiding this comment

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

yay looks 💯 !

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d2d6bae) 87.72% compared to head (9bd87ec) 87.72%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4348   +/-   ##
=======================================
  Coverage   87.72%   87.72%           
=======================================
  Files         335      335           
  Lines       21157    21160    +3     
  Branches     2752     2753    +1     
=======================================
+ Hits        18560    18563    +3     
  Misses       2127     2127           
  Partials      470      470           
Files Coverage Δ
...1/endpoints/privacy_experience_config_endpoints.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pattisdr pattisdr merged commit 6460408 into main Oct 26, 2023
45 of 46 checks passed
@pattisdr pattisdr deleted the PROD-1273_restrict_tcf_experience_config branch October 26, 2023 20:30
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