Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Add Consent Request API #1387

Merged
merged 34 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6865902
Start setup of consent
Sep 23, 2022
053d6c1
Add consent request verify
Sep 24, 2022
290c758
Add docstrings
Sep 24, 2022
2d50dd0
Save consent preferences
Sep 26, 2022
06477bd
Fix pylint error
Sep 26, 2022
198de44
Update postman
Sep 26, 2022
e343857
Merge remote-tracking branch 'origin/main' into ps-consent-api
Sep 26, 2022
34a46ba
Update changelog
Sep 26, 2022
b240b05
Fix typo
Sep 26, 2022
3790586
Make mail send sync
Sep 26, 2022
8f37141
Fix changelog formatting
Sep 26, 2022
5bb9437
Update postman collection
Sep 26, 2022
926ccba
Remove unused imports
Sep 26, 2022
30886bd
Fix typos
Sep 26, 2022
9ed2ec9
Add exception handling for verification code sending
Sep 26, 2022
a7d7ad3
Fix postman urls
Sep 26, 2022
c77221c
Add consent_request_id to ConsentRequestResponse
Sep 26, 2022
9090ede
Fix email and query
Sep 26, 2022
a816ac2
Make consent required
Sep 26, 2022
3ebe87b
Fix unique constraint
Sep 26, 2022
b452960
Remove identity from returned consent preferences
Sep 27, 2022
ea5965e
Remove some more identities
Sep 27, 2022
0dd77b8
Create shared function for returning consent
Sep 27, 2022
1162375
Catch integrity error
Sep 27, 2022
23f4602
Add shared function for sending verification coded
Sep 27, 2022
c798753
Remove variable that is no longer used
Sep 27, 2022
e192333
Filter out privacy request identities
Sep 27, 2022
4d77c2b
Fix pylint error
Sep 27, 2022
55c319a
Move pylint comment
Sep 27, 2022
926b3b8
Change from encrypted value to hashed value
Sep 27, 2022
639a1f8
Update from code review
Sep 28, 2022
a59a95b
Merge remote-tracking branch 'origin/main' into ps-consent-api
Sep 28, 2022
8b86c1c
Add classes to tests
Sep 28, 2022
fc1c767
Remove identity from responses
Sep 28, 2022
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
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ The types of changes are:
* `Fixed` for any bug fixes.
* `Security` in case of vulnerabilities.


## [Unreleased](https://github.com/ethyca/fidesops/compare/1.7.2...main)

### Changed

* Refactor privacy center to be more modular [#1363](https://github.com/ethyca/fidesops/pull/1363)

### Fixed

* Distinguish whether webhook has been visited and no fields were found, versus never visited [#1339](https://github.com/ethyca/fidesops/pull/1339)
* Fix Redis Cache Early Expiration in Tests [#1358](https://github.com/ethyca/fidesops/pull/1358)
* Limit values for the offset pagination strategy are now cast to integers before use [#1364](https://github.com/ethyca/fidesops/pull/1364)
Expand All @@ -35,6 +36,7 @@ The types of changes are:
* Allow querying the non-default schema with the Postgres Connector [#1375](https://github.com/ethyca/fidesops/pull/1375)
* Frontend - ability for users to manually enter PII to an IN PROGRESS subject request [#1016](https://github.com/ethyca/fidesops/pull/1377)
* Enable retries on saas connectors for failures at the http request level [#1376](https://github.com/ethyca/fidesops/pull/1376)
* Add consent request api [#1387](https://github.com/ethyca/fidesops/pull/1387)

### Removed

Expand Down Expand Up @@ -131,6 +133,7 @@ The types of changes are:
## [1.7.1](https://github.com/ethyca/fidesops/compare/1.7.0...1.7.1)

### Breaking Changes

The `oauth2` strategy has been renamed to `oauth2_authorization_code` in order to make a distinction between the newly introduced `oauth2_client_credentials` strategy [#1159](https://github.com/ethyca/fidesops/pull/1159)

### Added
Expand All @@ -143,7 +146,7 @@ The `oauth2` strategy has been renamed to `oauth2_authorization_code` in order t
* SaaS Connector Configuration - Testing a Connection [#985](https://github.com/ethyca/fidesops/pull/1099)
* Add an endpoint for verifying the user's identity before queuing the privacy request. [#1111](https://github.com/ethyca/fidesops/pull/1111)
* Adds tests for email endpoints and service [#1112](https://github.com/ethyca/fidesops/pull/1112)
* Adds the ability to verify a subject's identity before processing a Privacy Request [#1115](https://github.com/ethyca/fidesops/pull/1115)
* Adds the ability to verify a subject's identity before processing a Privacy Request [#1115](https://github.com/ethyca/fidesops/pull/1115)
* Add option to login as root user from config[#1116](https://github.com/ethyca/fidesops/pull/1116)
* Added email templates [#1123](https://github.com/ethyca/fidesops/pull/1123)
* Add Retry button back into the subject request detail view [#1128](https://github.com/ethyca/fidesops/pull/1131)
Expand All @@ -158,7 +161,7 @@ The `oauth2` strategy has been renamed to `oauth2_authorization_code` in order t
* Bump fideslib to fix issue where the authenticate button in the FastAPI docs did not work [#1092](https://github.com/ethyca/fidesops/pull/1092)
* Escape the Redis user and password to make them URL friendly [#1104](https://github.com/ethyca/fidesops/pull/1104)
* Reduced number of connections opened against app db during health checks [#1107](https://github.com/ethyca/fidesops/pull/1107)
* Fix FIDESOPS__ROOT_USER__ANALYTICS_ID generation when env var is set [#1113](https://github.com/ethyca/fidesops/pull/1113)
* Fix FIDESOPS**ROOT_USER**ANALYTICS_ID generation when env var is set [#1113](https://github.com/ethyca/fidesops/pull/1113)
* Set localhost to None for non-endpoint events [#1130](https://github.com/ethyca/fidesops/pull/1130)
* Fixed docs build in CI [#1138](https://github.com/ethyca/fidesops/pull/1138)
* Added future annotations to privacy_request.py for backwards compatibility [#1136](https://github.com/ethyca/fidesops/pull/1136)
Expand Down Expand Up @@ -471,7 +474,7 @@ The `oauth2` strategy has been renamed to `oauth2_authorization_code` in order t

* GET routes for users [#405](https://github.com/ethyca/fidesops/pull/405)
* Username based search on GET route [#444](https://github.com/ethyca/fidesops/pull/444)
* FIDESOPS__DEV_MODE for Easier SaaS Request Debugging [#363](https://github.com/ethyca/fidesops/pull/363)
* FIDESOPS\_\_DEV_MODE for Easier SaaS Request Debugging [#363](https://github.com/ethyca/fidesops/pull/363)
* Track user privileges across sessions [#425](https://github.com/ethyca/fidesops/pull/425)
* Add first_name and last_name fields. Also add them along with created_at to FidesUser response [#465](https://github.com/ethyca/fidesops/pull/465)
* Denial reasons for DSR and user `AuditLog` [#463](https://github.com/ethyca/fidesops/pull/463)
Expand Down
200 changes: 167 additions & 33 deletions docs/fidesops/docs/postman/Fidesops.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"info": {
"_postman_id": "296aa41f-49f7-4988-bbfb-b57c480a695f",
"_postman_id": "8f48b8e3-0a39-4e5e-b505-8087064dc1af",
"name": "Fidesops",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "1984786"
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
Expand Down Expand Up @@ -940,35 +939,6 @@
}
},
"response": []
},
{
"name": "Restart failed node",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{client_token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"url": {
"raw": "{{host}}/privacy-request/{{privacy_request_id}}/retry",
"host": [
"{{host}}"
],
"path": [
"privacy-request",
"{{privacy_request_id}}",
"retry"
]
}
},
"response": []
}
]
},
Expand Down Expand Up @@ -4443,6 +4413,40 @@
}
]
},
{
"name": "Restart from Failure",
"item": [
{
"name": "Restart failed node",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{client_token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"url": {
"raw": "{{host}}/privacy-request/{{privacy_request_id}}/retry",
"host": [
"{{host}}"
],
"path": [
"privacy-request",
"{{privacy_request_id}}",
"retry"
]
}
},
"response": []
}
]
},
{
"name": "ConnectionType",
"item": [
Expand Down Expand Up @@ -4753,6 +4757,116 @@
"response": []
}
]
},
{
"name": "Consent Request",
"item": [
{
"name": "Create Verification Code for Consent Request",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"phone_number\": \"{{phone_number}}\",\n \"email\": \"{{email}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{host}}/consent-request",
"host": [
"{{host}}"
],
"path": [
"consent-request"
]
}
},
"response": []
},
{
"name": "Verify Code and Return Current Preferences",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"code\": \"{{verification_code}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{host}}/consent-request/{{consent_request_id}}/verify",
"host": [
"{{host}}"
],
"path": [
"consent-request",
"{{consent_request_id}}",
"verify"
]
}
},
"response": []
},
{
"name": "Verify Code and Save Preferences",
"request": {
"method": "PATCH",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"identity\": {\n \"phone_number\": \"{{phone_number}}\",\n \"email\": \"{{email}}\"\n },\n \"consent\": [\n {\n \"data_use\": \"{{data_use}}\",\n \"data_use_description\": \"{{data_use_description}}\",\n \"opt_in\": {{opt_in}}\n }\n ],\n \"code\": \"{{verification_code}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{host}}/consent-request/{{consent_request_id}}/preferences",
"host": [
"{{host}}"
],
"path": [
"consent-request",
"{{consent_request_id}}",
"preferences"
]
}
},
"response": []
}
],
"auth": {
"type": "noauth"
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
],
"event": [
Expand Down Expand Up @@ -5020,10 +5134,30 @@
"value": "manual_webhook_key",
"type": "string"
},
{
"key": "consent_request_id",
"value": "",
"type": "default"
},
{
"key": "timescale_key",
"value": "",
"type": "string"
},
{
"key": "phone_number",
"value": "",
"type": "string"
},
{
"key": "email",
"value": "",
"type": "string"
},
{
"key": "verification_code",
"value": "",
"type": "string"
}
]
}
}
2 changes: 2 additions & 0 deletions src/fidesops/ops/api/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
config_endpoints,
connection_endpoints,
connection_type_endpoints,
consent_request_endpoints,
dataset_endpoints,
drp_endpoints,
email_endpoints,
Expand All @@ -25,6 +26,7 @@
api_router.include_router(config_endpoints.router)
api_router.include_router(connection_type_endpoints.router)
api_router.include_router(connection_endpoints.router)
api_router.include_router(consent_request_endpoints.router)
api_router.include_router(dataset_endpoints.router)
api_router.include_router(drp_endpoints.router)
api_router.include_router(encryption_endpoints.router)
Expand Down
Loading