licos-platform-cli 0.6.4__tar.gz → 0.6.6__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.
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/PKG-INFO +3 -2
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/README.md +1 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/pyproject.toml +2 -2
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/identity.py +3 -3
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/tests/test_identity.py +7 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/.gitignore +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/__init__.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/database_commands.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/help_commands.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/knowledge_commands.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/main.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/oauth_commands.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/ontology_commands.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/project_config_commands.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/storage_commands.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/user_commands.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/tests/test_cli.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/tests/test_project_config.py +0 -0
- {licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/tests/test_user.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: licos-platform-cli
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.6
|
|
4
4
|
Summary: LICOS platform CLI
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
|
-
Requires-Dist: licos-platform-sdk>=0.7.
|
|
6
|
+
Requires-Dist: licos-platform-sdk>=0.7.6
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
|
|
9
9
|
# licos-platform-cli
|
|
@@ -19,6 +19,7 @@ licos-platform help user me
|
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
用户接口默认使用 `LICOS_CURRENT_USER_ID` 指定的容器执行用户换取 Token。它不代表网页登录者。平台地址、服务凭证和项目工作空间沿用运行时配置。
|
|
22
|
+
运行时使用 `AGENT_CURRENT_USER_ID` 注入当前用户时同样支持,不以项目负责人替代当前执行用户。企业和空间上下文沿用平台签发的认证结果。
|
|
22
23
|
多用户请求可将当前使用者 Token 通过标准输入传入,不将 Token 放在命令行参数中:
|
|
23
24
|
|
|
24
25
|
```bash
|
|
@@ -11,6 +11,7 @@ licos-platform help user me
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
用户接口默认使用 `LICOS_CURRENT_USER_ID` 指定的容器执行用户换取 Token。它不代表网页登录者。平台地址、服务凭证和项目工作空间沿用运行时配置。
|
|
14
|
+
运行时使用 `AGENT_CURRENT_USER_ID` 注入当前用户时同样支持,不以项目负责人替代当前执行用户。企业和空间上下文沿用平台签发的认证结果。
|
|
14
15
|
多用户请求可将当前使用者 Token 通过标准输入传入,不将 Token 放在命令行参数中:
|
|
15
16
|
|
|
16
17
|
```bash
|
|
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "licos-platform-cli"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.6"
|
|
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.
|
|
12
|
+
"licos-platform-sdk>=0.7.6",
|
|
13
13
|
]
|
|
14
14
|
|
|
15
15
|
[project.scripts]
|
|
@@ -12,9 +12,9 @@ def user_token(args) -> str:
|
|
|
12
12
|
if not token:
|
|
13
13
|
raise ConfigurationError("--token-stdin requires a nonempty user Token")
|
|
14
14
|
return token
|
|
15
|
-
user_id = os.environ.get("LICOS_CURRENT_USER_ID", "").strip()
|
|
15
|
+
user_id = os.environ.get("LICOS_CURRENT_USER_ID", "").strip() or os.environ.get("AGENT_CURRENT_USER_ID", "").strip()
|
|
16
16
|
if not user_id:
|
|
17
|
-
raise ConfigurationError("CLI user identity requires LICOS_CURRENT_USER_ID or --token-stdin")
|
|
17
|
+
raise ConfigurationError("CLI user identity requires LICOS_CURRENT_USER_ID, AGENT_CURRENT_USER_ID or --token-stdin")
|
|
18
18
|
return runtime_user_token(user_id)
|
|
19
19
|
|
|
20
20
|
|
|
@@ -22,5 +22,5 @@ def add_user_token_option(parser) -> None:
|
|
|
22
22
|
parser.add_argument(
|
|
23
23
|
"--token-stdin",
|
|
24
24
|
action="store_true",
|
|
25
|
-
help="Read the caller Token from stdin; otherwise use LICOS_CURRENT_USER_ID",
|
|
25
|
+
help="Read the caller Token from stdin; otherwise use LICOS_CURRENT_USER_ID or AGENT_CURRENT_USER_ID",
|
|
26
26
|
)
|
|
@@ -7,6 +7,13 @@ from licos_platform_sdk import ConfigurationError
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class CliIdentityTests(TestCase):
|
|
10
|
+
def test_agent_current_user_alias_does_not_select_the_owner(self):
|
|
11
|
+
with mock.patch.dict("os.environ", {"AGENT_CURRENT_USER_ID":"actor", "AGENT_USER_ID":"owner"}, clear=True), mock.patch(
|
|
12
|
+
"licos_platform_cli.identity.runtime_user_token", return_value="actor-token"
|
|
13
|
+
) as exchange:
|
|
14
|
+
self.assertEqual(user_token(Namespace(token_stdin=False)),"actor-token")
|
|
15
|
+
exchange.assert_called_once_with("actor")
|
|
16
|
+
|
|
10
17
|
def test_cli_defaults_to_initialization_user(self):
|
|
11
18
|
with mock.patch.dict(
|
|
12
19
|
"os.environ", {"LICOS_CURRENT_USER_ID": "initializer", "LICOS_USER_ID": "owner"}, clear=True
|
|
File without changes
|
|
File without changes
|
{licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/database_commands.py
RENAMED
|
File without changes
|
{licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/help_commands.py
RENAMED
|
File without changes
|
{licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/knowledge_commands.py
RENAMED
|
File without changes
|
|
File without changes
|
{licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/oauth_commands.py
RENAMED
|
File without changes
|
{licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/ontology_commands.py
RENAMED
|
File without changes
|
|
File without changes
|
{licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/storage_commands.py
RENAMED
|
File without changes
|
{licos_platform_cli-0.6.4 → licos_platform_cli-0.6.6}/src/licos_platform_cli/user_commands.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|