trovesuite 1.0.8__py3-none-any.whl → 1.0.10__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.
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trovesuite
3
- Version: 1.0.8
4
- Summary: A comprehensive authentication and authorization service for ERP systems
5
- Home-page: https://github.com/deladetech/trovesuite-auth-service
3
+ Version: 1.0.10
4
+ Summary: TroveSuite services package providing authentication, authorization, notifications, Azure Storage, and other enterprise services for TroveSuite applications
5
+ Home-page: https://dev.azure.com/brightgclt/trovesuite/_git/packages
6
6
  Author: Bright Debrah Owusu
7
7
  Author-email: Bright Debrah Owusu <owusu.debrah@deladetech.com>
8
8
  Maintainer-email: Bright Debrah Owusu <owusu.debrah@deladetech.com>
@@ -11,7 +11,7 @@ Project-URL: Homepage, https://dev.azure.com/brightgclt/trovesuite/_git/packages
11
11
  Project-URL: Repository, https://dev.azure.com/brightgclt/trovesuite/_git/packages
12
12
  Project-URL: Documentation, https://dev.azure.com/brightgclt/trovesuite/_git/packages
13
13
  Project-URL: Bug Tracker, https://dev.azure.com/brightgclt/trovesuite/_workitems/create
14
- Keywords: authentication,authorization,jwt,erp,fastapi,security
14
+ Keywords: authentication,authorization,notifications,jwt,trovesuite,fastapi,security,tenant,permissions,enterprise,services,azure,storage,blob,cloud-storage
15
15
  Classifier: Development Status :: 5 - Production/Stable
16
16
  Classifier: Intended Audience :: Developers
17
17
  Classifier: License :: OSI Approved :: MIT License
@@ -34,6 +34,10 @@ Requires-Dist: python-multipart>=0.0.6
34
34
  Requires-Dist: python-jose[cryptography]>=3.3.0
35
35
  Requires-Dist: passlib[bcrypt]>=1.7.4
36
36
  Requires-Dist: passlib[argon2]<2.0.0,>=1.7.4
37
+ Requires-Dist: uvicorn<0.39.0,>=0.38.0
38
+ Requires-Dist: pyjwt<3.0.0,>=2.10.1
39
+ Requires-Dist: azure-storage-blob>=12.19.0
40
+ Requires-Dist: azure-identity>=1.15.0
37
41
  Provides-Extra: dev
38
42
  Requires-Dist: pytest>=8.4.2; extra == "dev"
39
43
  Requires-Dist: pytest-asyncio>=0.21.1; extra == "dev"
@@ -49,19 +53,21 @@ Dynamic: home-page
49
53
  Dynamic: license-file
50
54
  Dynamic: requires-python
51
55
 
52
- # TroveSuite Auth Service
56
+ # TroveSuite Packages
53
57
 
54
- A comprehensive authentication and authorization service for ERP systems. This package provides JWT token validation, user authorization, and permission checking capabilities.
58
+ TroveSuite package providing authentication, authorization, notifications, and other enterprise services for TroveSuite applications.
55
59
 
56
60
  ## Features
57
61
 
58
- - **JWT Token Validation**: Secure token decoding and validation
59
- - **User Authorization**: Multi-level authorization with tenant verification
62
+ - **Authentication Services**: JWT token validation and user authentication
63
+ - **Authorization Services**: Multi-level authorization with tenant verification
64
+ - **Notification Services**: Send and manage notifications for users
60
65
  - **Permission Checking**: Hierarchical permission system (organization > business > app > location > resource)
61
66
  - **Database Integration**: PostgreSQL support with connection pooling
62
67
  - **Logging**: Comprehensive logging with multiple output formats
63
68
  - **Azure Integration**: Support for Azure Storage Queues and Managed Identity
64
69
  - **FastAPI Ready**: Built for FastAPI applications
70
+ - **Extensible**: Easy to add new services and functionality
65
71
 
66
72
  ## Installation
67
73
 
@@ -115,10 +121,28 @@ poetry install --with dev
115
121
 
116
122
  ## Quick Start
117
123
 
124
+ > **✅ Package Status**: All import issues have been resolved in version 1.0.5. The package now works correctly when installed from PyPI or wheel files.
125
+
126
+ ### Import Patterns
127
+
128
+ The package provides clean, simplified import patterns:
129
+
130
+ ```python
131
+ # Import services and DTOs from main package
132
+ from trovesuite import AuthService, NotificationService
133
+ from trovesuite.auth import AuthServiceWriteDto
134
+ from trovesuite.notification import NotificationEmailServiceWriteDto, NotificationSMSServiceWriteDto
135
+
136
+ # Or import everything you need in one line
137
+ from trovesuite import AuthService, NotificationService
138
+ from trovesuite.auth import AuthServiceWriteDto
139
+ from trovesuite.notification import NotificationEmailServiceWriteDto
140
+ ```
141
+
118
142
  ### Basic Usage
119
143
 
120
144
  ```python
121
- from trovesuite import AuthService
145
+ from trovesuite import AuthService, NotificationService
122
146
  from trovesuite.configs.settings import db_settings
123
147
 
124
148
  # Configure your database settings
@@ -133,7 +157,7 @@ db_settings.SECRET_KEY = "your-secret-key"
133
157
  auth_service = AuthService()
134
158
 
135
159
  # Authorize a user
136
- from trovesuite.auth.auth_write_dto import AuthServiceWriteDto
160
+ from trovesuite.auth import AuthServiceWriteDto
137
161
  auth_data = AuthServiceWriteDto(user_id="user123", tenant="tenant456")
138
162
  result = AuthService.authorize(auth_data)
139
163
 
@@ -145,6 +169,30 @@ else:
145
169
  print(f"Authorization failed: {result.detail}")
146
170
  ```
147
171
 
172
+ ### Notification Service Usage
173
+
174
+ ```python
175
+ from trovesuite import NotificationService
176
+ from trovesuite.notification import NotificationEmailServiceWriteDto
177
+
178
+ # Send an email notification
179
+ email_data = NotificationEmailServiceWriteDto(
180
+ sender_email="your-email@gmail.com",
181
+ receiver_email=["recipient1@example.com", "recipient2@example.com"],
182
+ password="your-app-password", # Gmail app password
183
+ subject="Test Notification",
184
+ text_message="This is a plain text message",
185
+ html_message="<h1>This is an HTML message</h1><p>With rich formatting!</p>"
186
+ )
187
+
188
+ result = NotificationService.send_email(email_data)
189
+
190
+ if result.success:
191
+ print(f"Email sent successfully: {result.detail}")
192
+ else:
193
+ print(f"Email failed: {result.error}")
194
+ ```
195
+
148
196
  ### JWT Token Decoding
149
197
 
150
198
  ```python
@@ -162,7 +210,7 @@ async def protected_route(token: str = Depends(oauth2_scheme)):
162
210
  tenant_id = user_data["tenant_id"]
163
211
 
164
212
  # Authorize user
165
- from trovesuite.auth.auth_write_dto import AuthServiceWriteDto
213
+ from trovesuite.auth import AuthServiceWriteDto
166
214
  auth_data = AuthServiceWriteDto(user_id=user_id, tenant=tenant_id)
167
215
  auth_result = AuthService.authorize(auth_data)
168
216
  return auth_result
@@ -391,8 +439,84 @@ Check if user has all of the required permissions.
391
439
  **Returns:**
392
440
  - `bool`: True if user has all of the required permissions
393
441
 
442
+ ### NotificationService
443
+
444
+ #### `send_email(data: NotificationEmailServiceWriteDto) -> Respons[NotificationEmailServiceReadDto]`
445
+
446
+ Sends an email notification via Gmail SMTP. Supports both plain text and HTML email bodies.
447
+
448
+ **Parameters:**
449
+ - `data`: Email notification data including sender, recipients, subject, and message content
450
+
451
+ **Returns:**
452
+ - `Respons[NotificationEmailServiceReadDto]`: Email sending result with success status and details
453
+
454
+ **Example:**
455
+ ```python
456
+ from trovesuite import NotificationService
457
+ from trovesuite.notification import NotificationEmailServiceWriteDto
458
+
459
+ email_data = NotificationEmailServiceWriteDto(
460
+ sender_email="sender@gmail.com",
461
+ receiver_email=["user1@example.com", "user2@example.com"],
462
+ password="your-gmail-app-password",
463
+ subject="Welcome to TroveSuite",
464
+ text_message="Welcome! This is a plain text message.",
465
+ html_message="<h1>Welcome!</h1><p>This is an <strong>HTML</strong> message.</p>"
466
+ )
467
+
468
+ result = NotificationService.send_email(email_data)
469
+ if result.success:
470
+ print("Email sent successfully!")
471
+ else:
472
+ print(f"Failed to send email: {result.error}")
473
+ ```
474
+
475
+ #### `send_sms(data: NotificationSMSServiceWriteDto) -> Respons[NotificationSMSServiceReadDto]`
476
+
477
+ Sends an SMS notification (currently not implemented).
478
+
479
+ **Parameters:**
480
+ - `data`: SMS notification data
481
+
482
+ **Returns:**
483
+ - `Respons[NotificationSMSServiceReadDto]`: SMS sending result
484
+
394
485
  ### Data Models
395
486
 
487
+ #### `NotificationEmailServiceWriteDto`
488
+
489
+ ```python
490
+ class NotificationEmailServiceWriteDto(BaseModel):
491
+ sender_email: str
492
+ receiver_email: Union[str, List[str]] # Single email or list of emails
493
+ password: str # Gmail app password
494
+ subject: str
495
+ text_message: str
496
+ html_message: Optional[str] = None # Optional HTML content
497
+ ```
498
+
499
+ #### `NotificationEmailServiceReadDto`
500
+
501
+ ```python
502
+ class NotificationEmailServiceReadDto(BaseModel):
503
+ pass # Empty response model for email service
504
+ ```
505
+
506
+ #### `NotificationSMSServiceWriteDto`
507
+
508
+ ```python
509
+ class NotificationSMSServiceWriteDto(BaseModel):
510
+ pass # To be implemented for SMS functionality
511
+ ```
512
+
513
+ #### `NotificationSMSServiceReadDto`
514
+
515
+ ```python
516
+ class NotificationSMSServiceReadDto(BaseModel):
517
+ pass # To be implemented for SMS functionality
518
+ ```
519
+
396
520
  #### `AuthServiceReadDto`
397
521
 
398
522
  ```python
@@ -553,15 +677,65 @@ poetry install
553
677
 
554
678
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
555
679
 
680
+ ## Troubleshooting
681
+
682
+ ### Import Issues
683
+
684
+ If you encounter import errors, make sure you're using the correct import patterns:
685
+
686
+ ```python
687
+ # ✅ Correct imports
688
+ from trovesuite import AuthService, NotificationService
689
+ from trovesuite.auth import AuthServiceWriteDto
690
+ from trovesuite.notification import NotificationEmailServiceWriteDto
691
+
692
+ # ❌ Incorrect imports (will fail)
693
+ from trovesuite.auth.auth_write_dto import AuthServiceWriteDto # Too specific
694
+ from trovesuite.notification.notification_write_dto import NotificationEmailServiceWriteDto # Too specific
695
+ ```
696
+
697
+ ### Package Installation
698
+
699
+ If you're having issues with the package installation:
700
+
701
+ 1. **Make sure you have the latest version**:
702
+ ```bash
703
+ pip install --upgrade trovesuite
704
+ ```
705
+
706
+ 2. **Force reinstall if needed**:
707
+ ```bash
708
+ pip install --force-reinstall trovesuite
709
+ ```
710
+
711
+ 3. **Check your Python environment**:
712
+ ```bash
713
+ python -c "import trovesuite; print('Package installed successfully')"
714
+ ```
715
+
716
+ ### Common Issues
717
+
718
+ - **ImportError: No module named 'src'**: This was fixed in version 1.0.5. Update to the latest version.
719
+ - **AttributeError: module has no attribute 'AuthServiceWriteDto'**: Use `from trovesuite.auth import AuthServiceWriteDto` instead of importing from the main package.
720
+
556
721
  ## Support
557
722
 
558
723
  For support, email brightgclt@gmail.com or create a work item in the [Azure DevOps repository](https://dev.azure.com/brightgclt/trovesuite/_workitems/create).
559
724
 
560
725
  ## Changelog
561
726
 
727
+ ### 1.0.5
728
+ - Fixed all import issues across auth, notification, and entities modules
729
+ - Changed absolute imports (`from src.trovesuite.`) to relative imports (`from .` and `from ..`)
730
+ - Ensured package works correctly when installed from PyPI or wheel
731
+ - Added service write DTOs to module exports for easier usage
732
+ - Updated documentation with simplified import patterns
733
+ - All services and DTOs now import correctly in clean environments
734
+ - Package builds and installs without import errors
735
+
562
736
  ### 1.0.8
563
737
  - Restructured package for direct service imports
564
- - Added notification services
738
+ - Added comprehensive notification services with email support
565
739
  - Excluded controllers from package build
566
740
  - Updated import paths for better usability
567
741
  - JWT token validation
@@ -570,3 +744,6 @@ For support, email brightgclt@gmail.com or create a work item in the [Azure DevO
570
744
  - PostgreSQL database integration
571
745
  - Comprehensive logging
572
746
  - Azure integration support
747
+ - Email notification service with Gmail SMTP support
748
+ - Support for both plain text and HTML email content
749
+ - Multiple recipient support for email notifications
@@ -0,0 +1,33 @@
1
+ trovesuite/__init__.py,sha256=QIY7iN7TVyJKjCoB6CBA4pSqm_mL41frcFgFS4maO8k,555
2
+ trovesuite/auth/__init__.py,sha256=OjZllVvjul1glDazJ-d5TrNjgHFigFlQQi1G99DYshk,239
3
+ trovesuite/auth/auth_base.py,sha256=rZHQVLeJRBQ8GClgF5UwG-er4_HXVX5-nt8o6_Z29uY,75
4
+ trovesuite/auth/auth_controller.py,sha256=PAgaVlf5TYEfkSfK4vGGsvO84i8zEmeVVXyUF2YBppI,420
5
+ trovesuite/auth/auth_read_dto.py,sha256=pQT1ouRVZMAiJn4wAG7NQOKQKTquTMWUe-dYcpLTmEo,533
6
+ trovesuite/auth/auth_service.py,sha256=if2RFI6F1DpbNEuCTSpPbhHVBdYQEg4hVkoxTCnvC4k,14298
7
+ trovesuite/auth/auth_write_dto.py,sha256=rdwI7w6-9QZGv1H0PAGrjkLBCzaMHjgPIXeLb9RmNec,234
8
+ trovesuite/configs/__init__.py,sha256=h1mSZOaZ3kUy1ZMO_m9O9KklsxywM0RfMVZLh9h9WvQ,328
9
+ trovesuite/configs/database.py,sha256=IPSu8fXjxyYeJ3bFknJG06Qm2L2ub6Ht19xhKv8g7nA,11731
10
+ trovesuite/configs/logging.py,sha256=mGjR2d4urVNry9l5_aXycMMtcY2RAFIpEL35hw33KZg,9308
11
+ trovesuite/configs/settings.py,sha256=yUbkiFi4QdO9JZG1RRFbP4tYurT47HmN-ohgYcs2SHM,2561
12
+ trovesuite/entities/__init__.py,sha256=Dbl_03Bueyh2vOP2hykd40MmNMrl5nNHSRGP-kqwwNo,160
13
+ trovesuite/entities/health.py,sha256=KaW7yxTQdymIPlnkJJkDqEebBXkD0a7A66i5GgNZLoE,2700
14
+ trovesuite/entities/sh_response.py,sha256=1_sw3PpVaDxWsNiBU0W9YLHZgTFxEj4JJBLBfSY63Ho,1579
15
+ trovesuite/notification/__init__.py,sha256=mjglzmlk29SREP6LfvBYGmCSc-K1SKKAEx_OJdJ2Vrs,394
16
+ trovesuite/notification/notification_base.py,sha256=6Xo0Gnnpg3RgN1_SRkAcH-K4l7DwNDZvn1gRm3oMWyk,320
17
+ trovesuite/notification/notification_controller.py,sha256=VVy1xj4GL8_Wj7wMMTwozXXX8i_2WSJqC_NyNse35TI,847
18
+ trovesuite/notification/notification_read_dto.py,sha256=K0DFLyAArvtqOGS7q1VzmqO28StTMbcNCgpmhzhad8E,423
19
+ trovesuite/notification/notification_service.py,sha256=sf_lJWcrmRIUeEabdEYLaSdRz2H1D3RBEwKMOA1h2pY,2433
20
+ trovesuite/notification/notification_write_dto.py,sha256=PGpww3PomrmJgXTgpwGhXasv_fC8mgUQvTloaTqaSTA,452
21
+ trovesuite/storage/__init__.py,sha256=lO9E2QvzNFOfUocfITnIBuSR6-eg1zVYLrEVIEq3SXc,1334
22
+ trovesuite/storage/storage_base.py,sha256=nOdnjlwP4xiGdbpdeh5rLDAzkWHZd9M_7lznvNlqsV4,1899
23
+ trovesuite/storage/storage_controller.py,sha256=Yzki0L-jmSPbiw8spFm6Z84Bq-WZfih_0GsfbNRHssM,6569
24
+ trovesuite/storage/storage_read_dto.py,sha256=o7EVJdwrwVZAaeyGU9O01WMECGVaytkvLRwruA256hQ,1471
25
+ trovesuite/storage/storage_service.py,sha256=V7LIePIV6b_iuhm-9x8r4zwpZHgeRPL1YIe5IBnxhco,19768
26
+ trovesuite/storage/storage_write_dto.py,sha256=vl1iCZ93bpFmpvkCrn587QtMtOA_TPDseXSoTuj9RTQ,1355
27
+ trovesuite/utils/__init__.py,sha256=3UPKTz9cluTgAM-ldNsJxsnoPTZiqacXlAmzUEHy6q8,143
28
+ trovesuite/utils/helper.py,sha256=lvZ1mvaqY84dkIPB5Ov0uwYDOWBziAS8twobEJZh2Ik,1002
29
+ trovesuite-1.0.10.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
30
+ trovesuite-1.0.10.dist-info/METADATA,sha256=LMpOSCZRz-a7s54MlVZLsRBmsb7jL1y9x5EjegdYYK4,21737
31
+ trovesuite-1.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
+ trovesuite-1.0.10.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
33
+ trovesuite-1.0.10.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- trovesuite/__init__.py,sha256=a9jSrjmrhOey6yE2I83TO_rVJDogIwGDyL3HJBGiGqM,347
2
- trovesuite/auth/__init__.py,sha256=qhgPqBHiLOjMcnecLvZQPV3UKV0ADKWp91kXfkpeAi4,336
3
- trovesuite/auth/auth_base.py,sha256=I3-JU97KZJT89fGdL96HmQLFHXfN3CNokSChsqzeRPo,74
4
- trovesuite/auth/auth_controller.py,sha256=47LsxPvE2wCqpadLPf_m68M8eR7Zu9HxfSSxZQZKQyM,412
5
- trovesuite/auth/auth_read_dto.py,sha256=JxTwBlgUZ1S_KMaDuF0AueEhMBFrCiWgsHQDqoI2mMc,577
6
- trovesuite/auth/auth_service.py,sha256=ZsR6LXE6c0ej4U8rb5SdccL6cyk2t_LicIESe98sUE8,14260
7
- trovesuite/auth/auth_write_dto.py,sha256=OO4h_EYIxhCzhVZkoicYn31J_vw9tUNDegTeG6u65kE,230
8
- trovesuite/configs/__init__.py,sha256=h1mSZOaZ3kUy1ZMO_m9O9KklsxywM0RfMVZLh9h9WvQ,328
9
- trovesuite/configs/database.py,sha256=tXj-AYIUs-gjYrgioTnQafbDhsaIsgimWWLXR3ru-1A,7580
10
- trovesuite/configs/logging.py,sha256=mGjR2d4urVNry9l5_aXycMMtcY2RAFIpEL35hw33KZg,9308
11
- trovesuite/configs/settings.py,sha256=7Z9b-yWLSCL_NA28JfOGisQIrOvGb5PhcriQJvnZURk,7189
12
- trovesuite/entities/__init__.py,sha256=Dbl_03Bueyh2vOP2hykd40MmNMrl5nNHSRGP-kqwwNo,160
13
- trovesuite/entities/health.py,sha256=H8-XUywzvMfZy2dZwDyJGAUbmuULuZYvYIUWhiaVGdY,2729
14
- trovesuite/entities/sh_response.py,sha256=1_sw3PpVaDxWsNiBU0W9YLHZgTFxEj4JJBLBfSY63Ho,1579
15
- trovesuite/utils/__init__.py,sha256=3UPKTz9cluTgAM-ldNsJxsnoPTZiqacXlAmzUEHy6q8,143
16
- trovesuite/utils/helper.py,sha256=lvZ1mvaqY84dkIPB5Ov0uwYDOWBziAS8twobEJZh2Ik,1002
17
- trovesuite-1.0.8.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
18
- trovesuite-1.0.8.dist-info/METADATA,sha256=sGGcwQAl--L9L5wSFsIGSqNZQ2qOWRf3aMZ--Mv6jeo,15693
19
- trovesuite-1.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- trovesuite-1.0.8.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
21
- trovesuite-1.0.8.dist-info/RECORD,,