feat: Push Subscription keys#414
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for JMAP PushSubscription encryption keys by introducing site-level key management in Mail Settings, attaching keys during push subscription creation, and decrypting inbound encrypted push notifications.
Changes:
- Add generation + validation of JMAP push encryption keys (P256DH/public, private key, auth secret) in Mail Settings with a UI action.
- Include
keysin PushSubscription create payload and enforce/decryptaes128gcmencrypted push notifications when keys are configured. - Auto-generate keys during app install if missing.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
mail/mail/doctype/mail_settings/mail_settings.py |
Adds key validation, key generation, and helpers for base64/keypair consistency checks. |
mail/mail/doctype/mail_settings/mail_settings.json |
Adds new Mail Settings fields/section for JMAP Push keys. |
mail/mail/doctype/mail_settings/mail_settings.js |
Adds “Generate JMAP Push Keys” action with confirmation and server call. |
mail/jmap/services/mail/push_subscription.py |
Passes PushSubscription keys through to JMAP set/create payload. |
mail/install.py |
Generates site-level JMAP push keys on install when missing. |
mail/client/doctype/push_subscription/push_subscription.py |
Attaches keys when creating push subscriptions; adds decryption routine for encrypted notifications. |
mail/api/jmap.py |
Enforces encrypted push notifications when keys exist and decrypts request body accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
ref: https://github.com/jmapio/jmap/blob/master/spec/jmap/push.mdown#pushsubscription