trovesuite 1.0.32__py3-none-any.whl → 1.0.34__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/__init__.py CHANGED
@@ -11,7 +11,7 @@ from .notification import NotificationService
11
11
  from .storage import StorageService
12
12
  from .utils import Helper
13
13
 
14
- __version__ = "1.0.29"
14
+ __version__ = "1.0.33"
15
15
  __author__ = "Bright Debrah Owusu"
16
16
  __email__ = "owusu.debrah@deladetech.com"
17
17
 
@@ -235,17 +235,18 @@ class AuthService:
235
235
  # Use LEFT JOIN starting from cp_assign_roles to find BOTH direct user assignments AND group-based assignments
236
236
  logger.info(f"Fetching system-level roles for user: {user_id}")
237
237
 
238
+ # System group membership may be stored with user's tenant_id (not system-tenant-id); join on user_id and is_system
238
239
  system_roles = DatabaseManager.execute_query(
239
240
  f"""
240
241
  SELECT DISTINCT COALESCE(sar.group_id::TEXT, NULL) as group_id, sar.user_id, sar.role_id, sar.resource_type
241
242
  FROM {db_settings.CORE_PLATFORM_ASSIGN_ROLES_TABLE} sar
242
243
  LEFT JOIN {db_settings.CORE_PLATFORM_USER_GROUPS_TABLE} sug
243
- ON sar.group_id = sug.group_id AND sar.tenant_id = sug.tenant_id
244
+ ON sar.group_id = sug.group_id AND sug.user_id = %s AND sug.is_system = true AND sug.is_active = true AND sug.delete_status = 'NOT_DELETED'
244
245
  WHERE sar.tenant_id = 'system-tenant-id'
245
246
  AND sar.is_system = true
246
247
  AND sar.delete_status = 'NOT_DELETED'
247
248
  AND sar.is_active = true
248
- AND (sar.user_id = %s OR (sug.user_id = %s AND sug.tenant_id = 'system-tenant-id' AND sug.is_system = true AND sug.is_active = true AND sug.delete_status = 'NOT_DELETED'))
249
+ AND (sar.user_id = %s OR sug.user_id IS NOT NULL)
249
250
  """,
250
251
  (user_id, user_id)
251
252
  )
@@ -40,10 +40,10 @@ class DatabaseConfig:
40
40
  self.settings = db_settings
41
41
  self.database_url = self.settings.database_url
42
42
  # Safe pool size for Azure Basic tier (B_Standard_B1ms)
43
- # With 2 workers and pool_size=2: 2 × 2 = 4 connections (very safe)
44
- # With 4 workers and pool_size=2: 4 × 2 = 8 connections (still safe, well under 50 limit)
43
+ # With 2 workers and pool_size=5: 2 × 5 = 10 connections (safe, well under 50 limit)
44
+ # Increased from 2 to 5 to handle concurrent auth + business logic better
45
45
  # Can be overridden with DB_POOL_SIZE environment variable
46
- self.pool_size = int(os.getenv("DB_POOL_SIZE", "2"))
46
+ self.pool_size = int(os.getenv("DB_POOL_SIZE", "5"))
47
47
 
48
48
  def get_connection_params(self) -> dict:
49
49
  """Get database connection parameters"""
@@ -485,3 +485,87 @@ RESOURCE_STATUS_CHANGE_TEXT_TEMPLATE = (
485
485
  "— The Trovesuite Team\n"
486
486
  "Sent on: {cdate} at {ctime}"
487
487
  )
488
+
489
+ ADMIN_SIGNUP_NOTIFICATION_TEXT_TEMPLATE = (
490
+ "Hi,\n\n"
491
+ "User {fullname} with Email: {email} and contact {contact} have signup for subscription {subscription_name} with Generated OTP: {otp_code} has sign up Successfully. Thank you.\n\n"
492
+ "Sent at: {cdate}, {ctime}"
493
+ )
494
+
495
+ ADMIN_SIGNUP_NOTIFICATION_HTML_TEMPLATE = """
496
+ <html>
497
+ <body style="font-family: Arial, sans-serif; background-color: #f8f9fa; padding: 20px;">
498
+ <div style="max-width: 600px; margin: auto; background: white; border-radius: 12px; padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
499
+ <!-- Header -->
500
+ <div style="text-align: center; padding-bottom: 25px; border-bottom: 2px solid #2e86de;">
501
+ <h1 style="color: #2e86de; margin: 0; font-size: 26px;">👤 New User Signup Notification</h1>
502
+ </div>
503
+
504
+ <!-- Greeting -->
505
+ <div style="padding: 25px 0;">
506
+ <p style="font-size: 16px; color: #333; margin-bottom: 15px;">Hi,</p>
507
+ <p style="font-size: 15px; color: #333; line-height: 1.6;">
508
+ User <strong>{fullname}</strong> with Email: <strong>{email}</strong> and contact <strong>{contact}</strong> have signup for subscription <strong>{subscription_name}</strong> with Generated OTP: <strong>{otp_code}</strong> has sign up Successfully. Thank you.
509
+ </p>
510
+ </div>
511
+
512
+ <!-- User Details -->
513
+ <div style="background-color: #f8f9fa; border-radius: 8px; padding: 20px; margin: 20px 0;">
514
+ <h3 style="color: #2e86de; margin-top: 0; font-size: 18px; margin-bottom: 15px;">📋 Signup Details</h3>
515
+
516
+ <table style="width: 100%; border-collapse: collapse;">
517
+ <tr>
518
+ <td style="padding: 8px 0; color: #666; font-size: 14px; width: 35%;">
519
+ <strong>Full Name:</strong>
520
+ </td>
521
+ <td style="padding: 8px 0; color: #333; font-size: 14px;">
522
+ {fullname}
523
+ </td>
524
+ </tr>
525
+ <tr>
526
+ <td style="padding: 8px 0; color: #666; font-size: 14px;">
527
+ <strong>Email:</strong>
528
+ </td>
529
+ <td style="padding: 8px 0; color: #333; font-size: 14px;">
530
+ {email}
531
+ </td>
532
+ </tr>
533
+ <tr>
534
+ <td style="padding: 8px 0; color: #666; font-size: 14px;">
535
+ <strong>Contact:</strong>
536
+ </td>
537
+ <td style="padding: 8px 0; color: #333; font-size: 14px;">
538
+ {contact}
539
+ </td>
540
+ </tr>
541
+ <tr>
542
+ <td style="padding: 8px 0; color: #666; font-size: 14px;">
543
+ <strong>Subscription:</strong>
544
+ </td>
545
+ <td style="padding: 8px 0; color: #333; font-size: 14px;">
546
+ {subscription_name}
547
+ </td>
548
+ </tr>
549
+ <tr>
550
+ <td style="padding: 8px 0; color: #666; font-size: 14px;">
551
+ <strong>Generated OTP:</strong>
552
+ </td>
553
+ <td style="padding: 8px 0; color: #333; font-size: 14px; font-family: 'Courier New', monospace; background-color: #fff; padding: 5px 10px; border-radius: 4px; display: inline-block;">
554
+ {otp_code}
555
+ </td>
556
+ </tr>
557
+ </table>
558
+ </div>
559
+
560
+ <!-- Footer -->
561
+ <hr style="border: none; border-top: 1px solid #eee; margin: 25px 0;">
562
+ <div style="text-align: center;">
563
+ <p style="font-size: 12px; color: #888; margin: 5px 0;">
564
+ Trovesuite - Empowering Your Business<br>
565
+ Sent on: {cdate} at {ctime}
566
+ </p>
567
+ </div>
568
+ </div>
569
+ </body>
570
+ </html>
571
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trovesuite
3
- Version: 1.0.32
3
+ Version: 1.0.34
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
@@ -1,12 +1,12 @@
1
- trovesuite/__init__.py,sha256=tcNxxwRpfYZ23yCEn4b5EHqGL5zRe_BqQHLcNAP23PQ,646
1
+ trovesuite/__init__.py,sha256=gelcrNTcYootgFAtLe9QZlingTPaWAlscHFMpDfsb5w,646
2
2
  trovesuite/auth/__init__.py,sha256=OjZllVvjul1glDazJ-d5TrNjgHFigFlQQi1G99DYshk,239
3
3
  trovesuite/auth/auth_base.py,sha256=rZHQVLeJRBQ8GClgF5UwG-er4_HXVX5-nt8o6_Z29uY,75
4
4
  trovesuite/auth/auth_controller.py,sha256=PAgaVlf5TYEfkSfK4vGGsvO84i8zEmeVVXyUF2YBppI,420
5
5
  trovesuite/auth/auth_read_dto.py,sha256=e27JqKVPVUM83A_mYF452QCflsvGNo7aKje7q_urwFc,571
6
- trovesuite/auth/auth_service.py,sha256=TQOJFG0AzhPGwZBAXVxMkHxyG2wyct4Zcoq4z0cVBO4,22201
6
+ trovesuite/auth/auth_service.py,sha256=h98y4_ELas52tdTPkr1kcGv_JrL95HUFKAWWljoCCac,22282
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=u4aTAZD4vyByzwPkmH47rAZ8iA4nsYyMiaL634uUcAM,15008
9
+ trovesuite/configs/database.py,sha256=kUJWTh51C-CfUDq0HojA4QnQdnq5W8fHv-IJCHFXcW8,15008
10
10
  trovesuite/configs/logging.py,sha256=mGjR2d4urVNry9l5_aXycMMtcY2RAFIpEL35hw33KZg,9308
11
11
  trovesuite/configs/settings.py,sha256=s-RvzFI7IR8-Q_A0ZRxlTr-iDoY6MvbxM0RkbhmJOL4,6915
12
12
  trovesuite/entities/__init__.py,sha256=Dbl_03Bueyh2vOP2hykd40MmNMrl5nNHSRGP-kqwwNo,160
@@ -26,9 +26,9 @@ trovesuite/storage/storage_service.py,sha256=V7LIePIV6b_iuhm-9x8r4zwpZHgeRPL1YIe
26
26
  trovesuite/storage/storage_write_dto.py,sha256=vl1iCZ93bpFmpvkCrn587QtMtOA_TPDseXSoTuj9RTQ,1355
27
27
  trovesuite/utils/__init__.py,sha256=mDZuY77BphvQFYLmcWxjP5Tcq9ZZ3WXJWBKB1v6wzHU,185
28
28
  trovesuite/utils/helper.py,sha256=qpd-EWPaX3-QJA5xvxb4s9rEb9W2RKPCDXcdAKSUwSM,30858
29
- trovesuite/utils/templates.py,sha256=_92k4-EkqWs-h0LNJxPgorbspmp24kDngS7O3qWIFyQ,20388
30
- trovesuite-1.0.32.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
31
- trovesuite-1.0.32.dist-info/METADATA,sha256=HoifrGTHx071bljGeM7PCOeg4taR1Anie_s5SDwaOCs,21737
32
- trovesuite-1.0.32.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
- trovesuite-1.0.32.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
34
- trovesuite-1.0.32.dist-info/RECORD,,
29
+ trovesuite/utils/templates.py,sha256=OCGVP-KKX2zQopDMilHYkjjhHYpHxwqhbkFkzus0CQA,23906
30
+ trovesuite-1.0.34.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
31
+ trovesuite-1.0.34.dist-info/METADATA,sha256=G72viTpBpUIrbwgB09VKA-T7CNGSmtKxuxFZQ29ofVs,21737
32
+ trovesuite-1.0.34.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
33
+ trovesuite-1.0.34.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
34
+ trovesuite-1.0.34.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5