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

Search for PrivacyRequest based on hashed identity [#765] #847

Merged
merged 28 commits into from
Jul 12, 2022

Conversation

seanpreston
Copy link
Contributor

@seanpreston seanpreston commented Jul 11, 2022

Purpose

This PR adds exact match searching for identities.

Changes

  • adds identity query param to get_request_status API view
  • upon receiving an identity param, we hash the value with ProvidedIdentity.hash_value(...) then search the ProvidedIdentity table for a matching hashed value
  • we then add any matching ProvidedIdentity.privacy_request_id values to the main query.filter(...) search, so as to maintain compatibility with other filters

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 #765

@seanpreston seanpreston changed the title 765 id search Search for PrivacyRequest based on hashed identity [#765] Jul 11, 2022
@seanpreston seanpreston marked this pull request as ready for review July 12, 2022 11:01
Copy link
Contributor

@TheAndrewJackson TheAndrewJackson left a comment

Choose a reason for hiding this comment

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

LGTM. That's an interesting use of column to get back the ids. I haven't seen it before.

@TheAndrewJackson TheAndrewJackson merged commit eaf5578 into main Jul 12, 2022
@TheAndrewJackson TheAndrewJackson deleted the 765-id-search branch July 12, 2022 15:56
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* adds identity fields to PrivacyRequest model

* store identity data inside database

* update changelog

* add identities in test data command

* store identities provided via the DRP creation endpoint

* black + isort

* store provided identity data in request creation from onetrust

* remove deprecated migration

* adds new provided identity table

* use new provided identity table

* add docstring, remove comment

* update DRP privacy request creation to use ProvidedIdentity model

* update identity creation in test data command

* use persisted identity in OneTrust

* update test to use persisted identity

* isort update

* use enums

* optionally receive a salt in hash_value cmd

* use a constant salt for provided identity hashing

* remove import

* use typehints

* update typedef

* use enum in dict

* test for exact match search

* added exact match search to request status api

* import order

* update CHANGELOG
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.

Ability to search for subject requests on identity
2 participants