2022-06-03 08:09:47 -06:00
|
|
|
from rest_framework.permissions import IsAuthenticated
|
|
|
|
|
from rest_framework.response import Response
|
|
|
|
|
from rest_framework.views import APIView
|
|
|
|
|
|
|
|
|
|
from apps.auth_token.auth import ApiTokenAuthentication
|
2022-06-08 18:25:58 +04:00
|
|
|
from apps.public_api.throttlers import InfoThrottler
|
2022-06-03 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class InfoView(APIView):
|
|
|
|
|
authentication_classes = (ApiTokenAuthentication,)
|
|
|
|
|
permission_classes = (IsAuthenticated,)
|
|
|
|
|
|
2022-06-08 18:25:58 +04:00
|
|
|
throttle_classes = [InfoThrottler]
|
2022-06-03 08:09:47 -06:00
|
|
|
|
|
|
|
|
def get(self, request):
|
|
|
|
|
response = {"url": self.request.auth.organization.grafana_url}
|
|
|
|
|
return Response(response)
|