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

TCF Backend #3804

Merged
merged 81 commits into from
Sep 20, 2023
Merged

TCF Backend #3804

merged 81 commits into from
Sep 20, 2023

Commits on Jul 18, 2023

  1. Very early backend TCF POC -

    - Privacy Notices are not needed for the TCF Experience.  Instead, the content is generated at runtime by looking at what TCF data uses are on current systems.
    - Add a new experience type: the TCF overlay.
    - Expands the abilities to retrieve and save consent preferences with respect to "vendors", "data_uses" and "features", not just "privacy notices".
    - Relaxes constraints on PrivacyPreferenceHistory, ServedNoticeHistory, CurrentPrivacyPreference, and LastServedNotice to use these tables to store when preferences were saved and served against not just notices, but vendors, data uses, and features.
    pattisdr committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    e33ad96 View commit details
    Browse the repository at this point in the history
  2. Revert cython changes.

    pattisdr committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    7a06cd1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    19df040 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ddc0a5d View commit details
    Browse the repository at this point in the history
  5. DRY up code around getting saved and served notices/data uses/feature…

    …s/vendors.
    
    Improve logic around loading tcf data uses.
    pattisdr committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    2c9a7a3 View commit details
    Browse the repository at this point in the history
  6. Get rid of persisting tcf_details in a jsonb column now that we don't…

    … need to track consent mechanism, enforcement level, or has_gpc_flag.
    
    - Start drying up code related to saving privacy preferences and unit testing w.r.t data use, vendor, or feature.
    pattisdr committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    07eb2dd View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. Dry up user data collected for consent reporting. Dry up saving that …

    …notices were served for various identities. Refactor methods now that we're sharing a lot of code here.
    pattisdr committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    59dbe0b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    452e9f3 View commit details
    Browse the repository at this point in the history
  3. Add simple tests for consent settings endpoints and adjust permission…

    …s on getting settings.
    pattisdr committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    445aa4b View commit details
    Browse the repository at this point in the history
  4. - Give TCF items a default preference of False.

    - Split TCF schemas into their own file
    - Add test verifying that we can't create PrivacyPreferenceHistory records against multiple preference types.
    - Rename schemas for saving/serializing that notices were served to be more generic.
    - Write unit test for saving that tcf items were served.
    pattisdr committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    3179a1f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ac051e9 View commit details
    Browse the repository at this point in the history
  6. Bump downrev.

    pattisdr committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    f5f247b View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2023

  1. Refactor to save preferences against a "purpose" which is associated …

    …with many data uses, rather than a "data use" directly, as a purpose can be associated with many data uses.
    
    - Temporarily pin to a fideslang commit on a branch and pull in the tcf purpose mapping from there.
    pattisdr committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    b859941 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. Configuration menu
    Copy the full SHA
    050c651 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. Configuration menu
    Copy the full SHA
    fbe40e7 View commit details
    Browse the repository at this point in the history
  2. Dry up embed_experience_details using new get_related_tcf_contents me…

    …thod.
    
    - Fix bug with saving current privacy preferences with respect to a special purpose and special feature.
    pattisdr committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    8ce5794 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    18b037e View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2023

  1. Continued cleanup

    - Fix duplicate region in EEA_COUNTRIES
    - Add test for ConsentSetting model
    - Add test for PrivacyExperience.get_should_show_banner in the case where it is a TCF overlay - I return True here
    - Add test for PrivacyExperience.get_related_privacy_notices for TCF overlay - exits early with an empty list - not relevant here!
    - Add method tests for cache_saved_and_served_on_consent_record for special purpose, notice, and vendor
    - Add docstrings to TCF schemas and move TCFExperienceContents out of the file for schemas that are returned via the API
    - Add test for PrivacyPrefenceHistory.preference_type property
    - Add some checks on PrivacyPreferenceHistory and CurrentPrivacyPreference records on create
    - Rename PreferenceType enum and preference_type property to be more generic since they're also shared with served notices
    - Docstrings for schemas
    - Updated to TCF_COMPONENT_MAPPING and TCF_PREFERENCES_FIELD_MAPPING
    - Add test for privacy_notice_id - that it works w/ TCF too
    pattisdr committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    46c0f3b View commit details
    Browse the repository at this point in the history
  2. Continued cleanup

    - Added more fields to the vendor record
    - "has_notices" flag now also takes into account if TCF content exists too.
    - Tried to take care of areas accessing info off of the privacy notice history
    - "relevant_systems" definition has changed, and also now factors in TCF components.
    - Fix bug where wrong field is returned in historical report
    - Add validation on purposes and special purposes and duplicates for both saving preferences and serving TCF components
    - Surface tcf version in consent report
    pattisdr committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    4bbbcbd View commit details
    Browse the repository at this point in the history
  3. Refactor get_tcf_contents.

    pattisdr committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    8b1aba7 View commit details
    Browse the repository at this point in the history
  4. Make progress towards getting tests passing:

    - Fix bug related to Consent Settings scope name, copy/paste error
    - Fix test that relaxes returning systems as related even if they do not have system wide enforcement
    pattisdr committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    c4f1fb3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    18e3384 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Configuration menu
    Copy the full SHA
    a55fe7d View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2023

  1. Configuration menu
    Copy the full SHA
    46dd468 View commit details
    Browse the repository at this point in the history
  2. If component type is "overlay" return both overlay types - tcf overla…

    …y and regular overlay, when searching for Privacy Experiences. Region filters will further refine to return the most appropriate overlay altogether.
    pattisdr committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    d913dc0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    71e76d9 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. Configuration menu
    Copy the full SHA
    be09f0f View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2023

  1. Merge branch 'main' into tcf_backend_poc.

    - Bump downrev of fides migration
    
    # Conflicts:
    #	requirements.txt
    #	src/fides/api/util/connection_util.py
    pattisdr committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    203a545 View commit details
    Browse the repository at this point in the history
  2. Update fideslang commit to point to a branch that is based on 1.4.4 (…

    …so we have the system and privacy declaration changes) but also has gvl changes.
    pattisdr committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    84a649e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d3bde32 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2023

  1. Configuration menu
    Copy the full SHA
    a54043c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b5f4081 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2023

  1. Add WIP logic for features and special features.

    - Update ARRAY type used on System.privacy_declarations to be of the postgresql dialect.  (specifically this allows us to use "overlap")
    pattisdr committed Aug 20, 2023
    Configuration menu
    Copy the full SHA
    4eecffa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ec04f22 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2023

  1. Add system_fides_key as an attribute for which a customer can opt in …

    …and out, that is separate from "vendor". Saving preferences against a vendor apply to multiple systems, while saving against a fides key only applies to the particular system.
    
    - Have TCFFeature record inherit from fideslang Features.
    - Only embed TCF components beneath other components if they don't already exist.
    - Add the ability to save that consent for specific systems was served, and to also save preferences against a specific system.
    pattisdr committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    5e5cef2 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2023

  1. Configuration menu
    Copy the full SHA
    93f1604 View commit details
    Browse the repository at this point in the history
  2. Bump downrev.

    pattisdr committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    2687e97 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'tcf_backend_poc' into fides_3876_remaining_tcf_overlay_…

    …contents
    
    # Conflicts:
    #	tests/ops/util/test_tcf_util.py
    pattisdr committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    5560421 View commit details
    Browse the repository at this point in the history
  4. Respond to some CR comments - group TCF attributes together on models…

    …, add docstring to privacy experience endpoint, rename confusing query param, define has_tcf_contents_variable close to where we build the base contents.
    pattisdr committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    0d2525b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    25efb1c View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2023

  1. Configuration menu
    Copy the full SHA
    e7a3133 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bf24bf9 View commit details
    Browse the repository at this point in the history
  3. Consolidate TCF migration and identity system by id instead of fides_…

    …key to avoid potential overlaps with custom vendor_ids from the dictionary.
    pattisdr committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    46fa4c6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4380b57 View commit details
    Browse the repository at this point in the history
  5. Add validation when saving that tcf purposes, special purposes, featu…

    …res, or special features were served.
    pattisdr committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    715a615 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2023

  1. Configuration menu
    Copy the full SHA
    249d041 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2023

  1. Configuration menu
    Copy the full SHA
    86b445d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f837f83 View commit details
    Browse the repository at this point in the history
  3. - Sort systems/vendors by name, leaving purposes/features sorted by id

    - Sort legal_bases by name
    pattisdr committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    e9f26b6 View commit details
    Browse the repository at this point in the history
  4. Bump fideslang requirement.

    pattisdr committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    8e5d930 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. Fix bug where different systems have different legal_basis_for_proces…

    …sing for the same use.
    pattisdr committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    94c67cf View commit details
    Browse the repository at this point in the history
  2. Add further code comments

    pattisdr committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    5bfa356 View commit details
    Browse the repository at this point in the history
  3. Refactor building tcf overlay for new criteria regarding which system…

    …s appear. In short, a system shows up if it has a gvl-relevant data use, and a legal basis of consent or legitimate interests. If it just has a gvl feature, that is not enough for the system to appear. Further, if a feature is going to show up, it has to be on the same privacy declaration as a gvl data use.
    pattisdr committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    53f9ad4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    07eb26e View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2023

  1. Configuration menu
    Copy the full SHA
    042ab78 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a706dff View commit details
    Browse the repository at this point in the history
  3. bump fideslang dep

    adamsachs committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    e46b9ba View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1c4248d View commit details
    Browse the repository at this point in the history
  5. Refactor how PrivacyPreferenceHistory.determine_relevant_systems work…

    …s. This method runs when a privacy preference is saved, and it takes a snapshot of the systems that are relevant for that preference at that point in time.
    
    For TCF systems, a starting point for the system to be relevant is that it has to have a GVL-related data use and a legal basis of processing of consent or legitimate interests.  From there, we further filter those systems that match a specific use, feature, or system/vendor id.
    pattisdr committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    ac3ffee View commit details
    Browse the repository at this point in the history
  6. Update database annotations.

    pattisdr committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    f4e6fb6 View commit details
    Browse the repository at this point in the history
  7. Improve type hinting.

    pattisdr committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    031fdce View commit details
    Browse the repository at this point in the history
  8. Return historical preferences saved against system.

    - Test cache_saved_and_served_on_consent_record against features
    - Update _validate_before_saving_consent_history test to include systems
    pattisdr committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    2ff52e9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    bd40f38 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3d3808d View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2023

  1. Fix 500 error when updating tcf experience config, due to the underly…

    …ing method not completely handling the tcf overlay type.
    
    Split out served notice history endpoints from related privacy preference endpoints for pylint - privacy preference endpoints file way too large.
    pattisdr committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    29307b8 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2023

  1. For completeness, verify that privacy center endpoints (getting, savi…

    …ng) work with TCF without error.
    
    - Don't return TCF data in the privacy center unless TCF is turned on. (hopefully the FE is just looking at privacy preferences saved against notices).
    pattisdr committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    163815c View commit details
    Browse the repository at this point in the history
  2. Merge main

    pattisdr committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    50ab1bd View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2023

  1. Configuration menu
    Copy the full SHA
    9137949 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2023

  1. Merge branch 'main' into tcf_backend_poc

    # Conflicts:
    #	requirements.txt
    
    Pin fideslang to TCF work branched off of 1.4.6.  Bump downrev of tcf columns.
    pattisdr committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    39aecf0 View commit details
    Browse the repository at this point in the history
  2. Respond to some CR comments:

    - Removing auto-generated messaging template commits from my already-large migration.
    - Revert consent settings endpoint to being public again
    - Add an alias to for has_notices query param.
    - Try to better clarify when saving TCF preferences that nothing is saved if preferences are an empty list.
    - Fix mypy region issue
    - Add code comments to automatically generated migration that adds a lot of new columns
    - Get rid of _clone_top_level_record_then_add_legal_bases function
    - Add assert_length_of_tcf_sections helper, and add an auto use fixture for clearing the cache
    - "..ad_serving" is not a fideslang data use
    pattisdr committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    46dc739 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2023

  1. Merge branch 'main' into tcf_backend_poc

    # Conflicts:
    #	requirements.txt
    #	tests/fixtures/application_fixtures.py
    pattisdr committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    9197765 View commit details
    Browse the repository at this point in the history
  2. Bump downrev

    pattisdr committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    19cc0aa View commit details
    Browse the repository at this point in the history
  3. Continue to respond to CR

    - Update features to v3
    - Get rid of lru_cache.
    - Rearrange where we're extending legal bases
    pattisdr committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    d87fce5 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. Pylint

    pattisdr committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    8ccea25 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca3928d View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2023

  1. Configuration menu
    Copy the full SHA
    1f6f061 View commit details
    Browse the repository at this point in the history
  2. Update changelog.

    pattisdr committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    ca1d498 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    97c4507 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. Configuration menu
    Copy the full SHA
    0523079 View commit details
    Browse the repository at this point in the history
  2. Refactor overlay to allow components to not necessarily be notice dri…

    …ven (#3870)
    
    Co-authored-by: eastandwestwind <[email protected]>
    Co-authored-by: Adam Sachs <[email protected]>
    3 people authored Sep 19, 2023
    Configuration menu
    Copy the full SHA
    db4a7ed View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2023

  1. Merge main:

    Conflicts: Changelog, migrations.
    pattisdr committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    ff1e9c9 View commit details
    Browse the repository at this point in the history