Skip to content

Commit

Permalink
feat: adapt to sentry 24.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dlouzan committed Sep 11, 2024
1 parent d880ca4 commit 3bf8e55
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 103 deletions.
2 changes: 2 additions & 0 deletions oidc/provider.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import time

import requests
Expand Down
32 changes: 20 additions & 12 deletions oidc/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from __future__ import annotations

import logging

from sentry.auth.view import AuthView, ConfigureView
from django.http.request import HttpRequest

from sentry.auth.services.auth import RpcAuthProvider
from sentry.auth.view import AuthView
from sentry.organizations.services.organization.model import RpcOrganization
from sentry.plugins.base.response import DeferredResponse
from sentry.utils import json
from sentry.utils.signing import urlsafe_b64decode

Expand Down Expand Up @@ -52,17 +59,18 @@ def dispatch(self, request, helper):
return helper.next_step()


class OIDCConfigureView(ConfigureView):
def dispatch(self, request, organization, auth_provider):
config = auth_provider.config
if config.get("domain"):
domains = [config["domain"]]
else:
domains = config.get("domains")
return self.render(
"oidc/configure.html",
{"provider_name": ISSUER or "", "domains": domains or []},
)
def oidc_configure_view(
request: HttpRequest, organization: RpcOrganization, auth_provider: RpcAuthProvider
) -> DeferredResponse:
config = auth_provider.config
if config.get("domain"):
domains = [config["domain"]]
else:
domains = config.get("domains")
return DeferredResponse(
"oidc/configure.html",
{"provider_name": ISSUER or "", "domains": domains or []},
)


def extract_domain(email):
Expand Down
Loading

0 comments on commit 3bf8e55

Please sign in to comment.