pilot-platform-common 2.7.0__tar.gz → 2.9.0__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.
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/PKG-INFO +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/geid/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/geid/geid_client.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/jwt_handler/JWTHandler.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/jwt_handler/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/jwt_handler/jwt_handler_exception.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/jwt_handler/models.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/logging/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/logging/formatter.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/logging/logger.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/logging/logging.py +2 -3
- {pilot_platform_common-2.7.0/tests → pilot_platform_common-2.9.0/common/models}/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/models/config_center_policy.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/models/service_id_generator.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/object_storage_adaptor/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/object_storage_adaptor/base_client.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/object_storage_adaptor/boto3_admin_client.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/object_storage_adaptor/boto3_client.py +3 -5
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/object_storage_adaptor/minio_policy_client.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/permissions/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/permissions/exceptions.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/permissions/permissions.py +2 -3
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/permissions/permissions_manager.py +4 -6
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/permissions/schemas.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/project/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/project/project_client.py +11 -5
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/project/project_exceptions.py +1 -1
- {pilot_platform_common-2.7.0/common/models → pilot_platform_common-2.9.0/common/services}/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/services/auth_client.py +2 -5
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/vault/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/vault/vault_client.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/vault/vault_exception.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/pilot_platform_common.egg-info/PKG-INFO +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/pyproject.toml +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/setup.py +2 -2
- {pilot_platform_common-2.7.0/tests/fixtures → pilot_platform_common-2.9.0/tests}/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/conftest.py +1 -1
- {pilot_platform_common-2.7.0/common/services → pilot_platform_common-2.9.0/tests/fixtures}/__init__.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/fixtures/fake.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/fixtures/metadata.py +1 -1
- pilot_platform_common-2.9.0/tests/permissions/__init__.py +3 -0
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/permissions/test_auth_client.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/permissions/test_permissions.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/permissions/test_permissions_manager.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/test_formatter.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/test_geid_client.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/test_jwt_handler.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/test_logging.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/test_project_client.py +1 -1
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/tests/test_vault_client.py +1 -1
- pilot_platform_common-2.7.0/tests/permissions/__init__.py +0 -3
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/README.md +0 -0
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/pilot_platform_common.egg-info/SOURCES.txt +0 -0
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/pilot_platform_common.egg-info/dependency_links.txt +0 -0
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/pilot_platform_common.egg-info/requires.txt +0 -0
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/pilot_platform_common.egg-info/top_level.txt +0 -0
- {pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/setup.cfg +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2023-
|
|
1
|
+
# Copyright (C) 2023-2025 Indoc Systems
|
|
2
2
|
#
|
|
3
3
|
# Contact Indoc Systems for any questions regarding the use of this source code.
|
|
4
4
|
|
|
@@ -8,7 +8,6 @@ import logging
|
|
|
8
8
|
import logging.config
|
|
9
9
|
from collections.abc import Mapping
|
|
10
10
|
from typing import Any
|
|
11
|
-
from typing import Union
|
|
12
11
|
|
|
13
12
|
from opentelemetry import trace
|
|
14
13
|
|
|
@@ -81,7 +80,7 @@ def extend_logger_class() -> None:
|
|
|
81
80
|
logger_class.audit = audit
|
|
82
81
|
|
|
83
82
|
|
|
84
|
-
def configure_logging(level: int, formatter: str = 'json', namespaces:
|
|
83
|
+
def configure_logging(level: int, formatter: str = 'json', namespaces: list[str] | None = None) -> None:
|
|
85
84
|
"""Configure python logging system using a config dictionary."""
|
|
86
85
|
|
|
87
86
|
formatters = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022-
|
|
1
|
+
# Copyright (C) 2022-2025 Indoc Systems
|
|
2
2
|
#
|
|
3
3
|
# Contact Indoc Systems for any questions regarding the use of this source code.
|
|
4
4
|
|
|
@@ -8,8 +8,6 @@ from datetime import datetime
|
|
|
8
8
|
from datetime import timedelta
|
|
9
9
|
from datetime import timezone
|
|
10
10
|
from typing import Any
|
|
11
|
-
from typing import Optional
|
|
12
|
-
from typing import Union
|
|
13
11
|
|
|
14
12
|
import aioboto3
|
|
15
13
|
import httpx
|
|
@@ -73,7 +71,7 @@ class Boto3Client(BaseClient):
|
|
|
73
71
|
self.session_token = None
|
|
74
72
|
|
|
75
73
|
self._config = Config(signature_version=_SIGNATURE_VERSTION)
|
|
76
|
-
self._session:
|
|
74
|
+
self._session: aioboto3.Session | None = None
|
|
77
75
|
|
|
78
76
|
async def init_connection(self):
|
|
79
77
|
"""
|
|
@@ -305,7 +303,7 @@ class Boto3Client(BaseClient):
|
|
|
305
303
|
return presigned_url
|
|
306
304
|
|
|
307
305
|
async def prepare_multipart_upload(
|
|
308
|
-
self, bucket: str, keys: list[str], expire_time:
|
|
306
|
+
self, bucket: str, keys: list[str], expire_time: datetime | None = None
|
|
309
307
|
) -> list[str]:
|
|
310
308
|
"""
|
|
311
309
|
Summary:
|
{pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/permissions/permissions.py
RENAMED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
# Copyright (C) 2022-
|
|
1
|
+
# Copyright (C) 2022-2025 Indoc Systems
|
|
2
2
|
#
|
|
3
3
|
# Contact Indoc Systems for any questions regarding the use of this source code.
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
6
|
from typing import Any
|
|
7
|
-
from typing import Optional
|
|
8
7
|
|
|
9
8
|
from httpx import AsyncClient
|
|
10
9
|
|
|
@@ -66,7 +65,7 @@ async def has_permission(
|
|
|
66
65
|
raise Exception(f'Error calling authorize API - {error_msg}')
|
|
67
66
|
|
|
68
67
|
|
|
69
|
-
async def get_project_role(project_code: str, current_identity: dict[str, Any]) ->
|
|
68
|
+
async def get_project_role(project_code: str, current_identity: dict[str, Any]) -> str | None:
|
|
70
69
|
role = None
|
|
71
70
|
if current_identity['role'] == 'admin':
|
|
72
71
|
role = 'platform_admin'
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
# Copyright (C) 2023-
|
|
1
|
+
# Copyright (C) 2023-2025 Indoc Systems
|
|
2
2
|
#
|
|
3
3
|
# Contact Indoc Systems for any questions regarding the use of this source code.
|
|
4
4
|
|
|
5
5
|
from typing import Any
|
|
6
|
-
from typing import Optional
|
|
7
|
-
from typing import Union
|
|
8
6
|
|
|
9
7
|
from pydantic import ValidationError
|
|
10
8
|
|
|
@@ -24,7 +22,7 @@ class PermissionsManager:
|
|
|
24
22
|
self.project_code = project_code
|
|
25
23
|
|
|
26
24
|
def _assertion_mapper(
|
|
27
|
-
self, permission_request: PermissionsSchema, assertions: dict[str,
|
|
25
|
+
self, permission_request: PermissionsSchema, assertions: dict[str, bool | list]
|
|
28
26
|
) -> PermissionsMappedAssertionSchema:
|
|
29
27
|
"""Map assertions against single requested permission."""
|
|
30
28
|
|
|
@@ -53,7 +51,7 @@ class PermissionsManager:
|
|
|
53
51
|
logger.exception('Error occurred when building permission request.')
|
|
54
52
|
raise PermissionsException()
|
|
55
53
|
|
|
56
|
-
def retrieve_project_role(self, current_identity: dict[str, Any]) ->
|
|
54
|
+
def retrieve_project_role(self, current_identity: dict[str, Any]) -> str | None:
|
|
57
55
|
"""Retrieve permissible project role based on user realm roles."""
|
|
58
56
|
|
|
59
57
|
try:
|
|
@@ -71,7 +69,7 @@ class PermissionsManager:
|
|
|
71
69
|
raise PermissionsException(f'Failed to retrieve role for project: {self.project_code}')
|
|
72
70
|
|
|
73
71
|
def map_assertions(
|
|
74
|
-
self, permissions_requested: PermissionsRequestSchema, assertions: dict[str,
|
|
72
|
+
self, permissions_requested: PermissionsRequestSchema, assertions: dict[str, bool | list]
|
|
75
73
|
) -> PermissionsMappedAssertionSchema:
|
|
76
74
|
"""Map rbac assertions from auth service against requested permissions."""
|
|
77
75
|
|
{pilot_platform_common-2.7.0 → pilot_platform_common-2.9.0}/common/project/project_client.py
RENAMED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
# Copyright (C) 2022-
|
|
1
|
+
# Copyright (C) 2022-2025 Indoc Systems
|
|
2
2
|
#
|
|
3
3
|
# Contact Indoc Systems for any questions regarding the use of this source code.
|
|
4
4
|
|
|
5
5
|
import asyncio
|
|
6
6
|
import json
|
|
7
|
-
from typing import Union
|
|
8
7
|
|
|
9
8
|
import httpx
|
|
10
9
|
from redis.asyncio.utils import from_url
|
|
@@ -35,6 +34,7 @@ class ProjectObject:
|
|
|
35
34
|
'state',
|
|
36
35
|
'created_by',
|
|
37
36
|
'deleted_at',
|
|
37
|
+
'cpc_enabled',
|
|
38
38
|
]
|
|
39
39
|
|
|
40
40
|
def __init__(self, data, project_client):
|
|
@@ -62,6 +62,8 @@ class ProjectObject:
|
|
|
62
62
|
is_discoverable=None,
|
|
63
63
|
state=None,
|
|
64
64
|
notify_users=None,
|
|
65
|
+
initiator_username=None,
|
|
66
|
+
cpc_enabled=None,
|
|
65
67
|
):
|
|
66
68
|
await self.project_client.connect_redis()
|
|
67
69
|
data = {
|
|
@@ -74,6 +76,8 @@ class ProjectObject:
|
|
|
74
76
|
'is_discoverable': is_discoverable,
|
|
75
77
|
'state': state,
|
|
76
78
|
'notify_users': notify_users,
|
|
79
|
+
'initiator_username': initiator_username,
|
|
80
|
+
'cpc_enabled': cpc_enabled,
|
|
77
81
|
}
|
|
78
82
|
# remove blank items
|
|
79
83
|
data = {k: v for k, v in data.items() if v is not None}
|
|
@@ -134,6 +138,7 @@ class ProjectClient:
|
|
|
134
138
|
superset: bool = False,
|
|
135
139
|
jupyterhub: bool = False,
|
|
136
140
|
state=None,
|
|
141
|
+
cpc_enabled: bool | None = None,
|
|
137
142
|
):
|
|
138
143
|
data = {
|
|
139
144
|
'page': page,
|
|
@@ -153,6 +158,7 @@ class ProjectClient:
|
|
|
153
158
|
'superset': superset,
|
|
154
159
|
'jupyterhub': jupyterhub,
|
|
155
160
|
'state': state,
|
|
161
|
+
'cpc_enabled': cpc_enabled,
|
|
156
162
|
}
|
|
157
163
|
# remove blank items
|
|
158
164
|
data = {k: v for k, v in data.items() if v not in [None, False]}
|
|
@@ -203,9 +209,9 @@ class ProjectClient:
|
|
|
203
209
|
description: str,
|
|
204
210
|
operator: str,
|
|
205
211
|
created_by: str,
|
|
206
|
-
image_url:
|
|
207
|
-
tags:
|
|
208
|
-
system_tags:
|
|
212
|
+
image_url: str | None = None,
|
|
213
|
+
tags: list[str] | None = None,
|
|
214
|
+
system_tags: list[str] | None = None,
|
|
209
215
|
is_discoverable: bool = True,
|
|
210
216
|
version: int = 1,
|
|
211
217
|
) -> ProjectObject:
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
# Copyright (C) 2023-
|
|
1
|
+
# Copyright (C) 2023-2025 Indoc Systems
|
|
2
2
|
#
|
|
3
3
|
# Contact Indoc Systems for any questions regarding the use of this source code.
|
|
4
4
|
|
|
5
|
-
from typing import Union
|
|
6
5
|
|
|
7
6
|
from httpx import AsyncClient
|
|
8
7
|
from httpx import HTTPStatusError
|
|
@@ -20,9 +19,7 @@ class AuthClient:
|
|
|
20
19
|
def __init__(self, auth_service_url: str) -> None:
|
|
21
20
|
self.service_url = auth_service_url
|
|
22
21
|
|
|
23
|
-
async def get_assertions(
|
|
24
|
-
self, project_code: str, permissions: PermissionsRequestSchema
|
|
25
|
-
) -> dict[str, Union[bool, list]]:
|
|
22
|
+
async def get_assertions(self, project_code: str, permissions: PermissionsRequestSchema) -> dict[str, bool | list]:
|
|
26
23
|
"""Retrieve bulk rbac permission assertions."""
|
|
27
24
|
|
|
28
25
|
try:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2022-
|
|
1
|
+
# Copyright (C) 2022-2025 Indoc Systems
|
|
2
2
|
#
|
|
3
3
|
# Contact Indoc Systems for any questions regarding the use of this source code.
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ long_description = (this_directory / 'README.md').read_text()
|
|
|
11
11
|
|
|
12
12
|
setuptools.setup(
|
|
13
13
|
name='pilot-platform-common',
|
|
14
|
-
version='2.
|
|
14
|
+
version='2.9.0',
|
|
15
15
|
author='Indoc Systems',
|
|
16
16
|
author_email='etaylor@indocresearch.org',
|
|
17
17
|
description='Generates entity ID and connects with Vault (secret engine) to retrieve credentials',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|