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

#1008 User identity verification flow #1231

Merged
merged 19 commits into from
Sep 1, 2022

Conversation

TheAndrewJackson
Copy link
Contributor

@TheAndrewJackson TheAndrewJackson commented Aug 31, 2022

Purpose

Update the privacy center to utilize #1115 verify a users identity before fulfilling a privacy request.

Changes

  • Refactor modal to have multiple views
  • Refactor Policy cards into separate component
  • Update lint commands to match admin ui

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #1008

User_Identity_verification.mov

@TheAndrewJackson TheAndrewJackson changed the title 1008 user verification code 1008 User identity verification flow Aug 31, 2022
@TheAndrewJackson TheAndrewJackson marked this pull request as ready for review August 31, 2022 16:53
@TheAndrewJackson TheAndrewJackson changed the title 1008 User identity verification flow #1008 User identity verification flow Aug 31, 2022
Copy link
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @TheAndrewJackson ! Just a couple requests, but nothing blocking if you wanted to tackle anything in a follow-up ticket or as part of future work.

Also confirmed e2e testing for the following scenarios:

  1. subject_identity_verification_required set to false created a privacy request with no verification requirements
  2. subject_identity_verification_required set to true with no email config resulted in error message (in future we can deliver a more specific err message when no email config is found, within admin-ui)
  3. subject_identity_verification_required set to true with email config produced an email with verification code. Entering the wrong code resulted in an error message. Entering the correct code proceeded to success state as expected
  4. Confirmed that "try again" sent another code to email
  5. Confirmed success flow for a deletion request

const server = setupServer();
const server = setupServer(
rest.get(
"http://localhost:8080/api/v1/id-verification/config",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use our ${hostUrl} const in tests too? Or is there a specific reason not to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can. There's no particular reason. I'll update it now.

headers: {
Accept: "application/json",
"Content-Type": "application/json",
"X-Fides-Source": "fidesops-privacy-center",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding the source header! since this is duplicated across a couple endpoints, I'm curious whether we can do something similar to the admin-ui, where we have a method to add common headers to all endpoints?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can. I just added it in. It would be nice to keep things consistent between the projects. eslint complained and said the headers-polyfill package needed to be installed. They'll be one more small dependency added to the project. No big deal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much!

} else if (
isVerificationRequired &&
data.succeeded.length &&
data.succeeded[0].status === "identity_unverified"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an enum/type for possible privacy request statuses, and use it here? Something similar to https://github.com/ethyca/fidesops/blob/main/clients/ops/admin-ui/src/features/privacy-requests/types.ts#L1-L10

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I'll add that in. Once everything is unified we may be able to share a lot of these types and util functions between the 2 projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make it an enum instead of a type. Apparently you can't use types in value comparisons.

@eastandwestwind
Copy link
Contributor

Thanks for the updates! Manually e2e testing the happy path now...

@eastandwestwind eastandwestwind merged commit 12de691 into main Sep 1, 2022
@eastandwestwind eastandwestwind deleted the 1008_user_verification_code branch September 1, 2022 19:03
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* Update lint commands and eslint ignore

* Run lints and refactor privacy cards

* Refactor modal

* Finish verification flow

* get config from server

* Update changelong

* Fix test failures

* Format file

* Mock out route

* Format file

* Add code resending

* Update test to use hostUrl

* Add headers util function and PrivacyRequestStatus status enum
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frontend - Privacy center to accept an ID verification code
2 participants