forked from kevadesu/forgejo
Add ContextUser
to http request context (#18798)
This PR adds a middleware which sets a ContextUser (like GetUserByParams before) in a single place which can be used by other methods. For routes which represent a repo or org the respective middlewares set the field too. Also fix a bug in modules/context/org.go during refactoring.
This commit is contained in:
parent
f36701c702
commit
59b867dc2d
23 changed files with 247 additions and 323 deletions
|
@ -12087,39 +12087,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/users/{follower}/following/{followee}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Check if one user is following another user",
|
||||
"operationId": "userCheckFollowing",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "username of following user",
|
||||
"name": "follower",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "username of followed user",
|
||||
"name": "followee",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"$ref": "#/responses/empty"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/users/{username}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
|
@ -12225,6 +12192,39 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/users/{username}/following/{target}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Check if one user is following another user",
|
||||
"operationId": "userCheckFollowing",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "username of following user",
|
||||
"name": "username",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "username of followed user",
|
||||
"name": "target",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"$ref": "#/responses/empty"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/users/{username}/gpg_keys": {
|
||||
"get": {
|
||||
"produces": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue