From d18f13f8bc78c06dd78d84364bc467b087de5655 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 d22ee81584..8a15fb458c 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -836,6 +836,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 3dc23213ad..603f5db1e4 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": [