pilot-platform-common 0.7.2__tar.gz → 0.7.4__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-0.7.2 → pilot-platform-common-0.7.4}/PKG-INFO +1 -1
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/permissions.py +6 -2
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/project/project_client.py +7 -1
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/PKG-INFO +1 -1
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pyproject.toml +1 -1
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/setup.py +1 -1
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/test_permissions.py +4 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_project_client.py +19 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/README.md +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/geid/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/geid/geid_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/JWTHandler.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/jwt_handler_exception.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/models.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/logging/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/logging/formatter.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/logging/logger.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/logging/logging.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/models/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/models/config_center_policy.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/models/service_id_generator.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/base_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/boto3_admin_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/boto3_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/minio_policy_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/exceptions.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/permissions_manager.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/schemas.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/project/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/project/project_exceptions.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/services/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/services/auth_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/vault/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/vault/vault_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/vault/vault_exception.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/SOURCES.txt +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/dependency_links.txt +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/requires.txt +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/top_level.txt +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/setup.cfg +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/conftest.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/fixtures/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/fixtures/fake.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/fixtures/metadata.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/__init__.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/test_auth_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/test_permissions_manager.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_formatter.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_geid_client.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_jwt_handler.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_logging.py +0 -0
- {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_vault_client.py +0 -0
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/permissions.py
RENAMED
|
@@ -92,7 +92,7 @@ async def has_file_permission(
|
|
|
92
92
|
zone = 'greenroom' if file_entity['zone'] == 0 else 'core'
|
|
93
93
|
|
|
94
94
|
folder_path_split = get_folder_path(file_entity)
|
|
95
|
-
root_folder = folder_path_split[0]
|
|
95
|
+
root_folder = folder_path_split[0] if folder_path_split else None
|
|
96
96
|
|
|
97
97
|
if root_folder == 'shared':
|
|
98
98
|
if len(folder_path_split) == 1:
|
|
@@ -137,7 +137,11 @@ def get_folder_path(file_entity: dict[str, str]) -> list[str]:
|
|
|
137
137
|
path_for_permissions = 'restore_path'
|
|
138
138
|
else:
|
|
139
139
|
path_for_permissions = 'parent_path'
|
|
140
|
-
|
|
140
|
+
path = file_entity.get(path_for_permissions, '')
|
|
141
|
+
if path:
|
|
142
|
+
return path.split('/')
|
|
143
|
+
else:
|
|
144
|
+
return []
|
|
141
145
|
|
|
142
146
|
|
|
143
147
|
def get_name_or_path(file_entity: dict[str, str], folder_path_split: list[str]) -> str:
|
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/project/project_client.py
RENAMED
|
@@ -116,6 +116,9 @@ class ProjectClient:
|
|
|
116
116
|
created_at_start=None,
|
|
117
117
|
created_at_end=None,
|
|
118
118
|
favourite_by=None,
|
|
119
|
+
guacamole: bool = False,
|
|
120
|
+
superset: bool = False,
|
|
121
|
+
jupyterhub: bool = False,
|
|
119
122
|
):
|
|
120
123
|
data = {
|
|
121
124
|
'page': page,
|
|
@@ -131,9 +134,12 @@ class ProjectClient:
|
|
|
131
134
|
'created_at_start': created_at_start,
|
|
132
135
|
'created_at_end': created_at_end,
|
|
133
136
|
'favourite_by': favourite_by,
|
|
137
|
+
'guacamole': guacamole,
|
|
138
|
+
'superset': superset,
|
|
139
|
+
'jupyterhub': jupyterhub,
|
|
134
140
|
}
|
|
135
141
|
# remove blank items
|
|
136
|
-
data = {k: v for k, v in data.items() if v
|
|
142
|
+
data = {k: v for k, v in data.items() if v not in [None, False]}
|
|
137
143
|
|
|
138
144
|
async with httpx.AsyncClient() as client:
|
|
139
145
|
response = await client.get(self.base_url + '/v1/projects/', params=data)
|
|
@@ -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='0.7.
|
|
14
|
+
version='0.7.4',
|
|
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',
|
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/test_permissions.py
RENAMED
|
@@ -379,6 +379,8 @@ class TestFilePermissions:
|
|
|
379
379
|
'zone': 'core',
|
|
380
380
|
'container_code': 'test_project',
|
|
381
381
|
'container_type': 'project',
|
|
382
|
+
'parent_path': None,
|
|
383
|
+
'parent': None,
|
|
382
384
|
}
|
|
383
385
|
current_identity = {
|
|
384
386
|
'username': 'test',
|
|
@@ -396,6 +398,8 @@ class TestFilePermissions:
|
|
|
396
398
|
'zone': 'core',
|
|
397
399
|
'container_code': 'test_project',
|
|
398
400
|
'container_type': 'project',
|
|
401
|
+
'parent_path': None,
|
|
402
|
+
'parent': None,
|
|
399
403
|
}
|
|
400
404
|
current_identity = {
|
|
401
405
|
'username': 'test',
|
|
@@ -157,3 +157,22 @@ def test_project_search_200(redis, httpx_mock):
|
|
|
157
157
|
)
|
|
158
158
|
assert result['result'][0].name == PROJECT_DATA['name']
|
|
159
159
|
assert result['total'] == 1
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def test_project_search_200_with_workbench_filters(redis, httpx_mock):
|
|
163
|
+
result = {
|
|
164
|
+
'result': [PROJECT_DATA],
|
|
165
|
+
'total': 1,
|
|
166
|
+
}
|
|
167
|
+
url = PROJECT_URL + ('/v1/projects/?guacamole=true&superset=true&jupyterhub=true')
|
|
168
|
+
httpx_mock.add_response(
|
|
169
|
+
method='GET',
|
|
170
|
+
url=url,
|
|
171
|
+
json=result,
|
|
172
|
+
status_code=200,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
project_client = ProjectClient(PROJECT_URL, redis.url, enable_cache=False)
|
|
176
|
+
result = project_client.search(guacamole=True, superset=True, jupyterhub=True)
|
|
177
|
+
assert result['result'][0].name == PROJECT_DATA['name']
|
|
178
|
+
assert result['total'] == 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/JWTHandler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/models/config_center_policy.py
RENAMED
|
File without changes
|
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/models/service_id_generator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/project/project_exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/test_auth_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|