trovesuite 1.0.12__tar.gz → 1.0.13__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.
- {trovesuite-1.0.12/src/trovesuite.egg-info → trovesuite-1.0.13}/PKG-INFO +1 -1
- {trovesuite-1.0.12 → trovesuite-1.0.13}/pyproject.toml +2 -2
- {trovesuite-1.0.12 → trovesuite-1.0.13}/setup.py +1 -1
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/auth/auth_service.py +48 -3
- {trovesuite-1.0.12 → trovesuite-1.0.13/src/trovesuite.egg-info}/PKG-INFO +1 -1
- {trovesuite-1.0.12 → trovesuite-1.0.13}/LICENSE +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/MANIFEST.in +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/README.md +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/requirements.txt +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/setup.cfg +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/__init__.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/auth/__init__.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/auth/auth_base.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/auth/auth_controller.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/auth/auth_read_dto.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/auth/auth_write_dto.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/configs/__init__.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/configs/database.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/configs/logging.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/configs/settings.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/entities/__init__.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/entities/health.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/entities/sh_response.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/__init__.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/notification_base.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/notification_controller.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/notification_read_dto.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/notification_service.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/notification_write_dto.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/storage/__init__.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/storage/storage_base.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/storage/storage_controller.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/storage/storage_read_dto.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/storage/storage_service.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/storage/storage_write_dto.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/utils/__init__.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/utils/helper.py +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite.egg-info/SOURCES.txt +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite.egg-info/dependency_links.txt +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite.egg-info/not-zip-safe +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite.egg-info/requires.txt +0 -0
- {trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trovesuite
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.13
|
|
4
4
|
Summary: TroveSuite services package providing authentication, authorization, notifications, Azure Storage, and other enterprise services for TroveSuite applications
|
|
5
5
|
Home-page: https://dev.azure.com/brightgclt/trovesuite/_git/packages
|
|
6
6
|
Author: Bright Debrah Owusu
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "trovesuite"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.13"
|
|
8
8
|
description = "TroveSuite services package providing authentication, authorization, notifications, Azure Storage, and other enterprise services for TroveSuite applications"
|
|
9
9
|
authors = ["brightgclt <brightgclt@gmail.com>"]
|
|
10
10
|
license = "MIT"
|
|
@@ -58,7 +58,7 @@ Documentation = "https://dev.azure.com/brightgclt/trovesuite/_git/packages"
|
|
|
58
58
|
|
|
59
59
|
[project]
|
|
60
60
|
name = "trovesuite"
|
|
61
|
-
version = "1.0.
|
|
61
|
+
version = "1.0.13"
|
|
62
62
|
description = "TroveSuite services package providing authentication, authorization, notifications, Azure Storage, and other enterprise services for TroveSuite applications"
|
|
63
63
|
readme = "README.md"
|
|
64
64
|
license = {text = "MIT"}
|
|
@@ -15,7 +15,7 @@ with open("pyproject.toml", "r", encoding="utf-8") as fh:
|
|
|
15
15
|
|
|
16
16
|
setup(
|
|
17
17
|
name="trovesuite",
|
|
18
|
-
version="1.0.
|
|
18
|
+
version="1.0.13",
|
|
19
19
|
author="Bright Debrah Owusu",
|
|
20
20
|
author_email="owusu.debrah@deladetech.com",
|
|
21
21
|
description="TroveSuite services package providing authentication, authorization, notifications, and other enterprise services for TroveSuite applications",
|
|
@@ -225,18 +225,62 @@ class AuthService:
|
|
|
225
225
|
(user_id,),
|
|
226
226
|
)
|
|
227
227
|
|
|
228
|
+
# ✅ NEW: Get system-level roles from main.system_user_groups and main.system_assign_roles
|
|
229
|
+
logger.info(f"Fetching system-level roles for user: {user_id}")
|
|
230
|
+
|
|
231
|
+
system_roles = DatabaseManager.execute_query(
|
|
232
|
+
"""
|
|
233
|
+
SELECT DISTINCT sug.group_id, sug.user_id, sar.role_id, sar.resource_type
|
|
234
|
+
FROM main.system_user_groups sug
|
|
235
|
+
INNER JOIN main.system_assign_roles sar ON sug.group_id = sar.group_id
|
|
236
|
+
WHERE sug.user_id = %s
|
|
237
|
+
AND sug.delete_status = 'NOT_DELETED'
|
|
238
|
+
AND sar.is_active = true
|
|
239
|
+
AND sar.delete_status = 'NOT_DELETED'
|
|
240
|
+
""",
|
|
241
|
+
(user_id,)
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
if system_roles:
|
|
245
|
+
logger.info(f"Found {len(system_roles)} system-level role(s) for user: {user_id}")
|
|
246
|
+
else:
|
|
247
|
+
logger.info(f"No system-level roles found for user: {user_id}")
|
|
248
|
+
|
|
249
|
+
# ✅ NEW: Also check for direct system role assignments (user_id in system_assign_roles)
|
|
250
|
+
direct_system_roles = DatabaseManager.execute_query(
|
|
251
|
+
"""
|
|
252
|
+
SELECT DISTINCT NULL as group_id, sar.user_id, sar.role_id, sar.resource_type
|
|
253
|
+
FROM main.system_assign_roles sar
|
|
254
|
+
WHERE sar.user_id = %s
|
|
255
|
+
AND sar.is_active = true
|
|
256
|
+
AND sar.delete_status = 'NOT_DELETED'
|
|
257
|
+
""",
|
|
258
|
+
(user_id,)
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
if direct_system_roles:
|
|
262
|
+
logger.info(f"Found {len(direct_system_roles)} direct system-level role assignment(s) for user: {user_id}")
|
|
263
|
+
system_roles.extend(direct_system_roles)
|
|
264
|
+
|
|
265
|
+
# ✅ NEW: Merge tenant-level and system-level roles
|
|
266
|
+
all_roles = get_user_roles + system_roles
|
|
267
|
+
logger.info(f"Total roles (tenant + system) for user {user_id}: {len(all_roles)}")
|
|
268
|
+
|
|
228
269
|
# GET permissions and Append to Role
|
|
229
270
|
get_user_roles_with_tenant_and_permissions = []
|
|
230
|
-
for role in
|
|
271
|
+
for role in all_roles:
|
|
231
272
|
permissions = DatabaseManager.execute_query(
|
|
232
273
|
f"""SELECT permission_id FROM {db_settings.MAIN_ROLE_PERMISSIONS_TABLE} WHERE role_id = %s""",
|
|
233
|
-
params=(role["role_id"],),
|
|
274
|
+
params=(role["role_id"],),
|
|
275
|
+
)
|
|
234
276
|
|
|
235
277
|
role_dict = {**role, "tenant_id": tenant_id, "permissions": [p['permission_id'] for p in permissions]}
|
|
236
278
|
get_user_roles_with_tenant_and_permissions.append(role_dict)
|
|
237
279
|
|
|
238
280
|
roles_dto = Helper.map_to_dto(get_user_roles_with_tenant_and_permissions, AuthServiceReadDto)
|
|
239
281
|
|
|
282
|
+
logger.info(f"Authorization successful for user: {user_id} with {len(roles_dto)} total role entries")
|
|
283
|
+
|
|
240
284
|
return Respons[AuthServiceReadDto](
|
|
241
285
|
detail="Authorized",
|
|
242
286
|
data=roles_dto,
|
|
@@ -249,7 +293,7 @@ class AuthService:
|
|
|
249
293
|
raise http_ex
|
|
250
294
|
|
|
251
295
|
except Exception as e:
|
|
252
|
-
logger.error("Authorization check failed for user: %s", str(e))
|
|
296
|
+
logger.error("Authorization check failed for user: %s - Error: %s", user_id, str(e), exc_info=True)
|
|
253
297
|
return Respons[AuthServiceReadDto](
|
|
254
298
|
detail=None,
|
|
255
299
|
data=[],
|
|
@@ -258,6 +302,7 @@ class AuthService:
|
|
|
258
302
|
error="Authorization check failed due to an internal error"
|
|
259
303
|
)
|
|
260
304
|
|
|
305
|
+
|
|
261
306
|
@staticmethod
|
|
262
307
|
def check_permission(users_data: list, action=None, resource_type=None) -> bool:
|
|
263
308
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trovesuite
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.13
|
|
4
4
|
Summary: TroveSuite services package providing authentication, authorization, notifications, Azure Storage, and other enterprise services for TroveSuite applications
|
|
5
5
|
Home-page: https://dev.azure.com/brightgclt/trovesuite/_git/packages
|
|
6
6
|
Author: Bright Debrah Owusu
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/notification_controller.py
RENAMED
|
File without changes
|
{trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/notification_read_dto.py
RENAMED
|
File without changes
|
|
File without changes
|
{trovesuite-1.0.12 → trovesuite-1.0.13}/src/trovesuite/notification/notification_write_dto.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
|