Skip to content

Commit 6f6a139

Browse files
vgrozdanicandrewshie-sentry
authored andcommitted
chore(auth): Clean up killswitch for treating demo user as anon (#103224)
No need for a killswitch anymore, this has been in production for over a month without any problems. Part of TET-1350
1 parent ddb4158 commit 6f6a139

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

src/sentry/auth/helper.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from django.utils import timezone
2222
from django.utils.translation import gettext_lazy as _
2323

24-
from sentry import audit_log, features, options
24+
from sentry import audit_log, features
2525
from sentry.api.invite_helper import ApiInviteHelper, remove_invite_details_from_session
2626
from sentry.audit_log.services.log import AuditLogEvent, log_service
2727
from sentry.auth.email import AmbiguousUserFromEmail, resolve_email_to_user
@@ -451,11 +451,7 @@ def has_verified_account(self, verification_value: dict[str, Any]) -> bool:
451451
@property
452452
def _logged_in_user(self) -> User | None:
453453
"""The user, if they have authenticated on this session."""
454-
if (
455-
options.get("demo-user.auth.pipelines.always.unauthenticated.enabled")
456-
and is_demo_mode_enabled()
457-
and is_demo_user(self.request.user)
458-
):
454+
if is_demo_mode_enabled() and is_demo_user(self.request.user):
459455
return None
460456

461457
return self.request.user if self.request.user.is_authenticated else None

src/sentry/options/defaults.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3559,14 +3559,6 @@
35593559
flags=FLAG_AUTOMATOR_MODIFIABLE,
35603560
)
35613561

3562-
# Killswitch for treating demo user as unauthenticated
3563-
# in our auth pipelines.
3564-
register(
3565-
"demo-user.auth.pipelines.always.unauthenticated.enabled",
3566-
type=Bool,
3567-
default=False,
3568-
flags=FLAG_PRIORITIZE_DISK | FLAG_AUTOMATOR_MODIFIABLE,
3569-
)
35703562

35713563
# Rate at which to forward events to eap_items. 1.0
35723564
# means that 100% of projects will forward events to eap_items.

tests/sentry/web/frontend/test_auth_organization_login.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,6 @@ def test_demo_user_joins_existing_sso_organization(self) -> None:
13491349
"demo-mode.enabled": True,
13501350
"demo-mode.users": [self.demo_user.id],
13511351
"demo-mode.orgs": [self.demo_org.id],
1352-
"demo-user.auth.pipelines.always.unauthenticated.enabled": True,
13531352
}
13541353
):
13551354
sso_org = self.create_organization(name="sso-org", owner=self.normal_user)

0 commit comments

Comments
 (0)