REST get, post and delete endpoints for SSH Certificates
What does this MR do and why?
Adds get, post and delete endpoints for SSH Certificates under feature flag.
Contributes to #421915 (closed).
How to set up and validate locally
-
Enable the feature flag
ssh_certificates_rest_endpoints
. -
Following the documentation included in this MR, can add a SSH certificate to a group in your GDK:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "http://127.0.0.1:3000/api/v4/groups/29/ssh_certificates?title=newtitle&key="http://127.0.0.1:3000/api/v4/groups/29/ssh_certificates?title=newtitle&key=ssh-rsa%20AAAAB3NzaC1yc2EAAAADAQABAAAAgQCxT%2BaWnicS3k2ckFuoaGH3lapt28Wbif72onlVdHIhtUXZCixzs9r%2Bjw2kme4GkUP%2Fu6YUYJ0eEnEQR76uRje1xtoEUeM%2FJoC43iFX%2B3jbOd32gTSWe0NNWtdwLBbt8NqeDGv3WbYAKZfZpEfV7ipb70ju9ML1i94SC45NzbzcRQ%3D%3D%20example%40gitlab.com"
-
List the SSH Certificates for a group with:
curl --header "PRIVATE-TOKEN: <your_access_token>" "http://127.0.0.1:3000/api/v4/groups/29/ssh_certificates
-
Delete a SSH Certificate with:
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "http://127.0.0.1:3000/api/v4/groups/29/ssh_certificates/<ssh_cert_id_from_previous_request>"
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #421915 (closed)
Raw SQL for destroy! method
DELETE FROM "group_ssh_certificates"
WHERE "group_ssh_certificates"."id" = 1