Skip to content

Commit 34f2e5f

Browse files
authored
feat(pii): Enable advanced data scrubbing by default (#19630)
See also getsentry/sentry-docs#1786
1 parent 3b7bc1b commit 34f2e5f

File tree

6 files changed

+43
-128
lines changed

6 files changed

+43
-128
lines changed

src/sentry/conf/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ def create_partitioned_queues(name):
872872
# customized with SENTRY_ORG_SUBDOMAIN_TEMPLATE)
873873
"organizations:org-subdomains": False,
874874
# Enable access to more advanced (alpha) datascrubbing settings.
875-
"organizations:datascrubbers-v2": False,
875+
"organizations:datascrubbers-v2": True,
876876
# Enable the new version of interface/breadcrumbs
877877
"organizations:breadcrumbs-v2": False,
878878
# Enable Relay config feature

tests/acceptance/test_organization_security_privacy.py

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,43 @@ def renders_2fa_setting(self):
1616
return self.browser.element_exists("#require2FA")
1717

1818
def test_renders_2fa_setting_for_owner(self):
19-
with self.feature("organizations:datascrubbers-v2"):
20-
user_owner = self.create_user("[email protected]")
21-
organization = self.create_organization(name="Example", owner=user_owner)
22-
self.login_as(user_owner)
23-
path = "/settings/{}/security-and-privacy/".format(organization.slug)
19+
user_owner = self.create_user("[email protected]")
20+
organization = self.create_organization(name="Example", owner=user_owner)
21+
self.login_as(user_owner)
22+
path = "/settings/{}/security-and-privacy/".format(organization.slug)
2423

25-
self.browser.get(path)
26-
self.load_organization_helper()
27-
assert self.renders_2fa_setting()
24+
self.browser.get(path)
25+
self.load_organization_helper()
26+
assert self.renders_2fa_setting()
2827

2928
def test_renders_2fa_setting_for_manager(self):
30-
with self.feature("organizations:datascrubbers-v2"):
31-
user_manager = self.create_user("[email protected]")
32-
organization = self.create_organization(
33-
name="Example", owner=self.create_user("[email protected]")
34-
)
35-
self.create_member(organization=organization, user=user_manager, role="manager")
36-
self.login_as(user_manager)
37-
path = "/settings/{}/security-and-privacy/".format(organization.slug)
38-
39-
self.browser.get(path)
40-
self.load_organization_helper()
41-
assert self.renders_2fa_setting()
29+
user_manager = self.create_user("[email protected]")
30+
organization = self.create_organization(
31+
name="Example", owner=self.create_user("[email protected]")
32+
)
33+
self.create_member(organization=organization, user=user_manager, role="manager")
34+
self.login_as(user_manager)
35+
path = "/settings/{}/security-and-privacy/".format(organization.slug)
36+
37+
self.browser.get(path)
38+
self.load_organization_helper()
39+
assert self.renders_2fa_setting()
4240

4341
def test_setting_2fa_without_2fa_enabled(self):
44-
with self.feature("organizations:datascrubbers-v2"):
45-
user_owner = self.create_user("[email protected]")
46-
organization = self.create_organization(name="Example", owner=user_owner)
47-
self.login_as(user_owner)
48-
path = "/settings/{}/security-and-privacy/".format(organization.slug)
49-
50-
self.browser.get(path)
51-
self.browser.wait_until_not(".loading-indicator")
52-
assert not self.browser.element_exists(
53-
'[data-test-id="organization-settings-security-and-privacy"] .error'
54-
)
55-
self.browser.click("#require2FA")
56-
57-
self.browser.wait_until(".modal")
58-
self.browser.click('.modal [data-test-id="confirm-button"]')
59-
self.browser.wait_until_not(".modal")
60-
self.browser.wait_until_test_id("toast-error")
61-
self.load_organization_helper("setting 2fa without 2fa enabled")
42+
user_owner = self.create_user("[email protected]")
43+
organization = self.create_organization(name="Example", owner=user_owner)
44+
self.login_as(user_owner)
45+
path = "/settings/{}/security-and-privacy/".format(organization.slug)
46+
47+
self.browser.get(path)
48+
self.browser.wait_until_not(".loading-indicator")
49+
assert not self.browser.element_exists(
50+
'[data-test-id="organization-settings-security-and-privacy"] .error'
51+
)
52+
self.browser.click("#require2FA")
53+
54+
self.browser.wait_until(".modal")
55+
self.browser.click('.modal [data-test-id="confirm-button"]')
56+
self.browser.wait_until_not(".modal")
57+
self.browser.wait_until_test_id("toast-error")
58+
self.load_organization_helper("setting 2fa without 2fa enabled")

tests/acceptance/test_organization_settings.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

tests/sentry/api/endpoints/test_organization_details.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -665,23 +665,12 @@ def test_relay_pii_config(self):
665665
org = self.create_organization(owner=self.user)
666666
url = reverse("sentry-api-0-organization-details", kwargs={"organization_slug": org.slug})
667667
self.login_as(user=self.user)
668-
with self.feature("organizations:datascrubbers-v2"):
669-
value = '{"applications": {"freeform": []}}'
670-
resp = self.client.put(url, data={"relayPiiConfig": value})
671-
assert resp.status_code == 200, resp.content
672-
assert org.get_option("sentry:relay_pii_config") == value
673-
assert resp.data["relayPiiConfig"] == value
674-
675-
def test_relay_pii_config_forbidden(self):
676-
org = self.create_organization(owner=self.user)
677-
url = reverse("sentry-api-0-organization-details", kwargs={"organization_slug": org.slug})
678-
self.login_as(user=self.user)
679668

680669
value = '{"applications": {"freeform": []}}'
681670
resp = self.client.put(url, data={"relayPiiConfig": value})
682-
assert resp.status_code == 400
683-
assert b"feature" in resp.content
684-
assert org.get_option("sentry:relay_pii_config") is None
671+
assert resp.status_code == 200, resp.content
672+
assert org.get_option("sentry:relay_pii_config") == value
673+
assert resp.data["relayPiiConfig"] == value
685674

686675

687676
class OrganizationDeleteTest(APITestCase):

tests/sentry/api/endpoints/test_project_details.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -450,19 +450,11 @@ def test_store_crash_reports(self):
450450
assert resp.data["storeCrashReports"] == 10
451451

452452
def test_relay_pii_config(self):
453-
with self.feature("organizations:datascrubbers-v2"):
454-
value = '{"applications": {"freeform": []}}'
455-
resp = self.client.put(self.path, data={"relayPiiConfig": value})
456-
assert resp.status_code == 200, resp.content
457-
assert self.project.get_option("sentry:relay_pii_config") == value
458-
assert resp.data["relayPiiConfig"] == value
459-
460-
def test_relay_pii_config_forbidden(self):
461453
value = '{"applications": {"freeform": []}}'
462454
resp = self.client.put(self.path, data={"relayPiiConfig": value})
463-
assert resp.status_code == 400
464-
assert b"feature" in resp.content
465-
assert self.project.get_option("sentry:relay_pii_config") is None
455+
assert resp.status_code == 200, resp.content
456+
assert self.project.get_option("sentry:relay_pii_config") == value
457+
assert resp.data["relayPiiConfig"] == value
466458

467459
def test_sensitive_fields(self):
468460
resp = self.client.put(

tests/sentry/api/serializers/test_organization.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_simple(self):
3737
"releases-v2",
3838
"discover-basic",
3939
"discover-query",
40+
"datascrubbers-v2",
4041
]
4142
)
4243

0 commit comments

Comments
 (0)