feat: add auth to swagerr add middleware for check admin

This commit is contained in:
d3m0k1d
2026-02-14 16:26:27 +03:00
parent 05a8f0cbc7
commit 7e4dbd7e56
6 changed files with 123 additions and 3 deletions

View File

@@ -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"
}
}
}`