ENG-2694: Add fides_external_id option to FidesJS SDK to provide a custom ID on preferences#7094
ENG-2694: Add fides_external_id option to FidesJS SDK to provide a custom ID on preferences#7094
fides_external_id option to FidesJS SDK to provide a custom ID on preferences#7094Conversation
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/two-factor-authentication |
NevilleS
left a comment
There was a problem hiding this comment.
some changes needed to tidy this up
clients/privacy-center/components/consent/notice-driven/NoticeDrivenConsent.tsx
Outdated
Show resolved
Hide resolved
clients/privacy-center/components/consent/notice-driven/NoticeDrivenConsent.tsx
Outdated
Show resolved
Hide resolved
clients/privacy-center/cypress/e2e/fides-js/consent-notices.cy.ts
Outdated
Show resolved
Hide resolved
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
NevilleS
left a comment
There was a problem hiding this comment.
missed one more unneeded change
clients/privacy-center/cypress/e2e/fides-js/consent-notices.cy.ts
Outdated
Show resolved
Hide resolved
911b7c9 to
132262d
Compare
- Add fidesExternalId to type definitions, override support, and init defaults - Document fides_external_id and add test mock default - Implement cookie storage and persistence for external_id - Add FIDES_EXTERNAL_ID env/API support in Privacy Center - Add Cypress tests for external_id in consent banner - Revert Privacy Center notice-driven component usage per review Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
4132479 to
b3f2b06
Compare
NevilleS
left a comment
There was a problem hiding this comment.
Self review notes
clients/privacy-center/app/server-utils/PrivacyCenterSettings.ts
Outdated
Show resolved
Hide resolved
clients/privacy-center/app/server-utils/loadEnvironmentVariables.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile OverviewGreptile SummaryAdded support for Key changes:
Implementation notes:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 3899a21 |
gilluminate
left a comment
There was a problem hiding this comment.
Looks good! tested locally and it works well. Just one clarification question and good to go!
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…nt-constants override Co-authored-by: Cursor <cursoragent@cursor.com>
…y fides_external_id; cookie use ?? Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # clients/fides-js/src/lib/cookie.ts
|
Updated the PR description to include the |
fides_external_id option to FidesJS SDK to provide a custom ID on preferencesfides_external_id option to FidesJS SDK to provide a custom ID on preferences
Co-authored-by: Cursor <cursoragent@cursor.com>
gilluminate
left a comment
There was a problem hiding this comment.
Approved with nit-picks. No blockers though. 👍
…_OPTION_KEY_EXTERNAL_ID - Add normalizeIdentityValue() to centralize null/undefined/empty/whitespace handling - Refactor makeDefaultIdentity, getOrMakeFidesCookie, and setIdentity to use it - Use FIDES_IDENTITY_OPTION_KEY_EXTERNAL_ID in consent-constants override config - Add unit tests for normalizeIdentityValue - Update setIdentity error message for whitespace-only rejection Co-authored-by: Neville Samuell <NevilleS@users.noreply.github.com>
Co-authored-by: Neville Samuell <NevilleS@users.noreply.github.com>
Importing from cookie into consent-constants causes Cypress suite failures. The constant was not used anywhere in the codebase. Co-authored-by: Neville Samuell <NevilleS@users.noreply.github.com>
Co-authored-by: Neville Samuell <NevilleS@users.noreply.github.com>
Ticket ENG-2694
Description Of Changes
Add support for an optional
fides_external_idin FidesJS so customers can pass a custom user ID that is sent with privacy-preferences and notices-served API calls and stored in the consent cookie. The option can be set via init options, overrides (query param, cookie, window), and in the Privacy Center viaFIDES_EXTERNAL_IDenv and the/fides.jsAPI.Fides.setIdentity()helper: Customers can set identity after init viaFides.setIdentity({ external_id: "user-123" }). Onlyexternal_idis supported; reserved keys (e.g.fides_user_device_id) and verified keys (email,phone_number) throw. Empty or whitespace-onlyexternal_idthrows (omit the key to leave identity unchanged). Values are trimmed before saving. Init treats empty/whitespacefides_external_idas not set, consistent with setIdentity. Identity key constants are centralized incookie.ts(FIDES_* prefixed).Code Changes
fidesExternalIdto FidesJS type definitions, consent constants (override validation), and init defaultsexternal_idin cookie identity ingetOrMakeFidesCookie/makeFidesCookie/makeDefaultIdentityFIDES_EXTERNAL_IDto Privacy Center settings, env loading, and fides.js API configfides_external_idin FidesOptions docs and add Cypress tests for external_id in consent banner flowsFides.setIdentity(identity)in consent-types, set-identity module (validation, trim, empty/whitespace reject), init-utils wiring; JSDoc and generated Fides.md; unit tests (incl. empty string, whitespace-only, trim); Cypress tests (setIdentity then save, validation errors, empty string, GPC edge case)fidesExternalIdas not set; use??for device-id fallback; FidesOptions docs note empty/whitespace behaviorSteps to Confirm
fides_external_idset via override or init; confirm privacy-preferences and notices-served requests include the id and the consent cookie stores it.Fides.setIdentity({ external_id: "user-456" })then save preferences; confirm the id is in the API request. CallsetIdentity({ external_id: "" })and confirm it throws; omit the key and confirm identity is unchanged.Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works