diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 323e0d64ac567..0e8c310c12cd4 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -3311,6 +3311,89 @@
}
}
},
+ "/orgs/{org}/mirror-ssh-key": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Get SSH public key for organization mirroring",
+ "operationId": "orgGetMirrorSSHKey",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "SSH public key",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "fingerprint": {
+ "type": "string"
+ },
+ "public_key": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/orgs/{org}/mirror-ssh-key/regenerate": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Regenerate SSH keypair for organization mirroring",
+ "operationId": "orgRegenerateMirrorSSHKey",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "New SSH public key",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "fingerprint": {
+ "type": "string"
+ },
+ "public_key": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ }
+ },
"/orgs/{org}/public_members": {
"get": {
"produces": [
@@ -19627,6 +19710,65 @@
}
}
},
+ "/user/mirror-ssh-key": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Get SSH public key for user mirroring",
+ "operationId": "userGetMirrorSSHKey",
+ "responses": {
+ "200": {
+ "description": "SSH public key",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "fingerprint": {
+ "type": "string"
+ },
+ "public_key": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/user/mirror-ssh-key/regenerate": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Regenerate SSH keypair for user mirroring",
+ "operationId": "userRegenerateMirrorSSHKey",
+ "responses": {
+ "200": {
+ "description": "New SSH public key",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "fingerprint": {
+ "type": "string"
+ },
+ "public_key": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/user/orgs": {
"get": {
"produces": [
diff --git a/templates/user/settings/keys.tmpl b/templates/user/settings/keys.tmpl
index e0f5e426ae45a..20597dd6f6a4b 100644
--- a/templates/user/settings/keys.tmpl
+++ b/templates/user/settings/keys.tmpl
@@ -7,5 +7,7 @@
{{if not ($.UserDisabledFeatures.Contains "manage_gpg_keys")}}
{{template "user/settings/keys_gpg" .}}
{{end}}
+
+ {{template "user/settings/keys_mirror_ssh" .}}
{{template "user/settings/layout_footer" .}}
diff --git a/templates/user/settings/keys_mirror_ssh.tmpl b/templates/user/settings/keys_mirror_ssh.tmpl
new file mode 100644
index 0000000000000..de787a3615f7d
--- /dev/null
+++ b/templates/user/settings/keys_mirror_ssh.tmpl
@@ -0,0 +1,47 @@
+
+