feat(stalwart): add Stalwart webhook integration with authentication …#65
Draft
jzunigax2 wants to merge 5 commits into
Draft
feat(stalwart): add Stalwart webhook integration with authentication …#65jzunigax2 wants to merge 5 commits into
jzunigax2 wants to merge 5 commits into
Conversation
- Introduced a new column `network_bucket_id` in the `mail_accounts` table to associate accounts with network buckets. - Updated `AccountService` to create and delete mail buckets via the BridgeClient. - Enhanced unit tests to cover new functionality related to network bucket management. - Modified relevant models and repositories to handle the new `networkBucketId` attribute.
…and event handling - Introduced Stalwart webhook configuration in .env.template. - Added StalwartEventsModule, including controller, service, and authentication guard. - Implemented event handling logic for Stalwart webhook events. - Configured authentication using Basic Auth with credentials from environment variables. This integration allows the application to process events from Stalwart's webhook securely.
- Added `findBucketContextByProviderInternalId` method to `AddressRepository` for resolving user and bucket context. - Updated `AccountService` to delete provider links during account provisioning failure. - Implemented `createBucketEntry` method in `BridgeClient` for creating bucket entries in response to Stalwart events. - Enhanced `StalwartEventsService` to handle batch events and create bucket entries based on resolved account context. - Added unit tests for the new functionality in `StalwartEventsService` and `AddressRepository` to ensure proper behavior.
6ac1b18 to
17a2fce
Compare
- Updated `deleteEmail` method in `EmailService` to handle quota entry release upon email deletion. - Introduced `releaseQuotaEntry` method to manage quota entries based on email deletion results. - Modified `deleteEmail` in `MailProvider` to return a result object containing the deleted entry key. - Enhanced unit tests for `EmailService` and `JmapMailProvider` to cover new deletion behavior and quota management scenarios. - Integrated `BridgeClient` for handling quota entry deletions in the bridge service.
- Introduced `decodeStalwartIdBig` function to handle Stalwart IDs exceeding JavaScript's safe integer range, allowing for proper decoding of email IDs. - Updated `decodeStalwartId` to utilize the new decoding function and throw an error for IDs exceeding safe integer limits. - Enhanced `StalwartEventsAuthGuard` to throw an `UnauthorizedException` for malformed authorization headers lacking a colon separator. - Added unit tests for the new decoding function and authentication guard to ensure robust error handling and functionality.
8240a10 to
96cf7aa
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This integration allows the application to process events from Stalwart's webhook