2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-06 17:33:43 +08:00

feat(证书管理): 补全更新和显示接口

This commit is contained in:
耗子
2023-11-07 02:05:50 +08:00
parent c6263ebe73
commit 70601dfb00
21 changed files with 1920 additions and 246 deletions

View File

@@ -145,7 +145,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.CertAdd"
"$ref": "#/definitions/requests.CertStore"
}
}
],
@@ -172,6 +172,118 @@
}
},
"/panel/cert/certs/{id}": {
"get": {
"security": [
{
"BearerToken": []
}
],
"description": "获取面板证书管理的证书",
"produces": [
"application/json"
],
"tags": [
"证书"
],
"summary": "获取证书",
"parameters": [
{
"type": "integer",
"description": "证书 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controllers.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.Cert"
}
}
}
]
}
},
"401": {
"description": "登录已过期",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
},
"500": {
"description": "系统内部错误",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
}
}
},
"put": {
"security": [
{
"BearerToken": []
}
],
"description": "更新面板证书管理的证书",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"证书"
],
"summary": "更新证书",
"parameters": [
{
"type": "integer",
"description": "证书 ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "证书信息",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.CertUpdate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
},
"401": {
"description": "登录已过期",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
},
"500": {
"description": "系统内部错误",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
@@ -292,7 +404,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.DNSAdd"
"$ref": "#/definitions/requests.DNSStore"
}
}
],
@@ -319,6 +431,118 @@
}
},
"/panel/cert/dns/{id}": {
"get": {
"security": [
{
"BearerToken": []
}
],
"description": "获取面板证书管理的 DNS 接口",
"produces": [
"application/json"
],
"tags": [
"证书"
],
"summary": "获取 DNS 接口",
"parameters": [
{
"type": "integer",
"description": "DNS 接口 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controllers.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.CertDNS"
}
}
}
]
}
},
"401": {
"description": "登录已过期",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
},
"500": {
"description": "系统内部错误",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
}
}
},
"put": {
"security": [
{
"BearerToken": []
}
],
"description": "更新面板证书管理的 DNS 接口",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"证书"
],
"summary": "更新 DNS 接口",
"parameters": [
{
"type": "integer",
"description": "DNS 接口 ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "DNS 接口信息",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.DNSUpdate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
},
"401": {
"description": "登录已过期",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
},
"500": {
"description": "系统内部错误",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
@@ -638,7 +862,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.UserAdd"
"$ref": "#/definitions/requests.UserStore"
}
}
],
@@ -665,6 +889,118 @@
}
},
"/panel/cert/users/{id}": {
"get": {
"security": [
{
"BearerToken": []
}
],
"description": "获取面板证书管理的 ACME 用户",
"produces": [
"application/json"
],
"tags": [
"证书"
],
"summary": "获取 ACME 用户",
"parameters": [
{
"type": "integer",
"description": "用户 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controllers.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.CertUser"
}
}
}
]
}
},
"401": {
"description": "登录已过期",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
},
"500": {
"description": "系统内部错误",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
}
}
},
"put": {
"security": [
{
"BearerToken": []
}
],
"description": "更新面板证书管理的 ACME 用户",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"证书"
],
"summary": "更新 ACME 用户",
"parameters": [
{
"type": "integer",
"description": "用户 ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "用户信息",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.UserUpdate"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/controllers.SuccessResponse"
}
},
"401": {
"description": "登录已过期",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
},
"500": {
"description": "系统内部错误",
"schema": {
"$ref": "#/definitions/controllers.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
@@ -758,6 +1094,23 @@
}
}
}
},
"/swagger": {
"get": {
"description": "Swagger UI",
"tags": [
"Swagger"
],
"summary": "Swagger UI",
"responses": {
"200": {
"description": "OK"
},
"500": {
"description": "Internal Server Error"
}
}
}
}
},
"definitions": {
@@ -900,6 +1253,10 @@
"id": {
"type": "integer"
},
"name": {
"description": "备注名称",
"type": "string"
},
"type": {
"description": "DNS 提供商 (dnspod, aliyun, cloudflare)",
"type": "string"
@@ -951,6 +1308,9 @@
"models.Website": {
"type": "object",
"properties": {
"cert": {
"$ref": "#/definitions/models.Cert"
},
"created_at": {
"type": "string"
},
@@ -980,7 +1340,7 @@
}
}
},
"requests.CertAdd": {
"requests.CertStore": {
"type": "object",
"properties": {
"auto_renew": {
@@ -1000,15 +1360,67 @@
},
"user_id": {
"type": "integer"
},
"website_id": {
"type": "integer"
}
}
},
"requests.DNSAdd": {
"requests.CertUpdate": {
"type": "object",
"properties": {
"auto_renew": {
"type": "boolean"
},
"dns_id": {
"type": "integer"
},
"domains": {
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"type": "integer"
},
"type": {
"type": "string"
},
"user_id": {
"type": "integer"
},
"website_id": {
"type": "integer"
}
}
},
"requests.DNSStore": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/acme.DNSParam"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"requests.DNSUpdate": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/acme.DNSParam"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
@@ -1041,7 +1453,7 @@
}
}
},
"requests.UserAdd": {
"requests.UserStore": {
"type": "object",
"properties": {
"ca": {
@@ -1061,6 +1473,29 @@
}
}
},
"requests.UserUpdate": {
"type": "object",
"properties": {
"ca": {
"type": "string"
},
"email": {
"type": "string"
},
"hmac_encoded": {
"type": "string"
},
"id": {
"type": "integer"
},
"key_type": {
"type": "string"
},
"kid": {
"type": "string"
}
}
},
"responses.CertList": {
"type": "object",
"properties": {