This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* 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
- Loading branch information
Sean Preston
committed
Jul 11, 2022
1 parent
55d8e65
commit 9c028f4
Showing
11 changed files
with
266 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
src/fidesops/migrations/versions/3c5e1253465d_adds_provided_identity_table_for_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
"""adds provided identity table for identity storage and later identity search | ||
Revision ID: 3c5e1253465d | ||
Revises: fc90277bbcde | ||
Create Date: 2022-07-08 11:53:05.215848 | ||
""" | ||
import sqlalchemy as sa | ||
import sqlalchemy_utils | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "3c5e1253465d" | ||
down_revision = "fc90277bbcde" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"providedidentity", | ||
sa.Column("id", sa.String(length=255), nullable=False), | ||
sa.Column( | ||
"created_at", | ||
sa.DateTime(timezone=True), | ||
server_default=sa.text("now()"), | ||
nullable=True, | ||
), | ||
sa.Column( | ||
"updated_at", | ||
sa.DateTime(timezone=True), | ||
server_default=sa.text("now()"), | ||
nullable=True, | ||
), | ||
sa.Column("privacy_request_id", sa.String(), nullable=False), | ||
sa.Column( | ||
"field_name", | ||
sa.Enum("email", "phone_number", name="providedidentitytype"), | ||
nullable=False, | ||
), | ||
sa.Column("hashed_value", sa.String(), nullable=True), | ||
sa.Column( | ||
"encrypted_value", | ||
sqlalchemy_utils.types.encrypted.encrypted_type.StringEncryptedType(), | ||
nullable=True, | ||
), | ||
sa.ForeignKeyConstraint( | ||
["privacy_request_id"], | ||
["privacyrequest.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
op.create_index( | ||
op.f("ix_providedidentity_hashed_value"), | ||
"providedidentity", | ||
["hashed_value"], | ||
unique=False, | ||
) | ||
op.create_index( | ||
op.f("ix_providedidentity_id"), "providedidentity", ["id"], unique=False | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f("ix_providedidentity_id"), table_name="providedidentity") | ||
op.drop_index( | ||
op.f("ix_providedidentity_hashed_value"), table_name="providedidentity" | ||
) | ||
op.drop_table("providedidentity") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.