From 71951418059ebc0d72ab52bcb0b0b04e962c2472 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 6 Nov 2023 08:50:36 +0100 Subject: [PATCH] wip: lets define the post input more close --- routers/api/v1/api.go | 1 + templates/swagger/v1_json.tmpl | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index f81418e13f..fd6234e686 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -897,6 +897,7 @@ func Routes() *web.Route { m.Group("/repository-id/{repository-id}", func() { m.Get("", activitypub.Repository) m.Post("/inbox", + bind(api.CreateRepoOption{}), //activitypub.ReqHTTPSignature(), activitypub.RepositoryInbox) }, context_service.RepositoryIDAssignmentAPI()) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 67e949f4f2..595798cc55 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -23,6 +23,58 @@ }, "basePath": "{{AppSubUrl | JSEscape | Safe}}/api/v1", "paths": { + "/activitypub/repository-id/{repository-id}": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "activitypub" + ], + "summary": "Returns the Repository actor for a repo", + "operationId": "activitypubRepository", + "parameters": [ + { + "type": "integer", + "description": "repository ID of the repo", + "name": "repository-id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/ActivityPub" + } + } + } + }, + "/activitypub/repository-id/{repository-id}/inbox": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "activitypub" + ], + "summary": "Send to the inbox", + "operationId": "activitypubRepository", + "parameters": [ + { + "type": "integer", + "description": "repository ID of the repo", + "name": "repository-id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "$ref": "#/responses/empty" + } + } + } + }, "/activitypub/user-id/{user-id}": { "get": { "produces": [