docs(swagger): document admin master child key endpoints

This commit is contained in:
zenfun
2026-01-10 01:19:53 +08:00
parent e7db9f319f
commit f52c7acbe6
3 changed files with 542 additions and 0 deletions

View File

@@ -4214,6 +4214,107 @@ const docTemplate = `{
} }
}, },
"/admin/masters/{id}/keys": { "/admin/masters/{id}/keys": {
"get": {
"security": [
{
"AdminAuth": []
}
],
"description": "List child keys issued under a master (admin view)",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "List child keys for a master",
"parameters": [
{
"type": "integer",
"description": "Master ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "page (1-based)",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "limit (default 50, max 200)",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "search by group/scopes/namespaces/status",
"name": "search",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_api.TokenView"
}
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
}
}
},
"post": { "post": {
"security": [ "security": [
{ {
@@ -4343,6 +4444,113 @@ const docTemplate = `{
} }
} }
}, },
"/admin/masters/{id}/keys/{key_id}": {
"delete": {
"security": [
{
"AdminAuth": []
}
],
"description": "Revokes and removes a child key under the specified master",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Delete child key",
"parameters": [
{
"type": "integer",
"description": "Master ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Token ID",
"name": "key_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
},
"404": {
"description": "Not Found",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
}
}
}
},
"/admin/masters/{id}/manage": { "/admin/masters/{id}/manage": {
"post": { "post": {
"security": [ "security": [
@@ -7938,6 +8146,10 @@ const docTemplate = `{
} }
}, },
"definitions": { "definitions": {
"gin.H": {
"type": "object",
"additionalProperties": {}
},
"github_com_ez-api_ez-api_internal_dto.APIKeyDTO": { "github_com_ez-api_ez-api_internal_dto.APIKeyDTO": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -4208,6 +4208,107 @@
} }
}, },
"/admin/masters/{id}/keys": { "/admin/masters/{id}/keys": {
"get": {
"security": [
{
"AdminAuth": []
}
],
"description": "List child keys issued under a master (admin view)",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "List child keys for a master",
"parameters": [
{
"type": "integer",
"description": "Master ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "page (1-based)",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "limit (default 50, max 200)",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "search by group/scopes/namespaces/status",
"name": "search",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_api.TokenView"
}
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
}
}
},
"post": { "post": {
"security": [ "security": [
{ {
@@ -4337,6 +4438,113 @@
} }
} }
}, },
"/admin/masters/{id}/keys/{key_id}": {
"delete": {
"security": [
{
"AdminAuth": []
}
],
"description": "Revokes and removes a child key under the specified master",
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Delete child key",
"parameters": [
{
"type": "integer",
"description": "Master ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Token ID",
"name": "key_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
},
"404": {
"description": "Not Found",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"allOf": [
{
"$ref": "#/definitions/internal_api.ResponseEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/gin.H"
}
}
}
]
}
}
}
}
},
"/admin/masters/{id}/manage": { "/admin/masters/{id}/manage": {
"post": { "post": {
"security": [ "security": [
@@ -7932,6 +8140,10 @@
} }
}, },
"definitions": { "definitions": {
"gin.H": {
"type": "object",
"additionalProperties": {}
},
"github_com_ez-api_ez-api_internal_dto.APIKeyDTO": { "github_com_ez-api_ez-api_internal_dto.APIKeyDTO": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -1,5 +1,8 @@
basePath: / basePath: /
definitions: definitions:
gin.H:
additionalProperties: {}
type: object
github_com_ez-api_ez-api_internal_dto.APIKeyDTO: github_com_ez-api_ez-api_internal_dto.APIKeyDTO:
properties: properties:
access_token: access_token:
@@ -3801,6 +3804,63 @@ paths:
tags: tags:
- admin - admin
/admin/masters/{id}/keys: /admin/masters/{id}/keys:
get:
description: List child keys issued under a master (admin view)
parameters:
- description: Master ID
in: path
name: id
required: true
type: integer
- description: page (1-based)
in: query
name: page
type: integer
- description: limit (default 50, max 200)
in: query
name: limit
type: integer
- description: search by group/scopes/namespaces/status
in: query
name: search
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/internal_api.ResponseEnvelope'
- properties:
data:
items:
$ref: '#/definitions/internal_api.TokenView'
type: array
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/internal_api.ResponseEnvelope'
- properties:
data:
$ref: '#/definitions/gin.H'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/internal_api.ResponseEnvelope'
- properties:
data:
$ref: '#/definitions/gin.H'
type: object
security:
- AdminAuth: []
summary: List child keys for a master
tags:
- admin
post: post:
consumes: consumes:
- application/json - application/json
@@ -3871,6 +3931,64 @@ paths:
summary: Issue a child key on behalf of a master summary: Issue a child key on behalf of a master
tags: tags:
- admin - admin
/admin/masters/{id}/keys/{key_id}:
delete:
description: Revokes and removes a child key under the specified master
parameters:
- description: Master ID
in: path
name: id
required: true
type: integer
- description: Token ID
in: path
name: key_id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/internal_api.ResponseEnvelope'
- properties:
data:
$ref: '#/definitions/gin.H'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/internal_api.ResponseEnvelope'
- properties:
data:
$ref: '#/definitions/gin.H'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/internal_api.ResponseEnvelope'
- properties:
data:
$ref: '#/definitions/gin.H'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/internal_api.ResponseEnvelope'
- properties:
data:
$ref: '#/definitions/gin.H'
type: object
security:
- AdminAuth: []
summary: Delete child key
tags:
- admin
/admin/masters/{id}/manage: /admin/masters/{id}/manage:
post: post:
consumes: consumes: