fix(swagger): fix swagger authorization header

This commit is contained in:
2025-12-25 11:26:56 +08:00
parent ecdff89364
commit c8fced4cf1
4 changed files with 7 additions and 42 deletions

View File

@@ -46,13 +46,11 @@ import (
// @host localhost:8080 // @host localhost:8080
// @BasePath / // @BasePath /
// @securityDefinitions.apikey AdminAuth // @securityDefinitions.bearer AdminAuth
// @in header // @description Admin token for management API access
// @name Authorization
// @securityDefinitions.apikey MasterAuth // @securityDefinitions.bearer MasterAuth
// @in header // @description Master key for tenant API access
// @name Authorization
func fatal(logger *slog.Logger, msg string, args ...any) { func fatal(logger *slog.Logger, msg string, args ...any) {
logger.Error(msg, args...) logger.Error(msg, args...)

View File

@@ -4714,18 +4714,6 @@ const docTemplate = `{
} }
} }
} }
},
"securityDefinitions": {
"AdminAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
},
"MasterAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
} }
}` }`
@@ -4736,7 +4724,7 @@ var SwaggerInfo = &swag.Spec{
BasePath: "/", BasePath: "/",
Schemes: []string{}, Schemes: []string{},
Title: "EZ-API Control Plane", Title: "EZ-API Control Plane",
Description: "Management API for EZ-API Gateway system.", Description: "Master key for tenant API access",
InfoInstanceName: "swagger", InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate, SwaggerTemplate: docTemplate,
LeftDelim: "{{", LeftDelim: "{{",

View File

@@ -1,7 +1,7 @@
{ {
"swagger": "2.0", "swagger": "2.0",
"info": { "info": {
"description": "Management API for EZ-API Gateway system.", "description": "Master key for tenant API access",
"title": "EZ-API Control Plane", "title": "EZ-API Control Plane",
"termsOfService": "http://swagger.io/terms/", "termsOfService": "http://swagger.io/terms/",
"contact": { "contact": {
@@ -4708,17 +4708,5 @@
} }
} }
} }
},
"securityDefinitions": {
"AdminAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
},
"MasterAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
} }
} }

View File

@@ -798,7 +798,7 @@ info:
email: support@swagger.io email: support@swagger.io
name: API Support name: API Support
url: http://www.swagger.io/support url: http://www.swagger.io/support
description: Management API for EZ-API Gateway system. description: Master key for tenant API access
license: license:
name: Apache 2.0 name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html url: http://www.apache.org/licenses/LICENSE-2.0.html
@@ -3025,13 +3025,4 @@ paths:
summary: Update child key summary: Update child key
tags: tags:
- master - master
securityDefinitions:
AdminAuth:
in: header
name: Authorization
type: apiKey
MasterAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0" swagger: "2.0"