-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fides String Support for GPP #5845
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
7c9f09f
to
3a9360c
Compare
Are there corresponding docs changes or a ticket to capture this? |
Doc updates are in this same PR |
@eastandwestwind As per my latest commit, I've been thinking about it and I have to agree with you on the region -> API mapping problem. I'm reverting that portion of the code but keeping the other part that relies on it so that it's still the source of truth for all Fides supported regions (only need to update this one place). |
not_available: "000", | ||
opt_out: "111", | ||
not_opt_out: "222", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were just incorrect, so cleaning them up. Doesn't affect the tests.
@@ -149,7 +149,7 @@ SCRIPTS.forEach(({ name, gzipErrorSizeKb, gzipWarnSizeKb, isExtension }) => { | |||
file: `dist/${name}.js`, | |||
name: isExtension ? undefined : "Fides", | |||
format: isExtension ? undefined : "umd", | |||
sourcemap: IS_DEV && !isExtension ? "inline" : false, | |||
sourcemap: IS_DEV ? "inline" : false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note the new support for gpp=debug
below ;)
const createConsentPreferencesToSave = ( | ||
privacyNoticeList: PrivacyNoticeItem[], | ||
enabledPrivacyNoticeKeys: string[], | ||
): SaveConsentPreference[] => | ||
privacyNoticeList.map((item) => { | ||
const userPreference = transformConsentToFidesUserPreference( | ||
enabledPrivacyNoticeKeys.includes(item.notice.notice_key), | ||
item.notice.consent_mechanism, | ||
); | ||
return new SaveConsentPreference( | ||
item.notice, | ||
userPreference, | ||
item.bestTranslation?.privacy_notice_history_id, | ||
); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to a util file for re-usability.
const createConsentPreferencesToSave = ( | ||
privacyNoticeList: PrivacyNoticeWithBestTranslation[], | ||
enabledPrivacyNoticeIds: string[], | ||
): SaveConsentPreference[] => { | ||
if (!privacyNoticeList || !enabledPrivacyNoticeIds) { | ||
return []; | ||
} | ||
return privacyNoticeList.map((item) => { | ||
const userPreference = transformConsentToFidesUserPreference( | ||
enabledPrivacyNoticeIds.includes(item.id), | ||
item.consent_mechanism, | ||
); | ||
return new SaveConsentPreference( | ||
item, | ||
userPreference, | ||
item.bestTranslation?.privacy_notice_history_id, | ||
); | ||
}); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to a util file for re-usability.
const vendorIds = [ | ||
...tcStringPreferences.vendorsConsent, | ||
...tcStringPreferences.vendorsLegint, | ||
] | ||
.filter(vendorIsAc) | ||
.map((id) => decodeVendorId(id).id) | ||
.sort((a, b) => Number(a) - Number(b)) | ||
.join("."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little AI assisted clean up here. No change in functionality. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was actually moved from clients/fides-js/src/lib/tcf/fidesString.ts
and updated to include GPP. GitHub is making it look like this is all brand new.
@@ -57,6 +58,24 @@ describe("Fides-js GPP extension", () => { | |||
}).as("patchNoticesServed"); | |||
}); | |||
|
|||
describe("with GPP forced", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved up from below just because it's more "global" and felt like it belonged here with the other "global" tests.
if (gpp === "debug") { | ||
document.write('<script src="/fides-ext-gpp.js"><\/script>'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when gpp=debug
we're loading the js file instead of including it as part of the fides.js payload. That way we can benefit from the SourceMaps :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, nice work @gilluminate ! Lots of moving parts here, but the key changes look solid.
My comments / Qs above mostly deal with code readability / possible err cases
8aeb9a7
to
19fb7ab
Compare
e5524e4
to
106f1f2
Compare
fides
|
Project |
fides
|
Branch Review |
main
|
Run status |
|
Run duration | 00m 52s |
Commit |
|
Committer | Jason Gill |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
5
|
View all changes introduced in this branch ↗︎ |
Closes LJ-296
Description Of Changes
Fides.js must support a GPP string as a new section in the existing fides_string, so that GPP can be passed back and forth between the server and Fides.js and used to initialize the CMP with existing preferences.
Code Changes
Steps to Confirm
window.Fides.fides_string
value and/or cookie. Fides.js should store GPP as part of the Fides string in a new section after the TCF and AC strings (Example: fides_string: ,,DBABLA~BVAUAAAAAWA.QA) The GPP string should be placed at a third index after TCF and AC, even if there are no values for those strings.fides_string=...
query string, and use each GPP string noted above as the valueapi/v1/privacy-preferences
endpoint is the same.Pre-Merge Checklist
CHANGELOG.md
updatedmain
downgrade()
migration is correct and works