|
| 1 | +from __future__ import annotations |
| 2 | + |
1 | 3 | import logging
|
2 | 4 |
|
3 |
| -from sentry.auth.view import AuthView, ConfigureView |
| 5 | +from django.http.request import HttpRequest |
| 6 | + |
| 7 | +from sentry.auth.services.auth import RpcAuthProvider |
| 8 | +from sentry.auth.view import AuthView |
| 9 | +from sentry.organizations.services.organization.model import RpcOrganization |
| 10 | +from sentry.plugins.base.response import DeferredResponse |
4 | 11 | from sentry.utils import json
|
5 | 12 | from sentry.utils.signing import urlsafe_b64decode
|
6 | 13 |
|
@@ -52,17 +59,18 @@ def dispatch(self, request, helper):
|
52 | 59 | return helper.next_step()
|
53 | 60 |
|
54 | 61 |
|
55 |
| -class OIDCConfigureView(ConfigureView): |
56 |
| - def dispatch(self, request, organization, auth_provider): |
57 |
| - config = auth_provider.config |
58 |
| - if config.get("domain"): |
59 |
| - domains = [config["domain"]] |
60 |
| - else: |
61 |
| - domains = config.get("domains") |
62 |
| - return self.render( |
63 |
| - "oidc/configure.html", |
64 |
| - {"provider_name": ISSUER or "", "domains": domains or []}, |
65 |
| - ) |
| 62 | +def oidc_configure_view( |
| 63 | + request: HttpRequest, organization: RpcOrganization, auth_provider: RpcAuthProvider |
| 64 | +) -> DeferredResponse: |
| 65 | + config = auth_provider.config |
| 66 | + if config.get("domain"): |
| 67 | + domains = [config["domain"]] |
| 68 | + else: |
| 69 | + domains = config.get("domains") |
| 70 | + return DeferredResponse( |
| 71 | + "oidc/configure.html", |
| 72 | + {"provider_name": ISSUER or "", "domains": domains or []}, |
| 73 | + ) |
66 | 74 |
|
67 | 75 |
|
68 | 76 | def extract_domain(email):
|
|
0 commit comments