fmt and swagger

This commit is contained in:
techknowlogick
2025-07-15 17:42:20 -04:00
parent 2830c5f897
commit 21422e9af6
2 changed files with 151 additions and 3 deletions
+3 -3
View File
@@ -91,9 +91,9 @@ func IsRemoteNotExistError(err error) bool {
// normalizeSSHURL converts SSH-SCP format URLs to standard ssh:// format for security
func normalizeSSHURL(remoteAddr string) (string, error) {
if strings.HasPrefix(remoteAddr, "ssh://") {
return remoteAddr, nil
}
if strings.HasPrefix(remoteAddr, "ssh://") {
return remoteAddr, nil
}
if strings.Contains(remoteAddr, "://") {
return remoteAddr, errors.New("remoteAddr has a scheme")
}
+148
View File
@@ -3311,6 +3311,92 @@
}
}
},
"/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"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
},
"/orgs/{org}/public_members": {
"get": {
"produces": [
@@ -19627,6 +19713,68 @@
}
}
},
"/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"
}
}
}
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
},
"/user/orgs": {
"get": {
"produces": [