trovesuite 1.0.24__py3-none-any.whl → 1.0.26__py3-none-any.whl
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/configs/database.py +6 -10
- trovesuite/configs/settings.py +1 -4
- trovesuite/utils/helper.py +6 -5
- {trovesuite-1.0.24.dist-info → trovesuite-1.0.26.dist-info}/METADATA +1 -1
- {trovesuite-1.0.24.dist-info → trovesuite-1.0.26.dist-info}/RECORD +8 -8
- {trovesuite-1.0.24.dist-info → trovesuite-1.0.26.dist-info}/WHEEL +0 -0
- {trovesuite-1.0.24.dist-info → trovesuite-1.0.26.dist-info}/licenses/LICENSE +0 -0
- {trovesuite-1.0.24.dist-info → trovesuite-1.0.26.dist-info}/top_level.txt +0 -0
trovesuite/configs/database.py
CHANGED
|
@@ -303,13 +303,9 @@ class DatabaseManager:
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
|
|
306
|
-
# Database initialization
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
logger.error("⚠️ Please check your .env file and database configuration")
|
|
313
|
-
logger.error("⚠️ The application will not function properly without a database connection")
|
|
314
|
-
# Don't raise here to allow the app to start even if DB is unavailable
|
|
315
|
-
# But log it clearly so it's obvious what's wrong
|
|
306
|
+
# NOTE: Database initialization is NOT automatic
|
|
307
|
+
# You must call initialize_database() explicitly in your application startup
|
|
308
|
+
# Example in FastAPI:
|
|
309
|
+
# @app.on_event("startup")
|
|
310
|
+
# async def startup_event():
|
|
311
|
+
# initialize_database()
|
trovesuite/configs/settings.py
CHANGED
|
@@ -38,13 +38,11 @@ class Settings:
|
|
|
38
38
|
# SHARED TABLES (core_platform schema)
|
|
39
39
|
# =============================================================================
|
|
40
40
|
CORE_PLATFORM_TENANTS_TABLE = os.getenv("CORE_PLATFORM_TENANTS_TABLE", "core_platform.cp_tenants")
|
|
41
|
-
CORE_PLATFORM_TENANT_RESOURCE_ID_TABLE = os.getenv("CORE_PLATFORM_TENANT_RESOURCE_ID_TABLE", "core_platform.cp_resource_ids")
|
|
42
41
|
CORE_PLATFORM_SUBSCRIPTIONS_TABLE = os.getenv("CORE_PLATFORM_SUBSCRIPTIONS_TABLE", "core_platform.cp_subscriptions")
|
|
43
42
|
CORE_PLATFORM_APPS_TABLE = os.getenv("CORE_PLATFORM_APPS_TABLE", "core_platform.cp_apps")
|
|
44
43
|
CORE_PLATFORM_USERS_TABLE = os.getenv("CORE_PLATFORM_USERS_TABLE", "core_platform.cp_users")
|
|
45
44
|
CORE_PLATFORM_RESOURCE_TYPES_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_TYPES_TABLE", "core_platform.cp_resource_types")
|
|
46
|
-
CORE_PLATFORM_RESOURCE_ID_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_ID_TABLE", "core_platform.
|
|
47
|
-
CORE_PLATFORM_RESOURCES_TABLE = os.getenv("CORE_PLATFORM_RESOURCES_TABLE", "core_platform.resources")
|
|
45
|
+
CORE_PLATFORM_RESOURCE_ID_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_ID_TABLE", "core_platform.cp_resource_ids")
|
|
48
46
|
CORE_PLATFORM_PERMISSIONS_TABLE = os.getenv("CORE_PLATFORM_PERMISSIONS_TABLE", "core_platform.cp_permissions")
|
|
49
47
|
CORE_PLATFORM_ROLES_TABLE = os.getenv("CORE_PLATFORM_ROLES_TABLE", "core_platform.cp_roles")
|
|
50
48
|
CORE_PLATFORM_ROLE_PERMISSIONS_TABLE = os.getenv("CORE_PLATFORM_ROLE_PERMISSIONS_TABLE", "core_platform.cp_role_permissions")
|
|
@@ -69,7 +67,6 @@ class Settings:
|
|
|
69
67
|
CORE_PLATFORM_LOGIN_SETTINGS_TABLE = os.getenv("CORE_PLATFORM_LOGIN_SETTINGS_TABLE", "core_platform.cp_login_settings")
|
|
70
68
|
CORE_PLATFORM_RESOURCES_TABLE = os.getenv("CORE_PLATFORM_RESOURCES_TABLE", "core_platform.cp_resources")
|
|
71
69
|
CORE_PLATFORM_ASSIGN_ROLES_TABLE = os.getenv("CORE_PLATFORM_ASSIGN_ROLES_TABLE", "core_platform.cp_assign_roles")
|
|
72
|
-
CORE_PLATFORM_RESOURCE_ID_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_ID_TABLE", "core_platform.cp_resource_ids")
|
|
73
70
|
CORE_PLATFORM_SUBSCRIPTION_HISTORY_TABLE = os.getenv("CORE_PLATFORM_SUBSCRIPTION_HISTORY_TABLE", "core_platform.cp_user_subscription_histories")
|
|
74
71
|
CORE_PLATFORM_RESOURCE_DELETION_CHAT_HISTORY_TABLE = os.getenv("CORE_PLATFORM_RESOURCE_DELETION_CHAT_HISTORY_TABLE", "core_platform.cp_resource_deletion_chat_histories")
|
|
75
72
|
CORE_PLATFORM_USER_GROUPS_TABLE = os.getenv("CORE_PLATFORM_USER_GROUPS_TABLE", "core_platform.cp_user_groups")
|
trovesuite/utils/helper.py
CHANGED
|
@@ -96,11 +96,12 @@ class Helper:
|
|
|
96
96
|
|
|
97
97
|
try:
|
|
98
98
|
if tenant_id:
|
|
99
|
-
# For tenant-specific resource IDs,
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
# For tenant-specific resource IDs, use CORE_PLATFORM_RESOURCE_ID_TABLE
|
|
100
|
+
# This table has tenant_id column for filtering
|
|
101
|
+
resource_table = getattr(db_settings, 'CORE_PLATFORM_RESOURCE_ID_TABLE', None)
|
|
102
|
+
if resource_table:
|
|
102
103
|
resource_exists = DatabaseManager.execute_scalar(
|
|
103
|
-
f"""SELECT COUNT(1) FROM {
|
|
104
|
+
f"""SELECT COUNT(1) FROM {resource_table}
|
|
104
105
|
WHERE tenant_id = %s AND id = %s""",
|
|
105
106
|
(tenant_id, candidate,),
|
|
106
107
|
)
|
|
@@ -108,7 +109,7 @@ class Helper:
|
|
|
108
109
|
# Fallback: assume no conflict if table not configured
|
|
109
110
|
resource_exists = 0
|
|
110
111
|
else:
|
|
111
|
-
# For main schema resource IDs
|
|
112
|
+
# For main/shared schema resource IDs (no tenant_id)
|
|
112
113
|
main_resource_table = getattr(db_settings, 'CORE_PLATFORM_RESOURCE_ID_TABLE', None)
|
|
113
114
|
if main_resource_table:
|
|
114
115
|
resource_exists = DatabaseManager.execute_scalar(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trovesuite
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.26
|
|
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
|
|
@@ -6,9 +6,9 @@ trovesuite/auth/auth_read_dto.py,sha256=e27JqKVPVUM83A_mYF452QCflsvGNo7aKje7q_ur
|
|
|
6
6
|
trovesuite/auth/auth_service.py,sha256=TQOJFG0AzhPGwZBAXVxMkHxyG2wyct4Zcoq4z0cVBO4,22201
|
|
7
7
|
trovesuite/auth/auth_write_dto.py,sha256=rdwI7w6-9QZGv1H0PAGrjkLBCzaMHjgPIXeLb9RmNec,234
|
|
8
8
|
trovesuite/configs/__init__.py,sha256=h1mSZOaZ3kUy1ZMO_m9O9KklsxywM0RfMVZLh9h9WvQ,328
|
|
9
|
-
trovesuite/configs/database.py,sha256=
|
|
9
|
+
trovesuite/configs/database.py,sha256=CdPurBNe2_Ymmn0fEkYHFPVaeCunGS1k0x1f3SfNlr4,11400
|
|
10
10
|
trovesuite/configs/logging.py,sha256=mGjR2d4urVNry9l5_aXycMMtcY2RAFIpEL35hw33KZg,9308
|
|
11
|
-
trovesuite/configs/settings.py,sha256=
|
|
11
|
+
trovesuite/configs/settings.py,sha256=r3wyLdlLtnPzrTPV5Z4BytItLtfvQoP860waAfdecLA,6941
|
|
12
12
|
trovesuite/entities/__init__.py,sha256=Dbl_03Bueyh2vOP2hykd40MmNMrl5nNHSRGP-kqwwNo,160
|
|
13
13
|
trovesuite/entities/health.py,sha256=KaW7yxTQdymIPlnkJJkDqEebBXkD0a7A66i5GgNZLoE,2700
|
|
14
14
|
trovesuite/entities/sh_response.py,sha256=1_sw3PpVaDxWsNiBU0W9YLHZgTFxEj4JJBLBfSY63Ho,1579
|
|
@@ -25,10 +25,10 @@ trovesuite/storage/storage_read_dto.py,sha256=o7EVJdwrwVZAaeyGU9O01WMECGVaytkvLR
|
|
|
25
25
|
trovesuite/storage/storage_service.py,sha256=V7LIePIV6b_iuhm-9x8r4zwpZHgeRPL1YIe5IBnxhco,19768
|
|
26
26
|
trovesuite/storage/storage_write_dto.py,sha256=vl1iCZ93bpFmpvkCrn587QtMtOA_TPDseXSoTuj9RTQ,1355
|
|
27
27
|
trovesuite/utils/__init__.py,sha256=mDZuY77BphvQFYLmcWxjP5Tcq9ZZ3WXJWBKB1v6wzHU,185
|
|
28
|
-
trovesuite/utils/helper.py,sha256=
|
|
28
|
+
trovesuite/utils/helper.py,sha256=28KjFtiDS4IxuO13QBQUmU4dq9xUJDll9ewWetCrOcc,27061
|
|
29
29
|
trovesuite/utils/templates.py,sha256=_92k4-EkqWs-h0LNJxPgorbspmp24kDngS7O3qWIFyQ,20388
|
|
30
|
-
trovesuite-1.0.
|
|
31
|
-
trovesuite-1.0.
|
|
32
|
-
trovesuite-1.0.
|
|
33
|
-
trovesuite-1.0.
|
|
34
|
-
trovesuite-1.0.
|
|
30
|
+
trovesuite-1.0.26.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
|
|
31
|
+
trovesuite-1.0.26.dist-info/METADATA,sha256=NaoWkeiWQCnQ7lxDz_2fbaTalS46OvTlxryyQljljYs,21737
|
|
32
|
+
trovesuite-1.0.26.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
33
|
+
trovesuite-1.0.26.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
|
|
34
|
+
trovesuite-1.0.26.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|