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.
Files changed (57) hide show
  1. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/PKG-INFO +1 -1
  2. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/permissions.py +6 -2
  3. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/project/project_client.py +7 -1
  4. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/PKG-INFO +1 -1
  5. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pyproject.toml +1 -1
  6. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/setup.py +1 -1
  7. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/test_permissions.py +4 -0
  8. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_project_client.py +19 -0
  9. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/README.md +0 -0
  10. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/__init__.py +0 -0
  11. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/geid/__init__.py +0 -0
  12. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/geid/geid_client.py +0 -0
  13. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/JWTHandler.py +0 -0
  14. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/__init__.py +0 -0
  15. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/jwt_handler_exception.py +0 -0
  16. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/jwt_handler/models.py +0 -0
  17. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/logging/__init__.py +0 -0
  18. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/logging/formatter.py +0 -0
  19. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/logging/logger.py +0 -0
  20. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/logging/logging.py +0 -0
  21. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/models/__init__.py +0 -0
  22. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/models/config_center_policy.py +0 -0
  23. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/models/service_id_generator.py +0 -0
  24. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/__init__.py +0 -0
  25. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/base_client.py +0 -0
  26. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/boto3_admin_client.py +0 -0
  27. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/boto3_client.py +0 -0
  28. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/object_storage_adaptor/minio_policy_client.py +0 -0
  29. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/__init__.py +0 -0
  30. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/exceptions.py +0 -0
  31. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/permissions_manager.py +0 -0
  32. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/permissions/schemas.py +0 -0
  33. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/project/__init__.py +0 -0
  34. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/project/project_exceptions.py +0 -0
  35. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/services/__init__.py +0 -0
  36. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/services/auth_client.py +0 -0
  37. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/vault/__init__.py +0 -0
  38. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/vault/vault_client.py +0 -0
  39. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/common/vault/vault_exception.py +0 -0
  40. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/SOURCES.txt +0 -0
  41. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/dependency_links.txt +0 -0
  42. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/requires.txt +0 -0
  43. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/pilot_platform_common.egg-info/top_level.txt +0 -0
  44. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/setup.cfg +0 -0
  45. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/__init__.py +0 -0
  46. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/conftest.py +0 -0
  47. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/fixtures/__init__.py +0 -0
  48. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/fixtures/fake.py +0 -0
  49. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/fixtures/metadata.py +0 -0
  50. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/__init__.py +0 -0
  51. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/test_auth_client.py +0 -0
  52. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/permissions/test_permissions_manager.py +0 -0
  53. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_formatter.py +0 -0
  54. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_geid_client.py +0 -0
  55. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_jwt_handler.py +0 -0
  56. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_logging.py +0 -0
  57. {pilot-platform-common-0.7.2 → pilot-platform-common-0.7.4}/tests/test_vault_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pilot-platform-common
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: Generates entity ID and connects with Vault (secret engine) to retrieve credentials
5
5
  Author: Indoc Systems
6
6
  Author-email: etaylor@indocresearch.org
@@ -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
- return file_entity.get(path_for_permissions, '').split('/')
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:
@@ -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 is not None}
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pilot-platform-common
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: Generates entity ID and connects with Vault (secret engine) to retrieve credentials
5
5
  Author: Indoc Systems
6
6
  Author-email: etaylor@indocresearch.org
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "common"
3
- version = "0.7.2"
3
+ version = "0.7.4"
4
4
  description = ""
5
5
  authors = ["Indoc Systems"]
6
6
 
@@ -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.2',
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',
@@ -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