SSH Public Key missing from Repository Mirror created through API

Summary

Repository Mirror (push) created through GitLab API via curl commands does not include SSH Public Key which can be copied for pasting into remote authorized_keys file.

Steps to reproduce

  1. Set GitLab access token as environment variable: export GITLAB_TOKEN=xxxxxxxxxxxxxxx

  2. POST request to create repository mirror using SSH authentication, e.g.:

    curl --request POST \
     --data "url=ssh://josh@rhel6-64.slac.stanford.edu/sdf/group/supercdms/backups/git-backup/CompInfrastructure/cdms-jupyterlab.git" \
     --data "enabled=yes" \
     --data "keep_divergent_refs=yes" \
     --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "https://gitlab.com/api/v4/projects/12571860/remote_mirrors"

Example Project

Example project: CDMS JupyterLab - https://gitlab.com/supercdms/CompInfrastructure/cdms-jupyterlab

What is the current bug behavior?

Under project settings -> repository -> mirroring repositories, "Remove" and "Update Now" buttons are visible, but no "Copy SSH public key" button.

What is the expected correct behavior?

"Copy SSH public key" button for mirror created both via curl command and web UI.

Relevant logs and/or screenshots

image

Output of checks

This bug happens on GitLab.com

Possible fixes

My first thought was that perhaps the POST command is expecting an http url by default.

I looked through the [API]((https://docs.gitlab.com/ee/api/remote_mirrors.html#create-a-remote-mirror ) for remote mirrors to find a field to specify type of url (ssh vs. http) but nothing is specified.

Edited by Glass Ships