Skip to content

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.

Feature flag issue.

Contributes to #421915 (closed).

How to set up and validate locally

  1. Enable the feature flag ssh_certificates_rest_endpoints.

  2. 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"

  3. 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

  4. 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.

Related to #421915 (closed)

Raw SQL for destroy! method

DELETE FROM "group_ssh_certificates"
WHERE "group_ssh_certificates"."id" = 1

Query Plan

Edited by Gavin Hinfey

Merge request reports

Loading