From 6bcbaa71b9f185a5da1ee6ffc8e8ebcbd89fd808 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Mon, 14 Apr 2025 10:40:15 +0200 Subject: [PATCH] Support 'sentry-cli login' like so: ``` $ sentry-cli --url http://bugsink:8000/ login This helps you signing in your sentry-cli with an authentication token. If you do not yet have a token ready we can bring up a browser for you to create a token now. Sentry server: bugsink Open browser now? [y/n] y ``` See https://github.com/getsentry/sentry/issues/82078 --- bugsink/urls.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bugsink/urls.py b/bugsink/urls.py index e96328d..ad4859d 100644 --- a/bugsink/urls.py +++ b/bugsink/urls.py @@ -3,6 +3,7 @@ from django.conf import settings from django.contrib import admin from django.urls import include, path from django.contrib.auth import views as auth_views +from django.views.generic import RedirectView from alerts.views import debug_email as debug_alerts_email from users.views import debug_email as debug_users_email @@ -56,6 +57,12 @@ urlpatterns = [ path('events/', include('events.urls')), path('issues/', include('issues.urls')), path('files/', include('files.urls')), + + # this weird URL is what sentry-cli uses as part of their "login" flow. weird, because the word ':orgslug' shows up + # verbatim. In any case, we simply redirect to the auth token list, such that you can set one up + path('orgredirect/organizations/:orgslug/settings/auth-tokens/', + RedirectView.as_view(url='/bsmain/auth_tokens/', permanent=False)), + path('bsmain/', include('bsmain.urls')), path('admin/', admin.site.urls),