Skip to content

Commit

Permalink
docs: API文档问题修复和对外暴露接口梳理调整 TencentBlueKing#2657
Browse files Browse the repository at this point in the history
  • Loading branch information
zzdjx authored Oct 21, 2024
1 parent 1ee8f6f commit 40afaf5
Show file tree
Hide file tree
Showing 32 changed files with 5,492 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 蓝盾制品库文档

[部署文档](/install/)
[接口文档](/apidoc/)
[接口文档](/apidoc-user/)
2 changes: 1 addition & 1 deletion docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- [部署文档](/install/)
- [接口文档](/apidoc/)
- [接口文档](/apidoc-user/)
34 changes: 34 additions & 0 deletions docs/apidoc-user/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 蓝鲸制品库接口文档
- **接口公共说明**
- [通用接口协议](common/common.md)
- [自定义搜索协议](common/search.md)
- [事件类型](common/event.md)
- **项目/仓库**
- [项目接口](repo/project.md)
- [仓库接口](repo/repository.md)
- [代理源接口](repo/proxy-channel.md)
- **节点**
- [节点操作接口](node/node.md)
- [分享链接接口](node/share.md)
- **制品包/版本**
- [制品包版本接口](package/package.md)
- **元数据**
- [系统元数据说明](metadata/system-metadata.md)
- [节点元数据](metadata/node-metadata.md)
- [元数据搜索](metadata/search.md)
- **Generic通用制品仓库**
- [简单文件操作](generic/simple.md)
- [分块文件操作](generic/block.md)
- [临时访问凭证](generic/temporary-access.md)
- **认证服务**
- [用户相关](auth/user.md)
- [用户token相关](auth/token.md)
- **制品分析**
- [扫描器管理](scanner/scanner.md)
- [扫描](scanner/scan.md)
- [扫描报告](scanner/report.md)
- **WebHook**
- [webhook接口](webhook/webhook.md)
- [webhook消息](webhook/payload.md)
- **审计日志**
- [审计日志接口](log/log.md)
33 changes: 33 additions & 0 deletions docs/apidoc-user/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
- **接口公共说明**
- [通用接口协议](/apidoc-user/common/common.md)
- [自定义搜索协议](/apidoc-user/common/search.md)
- [事件类型](/apidoc-user/common/event.md)
- **项目/仓库**
- [项目接口](/apidoc-user/repo/project.md)
- [仓库接口](/apidoc-user/repo/repository.md)
- [代理源接口](/apidoc-user/repo/proxy-channel.md)
- **节点**
- [节点操作接口](/apidoc-user/node/node.md)
- [分享链接接口](/apidoc-user/node/share.md)
- **制品包/版本**
- [制品包版本接口](/apidoc-user/package/package.md)
- **元数据**
- [系统元数据说明](/apidoc-user/metadata/system-metadata.md)
- [节点元数据](/apidoc-user/metadata/node-metadata.md)
- [元数据搜索](/apidoc-user/metadata/search.md)
- **Generic通用制品仓库**
- [简单文件操作](/apidoc-user/generic/simple.md)
- [分块文件操作](/apidoc-user/generic/block.md)
- [临时访问凭证](/apidoc-user/generic/temporary-access.md)
- **认证服务**
- [用户相关](/apidoc-user/auth/user.md)
- [用户token相关](/apidoc-user/auth/token.md)
- **制品分析**
- [扫描器管理](/apidoc-user/scanner/scanner.md)
- [扫描](/apidoc-user/scanner/scan.md)
- [扫描报告](/apidoc-user/scanner/report.md)
- **WebHook**
- [webhook接口](/apidoc-user/webhook/webhook.md)
- [webhook消息](/apidoc-user/webhook/payload.md)
- **审计日志**
- [审计日志接口](/apidoc-user/log/log.md)
179 changes: 179 additions & 0 deletions docs/apidoc-user/auth/token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
## bkrepo token相关接口

### 新增用户token

- API:POST /auth/api/user/token/{uid}/{name}?expiredAt=2019-12-21T09:46:37.877Z&projectId=aaa
- API 名称: add_user_token
- 功能说明:
- 中文:新增用户token
- English:add user token

- input body:

``` json

```

- input 字段说明

|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|name|string|||token名|the token name|
|uid|string|||用户id|the user id|
|expiredAt|datetime|||过期时间|expiredAt|
|projectId|aaa|||项目ID|projectId|

- output:

```
{
"code":0,
"data":{
"createdAt":"2019-12-21T09:46:37.877Z",
"expiredAt":"2019-12-21T09:46:37.877Z",
"id":"abcd",
"name":"abcd"
},
"message":"string",
"traceId":"string"
}
```

- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | result data |the data for response|
|traceId|string|请求跟踪id|the trace id|


- data 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|createdAt|time|创建时间|create time|
|expiredAt|time|过期时间,null标识永久 |expired time |
|name | string | token name|the name of token|
|id|string|token id |the id of token|

### 用户token列表

- API:GET /auth/api/user/list/token/{uid}
- API 名称: list_user_token
- 功能说明:
- 中文:新增用户token
- English:add user token

- input body:

``` json

```

- input 字段说明

|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|uid|string|||用户id|the user id|

- output:

```
{
"code":0,
"data":[
{
"createdAt":"2019-12-21T09:46:37.877Z",
"expiredAt":"2019-12-21T09:46:37.877Z",
"name":"token1"
},
{
"createdAt":"2019-12-21T09:46:37.877Z",
"expiredAt":null,
"name":"token2"
}
],
"message":"string",
"traceId":"string"
}
```

- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | result data |the data for response|
|traceId|string|请求跟踪id|the trace id|


- data 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|createdAt|time|创建时间|create time|
|expiredAt|time|过期时间 |expired time |
|name | string | token name|the name of token|
|id|string|token id |the id of token|

### 删除用户token

- API:DELETE /auth/api/user/token/{uid}/{name}
- API 名称: delete_user_token
- 功能说明:
- 中文:删除用户token
- English:delete user token

- input body:

``` json

```

- input 字段说明

|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|uid|string|||用户id|the user id|
|name|string|||用户token|the user token|

- output:

```
{
"code":0,
"data":{
"admin":true,
"locked":true,
"name":"string",
"pwd":"string",
"roles":[
"string"
],
"tokens":[
{
"createdAt":"2019-12-21T09:46:37.877Z",
"expiredAt":"2019-12-21T09:46:37.877Z",
"name":"string"
}
],
"uid":"string"
},
"message":"string",
"traceId":"string"
}
```

- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | result data |the data for response|
|traceId|string|请求跟踪id|the trace id|
Loading

0 comments on commit 40afaf5

Please sign in to comment.