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 Cookies and Surface with Privacy Notices #3572

Merged
merged 28 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
22cd8aa
Initial commit - add a Cookies table with FK's to PrivacyDeclaration …
pattisdr Jun 14, 2023
bb4282d
Add optional path and domain to Cookies and allow upsert_cookies to u…
pattisdr Jun 15, 2023
29e2a2d
Surface relevant cookies on privacy notices by data use.
pattisdr Jun 15, 2023
f4a6936
Update fideslang version which removes cookies from System request, a…
pattisdr Jun 15, 2023
f5cca57
Remove the index from path and domain.
pattisdr Jun 15, 2023
1e8247c
Merge branch 'main' into fides_3478_system_cookies
pattisdr Jun 15, 2023
c510d1d
Merge main:
pattisdr Jun 16, 2023
561290e
Try to make tests more predictable.
pattisdr Jun 16, 2023
df5a462
Update changelog.
pattisdr Jun 16, 2023
a5b9125
Merge branch 'main' into fides_3478_system_cookies
pattisdr Jun 19, 2023
04ce44a
Add missing fixture.
pattisdr Jun 19, 2023
399ec19
Merge main, conflicts:
pattisdr Jun 20, 2023
9911bf2
Bump fides lang commit to see if organization relationship key findin…
pattisdr Jun 20, 2023
ba64204
Make history tests more reliable - there's no guarantee that these ar…
pattisdr Jun 20, 2023
47010a9
Bump fideslang commit
pattisdr Jun 20, 2023
3ee9f3a
fix: bump fideslang version for testing
ThomasLaPiana Jun 21, 2023
e134836
Merge branch 'main' into fides_3478_system_cookies
ThomasLaPiana Jun 21, 2023
805393e
fix: pin pydantic to a new version supported by fideslang
ThomasLaPiana Jun 21, 2023
02ac533
Merge main, conflicts:
pattisdr Jun 21, 2023
f597094
Try sorting declarations for repeatability in tests.
pattisdr Jun 21, 2023
c8493db
Data use cookie field (#3571)
allisonking Jun 21, 2023
2720914
`fides-js` and privacy center cookie enforcement (#3569)
allisonking Jun 21, 2023
a879831
More attempts to improve reliability of cookie tests
pattisdr Jun 21, 2023
16d9355
Fix new mypy errors.
pattisdr Jun 21, 2023
9e0bb35
Bump fideslang to 1.4.2.
pattisdr Jun 21, 2023
d9988ef
Merge branch 'main' into fides_3478_system_cookies
pattisdr Jun 21, 2023
478a951
Merge branch 'main' into fides_3478_system_cookies
pattisdr Jun 21, 2023
d283aab
Classmethod placement was preventing validator from running.
pattisdr Jun 21, 2023
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
37 changes: 37 additions & 0 deletions .fides/db_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2240,4 +2240,41 @@ dataset:
description: 'The name of the organization this Fides deployment belongs to'
data_categories:
- user.workplace
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: cookies
description: 'Fides Generated Description for Table: cookies'
data_categories: []
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
fields:
- name: created_at
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: domain
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: id
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: name
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: path
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: privacy_declaration_id
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: system_id
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: updated_at
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ The types of changes are:
- HTML format for privacy request storage destinations [#3427](https://github.com/ethyca/fides/pull/3427)
- Persistent message showing result and timestamp of last integration test to "Integrations" tab in system view [#3628](https://github.com/ethyca/fides/pull/3628)
- Access and erasure support for SurveyMonkey [#3590](https://github.com/ethyca/fides/pull/3590)
- New Cookies Table for storing cookies associated with systems and privacy declarations [#3572](https://github.com/ethyca/fides/pull/3572)
- `fides-js` and privacy center now delete cookies associated with notices that were opted out of [#3569](https://github.com/ethyca/fides/pull/3569)
- Cookie input field on system data use tab [#3571](https://github.com/ethyca/fides/pull/3571)

### Fixed

Expand Down Expand Up @@ -198,7 +201,7 @@ The types of changes are:

### Developer Experience

- Use prettier to format *all* source files in client packages [#3240](https://github.com/ethyca/fides/pull/3240)
- Use prettier to format _all_ source files in client packages [#3240](https://github.com/ethyca/fides/pull/3240)

### Deprecated

Expand Down
2 changes: 2 additions & 0 deletions clients/admin-ui/cypress/e2e/systems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ describe("System management page", () => {
data_categories: declaration.data_categories,
data_subjects: declaration.data_subjects,
dataset_references: ["demo_users_dataset_2"],
cookies: [],
id: "",
});
});
});
Expand Down
4 changes: 3 additions & 1 deletion clients/admin-ui/cypress/fixtures/systems/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"data_use": "improve.system",
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
"data_subjects": ["customer"],
"dataset_references": ["demo_users_dataset"]
"dataset_references": ["demo_users_dataset"],
"cookies": [],
"id": "pri_ac9d4dfb-d033-4b06-bc7f-968df8d125ff"
}
],
"joint_controller": { "name": "Sally Controller" },
Expand Down
12 changes: 9 additions & 3 deletions clients/admin-ui/cypress/fixtures/systems/systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"data_use": "improve.system",
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
"data_subjects": ["anonymous_user"],
"dataset_references": ["public"]
"dataset_references": ["public"],
"cookies": [],
"id": "pri_ac9d4dfb-d033-4b06-bc7f-968df8d125ff"
}
],
"joint_controller": null,
Expand Down Expand Up @@ -59,7 +61,9 @@
"data_subjects": ["customer"],
"dataset_references": ["demo_users_dataset"],
"egress": null,
"ingress": null
"ingress": null,
"cookies": [],
"id": "pri_ac9d4dfb-d033-4b06-bc7f-968df8d125ff"
}
],
"joint_controller": null,
Expand Down Expand Up @@ -99,7 +103,9 @@
"data_subjects": ["customer"],
"dataset_references": null,
"egress": null,
"ingress": null
"ingress": null,
"cookies": [],
"id": "pri_06430a1c-1365-422e-90a7-d444ddb32181"
}
],
"joint_controller": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"data_use": "improve.system",
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
"data_subjects": ["anonymous_user"],
"dataset_references": ["public"]
"dataset_references": ["public"],
"cookies": [],
"id": "pri_ac9d4dfb-d033-4b06-bc7f-968df8d125ff"
},
{
"name": "Collect data for marketing",
Expand All @@ -27,7 +29,9 @@
"data_subjects": ["customer"],
"dataset_references": null,
"egress": null,
"ingress": null
"ingress": null,
"cookies": [],
"id": "pri_bc6e6efe-f122-3e33-ac9a-732ae8b437bb"
}
],
"joint_controller": null,
Expand Down
19 changes: 12 additions & 7 deletions clients/admin-ui/src/features/common/form/inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,21 +316,26 @@ const CreatableSelectInput = ({
size={size}
classNamePrefix="custom-creatable-select"
chakraStyles={{
container: (provided) => ({ ...provided, flexGrow: 1 }),
container: (provided) => ({
...provided,
flexGrow: 1,
backgroundColor: "white",
}),
dropdownIndicator: (provided) => ({
...provided,
background: "white",
bg: "transparent",
px: 2,
cursor: "inherit",
}),
indicatorSeparator: (provided) => ({
...provided,
display: "none",
}),
multiValue: (provided) => ({
...provided,
background: "primary.400",
color: "white",
}),
multiValueRemove: (provided) => ({
...provided,
display: "none",
visibility: "hidden",
}),
}}
components={components}
isSearchable={isSearchable}
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/src/features/system/SystemFormTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const SystemFormTabs = ({
label: "Data uses",
content: activeSystem ? (
<Box px={6} width={{ base: "100%", lg: "70%" }}>
<PrivacyDeclarationStep system={activeSystem as System} />
<PrivacyDeclarationStep system={activeSystem} />
</Box>
) : null,
isDisabled: !activeSystem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,40 @@ import {
import { Form, Formik } from "formik";

import { FormGuard } from "~/features/common/hooks/useIsAnyFormDirty";
import { PrivacyDeclarationResponse } from "~/types/api";

import {
DataProps,
PrivacyDeclarationFormComponents,
usePrivacyDeclarationForm,
ValidationSchema,
} from "./PrivacyDeclarationForm";
import { PrivacyDeclarationWithId } from "./types";

interface AccordionProps extends DataProps {
privacyDeclarations: PrivacyDeclarationWithId[];
privacyDeclarations: PrivacyDeclarationResponse[];
onEdit: (
oldDeclaration: PrivacyDeclarationWithId,
newDeclaration: PrivacyDeclarationWithId
) => Promise<PrivacyDeclarationWithId[] | undefined>;
oldDeclaration: PrivacyDeclarationResponse,
newDeclaration: PrivacyDeclarationResponse
) => Promise<PrivacyDeclarationResponse[] | undefined>;
onDelete: (
declaration: PrivacyDeclarationWithId
) => Promise<PrivacyDeclarationWithId[] | undefined>;
declaration: PrivacyDeclarationResponse
) => Promise<PrivacyDeclarationResponse[] | undefined>;
includeCustomFields?: boolean;
includeCookies?: boolean;
}

const PrivacyDeclarationAccordionItem = ({
privacyDeclaration,
onEdit,
onDelete,
includeCustomFields,
includeCookies,
...dataProps
}: { privacyDeclaration: PrivacyDeclarationWithId } & Omit<
}: { privacyDeclaration: PrivacyDeclarationResponse } & Omit<
AccordionProps,
"privacyDeclarations"
>) => {
const handleEdit = (values: PrivacyDeclarationWithId) =>
const handleEdit = (values: PrivacyDeclarationResponse) =>
onEdit(privacyDeclaration, values);

const { initialValues, renderHeader, handleSubmit } =
Expand Down Expand Up @@ -85,6 +87,7 @@ const PrivacyDeclarationAccordionItem = ({
privacyDeclarationId={privacyDeclaration.id}
onDelete={onDelete}
includeCustomFields={includeCustomFields}
includeCookies={includeCookies}
{...dataProps}
/>
</Stack>
Expand Down
Loading