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

Add our CMP ID #4233

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The types of changes are:
- Removed `TCF_ENABLED` environment variable from the privacy center in favor of dynamically figuring out which `fides-js` bundle to send [#4131](https://github.com/ethyca/fides/pull/4131)
- Updated copy of info boxes on each TCF tab [#4191](https://github.com/ethyca/fides/pull/4191)
- Updated fides server to use an environment variable for turning TCF on and off [#4220](https://github.com/ethyca/fides/pull/4220)
- Added our CMP ID [#4233](https://github.com/ethyca/fides/pull/4233)

### Fixed
- TCF overlay can initialize its consent preferences from a cookie [#4124](https://github.com/ethyca/fides/pull/4124)
Expand Down
2 changes: 1 addition & 1 deletion clients/fides-js/src/lib/tcf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { vendorIsGvl } from "./tcf/vendors";
import { PrivacyExperience } from "./consent-types";

const CMP_ID = 12; // TODO: hardcode our unique CMP ID after certification
const CMP_ID = 407;
const CMP_VERSION = 1;
const FORBIDDEN_LEGITIMATE_INTEREST_PURPOSE_IDS = [1, 3, 4, 5, 6];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,45 @@
Create Date: 2023-10-03 20:26:12.492657

"""
from alembic import op
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '9b98aba5bba8'
down_revision = '4cb3b5af4160'
revision = "9b98aba5bba8"
down_revision = "4cb3b5af4160"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index('ix_consentsettings_id', table_name='consentsettings')
op.drop_table('consentsettings')
op.drop_index("ix_consentsettings_id", table_name="consentsettings")
op.drop_table("consentsettings")
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('consentsettings',
sa.Column('id', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=True),
sa.Column('updated_at', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=True),
sa.Column('tcf_enabled', sa.BOOLEAN(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name='consentsettings_pkey')
op.create_table(
"consentsettings",
sa.Column("id", sa.VARCHAR(length=255), autoincrement=False, nullable=False),
sa.Column(
"created_at",
postgresql.TIMESTAMP(timezone=True),
server_default=sa.text("now()"),
autoincrement=False,
nullable=True,
),
sa.Column(
"updated_at",
postgresql.TIMESTAMP(timezone=True),
server_default=sa.text("now()"),
autoincrement=False,
nullable=True,
),
sa.Column("tcf_enabled", sa.BOOLEAN(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint("id", name="consentsettings_pkey"),
)
op.create_index('ix_consentsettings_id', 'consentsettings', ['id'], unique=False)
op.create_index("ix_consentsettings_id", "consentsettings", ["id"], unique=False)
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion src/fides/api/util/tcf/tc_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from fides.api.schemas.tcf import TCFFeatureRecord, TCFPurposeRecord, TCFVendorRecord
from fides.api.util.tcf.tcf_experience_contents import TCFExperienceContents, load_gvl

CMP_ID: int = 12 # TODO: hardcode our unique CMP ID after certification
CMP_ID: int = 407
CMP_VERSION = 1
CONSENT_SCREEN = 1 # TODO On which 'screen' consent was captured; this is a CMP proprietary number encoded into the TC string

Expand Down
24 changes: 12 additions & 12 deletions tests/ops/util/test_tc_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def test_build_tc_string_captify_accept_all(self, db):
tcf_contents, UserConsentPreference.opt_in
)

assert model.cmp_id == 12
assert model.cmp_id == 407
assert model.vendor_list_version == 20
assert model.policy_version == 4
assert model.cmp_version == 1
Expand All @@ -403,7 +403,7 @@ def test_build_tc_string_captify_accept_all(self, db):

assert decoded.version == 2
assert datetime.utcnow().date() == decoded.created.date()
assert decoded.cmp_id == 12
assert decoded.cmp_id == 407
assert decoded.cmp_version == 1
assert decoded.consent_screen == 1
assert decoded.consent_language == b"EN"
Expand Down Expand Up @@ -492,7 +492,7 @@ def test_build_tc_string_emerse_accept_all(self, db):
tcf_contents, UserConsentPreference.opt_in
)

assert model.cmp_id == 12
assert model.cmp_id == 407
assert model.vendor_list_version == 20
assert model.policy_version == 4
assert model.cmp_version == 1
Expand All @@ -509,7 +509,7 @@ def test_build_tc_string_emerse_accept_all(self, db):
decoded = decode_v2(tc_str)

assert decoded.version == 2
assert decoded.cmp_id == 12
assert decoded.cmp_id == 407
assert decoded.cmp_version == 1
assert decoded.consent_screen == 1
assert decoded.consent_language == b"EN"
Expand Down Expand Up @@ -625,7 +625,7 @@ def test_build_tc_string_skimbit_accept_all(self, db):
tcf_contents, UserConsentPreference.opt_in
)

assert model.cmp_id == 12
assert model.cmp_id == 407
assert model.vendor_list_version == 20
assert model.policy_version == 4
assert model.cmp_version == 1
Expand All @@ -643,7 +643,7 @@ def test_build_tc_string_skimbit_accept_all(self, db):
decoded = decode_v2(tc_str)

assert decoded.version == 2
assert decoded.cmp_id == 12
assert decoded.cmp_id == 407
assert decoded.cmp_version == 1
assert decoded.consent_screen == 1
assert decoded.consent_language == b"EN"
Expand Down Expand Up @@ -830,7 +830,7 @@ def test_build_tc_string_three_systems_accept_all(self, db):
tcf_contents, UserConsentPreference.opt_in
)

assert model.cmp_id == 12
assert model.cmp_id == 407
assert model.vendor_list_version == 20
assert model.policy_version == 4
assert model.cmp_version == 1
Expand All @@ -848,7 +848,7 @@ def test_build_tc_string_three_systems_accept_all(self, db):
decoded = decode_v2(tc_str)

assert decoded.version == 2
assert decoded.cmp_id == 12
assert decoded.cmp_id == 407
assert decoded.cmp_version == 1
assert decoded.consent_screen == 1
assert decoded.consent_language == b"EN"
Expand Down Expand Up @@ -1048,7 +1048,7 @@ def test_build_tc_string_not_vendor(self, db, skimbit_system):
tcf_contents, UserConsentPreference.opt_in
)

assert model.cmp_id == 12
assert model.cmp_id == 407
assert model.vendor_list_version == 20
assert model.policy_version == 4
assert model.cmp_version == 1
Expand All @@ -1066,7 +1066,7 @@ def test_build_tc_string_not_vendor(self, db, skimbit_system):
decoded = decode_v2(tc_str)

assert decoded.version == 2
assert decoded.cmp_id == 12
assert decoded.cmp_id == 407
assert decoded.cmp_version == 1
assert decoded.consent_screen == 1
assert decoded.consent_language == b"EN"
Expand Down Expand Up @@ -1166,7 +1166,7 @@ def test_build_tc_string_generic_reject_all(
tcf_contents, UserConsentPreference.opt_out
)

assert model.cmp_id == 12
assert model.cmp_id == 407
assert model.vendor_list_version == 20
assert model.policy_version == 4
assert model.cmp_version == 1
Expand All @@ -1185,7 +1185,7 @@ def test_build_tc_string_generic_reject_all(
assert decoded.version == 2
assert datetime.utcnow().date() == decoded.created.date()
assert datetime.utcnow().date() == decoded.last_updated.date()
assert decoded.cmp_id == 12
assert decoded.cmp_id == 407
assert decoded.cmp_version == 1
assert decoded.consent_screen == 1
assert decoded.consent_language == b"EN"
Expand Down