@tachybase/plugin-api-keys 0.23.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +14 -0
- package/LICENSE +201 -0
- package/README.md +9 -0
- package/README.zh-CN.md +9 -0
- package/client.d.ts +3 -0
- package/client.js +65 -0
- package/dist/client/Configuration/ExpiresSelect.d.ts +3 -0
- package/dist/client/Configuration/index.d.ts +2 -0
- package/dist/client/Configuration/roles.d.ts +3 -0
- package/dist/client/Configuration/schema.d.ts +2 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +6 -0
- package/dist/client/locale/index.d.ts +2 -0
- package/dist/collections/apiKeys.d.ts +3 -0
- package/dist/collections/apiKeys.js +120 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +27 -0
- package/dist/externalVersion.js +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +21 -0
- package/dist/locale/ko_KR.json +21 -0
- package/dist/locale/zh-CN.json +21 -0
- package/dist/locale.d.ts +1 -0
- package/dist/locale.js +30 -0
- package/dist/server/actions/api-keys.d.ts +3 -0
- package/dist/server/actions/api-keys.js +84 -0
- package/dist/server/collections/apiKeys.d.ts +2 -0
- package/dist/server/collections/apiKeys.js +34 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/locale/en-US.d.ts +2 -0
- package/dist/server/locale/en-US.js +23 -0
- package/dist/server/locale/fr-FR.d.ts +2 -0
- package/dist/server/locale/fr-FR.js +23 -0
- package/dist/server/locale/index.d.ts +2 -0
- package/dist/server/locale/index.js +40 -0
- package/dist/server/locale/zh-CN.d.ts +4 -0
- package/dist/server/locale/zh-CN.js +25 -0
- package/dist/server/plugin.d.ts +7 -0
- package/dist/server/plugin.js +85 -0
- package/dist/swagger/index.d.ts +106 -0
- package/dist/swagger/index.js +130 -0
- package/docs/en-US/changelog.md +1 -0
- package/docs/en-US/index.md +9 -0
- package/docs/en-US/tabs.json +14 -0
- package/docs/en-US/usage.md +21 -0
- package/docs/zh-CN/changelog.md +1 -0
- package/docs/zh-CN/index.md +10 -0
- package/docs/zh-CN/tabs.json +14 -0
- package/docs/zh-CN/usage.md +21 -0
- package/package.json +34 -0
- package/server.d.ts +3 -0
- package/server.js +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# API keys Usage
|
|
2
|
+
|
|
3
|
+
## Creating an API key
|
|
4
|
+
|
|
5
|
+
After enabling the plugin, go to the API keys plugin management page, click `Add API key`, fill in the relevant information, and click Save to create an API key.
|
|
6
|
+
|
|
7
|
+
## Using an API key
|
|
8
|
+
|
|
9
|
+
Add the `Authorization` field to the request header, with the value of `Bearer ${API_KEY}`, to access all `TachyBase` APIs using the API key.
|
|
10
|
+
|
|
11
|
+
Here's an example using cURL:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
curl '{domain}/api/roles:check' -H 'Authorization: Bearer {API key}'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
> Warning: When using the `Docker` image to use `TachyBase`, make sure you have configured the [APP_KEY](https://docs.tachybase.com/api/env#app_key) environment variable, otherwise the API key will be invalid after each restart.
|
|
18
|
+
|
|
19
|
+
## Deleting an API key
|
|
20
|
+
|
|
21
|
+
After deleting the API key, it will no longer be usable.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# API keys 更新日志
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# API keys 使用方法
|
|
2
|
+
|
|
3
|
+
## 创建 API key
|
|
4
|
+
|
|
5
|
+
当你启用插件后,前往 API keys 的插件管理页面,点击 `添加 API key` 并填写相关信息,点击 `保存` 即可创建 API key。
|
|
6
|
+
|
|
7
|
+
## 使用 API key
|
|
8
|
+
|
|
9
|
+
在请求头中添加 `Authorization` 字段,值为 `Bearer ${API_KEY}`,即可使用 API key 访问 `TachyBase` 所有 API。
|
|
10
|
+
|
|
11
|
+
cURL 的例子如下
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
curl '{domain}/api/roles:check' -H 'Authorization: Bearer {API key}'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
> Warning: 当你使用 `Docker` 镜像来使用 `TachyBase` 时,请确保你配置了 [APP_KEY](https://docs-cn.tachybase.com/api/env#app_key) 环境变量,否则 API key 将在每次重启后失效。
|
|
18
|
+
|
|
19
|
+
## 删除 API key
|
|
20
|
+
|
|
21
|
+
删除 API key 后,该 Key 将无法继续使用。
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tachybase/plugin-api-keys",
|
|
3
|
+
"displayName": "Auth: API keys",
|
|
4
|
+
"version": "0.23.8",
|
|
5
|
+
"description": "Allows users to use API key to access application's HTTP API",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"Authentication"
|
|
8
|
+
],
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"main": "./dist/server/index.js",
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"ahooks": "^3.8.4",
|
|
13
|
+
"antd": "5.22.5",
|
|
14
|
+
"dayjs": "1.11.13",
|
|
15
|
+
"react": "^18.3.1",
|
|
16
|
+
"react-dom": "^18.3.1",
|
|
17
|
+
"react-i18next": "^15.2.0",
|
|
18
|
+
"@tachybase/schema": "0.23.8"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@tachybase/client": "0.23.8",
|
|
22
|
+
"@tachybase/test": "0.23.8",
|
|
23
|
+
"@tachybase/actions": "0.23.8",
|
|
24
|
+
"@tachybase/server": "0.23.8",
|
|
25
|
+
"@tachybase/database": "0.23.8",
|
|
26
|
+
"@tachybase/resourcer": "0.23.8",
|
|
27
|
+
"@tachybase/utils": "0.23.8"
|
|
28
|
+
},
|
|
29
|
+
"description.zh-CN": "允许用户使用 API 密钥访问应用的 HTTP API",
|
|
30
|
+
"displayName.zh-CN": "认证:API 密钥",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tachybase-build --no-dts @tachybase/plugin-api-keys"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/server.d.ts
ADDED
package/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/server/index.js');
|