diff --git a/cmd/server/main.go b/cmd/server/main.go index 4f1e61b..2af2573 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -46,11 +46,15 @@ import ( // @host localhost:8080 // @BasePath / -// @securityDefinitions.bearer AdminAuth -// @description Admin token for management API access +// @securityDefinitions.apikey AdminAuth +// @in header +// @name Authorization +// @description Type "Bearer" followed by a space and the admin token. Example: Bearer admin123 -// @securityDefinitions.bearer MasterAuth -// @description Master key for tenant API access +// @securityDefinitions.apikey MasterAuth +// @in header +// @name Authorization +// @description Type "Bearer" followed by a space and the master key. Example: Bearer sk-xxx func fatal(logger *slog.Logger, msg string, args ...any) { logger.Error(msg, args...) diff --git a/docs/docs.go b/docs/docs.go index 15a34e1..a8b2a75 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -4714,6 +4714,20 @@ const docTemplate = `{ } } } + }, + "securityDefinitions": { + "AdminAuth": { + "description": "Type \"Bearer\" followed by a space and the admin token. Example: Bearer admin123", + "type": "apiKey", + "name": "Authorization", + "in": "header" + }, + "MasterAuth": { + "description": "Type \"Bearer\" followed by a space and the master key. Example: Bearer sk-xxx", + "type": "apiKey", + "name": "Authorization", + "in": "header" + } } }` @@ -4724,7 +4738,7 @@ var SwaggerInfo = &swag.Spec{ BasePath: "/", Schemes: []string{}, Title: "EZ-API Control Plane", - Description: "Master key for tenant API access", + Description: "Management API for EZ-API Gateway system.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", diff --git a/docs/swagger.json b/docs/swagger.json index 34922e0..75cea0a 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "description": "Master key for tenant API access", + "description": "Management API for EZ-API Gateway system.", "title": "EZ-API Control Plane", "termsOfService": "http://swagger.io/terms/", "contact": { @@ -4708,5 +4708,19 @@ } } } + }, + "securityDefinitions": { + "AdminAuth": { + "description": "Type \"Bearer\" followed by a space and the admin token. Example: Bearer admin123", + "type": "apiKey", + "name": "Authorization", + "in": "header" + }, + "MasterAuth": { + "description": "Type \"Bearer\" followed by a space and the master key. Example: Bearer sk-xxx", + "type": "apiKey", + "name": "Authorization", + "in": "header" + } } } \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 74ef7ae..91734c8 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -798,7 +798,7 @@ info: email: support@swagger.io name: API Support url: http://www.swagger.io/support - description: Master key for tenant API access + description: Management API for EZ-API Gateway system. license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html @@ -3025,4 +3025,17 @@ paths: summary: Update child key tags: - master +securityDefinitions: + AdminAuth: + description: 'Type "Bearer" followed by a space and the admin token. Example: + Bearer admin123' + in: header + name: Authorization + type: apiKey + MasterAuth: + description: 'Type "Bearer" followed by a space and the master key. Example: Bearer + sk-xxx' + in: header + name: Authorization + type: apiKey swagger: "2.0"