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: Update TCF Version #4305

Merged
merged 3 commits into from
Oct 24, 2023
Merged

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Oct 19, 2023

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

Description Of Changes

Update hardcoded TCF Version saved for consent reporting to 2.2.

Code Changes

  • Updated TCF_VERSION for consent reporting
  • Stop using this field for TCF to deem a saved preference is "outdated" - this isn't very relevant for TCF, we'll have other criteria to determine if consent needs to be resurfaced.
  • Rename related method from record_matches_current_version to record_is_current and change it's default value to True instead of False. Other than Privacy Notices which I am comparing the latest version of the notice to the version on the saved preference, everything else, I'll just say is "True"

Steps to Confirm

  • Easiest way is to go to checkout main which has TCF at an earlier version. Set up TCF per usual:
  • Fetch Privacy Experiences, I'm going to select a consent purpose of 10 against which to save preferences
curl -X 'GET' \
  'http://localhost:8080/api/v1/privacy-experience?show_disabled=true&fides_user_device_id=6f8692dc-43f7-4dc5-97bb-4560c73f5503&systems_applicable=false&include_gvl=false&include_meta=false&page=1&size=50' \
  -H 'accept: application/json'
{
  "purpose_consent_preferences": [{"id": 10, "preference": "opt_in"}],
  "browser_identity": {
    "fides_user_device_id": "6f8692dc-43f7-4dc5-97bb-4560c73f5503"
  }
}```
* [ ] Now checkout this branch, and fetch experiences, your saved TCF preference should show up under "current_preference` instead of `outdated_preference` even though the version has changed. 

curl -X 'GET'
'http://localhost:8080/api/v1/privacy-experience?show_disabled=true&fides_user_device_id=6f8692dc-43f7-4dc5-97bb-4560c73f5503&systems_applicable=false&include_gvl=false&include_meta=false&page=1&size=50'
-H 'accept: application/json'

...
 "tcf_purpose_consents": [
        {
          "id": 10,
          "name": "Develop and improve services",
          "data_uses": [
            "functional.service.improve"
          ],
          "default_preference": "opt_out",
          "current_preference": "opt_in",
          "outdated_preference": null,
          "current_served": null,
          "outdated_served": null,
          "vendors": [
            {
              "id": "gacp.8",
              "name": "Third Party Payments"
            }
          ],
          "systems": [
            {
              "id": "ctl_c5c78785-5eb5-4a03-94a2-8a1ba03931b9",
              "name": "PostgreSQL System"
            }
          ]
        }
      ]

Pre-Merge Checklist

…instead of "2.0".

- While we're here,  stop using the TCF Version to say a previously saved preference was outdated.  This isn't very relevant here - we'll use a different set of logic to determine if consent needs to be resurfaced for TCF.
- Rename method "record_matches_current_version" to "record_is_current"
@cypress
Copy link

cypress bot commented Oct 19, 2023

Passing run #4720 ↗︎

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 5a74393 into 82d6223...
Project: fides Commit: 8cf8ab73e6 ℹ️
Status: Passed Duration: 01:08 💡
Started: Oct 20, 2023 10:15 PM Ended: Oct 20, 2023 10:16 PM

Review all test suite changes for PR #4305 ↗︎

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (82d6223) 87.76% compared to head (5a74393) 87.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4305   +/-   ##
=======================================
  Coverage   87.76%   87.77%           
=======================================
  Files         331      331           
  Lines       20928    20926    -2     
  Branches     2715     2714    -1     
=======================================
  Hits        18368    18368           
+ Misses       2093     2092    -1     
+ Partials      467      466    -1     
Files Coverage Δ
src/fides/api/models/privacy_experience.py 98.63% <100.00%> (ø)
src/fides/api/models/privacy_preference.py 97.71% <100.00%> (+0.73%) ⬆️

☔ 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.

seems fine to me! i'll trust you that there aren't any other broad implications by switching the default here to True :)

@pattisdr
Copy link
Contributor Author

i'll trust you that there aren't any other broad implications by switching the default here to True :)

I think this is ok for now! Preferences saved against notices still use the version of the current notice to determine if the preference is outdated. Nothing else has the concept of an "outdated saved preference" - the may change in the future.

@pattisdr pattisdr merged commit 934a378 into main Oct 24, 2023
40 checks passed
@pattisdr pattisdr deleted the fidesplus_tcf_version_for_consent_reporting branch October 24, 2023 16:41
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