Skip to content

Add API endpoint to add an instance-level deploy key

Taka Nishida requested to merge api-for-instance-level-public-deploy-keys into master

What does this MR do and why?

Closes #478476 (closed).

This MR adds a new API endpoint to add an instance-level public deploy key.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Set up GDK.
  2. Create your sample deploy key to a file, e.g. deploy-key-sample.txt.
  3. Send an API request.
curl -X POST "https://gdk.test:3443/api/v4/deploy_keys" \
     -H "Content-Type: application/json" \
     -H "PRIVATE-TOKEN: YOUR_PEROSNAL_ACCESS_TOKEN \
     -d "{\"key\": \"$(cat deploy-key-sample.txt)\", \"title\": \"My Deploy Key\", \"expires_at\": \"2025-01-01T00:00:00Z\"}"

The successful response is a JSON. e.g:

{
    "id":13,
    "title":"My Deploy Key",
    "created_at":"2024-10-02T06:21:50.652Z",
    "expires_at":"2025-01-01T00:00:00.000Z",
    "key":"<KEY>",
    "usage_type":"auth_and_signing",
    "fingerprint":"<FINGER PRINT>",
    "fingerprint_sha256":"<FINGER PRINT DIGEST>"
}
Edited by Taka Nishida

Merge request reports

Loading