Related to https://github.com/grafana/oncall-private/issues/2806#issuecomment-2246286918. Prepare engine for the backend plugin enablement/migration: - Refactor sync code - Improve plugin user authentication to set up user on-the-fly (when missing) - Implement v2 endpoints for install, sync and status (to be used via the backend plugin) (most of the changes come from https://github.com/grafana/oncall/pull/4657; backport all engine changes that keep backwards compatibility)
17 lines
490 B
Python
17 lines
490 B
Python
from django.conf import settings
|
|
from rest_framework.request import Request
|
|
from rest_framework.response import Response
|
|
from rest_framework.views import APIView
|
|
|
|
from apps.auth_token.auth import PluginAuthentication
|
|
|
|
|
|
class RecaptchaView(APIView):
|
|
authentication_classes = (PluginAuthentication,)
|
|
|
|
def get(self, request: Request) -> Response:
|
|
return Response(
|
|
data={
|
|
"recaptcha_site_key": settings.RECAPTCHA_V3_SITE_KEY,
|
|
}
|
|
)
|