Skip to content

Commit

Permalink
Merge branch 'main' into HJ-92_persist-monitor-execution
Browse files Browse the repository at this point in the history
  • Loading branch information
thingscouldbeworse committed Feb 5, 2025
2 parents ac56917 + 29f3415 commit 2de3b14
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o

### Changed
- Added frequency field to DataHubSchema integration config [#5716](https://github.com/ethyca/fides/pull/5716)
- Added initial support for upcoming "headless" CMP experience type [#5731](https://github.com/ethyca/fides/pull/5731)

### Fixed
- Fixed `fides annotate dataset` command enters incorrect value on the `direction` field. [#5727](https://github.com/ethyca/fides/pull/5727)
Expand Down
1 change: 1 addition & 0 deletions clients/fides-js/src/lib/consent-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ export enum ComponentType {
MODAL = "modal",
PRIVACY_CENTER = "privacy_center",
TCF_OVERLAY = "tcf_overlay",
HEADLESS = "headless",
}

export enum BannerEnabled {
Expand Down
2 changes: 1 addition & 1 deletion data/saas/config/stripe_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ saas_config:
type: stripe
user_guide: https://docs.ethyca.com/user-guides/integrations/saas-integrations/stripe
description: A sample schema representing the Stripe connector for Fides
version: 0.0.6
version: 0.0.9

connector_params:
- name: domain
Expand Down
39 changes: 39 additions & 0 deletions data/saas/dataset/stripe_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ dataset:
data_categories: [user.contact.email]
fidesops_meta:
data_type: string
masking_strategy_override:
strategy: random_string_rewrite
configuration:
format_preservation:
suffix: "+masked@ethyca.com"
- name: invoice_prefix
data_categories: [system.operations]
- name: invoice_settings
Expand All @@ -89,6 +94,8 @@ dataset:
data_categories: [user.contact.phone_number]
fidesops_meta:
data_type: string
masking_strategy_override:
strategy: null_rewrite
- name: preferred_locales
data_categories: [user]
fidesops_meta:
Expand Down Expand Up @@ -183,6 +190,11 @@ dataset:
data_categories: [user.contact.email]
fidesops_meta:
data_type: string
masking_strategy_override:
strategy: random_string_rewrite
configuration:
format_preservation:
suffix: "+masked@ethyca.com"
- name: name
data_categories: [user.name]
fidesops_meta:
Expand Down Expand Up @@ -289,6 +301,11 @@ dataset:
data_categories: [user.contact.email]
fidesops_meta:
data_type: string
masking_strategy_override:
strategy: random_string_rewrite
configuration:
format_preservation:
suffix: "+masked@ethyca.com"
- name: receipt_number
data_categories: [system.operations]
- name: receipt_url
Expand Down Expand Up @@ -421,6 +438,11 @@ dataset:
data_categories: [user.contact.email]
fidesops_meta:
data_type: string
masking_strategy_override:
strategy: random_string_rewrite
configuration:
format_preservation:
suffix: "+masked@ethyca.com"
- name: customer_name
data_categories: [user.name]
fidesops_meta:
Expand Down Expand Up @@ -559,6 +581,11 @@ dataset:
data_categories: [user.contact.email]
fidesops_meta:
data_type: string
masking_strategy_override:
strategy: random_string_rewrite
configuration:
format_preservation:
suffix: "+masked@ethyca.com"
- name: review
data_categories: [system.operations]
- name: setup_future_usage
Expand Down Expand Up @@ -634,6 +661,7 @@ dataset:
data_categories: [user.contact.address.country]
fidesops_meta:
data_type: string
read_only: true
- name: line1
data_categories: [user.contact.address.street]
fidesops_meta:
Expand All @@ -654,6 +682,11 @@ dataset:
data_categories: [user.contact.email]
fidesops_meta:
data_type: string
masking_strategy_override:
strategy: random_string_rewrite
configuration:
format_preservation:
suffix: "+masked@ethyca.com"
- name: name
data_categories: [user.name]
fidesops_meta:
Expand Down Expand Up @@ -734,6 +767,7 @@ dataset:
data_categories: [user.contact.address.country]
fidesops_meta:
data_type: string
read_only: True
- name: currency
data_categories: [system.operations]
- name: customer
Expand Down Expand Up @@ -1041,6 +1075,11 @@ dataset:
data_categories: [user.contact.email]
fidesops_meta:
data_type: string
masking_strategy_override:
strategy: random_string_rewrite
configuration:
format_preservation:
suffix: "+masked@ethyca.com"
- name: customer_name
data_categories: [user.name]
fidesops_meta:
Expand Down
3 changes: 3 additions & 0 deletions src/fides/api/models/privacy_experience.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ComponentType(Enum):
modal = "modal"
privacy_center = "privacy_center"
tcf_overlay = "tcf_overlay" # TCF Banner + modal combined
headless = "headless"


class Layer1ButtonOption(Enum):
Expand All @@ -51,13 +52,15 @@ class Layer1ButtonOption(Enum):
FidesJSUXTypes: List[ComponentType] = [
ComponentType.banner_and_modal,
ComponentType.modal,
ComponentType.headless,
]

# Fides JS Overlay Types - there should only be one of these defined per region + property
FidesJSOverlayTypes: List[ComponentType] = [
ComponentType.banner_and_modal,
ComponentType.modal,
ComponentType.tcf_overlay,
ComponentType.headless,
]


Expand Down
9 changes: 4 additions & 5 deletions tests/fixtures/saas/stripe_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,12 @@ def delete_subscription(self, subscription_id):
headers=self.headers,
)

def get_customer(self, email):
def get_customer(self, id):
response = requests.get(
url=f"{self.base_url}/v1/customers",
url=f"{self.base_url}/v1/customers/{id}",
headers=self.headers,
params={"email": email},
)
customer = response.json()["data"][0]
customer = response.json()
return customer

def get_card(self, customer_id):
Expand Down Expand Up @@ -513,7 +512,7 @@ def stripe_create_data(
stripe_test_client, generate_random_email(), generate_random_phone_number()
)

yield
yield customer

for data in [customer, random_customer]:
stripe_test_client.delete_customer(data["customer_id"])
Expand Down
19 changes: 12 additions & 7 deletions tests/ops/integration_tests/saas/test_stripe_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async def test_non_strict_erasure_request_with_email(
policy: Policy,
dsr_version,
request,
erasure_policy_string_rewrite,
erasure_policy_all_categories,
stripe_identity_email,
stripe_test_client,
stripe_create_data,
Expand All @@ -153,12 +153,18 @@ async def test_non_strict_erasure_request_with_email(

dataset_name = stripe_runner.dataset_config.fides_key

generated_customer = stripe_create_data
customer_id = generated_customer["customer_id"]

customer = stripe_test_client.get_customer(customer_id)
customer_name = customer["shipping"]["name"]

(
_,
erasure_results,
) = await stripe_runner.non_strict_erasure_request(
access_policy=policy,
erasure_policy=erasure_policy_string_rewrite,
erasure_policy=erasure_policy_all_categories,
identities={"email": stripe_identity_email},
)

Expand All @@ -180,9 +186,8 @@ async def test_non_strict_erasure_request_with_email(
}

# customer
customer = stripe_test_client.get_customer(stripe_identity_email)
customer_id = customer["id"]
assert customer["shipping"]["name"] == "MASKED"
customer = stripe_test_client.get_customer(customer_id)
assert customer["shipping"]["name"] != customer_name

# card
cards = stripe_test_client.get_card(customer_id)
Expand All @@ -191,11 +196,11 @@ async def test_non_strict_erasure_request_with_email(
# payment method
payment_methods = stripe_test_client.get_payment_method(customer_id)
for payment_method in payment_methods:
assert payment_method["billing_details"]["name"] == "MASKED"
assert payment_method["billing_details"]["name"] != customer_name

# bank account
bank_account = stripe_test_client.get_bank_account(customer_id)
assert bank_account["account_holder_name"] == "MASKED"
assert bank_account["account_holder_name"] != customer_name

# tax_id
tax_ids = stripe_test_client.get_tax_ids(customer_id)
Expand Down

0 comments on commit 2de3b14

Please sign in to comment.