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

Update Version Hash Contents #4313

Merged
merged 4 commits into from
Oct 24, 2023
Merged

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Oct 20, 2023

Closes https://github.com/ethyca/fidesplus/issues/1172

Description Of Changes

Update the contents of the version hash that is used to determine when consent should be resurfaced for TCF. Previously we hashed purpose x legal basis and vendor x legal basis to match what could be saved in the string. This largely updates to save three dimensions together vendor x legal basis x purpose and also includes AC vendors and other applicable systems in the hash, as well as determination of whether vendors moved from GVL 2 to GVL 3

New sections are:
  - Policy version (no change)
  - Vendor purpose consents
  - Vendor purpose legitimate interests
  - gvl vendors disclosed

Code Changes

  • Updates the fields in TCFVersionHash which is the object built prior to constructing the version hash

Steps to Confirm

  • Set tcf_enabled is True, run nox -s dev -- shell
  • Add GVL System
  • GET Privacy Experiences with include_meta query param:
curl -X 'GET' \
  'http://localhost:8080/api/v1/privacy-experience?show_disabled=true&region=eea&systems_applicable=false&include_gvl=false&include_meta=true&page=1&size=50' \
  -H 'accept: application/json'
  • Note stays the same on repeated API calls.
  • Add new system, or add new GVL purpose to an existing system or update the legal basis of an existing GVL purpose. Note the hash changes.

Pre-Merge Checklist

…n consent should be resurfaced. Previously we hashed purpose x legal basis and vendor x legal basis to match what could be saved in the string. This largely updates to save three dimensions together vendor x legal basis x purpose

New sections are:
  - Policy version (no change)
  - Vendor purpose consents
  - Vendor purpose legitimate interests
  - gvl vendors disclosed
@cypress
Copy link

cypress bot commented Oct 20, 2023

Passing run #4782 ↗︎

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 a0a6a6c into 934a378...
Project: fides Commit: 0b512aa119 ℹ️
Status: Passed Duration: 00:57 💡
Started: Oct 24, 2023 5:17 PM Ended: Oct 24, 2023 5:18 PM

Review all test suite changes for PR #4313 ↗︎

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (934a378) 87.82% compared to head (a0a6a6c) 87.84%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4313      +/-   ##
==========================================
+ Coverage   87.82%   87.84%   +0.01%     
==========================================
  Files         333      333              
  Lines       21056    21065       +9     
  Branches     2739     2742       +3     
==========================================
+ Hits        18493    18504      +11     
  Misses       2096     2096              
+ Partials      467      465       -2     
Files Coverage Δ
src/fides/api/util/tcf/experience_meta.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

looks great @pattisdr , nice work! mainly just some documentation nits, but i think the functionality here is spot on and it's a clean update to capture the new requirements 👍

src/fides/api/util/tcf/experience_meta.py Outdated Show resolved Hide resolved
src/fides/api/util/tcf/experience_meta.py Outdated Show resolved Hide resolved
src/fides/api/util/tcf/experience_meta.py Outdated Show resolved Hide resolved
src/fides/api/util/tcf/experience_meta.py Outdated Show resolved Hide resolved
src/fides/api/util/tcf/experience_meta.py Outdated Show resolved Hide resolved
tests/ops/util/test_tc_string.py Show resolved Hide resolved
# Conflicts:
#	CHANGELOG.md
#	src/fides/api/util/tcf/experience_meta.py
…ag is needed for AC vendors to show up in vendor hash.
@pattisdr pattisdr merged commit cf5814b into main Oct 24, 2023
40 checks passed
@pattisdr pattisdr deleted the PROD-1204_recalculate_version_hash branch October 24, 2023 18:10
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