Add API path for outbox
This commit is contained in:
parent
7ea5e108a5
commit
c9517a2a3a
|
@ -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)
|
||||
}
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue