3
3
from rest_framework .response import Response
4
4
5
5
from sentry import audit_log
6
- from sentry .api .base import region_silo_endpoint
7
- from sentry .api .bases .organization import OrganizationAdminPermission , OrganizationEndpoint
6
+ from sentry .api .base import control_silo_endpoint
7
+ from sentry .api .bases .organization import (
8
+ ControlSiloOrganizationEndpoint ,
9
+ OrganizationAdminPermission ,
10
+ )
8
11
from sentry .api .exceptions import ResourceDoesNotExist
9
12
from sentry .api .serializers import serialize
10
13
from sentry .models import ApiKey
@@ -16,11 +19,11 @@ class Meta:
16
19
fields = ("label" , "scope_list" , "allowed_origins" )
17
20
18
21
19
- @region_silo_endpoint
20
- class OrganizationApiKeyDetailsEndpoint (OrganizationEndpoint ):
22
+ @control_silo_endpoint
23
+ class OrganizationApiKeyDetailsEndpoint (ControlSiloOrganizationEndpoint ):
21
24
permission_classes = (OrganizationAdminPermission ,)
22
25
23
- def get (self , request : Request , organization , api_key_id ) -> Response :
26
+ def get (self , request : Request , organization_context , organization , api_key_id ) -> Response :
24
27
"""
25
28
Retrieves API Key details
26
29
`````````````````````````
@@ -37,7 +40,7 @@ def get(self, request: Request, organization, api_key_id) -> Response:
37
40
38
41
return Response (serialize (api_key , request .user ))
39
42
40
- def put (self , request : Request , organization , api_key_id ) -> Response :
43
+ def put (self , request : Request , organization_context , organization , api_key_id ) -> Response :
41
44
"""
42
45
Update an API Key
43
46
`````````````````
@@ -73,7 +76,7 @@ def put(self, request: Request, organization, api_key_id) -> Response:
73
76
74
77
return Response (serializer .errors , status = status .HTTP_400_BAD_REQUEST )
75
78
76
- def delete (self , request : Request , organization , api_key_id ) -> Response :
79
+ def delete (self , request : Request , organization_context , organization , api_key_id ) -> Response :
77
80
"""
78
81
Deletes an API Key
79
82
``````````````````
0 commit comments