Skip to content

Commit

Permalink
Update docstrings from CR and update test that enables AC now that fl…
Browse files Browse the repository at this point in the history
…ag is needed for AC vendors to show up in vendor hash.
  • Loading branch information
pattisdr committed Oct 24, 2023
1 parent 43ba9ce commit a0a6a6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/fides/api/util/tcf/experience_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ class TCFVersionHash(FidesSchema):
"re-establish transparency and consent from users."
)
vendor_purpose_consents: List[str] = Field(
description="Stores vendor * purpose * consent legal basis in the format "
description="Stores vendor * purpose * consent legal basis in the format: "
"<universal_vendor_id>-<comma separated purposes>"
)
vendor_purpose_legitimate_interests: List[str] = Field(
description="Stores vendor * purpose * legitimate interest legal basis in the format"
" <universal_vendor_id>-<comma separated purposes>"
description="Stores vendor * purpose * legitimate interest legal basis in the format: "
"<universal_vendor_id>-<comma separated purposes>"
)
gvl_vendors_disclosed: List[int] = Field(
description="List of GVL vendors disclosed from the last vendor list"
description="List of GVL vendors disclosed from the current vendor list"
)

@root_validator()
@classmethod
def sort_lists(cls, values: Dict) -> Dict:
"""Verify lists are sorted for repeatability"""
"""Verify lists are sorted deterministically for repeatability"""
for field, val in values.items():
if isinstance(val, list):
values[field] = sorted(val)
Expand Down Expand Up @@ -72,7 +72,7 @@ def build_vendor_by_purpose_strings(
) -> List[str]:
"""Hash helper for building vendor x purposes. Converts a list of vendor records
into a list of strings each consisting of a vendor id, a separator (-), and comma
separated purposes (if applicable) with the given legitimate interest.
separated purposes (if applicable) with the given legal basis.
Example:
[<universal_vendor_id>-<comma separated purposes>]
Expand Down Expand Up @@ -118,7 +118,8 @@ def build_vendor_by_purpose_strings(
policy_version=model.policy_version,
vendor_purpose_consents=vendor_consents,
vendor_purpose_legitimate_interests=vendor_li,
gvl_vendors_disclosed=model.vendors_disclosed,
gvl_vendors_disclosed=model.vendors_disclosed, # `vendors_disclosed` field only has GVL vendors present
# in "current" GVL vendor list
)


Expand Down
1 change: 1 addition & 0 deletions tests/ops/util/test_tc_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_version_hash_model_sorting(self):
"captify_technologies_system",
"ac_system_without_privacy_declaration",
"ac_system_with_privacy_declaration",
"enable_ac",
)
def test_vendor_hash_model_contents(self, db, system):
"""Test building hash model with a mixture of GVL, AC, and regular Systems without a vendor"""
Expand Down

0 comments on commit a0a6a6c

Please sign in to comment.