trovesuite 1.0.33__tar.gz → 1.0.35__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 (43) hide show
  1. {trovesuite-1.0.33/src/trovesuite.egg-info → trovesuite-1.0.35}/PKG-INFO +1 -1
  2. {trovesuite-1.0.33 → trovesuite-1.0.35}/pyproject.toml +2 -2
  3. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/auth/auth_service.py +11 -3
  4. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/utils/templates.py +84 -0
  5. {trovesuite-1.0.33 → trovesuite-1.0.35/src/trovesuite.egg-info}/PKG-INFO +1 -1
  6. {trovesuite-1.0.33 → trovesuite-1.0.35}/LICENSE +0 -0
  7. {trovesuite-1.0.33 → trovesuite-1.0.35}/MANIFEST.in +0 -0
  8. {trovesuite-1.0.33 → trovesuite-1.0.35}/README.md +0 -0
  9. {trovesuite-1.0.33 → trovesuite-1.0.35}/requirements.txt +0 -0
  10. {trovesuite-1.0.33 → trovesuite-1.0.35}/setup.cfg +0 -0
  11. {trovesuite-1.0.33 → trovesuite-1.0.35}/setup.py +0 -0
  12. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/__init__.py +0 -0
  13. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/auth/__init__.py +0 -0
  14. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/auth/auth_base.py +0 -0
  15. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/auth/auth_controller.py +0 -0
  16. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/auth/auth_read_dto.py +0 -0
  17. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/auth/auth_write_dto.py +0 -0
  18. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/configs/__init__.py +0 -0
  19. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/configs/database.py +0 -0
  20. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/configs/logging.py +0 -0
  21. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/configs/settings.py +0 -0
  22. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/entities/__init__.py +0 -0
  23. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/entities/health.py +0 -0
  24. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/entities/sh_response.py +0 -0
  25. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/notification/__init__.py +0 -0
  26. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/notification/notification_base.py +0 -0
  27. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/notification/notification_controller.py +0 -0
  28. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/notification/notification_read_dto.py +0 -0
  29. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/notification/notification_service.py +0 -0
  30. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/notification/notification_write_dto.py +0 -0
  31. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/storage/__init__.py +0 -0
  32. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/storage/storage_base.py +0 -0
  33. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/storage/storage_controller.py +0 -0
  34. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/storage/storage_read_dto.py +0 -0
  35. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/storage/storage_service.py +0 -0
  36. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/storage/storage_write_dto.py +0 -0
  37. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/utils/__init__.py +0 -0
  38. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite/utils/helper.py +0 -0
  39. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite.egg-info/SOURCES.txt +0 -0
  40. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite.egg-info/dependency_links.txt +0 -0
  41. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite.egg-info/not-zip-safe +0 -0
  42. {trovesuite-1.0.33 → trovesuite-1.0.35}/src/trovesuite.egg-info/requires.txt +0 -0
  43. {trovesuite-1.0.33 → trovesuite-1.0.35}/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.33
3
+ Version: 1.0.35
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.33"
7
+ version = "1.0.35"
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.33"
61
+ version = "1.0.35"
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"}
@@ -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
  )
@@ -328,7 +329,14 @@ class AuthService:
328
329
  logger.error(f"Error querying permissions for role {role_id}: {str(e)}", exc_info=True)
329
330
  permissions = []
330
331
 
331
- role_dict = {**role, "tenant_id": tenant_id, "permissions": [p['permission_id'] for p in permissions]}
332
+ role_user_id = role.get("user_id") if hasattr(role, "get") else None
333
+ # Ensure user_id is always present (group roles can have user_id NULL)
334
+ role_dict = {
335
+ **role,
336
+ "user_id": role_user_id or user_id,
337
+ "tenant_id": tenant_id,
338
+ "permissions": [p['permission_id'] for p in permissions],
339
+ }
332
340
  get_user_roles_with_tenant_and_permissions.append(role_dict)
333
341
 
334
342
  roles_dto = Helper.map_to_dto(get_user_roles_with_tenant_and_permissions, AuthServiceReadDto)
@@ -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.33
3
+ Version: 1.0.35
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