Add API path for outbox

This commit is contained in:
Anthony Wang 2022-03-31 08:59:14 -05:00
parent 7ea5e108a5
commit c9517a2a3a
Signed by: a
GPG key ID: BC96B00AEC5F2D76
3 changed files with 51 additions and 3 deletions

View file

@ -109,8 +109,29 @@ func PersonInbox(ctx *context.APIContext) {
// required: true
// responses:
// responses:
// "204":
// "200":
// "$ref": "#/responses/empty"
ctx.Status(http.StatusNoContent)
}
// PersonOutbox function
func PersonOutbox(ctx *context.APIContext) {
// swagger:operation GET /activitypub/user/{username}/outbox activitypub activitypubPersonOutbox
// ---
// summary: Returns the outbox
// produces:
// - application/json
// parameters:
// - name: username
// in: path
// description: username of the user
// type: string
// required: true
// responses:
// responses:
// "200":
// "$ref": "#/responses/empty"
ctx.Status(http.StatusNoContent)
}

View file

@ -601,6 +601,7 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
m.Group("/activitypub", func() {
m.Get("/user/{username}", activitypub.Person)
m.Post("/user/{username}/inbox", activitypub.ReqSignature(), activitypub.PersonInbox)
m.Get("/user/{username}/outbox", activitypub.ReqSignature(), activitypub.PersonOutbox)
})
}
m.Get("/signing-key.gpg", misc.SigningKey)

View file

@ -69,8 +69,34 @@
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
"200": {
"$ref": "#/responses/ActivityPub"
}
}
}
},
"/activitypub/user/{username}/outbox": {
"get": {
"produces": [
"application/json"
],
"tags": [
"activitypub"
],
"summary": "Returns the outbox",
"operationId": "activitypubPersonOutbox",
"parameters": [
{
"type": "string",
"description": "username of the user",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/ActivityPub"
}
}
}