licos-platform-cli 0.6.0__tar.gz → 0.6.1__tar.gz

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.
Files changed (21) hide show
  1. licos_platform_cli-0.6.1/PKG-INFO +65 -0
  2. licos_platform_cli-0.6.1/README.md +57 -0
  3. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/pyproject.toml +2 -2
  4. licos_platform_cli-0.6.0/PKG-INFO +0 -40
  5. licos_platform_cli-0.6.0/README.md +0 -32
  6. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/.gitignore +0 -0
  7. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/__init__.py +0 -0
  8. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/database_commands.py +0 -0
  9. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/help_commands.py +0 -0
  10. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/identity.py +0 -0
  11. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/knowledge_commands.py +0 -0
  12. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/main.py +0 -0
  13. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/oauth_commands.py +0 -0
  14. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/ontology_commands.py +0 -0
  15. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/project_config_commands.py +0 -0
  16. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/storage_commands.py +0 -0
  17. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/src/licos_platform_cli/user_commands.py +0 -0
  18. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/tests/test_cli.py +0 -0
  19. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/tests/test_identity.py +0 -0
  20. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/tests/test_project_config.py +0 -0
  21. {licos_platform_cli-0.6.0 → licos_platform_cli-0.6.1}/tests/test_user.py +0 -0
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.5
2
+ Name: licos-platform-cli
3
+ Version: 0.6.1
4
+ Summary: LICOS platform CLI
5
+ Requires-Python: >=3.10
6
+ Requires-Dist: licos-platform-sdk>=0.7.1
7
+ Description-Content-Type: text/markdown
8
+
9
+ # licos-platform-cli
10
+
11
+ LICOS 平台命令行工具。`licos-platform help` 返回结构化 JSON 帮助。
12
+
13
+ ## 当前使用者(0.5.1 起)
14
+
15
+ ```bash
16
+ licos-platform user me
17
+ licos-platform user me --workspace-id <执行工作空间ID>
18
+ licos-platform help user me
19
+ ```
20
+
21
+ 用户接口默认使用 `LICOS_CURRENT_USER_ID` 指定的容器执行用户换取 Token。它不代表网页登录者。平台地址、服务凭证和项目工作空间沿用运行时配置。
22
+ 多用户请求可将当前使用者 Token 通过标准输入传入,不将 Token 放在命令行参数中:
23
+
24
+ ```bash
25
+ licos-platform user me --token-stdin
26
+ ```
27
+
28
+ 输入不含 `Bearer ` 前缀的 Token 并结束标准输入。程序调用时可通过子进程的 `input` 参数传入。
29
+
30
+ 输出为与低代码 `sys_user` 相同的 JSON:用户 ID、账号、姓名、头像、执行企业、
31
+ 主部门、全部所属部门、组织任职、主岗位和主职务。部门含名称路径、ID 路径;
32
+ 无部门/任职时保持 `[]`/`null`。缺少当前使用者身份或 Token 失效时返回非零退出码,
33
+ 不改用项目所有者。Token 和内部服务凭证不回显。
34
+
35
+
36
+ ## 身份选择(0.6.0 起)
37
+
38
+ `LICOS_CURRENT_USER_ID` 表示容器启动时配置的执行用户,项目身份指运行时配置的项目所有者身份。不同命令的默认身份如下:
39
+
40
+ | 命令 | 默认身份 | 网页登录用户执行 |
41
+ | --- | --- | --- |
42
+ | `user me` | 按 `LICOS_CURRENT_USER_ID` 换 Token | 使用 `--token-stdin` |
43
+ | `knowledge enterprise …` | 按 `LICOS_CURRENT_USER_ID` 换 Token | 使用 `--token-stdin`,企业范围和权限由平台认证结果确定 |
44
+ | `ontology search`、`ontology invoke` | 按 `LICOS_CURRENT_USER_ID` 换 Token | 使用 `--token-stdin` |
45
+ | 普通 `knowledge …` | 项目身份 | 需要用户权限时使用 `--token-stdin` |
46
+ | 数据库、对象存储、OAuth 应用管理 | 项目身份 | 保持项目身份 |
47
+
48
+ 用户操作未传 `--token-stdin` 时,用 `LICOS_CURRENT_USER_ID` 和运行时服务凭证换 Token;缺少执行用户配置则报错。`--token-stdin` 优先使用标准输入的 Token,空输入直接报错,不再换取其他身份。
49
+
50
+ HTTP 服务调用用户接口时,必须从本次认证会话取得 Token,并写入该子进程的标准输入;缺少 Token 时在业务入口返回登录错误。不能依赖容器默认用户,也不能把请求 Token 或用户 ID 写入共享环境变量。例如在 Python 服务中:
51
+
52
+ ```python
53
+ import subprocess
54
+
55
+ # token 来自本次请求的认证会话,不含 "Bearer " 前缀。
56
+ result = subprocess.run(
57
+ ["licos-platform", "user", "me", "--token-stdin"],
58
+ input=token,
59
+ text=True,
60
+ capture_output=True,
61
+ check=True,
62
+ )
63
+ ```
64
+
65
+ 显式传入的 Token 鉴权失败时返回非零退出码,由调用方更新登录凭证,不切换到容器用户或项目所有者。项目所有者和工作空间等资源归属字段单独保留,不用它们冒充调用用户。
@@ -0,0 +1,57 @@
1
+ # licos-platform-cli
2
+
3
+ LICOS 平台命令行工具。`licos-platform help` 返回结构化 JSON 帮助。
4
+
5
+ ## 当前使用者(0.5.1 起)
6
+
7
+ ```bash
8
+ licos-platform user me
9
+ licos-platform user me --workspace-id <执行工作空间ID>
10
+ licos-platform help user me
11
+ ```
12
+
13
+ 用户接口默认使用 `LICOS_CURRENT_USER_ID` 指定的容器执行用户换取 Token。它不代表网页登录者。平台地址、服务凭证和项目工作空间沿用运行时配置。
14
+ 多用户请求可将当前使用者 Token 通过标准输入传入,不将 Token 放在命令行参数中:
15
+
16
+ ```bash
17
+ licos-platform user me --token-stdin
18
+ ```
19
+
20
+ 输入不含 `Bearer ` 前缀的 Token 并结束标准输入。程序调用时可通过子进程的 `input` 参数传入。
21
+
22
+ 输出为与低代码 `sys_user` 相同的 JSON:用户 ID、账号、姓名、头像、执行企业、
23
+ 主部门、全部所属部门、组织任职、主岗位和主职务。部门含名称路径、ID 路径;
24
+ 无部门/任职时保持 `[]`/`null`。缺少当前使用者身份或 Token 失效时返回非零退出码,
25
+ 不改用项目所有者。Token 和内部服务凭证不回显。
26
+
27
+
28
+ ## 身份选择(0.6.0 起)
29
+
30
+ `LICOS_CURRENT_USER_ID` 表示容器启动时配置的执行用户,项目身份指运行时配置的项目所有者身份。不同命令的默认身份如下:
31
+
32
+ | 命令 | 默认身份 | 网页登录用户执行 |
33
+ | --- | --- | --- |
34
+ | `user me` | 按 `LICOS_CURRENT_USER_ID` 换 Token | 使用 `--token-stdin` |
35
+ | `knowledge enterprise …` | 按 `LICOS_CURRENT_USER_ID` 换 Token | 使用 `--token-stdin`,企业范围和权限由平台认证结果确定 |
36
+ | `ontology search`、`ontology invoke` | 按 `LICOS_CURRENT_USER_ID` 换 Token | 使用 `--token-stdin` |
37
+ | 普通 `knowledge …` | 项目身份 | 需要用户权限时使用 `--token-stdin` |
38
+ | 数据库、对象存储、OAuth 应用管理 | 项目身份 | 保持项目身份 |
39
+
40
+ 用户操作未传 `--token-stdin` 时,用 `LICOS_CURRENT_USER_ID` 和运行时服务凭证换 Token;缺少执行用户配置则报错。`--token-stdin` 优先使用标准输入的 Token,空输入直接报错,不再换取其他身份。
41
+
42
+ HTTP 服务调用用户接口时,必须从本次认证会话取得 Token,并写入该子进程的标准输入;缺少 Token 时在业务入口返回登录错误。不能依赖容器默认用户,也不能把请求 Token 或用户 ID 写入共享环境变量。例如在 Python 服务中:
43
+
44
+ ```python
45
+ import subprocess
46
+
47
+ # token 来自本次请求的认证会话,不含 "Bearer " 前缀。
48
+ result = subprocess.run(
49
+ ["licos-platform", "user", "me", "--token-stdin"],
50
+ input=token,
51
+ text=True,
52
+ capture_output=True,
53
+ check=True,
54
+ )
55
+ ```
56
+
57
+ 显式传入的 Token 鉴权失败时返回非零退出码,由调用方更新登录凭证,不切换到容器用户或项目所有者。项目所有者和工作空间等资源归属字段单独保留,不用它们冒充调用用户。
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "licos-platform-cli"
7
- version = "0.6.0"
7
+ version = "0.6.1"
8
8
  description = "LICOS platform CLI"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  dependencies = [
12
- "licos-platform-sdk>=0.7.0",
12
+ "licos-platform-sdk>=0.7.1",
13
13
  ]
14
14
 
15
15
  [project.scripts]
@@ -1,40 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: licos-platform-cli
3
- Version: 0.6.0
4
- Summary: LICOS platform CLI
5
- Requires-Python: >=3.10
6
- Requires-Dist: licos-platform-sdk>=0.7.0
7
- Description-Content-Type: text/markdown
8
-
9
- # licos-platform-cli
10
-
11
- LICOS 平台命令行工具。`licos-platform help` 返回结构化 JSON 帮助。
12
-
13
- ## 当前使用者(0.5.1 起)
14
-
15
- ```bash
16
- licos-platform user me
17
- licos-platform user me --workspace-id <执行工作空间ID>
18
- licos-platform help user me
19
- ```
20
-
21
- 用户接口默认使用 `LICOS_CURRENT_USER_ID` 指定的容器执行用户换取 Token。它不代表网页登录者。平台地址、服务凭证和项目工作空间沿用运行时配置。
22
- 多用户请求可将当前使用者 Token 通过标准输入传入,不将 Token 放在命令行参数中:
23
-
24
- ```bash
25
- licos-platform user me --token-stdin
26
- ```
27
-
28
- 输入不含 `Bearer ` 前缀的 Token 并结束标准输入。程序调用时可通过子进程的 `input` 参数传入。
29
-
30
- 输出为与低代码 `sys_user` 相同的 JSON:用户 ID、账号、姓名、头像、执行企业、
31
- 主部门、全部所属部门、组织任职、主岗位和主职务。部门含名称路径、ID 路径;
32
- 无部门/任职时保持 `[]`/`null`。缺少当前使用者身份或 Token 失效时返回非零退出码,
33
- 不改用项目所有者。Token 和内部服务凭证不回显。
34
-
35
-
36
- ## 身份选择(0.6.0 起)
37
-
38
- `user me`、`knowledge enterprise …`、`ontology …` 均支持 `--token-stdin`。HTTP 服务调用这些命令时必须从标准输入传本次网页登录 Token;独立 CLI 不传此选项时按 `LICOS_CURRENT_USER_ID` 换 Token,缺少该变量则报错。
39
-
40
- 普通 `knowledge …` 命令默认使用项目身份,`--token-stdin` 可显式按调用用户授权。数据库、存储和 OAuth 应用管理仍使用项目身份。空 Token、失效 Token 不切换身份。完整接口分类见仓库 `tools/IDENTITY.md`。
@@ -1,32 +0,0 @@
1
- # licos-platform-cli
2
-
3
- LICOS 平台命令行工具。`licos-platform help` 返回结构化 JSON 帮助。
4
-
5
- ## 当前使用者(0.5.1 起)
6
-
7
- ```bash
8
- licos-platform user me
9
- licos-platform user me --workspace-id <执行工作空间ID>
10
- licos-platform help user me
11
- ```
12
-
13
- 用户接口默认使用 `LICOS_CURRENT_USER_ID` 指定的容器执行用户换取 Token。它不代表网页登录者。平台地址、服务凭证和项目工作空间沿用运行时配置。
14
- 多用户请求可将当前使用者 Token 通过标准输入传入,不将 Token 放在命令行参数中:
15
-
16
- ```bash
17
- licos-platform user me --token-stdin
18
- ```
19
-
20
- 输入不含 `Bearer ` 前缀的 Token 并结束标准输入。程序调用时可通过子进程的 `input` 参数传入。
21
-
22
- 输出为与低代码 `sys_user` 相同的 JSON:用户 ID、账号、姓名、头像、执行企业、
23
- 主部门、全部所属部门、组织任职、主岗位和主职务。部门含名称路径、ID 路径;
24
- 无部门/任职时保持 `[]`/`null`。缺少当前使用者身份或 Token 失效时返回非零退出码,
25
- 不改用项目所有者。Token 和内部服务凭证不回显。
26
-
27
-
28
- ## 身份选择(0.6.0 起)
29
-
30
- `user me`、`knowledge enterprise …`、`ontology …` 均支持 `--token-stdin`。HTTP 服务调用这些命令时必须从标准输入传本次网页登录 Token;独立 CLI 不传此选项时按 `LICOS_CURRENT_USER_ID` 换 Token,缺少该变量则报错。
31
-
32
- 普通 `knowledge …` 命令默认使用项目身份,`--token-stdin` 可显式按调用用户授权。数据库、存储和 OAuth 应用管理仍使用项目身份。空 Token、失效 Token 不切换身份。完整接口分类见仓库 `tools/IDENTITY.md`。