From 15621f5324b4613d83efb94711c97eeaa83da2b3 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:27:43 +0200 Subject: Follow request improvements (#282) * tiny doc update * add rejectfollowrequest to db * add follow request reject to processor * add reject handler * tidy up follow request api * tidy up federation call * regenerate swagger docs * api endpoint tests * processor test * add reject federatingdb handler * start writing reject tests * test reject follow request * go fmt * increase sleep for slow test setups * more relaxed time.sleep --- docs/api/swagger.yaml | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) (limited to 'docs/api') diff --git a/docs/api/swagger.yaml b/docs/api/swagger.yaml index 72c543a3a..ae258bb46 100644 --- a/docs/api/swagger.yaml +++ b/docs/api/swagger.yaml @@ -2450,6 +2450,115 @@ paths: summary: Get an array of accounts that requesting account has blocked. tags: - blocks + /api/v1/follow_requests: + get: + description: |- + The next and previous queries can be parsed from the returned Link header. + Example: + + ``` + ; rel="next", ; rel="prev" + ```` + operationId: getFollowRequests + parameters: + - default: 40 + description: Number of accounts to return. + in: query + name: limit + type: integer + produces: + - application/json + responses: + "200": + description: "" + headers: + Link: + description: Links to the next and previous queries. + type: string + schema: + items: + $ref: '#/definitions/account' + type: array + "400": + description: bad request + "401": + description: unauthorized + "403": + description: forbidden + "404": + description: not found + security: + - OAuth2 Bearer: + - read:follows + summary: Get an array of accounts that have requested to follow you. + tags: + - follow_requests + /api/v1/follow_requests/{account_id}/authorize: + post: + description: Accept a follow request and put the requesting account in your + 'followers' list. + operationId: authorizeFollowRequest + parameters: + - description: ID of the account requesting to follow you. + in: path + name: account_id + required: true + type: string + produces: + - application/json + responses: + "200": + description: Your relationship to this account. + schema: + $ref: '#/definitions/accountRelationship' + "400": + description: bad request + "401": + description: unauthorized + "403": + description: forbidden + "404": + description: not found + "500": + description: internal server error + security: + - OAuth2 Bearer: + - write:follows + summary: Accept/authorize follow request from the given account ID. + tags: + - follow_requests + /api/v1/follow_requests/{account_id}/reject: + post: + operationId: rejectFollowRequest + parameters: + - description: ID of the account requesting to follow you. + in: path + name: account_id + required: true + type: string + produces: + - application/json + responses: + "200": + description: Your relationship to this account. + schema: + $ref: '#/definitions/accountRelationship' + "400": + description: bad request + "401": + description: unauthorized + "403": + description: forbidden + "404": + description: not found + "500": + description: internal server error + security: + - OAuth2 Bearer: + - write:follows + summary: Reject/deny follow request from the given account ID. + tags: + - follow_requests /api/v1/instance: get: description: |- -- cgit v1.2.3