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] Add Required Notice Key to Privacy Notices #3337

Merged
merged 8 commits into from
May 22, 2023

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented May 19, 2023

Closes #3281
❗ Contains migration

Description Of Changes

We need a key for each notice which will be exposed via the Fides consent cookie and the consent object for third parties to use when deciding to load scripts and pixes.

We want a notice key in the database. Out of the box we will pre-populate this but then we can edit it as needed. We will likely add some frontend UX to discourage changing this key. An important criteria right now is that the keys are not unique.

Internal context here

Code Changes

  • Add new required PrivacyNotice.notice_key field that needs to be a fides key
  • Migrate any existing notices in the db to have this field from a lower cased underscored name
  • Now required in the request to create a PrivacyNotice

Steps to Confirm

  • In Postman the Post privacy notices should be supplied a notice key. If none supplied, I create one.

Pre-Merge Checklist

@cypress
Copy link

cypress bot commented May 19, 2023

Passing run #2110 ↗︎

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 5d861c0 into 28f5b3c...
Project: fides Commit: 97ce11a530 ℹ️
Status: Passed Duration: 00:58 💡
Started: May 22, 2023 7:58 PM Ended: May 22, 2023 7:58 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@pattisdr pattisdr marked this pull request as ready for review May 19, 2023 19:30
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (00caa4c) 87.07% compared to head (5d861c0) 87.08%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3337   +/-   ##
=======================================
  Coverage   87.07%   87.08%           
=======================================
  Files         313      313           
  Lines       18970    18988   +18     
  Branches     2473     2475    +2     
=======================================
+ Hits        16519    16536   +17     
- Misses       2009     2010    +1     
  Partials      442      442           
Impacted Files Coverage Δ
.../api/service/connectors/consent_email_connector.py 97.14% <ø> (ø)
src/fides/api/models/privacy_notice.py 99.00% <100.00%> (+0.04%) ⬆️
src/fides/api/schemas/privacy_notice.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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! let's coordinate on FE changes...

@pattisdr
Copy link
Contributor Author

OK @allisonking I'm creating the notice key if not supplied here as a temporary measure to move this forward.

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.

perfect, thanks @pattisdr !!

@pattisdr pattisdr merged commit c83e84e into main May 22, 2023
@pattisdr pattisdr deleted the fides_3281_notice_key branch May 22, 2023 20:36
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.

Add a notice_key to the privacy notices to enable FE integrations
2 participants