Skip to content
Snippets Groups Projects
Commit d92b8a75 authored by Adam Hegyi's avatar Adam Hegyi
Browse files

Use ErrorTracking::ClientKey when deleting a key

This change alters the response when deleting a client key within the
error tracking feature. To avoid leaking unnecessary fields, we use the
Entities::ErrorTracking::ClientKey to serialize the deleted object.
parent 0f5db9e0
No related branches found
No related tags found
1 merge request!86101Use ErrorTracking::ClientKey when deleting a key
......@@ -43,6 +43,8 @@ class ErrorTracking::ClientKeys < ::API::Base
delete '/client_keys/:key_id' do
key = user_project.error_tracking_client_keys.find(params[:key_id])
key.destroy!
present key, with: Entities::ErrorTracking::ClientKey
end
end
end
......
......@@ -81,6 +81,10 @@
it 'returns a correct status' do
expect(response).to have_gitlab_http_status(:ok)
end
it 'returns specific fields using the entity' do
expect(json_response.keys).to match_array(%w[id active public_key sentry_dsn])
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment