opened the tags endpoint to the apekey authentication

This commit is contained in:
Miodec 2023-06-29 13:11:40 +02:00
parent 69071f6414
commit 10159702ff
2 changed files with 97 additions and 2 deletions

View file

@ -247,8 +247,10 @@ router.delete(
router.get(
"/tags",
authenticateRequest(),
RateLimit.userTagsGet,
authenticateRequest({
acceptApeKeys: true,
}),
withApeRateLimiter(RateLimit.userTagsGet),
asyncHandler(UserController.getTags)
);

View file

@ -72,6 +72,20 @@
}
}
},
"/users/tags": {
"get": {
"tags": ["users"],
"summary": "Gets a user's tags data",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/Tags"
}
}
}
}
},
"/users/:uid/profile": {
"get": {
"tags": ["users"],
@ -457,6 +471,85 @@
}
}
},
"Tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"_id": {
"type": "string",
"example": "63fde8d39312642481070f5d"
},
"name": {
"type": "string",
"example": "example_tag"
},
"personalBests": {
"type": "object",
"properties": {
"time": {
"type": "object",
"properties": {
"15": {
"type": "array",
"items": {
"$ref": "#/definitions/PersonalBest"
}
},
"30": {
"type": "array",
"items": {
"$ref": "#/definitions/PersonalBest"
}
},
"60": {
"type": "array",
"items": {
"$ref": "#/definitions/PersonalBest"
}
},
"120": {
"type": "array",
"items": {
"$ref": "#/definitions/PersonalBest"
}
}
}
},
"words": {
"type": "object",
"properties": {
"10": {
"type": "array",
"items": {
"$ref": "#/definitions/PersonalBest"
}
},
"25": {
"type": "array",
"items": {
"$ref": "#/definitions/PersonalBest"
}
},
"50": {
"type": "array",
"items": {
"$ref": "#/definitions/PersonalBest"
}
},
"100": {
"type": "array",
"items": {
"$ref": "#/definitions/PersonalBest"
}
}
}
}
}
}
}
}
},
"LeaderboardEntry": {
"type": "object",
"properties": {