From 24c10528d113b87fb61fbad8757925b540b976dd Mon Sep 17 00:00:00 2001 From: Brandon Geraci Date: Thu, 19 Mar 2026 08:35:18 -0500 Subject: [PATCH] fix: sync OpenAPI spec with backend (members field, upstream auth endpoints) Updates the spec to match the current backend: - VirtualMembersListResponse: field renamed from "items" to "members" to match the Rust struct serialization - New upstream auth endpoints (PUT upstream-auth, POST test-upstream) - New fields on CreateRepositoryRequest (upstream_auth_type, etc.) - New RepositoryResponse fields (upstream_auth_type, upstream_auth_configured) The items/members mismatch caused the generated SDK to expect a different field name than what the backend actually returns, which could break the virtual members panel in the web UI. Ref artifact-keeper/artifact-keeper#461 --- openapi.json | 217 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 215 insertions(+), 2 deletions(-) diff --git a/openapi.json b/openapi.json index 07a9c5f..2d64f99 100644 --- a/openapi.json +++ b/openapi.json @@ -2372,6 +2372,39 @@ ] } }, + "/api/v1/admin/storage-backends": { + "get": { + "tags": [ + "admin" + ], + "summary": "List available storage backends.", + "description": "Returns the names of all configured and available storage backends.\nRequires admin privileges.", + "operationId": "list_storage_backends", + "responses": { + "200": { + "description": "Available storage backends", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "403": { + "description": "Admin privileges required" + } + }, + "security": [ + { + "bearer_auth": [] + } + ] + } + }, "/api/v1/admin/storage-gc": { "post": { "tags": [ @@ -11963,6 +11996,97 @@ ] } }, + "/api/v1/repositories/{key}/test-upstream": { + "post": { + "tags": [ + "repositories" + ], + "summary": "Test connectivity to the upstream URL of a remote repository", + "operationId": "test_upstream", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Repository key", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Upstream reachable" + }, + "400": { + "description": "Repository is not remote or has no upstream URL" + }, + "401": { + "description": "Authentication required" + }, + "404": { + "description": "Repository not found" + }, + "502": { + "description": "Upstream unreachable" + } + }, + "security": [ + { + "bearer_auth": [] + } + ] + } + }, + "/api/v1/repositories/{key}/upstream-auth": { + "put": { + "tags": [ + "repositories" + ], + "summary": "Set or remove upstream auth for a remote repository", + "operationId": "set_upstream_auth", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Repository key", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpstreamAuthRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Upstream auth updated" + }, + "400": { + "description": "Invalid auth type or missing fields" + }, + "401": { + "description": "Authentication required" + }, + "404": { + "description": "Repository not found" + } + }, + "security": [ + { + "bearer_auth": [] + } + ] + } + }, "/api/v1/sbom": { "get": { "tags": [ @@ -19258,6 +19382,16 @@ "key": { "type": "string" }, + "member_repos": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/CreateVirtualMemberInput" + }, + "description": "Member repositories to add when creating a virtual repository.\nEach entry specifies a repository key and optional priority." + }, "name": { "type": "string" }, @@ -19271,11 +19405,39 @@ "repo_type": { "type": "string" }, + "storage_backend": { + "type": [ + "string", + "null" + ], + "description": "Override the default storage backend for this repository.\nWhen omitted, the server's configured default is used.\nNon-admin users may only use the default backend." + }, + "upstream_auth_type": { + "type": [ + "string", + "null" + ], + "description": "Upstream auth type: \"basic\" or \"bearer\". Only valid for remote repos." + }, + "upstream_password": { + "type": [ + "string", + "null" + ], + "description": "Password (basic) or token (bearer). Write-only, never returned in responses." + }, "upstream_url": { "type": [ "string", "null" ] + }, + "upstream_username": { + "type": [ + "string", + "null" + ], + "description": "Username for basic auth." } } }, @@ -19608,6 +19770,21 @@ } } }, + "CreateVirtualMemberInput": { + "type": "object", + "required": [ + "repo_key" + ], + "properties": { + "priority": { + "type": "integer", + "format": "int32" + }, + "repo_key": { + "type": "string" + } + } + }, "CreateWebhookRequest": { "type": "object", "required": [ @@ -24967,6 +25144,7 @@ "repo_type", "is_public", "storage_used_bytes", + "upstream_auth_configured", "created_at", "updated_at" ], @@ -25014,6 +25192,15 @@ "updated_at": { "type": "string", "format": "date-time" + }, + "upstream_auth_configured": { + "type": "boolean" + }, + "upstream_auth_type": { + "type": [ + "string", + "null" + ] } } }, @@ -28138,6 +28325,32 @@ } } }, + "UpstreamAuthRequest": { + "type": "object", + "required": [ + "auth_type" + ], + "properties": { + "auth_type": { + "type": "string", + "description": "Auth type: \"basic\", \"bearer\", or \"none\" to remove." + }, + "password": { + "type": [ + "string", + "null" + ], + "description": "Password (basic) or token (bearer). Write-only, never returned." + }, + "username": { + "type": [ + "string", + "null" + ], + "description": "Username for basic auth." + } + } + }, "UserListResponse": { "type": "object", "required": [ @@ -28248,10 +28461,10 @@ "VirtualMembersListResponse": { "type": "object", "required": [ - "items" + "members" ], "properties": { - "items": { + "members": { "type": "array", "items": { "$ref": "#/components/schemas/VirtualMemberResponse"