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

Custom identities #4764

Merged
merged 42 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8ceedea
First pass of custom identities
galvana Mar 30, 2024
303fdaf
Fixing tests
galvana Apr 1, 2024
e4affb3
Fixing migration
galvana Apr 1, 2024
002aaeb
Formatting cleanup
galvana Apr 1, 2024
56bde74
Cleanup
galvana Apr 1, 2024
75e513d
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 1, 2024
5e44592
Updating identity caching to support dicts
galvana Apr 1, 2024
c763758
Fixing cache tests
galvana Apr 1, 2024
20ba58d
Removing unused import
galvana Apr 1, 2024
369c9ba
Fixing test
galvana Apr 2, 2024
d728357
Fixing integration test
galvana Apr 2, 2024
c635afc
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 2, 2024
a71d715
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 2, 2024
15e892d
Updating Privacy Center form to support custom identities
galvana Apr 2, 2024
bdbfe8c
Updating Admin UI to support new identity format
galvana Apr 2, 2024
1ce66d2
Updating pre_process_input_data to deduplicate results
galvana Apr 3, 2024
dd38cb0
Additional front-end cleanup
galvana Apr 4, 2024
24f3925
Adding integration test for custom identities
galvana Apr 4, 2024
2f6d878
Fixing tests
galvana Apr 4, 2024
afc550b
Front-end fixes
galvana Apr 4, 2024
674dfe2
Fixing smoke test
galvana Apr 4, 2024
768bf7a
Fixing smoke test assertion
galvana Apr 4, 2024
b6a45d8
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 4, 2024
454a7e7
Fixing Cypress fixtures
galvana Apr 4, 2024
035d180
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 4, 2024
6f19304
Adding test
galvana Apr 4, 2024
db238f8
Updating Cookie House demo
galvana Apr 5, 2024
8255b04
Adding extra identities to DSR package
galvana Apr 5, 2024
0f9716f
Fixing mypy errors
galvana Apr 5, 2024
910e9ae
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 5, 2024
705ee4f
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 8, 2024
581e18a
Codecov test
galvana Apr 8, 2024
8e1043c
Fixing privacy request form validation
galvana Apr 8, 2024
a2da376
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 8, 2024
ae6e330
Changes based on PR feedback
galvana Apr 8, 2024
6ae9c8b
Adding more tests
galvana Apr 8, 2024
8e84a72
Fixing down rev
galvana Apr 9, 2024
4e42ce9
Updating sample project to fix smoke test
galvana Apr 9, 2024
ccd5374
Fixing value fallback logic
galvana Apr 9, 2024
d8dfdd9
Fixing fallback logic
galvana Apr 9, 2024
4b448f0
Merge branch 'main' into PROD-1806-custom-identities
galvana Apr 9, 2024
98f7c26
Updating change log
galvana Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .fides/db_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,8 @@ dataset:
data_categories: [user.contact, user.unique_id]
- name: field_name
data_categories: [system.operations]
- name: field_label
data_categories: [system.operations]
- name: hashed_value
data_categories: [user.contact, user.unique_id]
- name: id
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The types of changes are:
- Added `getModalLinkLabel` method to global fides object [#4766](https://github.com/ethyca/fides/pull/4766)
- Added language switcher to fides overlay modal [#4773](https://github.com/ethyca/fides/pull/4773)
- Added modal link label to experience translation model [#4767](https://github.com/ethyca/fides/pull/4767)
- Added support for custom identities [#4764](https://github.com/ethyca/fides/pull/4764)

### Changed
- Changed the Stripe integration for `Cards` to delete instead of update due to possible issues of a past expiration date [#4768](https://github.com/ethyca/fides/pull/4768)
Expand Down
39 changes: 30 additions & 9 deletions clients/admin-ui/cypress/fixtures/privacy-requests/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"paused_at": null,
"status": "pending",
"external_id": null,
"identity": { "phone_number": null, "email": "[email protected]" },
"identity": {
"phone_number": { "label": "Phone number", "value": null },
"email": { "label": "Email", "value": "[email protected]" }
},
"custom_privacy_request_fields": {
"account_id": { "label": "Account ID", "value": 1 },
"user_id": { "label": "User ID", "value": "123" },
Expand Down Expand Up @@ -61,7 +64,10 @@
"paused_at": null,
"status": "pending",
"external_id": null,
"identity": { "phone_number": null, "email": "[email protected]" },
"identity": {
"phone_number": { "label": "Phone number", "value": null },
"email": { "label": "Email", "value": "[email protected]" }
},
"policy": {
"name": "default_access_policy",
"key": "default_access_policy",
Expand Down Expand Up @@ -104,7 +110,10 @@
"paused_at": null,
"status": "pending",
"external_id": null,
"identity": { "phone_number": null, "email": "[email protected]" },
"identity": {
"phone_number": { "label": "Phone number", "value": null },
"email": { "label": "Email", "value": "[email protected]" }
},
"policy": {
"name": "default_access_policy",
"key": "default_access_policy",
Expand Down Expand Up @@ -147,7 +156,10 @@
"paused_at": null,
"status": "pending",
"external_id": null,
"identity": { "phone_number": null, "email": "[email protected]" },
"identity": {
"phone_number": { "label": "Phone number", "value": null },
"email": { "label": "Email", "value": "[email protected]" }
},
"policy": {
"name": "default_access_policy",
"key": "default_access_policy",
Expand Down Expand Up @@ -190,7 +202,10 @@
"paused_at": null,
"status": "complete",
"external_id": null,
"identity": { "phone_number": null, "email": "[email protected]" },
"identity": {
"phone_number": { "label": "Phone number", "value": null },
"email": { "label": "Email", "value": "[email protected]" }
},
"policy": {
"name": "default_access_policy",
"key": "default_access_policy",
Expand Down Expand Up @@ -233,7 +248,10 @@
"paused_at": null,
"status": "complete",
"external_id": null,
"identity": { "phone_number": null, "email": "[email protected]" },
"identity": {
"phone_number": { "label": "Phone number", "value": null },
"email": { "label": "Email", "value": "[email protected]" }
},
"policy": {
"name": "default_access_policy",
"key": "default_access_policy",
Expand Down Expand Up @@ -276,7 +294,10 @@
"paused_at": null,
"status": "complete",
"external_id": null,
"identity": { "phone_number": null, "email": "[email protected]" },
"identity": {
"phone_number": { "label": "Phone number", "value": null },
"email": { "label": "Email", "value": "[email protected]" }
},
"policy": {
"name": "default_access_policy",
"key": "default_access_policy",
Expand Down Expand Up @@ -320,8 +341,8 @@
"status": "error",
"external_id": null,
"identity": {
"phone_number": "+14155551234",
"email": "[email protected]"
"phone_number": { "label": "Phone number", "value": "+14155551234" },
"email": { "label": "Email", "value": "[email protected]" }
},
"policy": {
"name": "default_access_policy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,31 @@ const ApprovePrivacyRequestModal = ({
Are you sure you want to approve this privacy request?
</Text>
<UnorderedList>
{identity.email && (
<ListItem>
<Flex alignItems="flex-start">
<Text mr={2} fontSize="sm" color="gray.900" fontWeight="500">
Email:
</Text>
<Text color="gray.600" fontWeight="500" fontSize="sm" mr={2}>
{identity.email} (
{identityVerifiedAt ? "Verified" : "Unverified"})
</Text>
</Flex>
</ListItem>
)}
{identity.phone_number && (
<ListItem>
<Flex alignItems="flex-start">
<Text mr={2} fontSize="sm" color="gray.900" fontWeight="500">
Phone Number:
</Text>
<Text color="gray.600" fontWeight="500" fontSize="sm" mr={2}>
{identity.phone_number} (
{identityVerifiedAt ? "Verified" : "Unverified"})
</Text>
</Flex>
</ListItem>
)}
{Object.entries(identity)
.filter(([, { value }]) => value !== null)
.map(([key, { value, label }]) => (
<ListItem key={key}>
<Flex key={key} alignItems="flex-start">
<Text
mr={2}
fontSize="sm"
color="gray.900"
fontWeight="500"
>
{label}:
</Text>
<Text
color="gray.600"
fontWeight="500"
fontSize="sm"
mr={2}
>
{value}
</Text>
({identityVerifiedAt ? "Verified" : "Unverified"})
</Flex>
</ListItem>
))}
{customPrivacyRequestFields &&
Object.entries(customPrivacyRequestFields)
.filter(([, item]) => item.value)
Expand All @@ -101,8 +100,8 @@ const ApprovePrivacyRequestModal = ({
{Array.isArray(item.value)
? item.value.join(", ")
: item.value}{" "}
(Unverified)
</Text>
(Unverified)
</Flex>
</ListItem>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ const RequestDetails = ({ subjectRequest }: RequestDetailsProps) => {

return (
<>
<Heading color="gray.900" fontSize="lg" fontWeight="semibold" mb={4}>
<Heading
color="gray.900"
fontSize="lg"
fontWeight="semibold"
mt={4}
mb={4}
>
Request details
</Heading>
<Divider />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ const RequestRow = ({
<PII
data={
request.identity
? request.identity.email || request.identity.phone_number || ""
? request.identity.email.value ||
request.identity.phone_number.value ||
""
: ""
}
revealPII={revealPII}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,58 +36,40 @@ const SubjectIdentities = ({ subjectRequest }: SubjectIdentitiesProps) => {
</Text>
</Flex>
</Flex>
<Divider />

{identity.email && (
<Flex alignItems="center">
<Text
mt={4}
mb={4}
mr={2}
fontSize="sm"
color="gray.900"
fontWeight="500"
>
Email:
</Text>
<Text color="gray.600" fontWeight="500" fontSize="sm" mr={2}>
<PII
data={identity.email ? identity.email : ""}
revealPII={revealPII}
/>
</Text>
<Tag color="white" bg="primary.400" fontWeight="medium" fontSize="sm">
{identityVerifiedAt ? "Verified" : "Unverified"}
</Tag>
</Flex>
)}
{identity.phone_number && (
<Flex alignItems="flex-start">
<Text mb={4} mr={2} fontSize="sm" color="gray.900" fontWeight="500">
Mobile:
</Text>
<Text color="gray.600" fontWeight="500" fontSize="sm">
<PII
data={identity.phone_number ? identity.phone_number : ""}
revealPII={revealPII}
/>
</Text>
<Tag color="white" bg="primary.400" fontWeight="medium" fontSize="sm">
{identityVerifiedAt ? "Verified" : "Unverified"}
</Tag>
</Flex>
)}
<Divider mb={4} />
{Object.entries(identity)
.filter(([, { value }]) => value !== null)
.map(([key, { value, label }]) => (
<Flex key={key} alignItems="flex-start">
<Text mb={4} mr={2} fontSize="sm" color="gray.900" fontWeight="500">
{label}:
</Text>
<Text color="gray.600" fontWeight="500" fontSize="sm" mr={2}>
<PII data={value || ""} revealPII={revealPII} />
</Text>
<Tag
color="white"
bg="primary.400"
fontWeight="medium"
fontSize="sm"
>
{identityVerifiedAt ? "Verified" : "Unverified"}
</Tag>
</Flex>
))}
{customPrivacyRequestFields &&
Object.keys(customPrivacyRequestFields).length > 0 && (
<>
<Heading
color="gray.900"
fontSize="sm"
fontSize="lg"
fontWeight="semibold"
mt={4}
mb={4}
>
Custom privacy request fields
Custom request fields
</Heading>
<Divider mb={4} />
{Object.entries(customPrivacyRequestFields)
.filter(([, item]) => item.value)
.map(([key, item]) => (
Expand Down
3 changes: 1 addition & 2 deletions clients/admin-ui/src/features/privacy-requests/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ export interface PrivacyRequestEntity {
status: PrivacyRequestStatus;
results?: PrivacyRequestResults;
identity: {
email?: string;
phone_number?: string;
[key: string]: { label: string; value: any };
};
identity_verified_at?: string;
custom_privacy_request_fields?: {
Expand Down
7 changes: 2 additions & 5 deletions clients/cypress-e2e/cypress/e2e/smoke_test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe("Smoke test", () => {
cy.getByTestId("card").contains("Access your data").click();
cy.getByTestId("privacy-request-form").within(() => {
cy.get("input#email").type("[email protected]");
cy.get("input#loyalty_id").type("CH-1");
cy.get("input#first_name").type("Jenny");
cy.get("input#color").clear().type("blue");
cy.get("button").contains("Continue").click();
Expand All @@ -30,17 +31,13 @@ describe("Smoke test", () => {
{
identity: {
email: "[email protected]",
phone_number: "",
loyalty_id: { label: "Loyalty ID", value: "CH-1" },
},
custom_privacy_request_fields: {
first_name: {
label: "First name",
value: "Jenny",
},
last_name: {
label: "Last name",
value: "",
},
color: {
label: "Color",
value: "blue",
Expand Down
Loading
Loading