From f45dda7f1cdc6f0032d24070bd07cbd0889ec99d Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 18 Feb 2025 12:54:33 +0100 Subject: [PATCH] docs: ssh key with new line --- coderd/apidoc/docs.go | 1 + coderd/apidoc/swagger.json | 1 + codersdk/gitsshkey.go | 5 ++++- docs/reference/api/schemas.md | 12 ++++++------ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 52fc18e60558a..4068f1e022985 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -11800,6 +11800,7 @@ const docTemplate = `{ "format": "date-time" }, "public_key": { + "description": "PublicKey is the SSH public key in OpenSSH format.\nExample: \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3OmYJvT7q1cF1azbybYy0OZ9yrXfA+M6Lr4vzX5zlp\\n\"\nNote: The key includes a trailing newline (\\n).", "type": "string" }, "updated_at": { diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 67c032ed15213..6d63e3ed5b0b9 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -10591,6 +10591,7 @@ "format": "date-time" }, "public_key": { + "description": "PublicKey is the SSH public key in OpenSSH format.\nExample: \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3OmYJvT7q1cF1azbybYy0OZ9yrXfA+M6Lr4vzX5zlp\\n\"\nNote: The key includes a trailing newline (\\n).", "type": "string" }, "updated_at": { diff --git a/codersdk/gitsshkey.go b/codersdk/gitsshkey.go index 7b56e01427f85..d1b65774610f3 100644 --- a/codersdk/gitsshkey.go +++ b/codersdk/gitsshkey.go @@ -15,7 +15,10 @@ type GitSSHKey struct { UserID uuid.UUID `json:"user_id" format:"uuid"` CreatedAt time.Time `json:"created_at" format:"date-time"` UpdatedAt time.Time `json:"updated_at" format:"date-time"` - PublicKey string `json:"public_key"` + // PublicKey is the SSH public key in OpenSSH format. + // Example: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3OmYJvT7q1cF1azbybYy0OZ9yrXfA+M6Lr4vzX5zlp\n" + // Note: The key includes a trailing newline (\n). + PublicKey string `json:"public_key"` } // GitSSHKey returns the user's git SSH public key. diff --git a/docs/reference/api/schemas.md b/docs/reference/api/schemas.md index f892c27e00d55..d13a46ed9b365 100644 --- a/docs/reference/api/schemas.md +++ b/docs/reference/api/schemas.md @@ -3090,12 +3090,12 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith ### Properties -| Name | Type | Required | Restrictions | Description | -|--------------|--------|----------|--------------|-------------| -| `created_at` | string | false | | | -| `public_key` | string | false | | | -| `updated_at` | string | false | | | -| `user_id` | string | false | | | +| Name | Type | Required | Restrictions | Description | +|--------------|--------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `created_at` | string | false | | | +| `public_key` | string | false | | Public key is the SSH public key in OpenSSH format. Example: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3OmYJvT7q1cF1azbybYy0OZ9yrXfA+M6Lr4vzX5zlp\n" Note: The key includes a trailing newline (\n). | +| `updated_at` | string | false | | | +| `user_id` | string | false | | | ## codersdk.Group