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

feat(demo-mode): passwordless login #83090

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

obostjancic
Copy link
Member

@obostjancic obostjancic commented Jan 8, 2025

Context

  • In order to replace Current sandbox, which is a self-hosted instance available at https://try.sentry-demo.com/ we created a SaaS sandbox org https://sandbox.sentry.io/
  • Event data in sandbox org will be synced with demo org through sentry-mirror
  • In order to allow public access to this org we created a Demo User
    • that should have read-only access to only this org. PoC PR
    • that should be able to log in automatically. WIP PR
  • sandbox org and Demo User are behind demo-mode.orgs and demo-mode.users options respectively. Those options are added in PR

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 8, 2025
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 45.16129% with 17 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/utils/demo_mode.py 43.47% 13 Missing ⚠️
src/sentry/web/frontend/auth_login.py 40.00% 3 Missing ⚠️
src/sentry/utils/auth.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #83090      +/-   ##
==========================================
+ Coverage   87.57%   87.62%   +0.05%     
==========================================
  Files        9459     9440      -19     
  Lines      536794   536268     -526     
  Branches    21130    21047      -83     
==========================================
- Hits       470086   469898     -188     
+ Misses      66349    66011     -338     
  Partials      359      359              

@obostjancic obostjancic requested a review from a team January 9, 2025 14:49
@obostjancic obostjancic marked this pull request as ready for review January 9, 2025 14:49
@obostjancic obostjancic requested a review from a team as a code owner January 9, 2025 14:49
@obostjancic obostjancic requested a review from a team January 9, 2025 14:49
Comment on lines +15 to +18
if email:
return True

return email in options.get("demo-mode.users")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check short circuits the check whether the email is in the "demo-mode.users" option. It will return with True whenever it is set to any non-empty string.

Copy link
Member

@mdtro mdtro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add tests to ensure this all behaves as expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically log vistors in
3 participants