Update document

This commit is contained in:
2022-10-18 02:30:54 +00:00
committed by GitHub
parent b2c964c664
commit dc541b8eef
8 changed files with 98 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
[中文(简体)](README.zh_CN.md)
* [Server Version](version.md)
* [Server Authentication](auth.md)

9
doc/api/auth.md Normal file
View File

@@ -0,0 +1,9 @@
[中文简体](auth.zh_CN.md)
# Authentication related APIs
## Get server authentication status
* route: `/auth/status` or `/api/auth/status`
* method: `GET` or `POST`
* auth: Not needed
* parameters: None
* [Example](auth/status.example.json) of the response
* [JSON schema](auth/status.json) of the response

View File

@@ -1,8 +1,12 @@
[English](auth.md)
# 验证相关API
## 获取服务器验证状态
* 路径: `/api/auth/status``/auth/status``/api/auth``/auth`
* 方法: `GET``POST`
* 鉴权: 无需
* 参数:无
* 返回结构[示例](auth/status.example.json)
* 返回结果的[JSON Schema](auth/status.zh_CN.json)
## 获取服务器公钥
* 路径: `/api/auth/pubkey``/auth/pubkey`
* 方法: `GET``POST`

View File

@@ -1,5 +1,5 @@
{
"$schema": "pubkey.zh_CN.json",
"$schema": "pubkey.json",
"ok": true,
"code": 0,
"result": {

39
doc/api/auth/pubkey.json Normal file
View File

@@ -0,0 +1,39 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/lifegpc/pixiv_downloader/raw/master/doc/api/auth/pubkey.json",
"title": "Result object",
"type": "object",
"properties": {
"ok": {
"description": "Whether the request was successful",
"type": "boolean"
},
"code": {
"description": "Error code, 0 if it was successful",
"type": "integer"
},
"msg": {
"description": "Error message",
"type": "string"
},
"debug_msg": {
"description": "Error message contains debug information"
},
"result": {
"description": "Result",
"type": "object",
"properties": {
"key": {
"description": "RSA public key",
"type": "string"
},
"generated_time": {
"description": "The generated time of the key",
"type": "integer"
}
},
"required": ["key", "generated_time"]
}
},
"required": ["ok", "code"]
}

View File

@@ -0,0 +1,4 @@
{
"$schema": "status.json",
"has_root_user": false
}

13
doc/api/auth/status.json Normal file
View File

@@ -0,0 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/lifegpc/pixiv_downloader/raw/master/doc/api/auth/status.json",
"title": "服务器验证状态",
"type": "object",
"properties": {
"has_root_user": {
"type": "boolean",
"description": "Whether to have the root user, if not, the authentication is not needed when adding new user."
}
},
"required": ["has_root_user"]
}

27
doc/api/result.json Normal file
View File

@@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/lifegpc/pixiv_downloader/raw/master/doc/api/result.json",
"title": "Result object",
"type": "object",
"properties": {
"ok": {
"description": "Whether the request was successful",
"type": "boolean"
},
"code": {
"description": "Error code, 0 if it was successful",
"type": "integer"
},
"msg": {
"description": "Error message",
"type": "string"
},
"debug_msg": {
"description": "Error message contains debug information"
},
"result": {
"description": "Result"
}
},
"required": ["ok", "code"]
}