feat: add auth to swagerr add middleware for check admin
This commit is contained in:
@@ -133,6 +133,11 @@ const docTemplate = `{
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Create new post",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
@@ -245,6 +250,11 @@ const docTemplate = `{
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Update post",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
@@ -308,6 +318,11 @@ const docTemplate = `{
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Delete post",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
@@ -440,6 +455,14 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"Bearer": {
|
||||
"description": "Type \"Bearer\" followed by a space and the JWT token.",
|
||||
"type": "apiKey",
|
||||
"name": "Authorization",
|
||||
"in": "header"
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
|
||||
@@ -122,6 +122,11 @@
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Create new post",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
@@ -234,6 +239,11 @@
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Update post",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
@@ -297,6 +307,11 @@
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Delete post",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
@@ -429,5 +444,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"Bearer": {
|
||||
"description": "Type \"Bearer\" followed by a space and the JWT token.",
|
||||
"type": "apiKey",
|
||||
"name": "Authorization",
|
||||
"in": "header"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,6 +149,8 @@ paths:
|
||||
description: Invalid request
|
||||
schema:
|
||||
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Create post
|
||||
tags:
|
||||
- posts
|
||||
@@ -187,6 +189,8 @@ paths:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Delete post
|
||||
tags:
|
||||
- posts
|
||||
@@ -263,7 +267,15 @@ paths:
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/gitea_d3m0k1d_ru_d3m0k1d_d3m0k1d_ru_backend_internal_models.ErrorResponse'
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Update post
|
||||
tags:
|
||||
- posts
|
||||
securityDefinitions:
|
||||
Bearer:
|
||||
description: Type "Bearer" followed by a space and the JWT token.
|
||||
in: header
|
||||
name: Authorization
|
||||
type: apiKey
|
||||
swagger: "2.0"
|
||||
|
||||
Reference in New Issue
Block a user