-
Notifications
You must be signed in to change notification settings - Fork 72
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
Parse ac string from fides string #4308
Parse ac string from fides string #4308
Conversation
Passing run #4817 ↗︎
Details:
Review all test suite changes for PR #4308 ↗︎ |
Here's some nuances around how the backend works around both returning AC systems and building AC strings |
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.
looks great, just a Q and a small nit, nothing blocking.
/** | ||
* Given an AC string, return a list of its ids, encoded | ||
* | ||
* @example 1~1.2.3 --> [gacp.1, gacp.2, gacp.3] |
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.
Nice! What does the @example
annotation do exactly?
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.
oh heh I think I had just seen it around before, but only just looked up the documentation: https://jsdoc.app/tags-example.html
so it actually looks like it should be in the format of calling the function to show it being used as an example... I'll update the docstring, but basically it formats the following line to look like code
export const idsFromAcString = (acString: string) => { | ||
const isValidAc = /\d~/; | ||
if (!isValidAc.test(acString)) { | ||
return []; |
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.
can we debug log if we have an invalid AC str?
|
||
export const transformFidesStringToCookieKeys = ( | ||
fidesString: string, | ||
debug: boolean | ||
): TcfCookieConsent => { | ||
// Defer: to fully support AC string, we need to split out TC from AC string https://github.com/ethyca/fides/issues/4263 |
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.
🎉
Failing test is one we know about: https://ethyca.atlassian.net/browse/PROD-1272?atlOrigin=eyJpIjoiNzliMjlkYjU4ZjljNDg4ZWEzMDc2YzUzMDcyZDZmMmUiLCJwIjoiaiJ9 |
Closes #4263
Description Of Changes
We are able to take a custom fides string and initialize the
tcf_consent
portion of the cookie. This PR allows us to take a fides string that has an AC string attached, and initialize the AC values on our cookie as well.Code Changes
vendor_consents
based on AC stringSteps to Confirm
fides_string
an entry likeCPz5G8APz5G8AGXABBENAWEAAACAAEIAAAAAAAAKhgAgKhAA.IJawBAABAD-AVCBLUAAA,1~
. The first part might differ, but it should end in,1~
. This is because there are no AC vendors opted in.gacp.89
)fides_string=CPz5G8APz5G8AGXABBENAWEAAACAAEIAAAAAAAAKhgAgKhAA.IJawBAABAD-AVCBLUAAA,1~89
to your URL, i.e. http://localhost:3001/fides-js-demo.html?geolocation=fi-18&fides_string=CPz5G8APz5G8AGXABBENAWEAAACAAEIAAAAAAAAKhgAgKhAA.IJawBAABAD-AVCBLUAAA,1~89. This passes in the fides string as a query parameter for initialization. Replace the89
with the AC vendor ID you addedPre-Merge Checklist
CHANGELOG.md