Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deprecate creation of legacy API Keys #67957

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions src/sentry/api/endpoints/organization_api_key_index.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from rest_framework import status
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import audit_log
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import control_silo_endpoint
Expand All @@ -21,7 +19,6 @@ class OrganizationApiKeyIndexEndpoint(ControlSiloOrganizationEndpoint):
owner = ApiOwner.ECOSYSTEM
publish_status = {
"GET": ApiPublishStatus.PRIVATE,
"POST": ApiPublishStatus.PRIVATE,
}
permission_classes = (OrganizationAdminPermission,)

Expand All @@ -38,23 +35,3 @@ def get(self, request: Request, organization_context, organization) -> Response:
)

return Response(serialize(queryset, request.user))

def post(self, request: Request, organization_context, organization) -> Response:
"""
Create an Organization API Key
```````````````````````````````````

:pparam string organization_slug: the organization short name
:auth: required
"""
key = ApiKey.objects.create(organization_id=organization.id, scope_list=DEFAULT_SCOPES)

self.create_audit_entry(
request,
organization=organization,
target_object=key.id,
event=audit_log.get_event_id("APIKEY_ADD"),
data=key.get_audit_log_data(),
)

return Response(serialize(key, request.user), status=status.HTTP_201_CREATED)
Loading