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

Surface AC Systems in Vendor Consents section of the TCF Overlay #4266

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Oct 12, 2023

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

Description Of Changes

AC systems should show up in the TCF overlay and need vendor consent toggles. They are not required to have privacy declarations though, which currently drives what is in the TCF overlay.

Code Changes

  • Surface AC Systems (systems whose vendor_id starts with an "ac.*" prefix) in the TCF overlay under the Vendor Consents section, even if it has no privacy declarations.

  • Separately update the "relevant systems" when vendor consent preferences are saved to include ac systems in the lookup

Steps to Confirm

  • Set tcf_enabled=true in fides.toml
  • Add a system, setting vendor_id to be "ac.100"
  • GET Privacy Experiences from the EEA
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'
  • TCF Vendor consents section should have the AC system. There won't be any purpose consents unless it has privacy declarations with relevant purposes and consent legal basis:
 "tcf_vendor_consents": [
        {
          "id": "gvl.8",
          "has_vendor_id": true,
          "name": "Emerse",
          "description": "Emerse Sverige AB is a provider of programmatic advertising solutions, offering advertisers and publishers tools to manage and optimize their digital ad campaigns.",
          "default_preference": "opt_out",
          "current_preference": null,
          "outdated_preference": null,
          "current_served": null,
          "outdated_served": null,
          "purpose_consents": [
            {
              "id": 1,
              "name": "Store and/or access information on a device"
            },
            {
              "id": 3,
              "name": "Create profiles for personalised advertising"
            },
            {
              "id": 4,
              "name": "Use profiles to select personalised advertising"
            }
          ]
        },
        {
          "id": "ac.100",
          "has_vendor_id": true,
          "name": "test",
          "description": "",
          "default_preference": "opt_out",
          "current_preference": null,
          "outdated_preference": null,
          "current_served": null,
          "outdated_served": null,
          "purpose_consents": []
        }
      ]

Pre-Merge Checklist

@cypress
Copy link

cypress bot commented Oct 12, 2023

Passing run #4678 ↗︎

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 889e821 into a862790...
Project: fides Commit: 0efe76ae3f ℹ️
Status: Passed Duration: 00:50 💡
Started: Oct 18, 2023 5:32 AM Ended: Oct 18, 2023 5:33 AM

Review all test suite changes for PR #4266 ↗︎

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (e8bcfcc) 87.75% compared to head (889e821) 87.76%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4266      +/-   ##
==========================================
+ Coverage   87.75%   87.76%   +0.01%     
==========================================
  Files         331      331              
  Lines       20907    20922      +15     
  Branches     2711     2714       +3     
==========================================
+ Hits        18346    18362      +16     
+ Misses       2094     2093       -1     
  Partials      467      467              
Files Coverage Δ
src/fides/api/util/tcf/tc_model.py 94.96% <100.00%> (-0.04%) ⬇️
src/fides/api/util/tcf/tc_string.py 100.00% <100.00%> (ø)
src/fides/api/util/tcf/tcf_experience_contents.py 94.16% <100.00%> (+0.41%) ⬆️

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

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

this looks great—very clean and easy to follow, well done! will test it out with the FE now to see if things Just Work and report back

@pattisdr pattisdr added the do not merge Please don't merge yet, bad things will happen if you do label Oct 13, 2023
@allisonking
Copy link
Contributor

ah I guess this will also need the prefix change before I can test E2E with local compass

@pattisdr
Copy link
Contributor Author

I'll start on that now!

Base automatically changed from integration/compass-1.0.0 to main October 16, 2023 13:53
…fix) in the TCF overlay under the Vendor Consents section, even if it has no privacy declarations.

- Separately update the "relevant systems" when vendor consent preferences are saved to include ac systems in the lookup -
- Dry up defining AC and GVL prefixes.
@pattisdr pattisdr force-pushed the fidesplus_1155_ac_vendors_in_overlay_PROD-1164 branch from 5d1e697 to 035dfce Compare October 17, 2023 17:55
@pattisdr
Copy link
Contributor Author

Rebased onto main due to messy diff when this was originally based off of the compass integration branch. @adamsachs

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.

the changes look great here @pattisdr, this is a lot less painful than i expected, which owes a lot to your clean implementation! just had some minor nits, none of which i'd consider blocking - but would be curious to get your thoughts on them.

i didn't get a chance to smoke test, but if you've done some manual testing, then i think that's sufficient since the changes are straightforward enough. i can circle back and do some testing though if you'd like that extra confirmation!

Comment on lines 466 to 473
if not tcf_vendor_component_type == TCFVendorConsentRecord:
return

if not system_identifier.startswith(AC_PREFIX):
return

if system_identifier in vendor_map:
return
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity - do you think this reads easier as 3 separate conditionals rather than joining them in a single conditional with ors? just caught my eye since it's not the way i would have written it, but i'm guessing this was deliberate so i'm curious to hear! no need to adjust obviously.

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 do think it's easier to parse this way 😎

src/fides/api/util/tcf/tcf_experience_contents.py Outdated Show resolved Hide resolved
tests/fixtures/application_fixtures.py Outdated Show resolved Hide resolved
tests/fixtures/application_fixtures.py Outdated Show resolved Hide resolved
- Update docstring
- Add test for experience contents with an AC system with a valid privacy declaration
@pattisdr pattisdr removed the do not merge Please don't merge yet, bad things will happen if you do label Oct 18, 2023
@pattisdr
Copy link
Contributor Author

Thanks for the review Adam - I always do manual testing! I'll go ahead and merge and get the follow-up PR up that is building AC strings on the backend, building off of this work -

@pattisdr pattisdr merged commit a9b5950 into main Oct 18, 2023
39 of 40 checks passed
@pattisdr pattisdr deleted the fidesplus_1155_ac_vendors_in_overlay_PROD-1164 branch October 18, 2023 12:07
@pattisdr pattisdr mentioned this pull request Oct 19, 2023
7 tasks
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.

3 participants